Overview
Trezõr brïdge® (commonly: Trezor Bridge) is a small native application that enables secure communication between a browser or desktop app and a Trezor hardware device over USB. It abstracts platform-specific USB drivers and provides a stable, message-based transport for higher-level libraries like Trezor Connect and Trezor Suite.
Bridge acts as a minimal trusted relay: it forwards JSON-RPC style requests to the device and returns responses, while ensuring the user must approve actions on the physical device. For integrators, understanding Bridge behavior is essential to diagnose connectivity issues, secure flows, and automate testing.
Why Bridge exists
- Browsers historically lack consistent low-level USB access across platforms — Bridge provides a single, maintained solution.
- Bridge avoids exposing raw USB to web pages; instead it communicates via HTTP/WebSocket with strict origins and manifests.
- It lets Suite and third-party apps use the same transport layer without bundling platform-specific drivers.
How Bridge works (simplified)
- Install — user installs the Bridge native app on their OS.
- Start — Bridge runs a local HTTP/WebSocket server bound to localhost.
- Handshake — web apps or Suite connect to Bridge and perform origin checks and manifest verification.
- Forward — Bridge forwards binary protobuf messages to the device, which performs cryptographic operations and returns responses.
Bridge intentionally keeps no long-term sensitive state; it only relays messages and enforces access restrictions.
Installing Bridge
Provide users with clear instructions and links for all supported platforms:
- Windows — MSI/EXE installer with auto-start settings.
- macOS — signed DMG with required permissions.
- Linux — AppImage, DEB/RPM packages or distro-specific instructions.
Always point users to the official download page and encourage them to verify signatures and checksums where provided.
Developer integration patterns
Trezor Connect
Trezor Connect is the typical integration for web apps; it will automatically use Bridge if native USB transport isn't available. Use Connect methods for account discovery, signing, and device management.
Direct Suite integration
Desktop Suite uses the Bridge (or direct native transports) for device communication — contributors should reuse Suite transport modules to remain consistent with user expectations.
// example: Connect will probe Bridge automatically
import TrezorConnect from 'trezor-connect'
TrezorConnect.getPublicKey({ path: "m/44'/60'/0'/0/0" })
Troubleshooting & best practices
Common symptoms
- No device found: Bridge not installed, outdated, or blocked by firewall/antivirus.
- Permissions error: macOS USB permission or Linux udev rules missing.
- Intermittent disconnects: faulty USB cable or power-saving settings on the host.
Developer checks
- Confirm Bridge service is running and listening (check OS service manager or process list).
- Open browser console for Connect/Bridge handshake logs — they often show manifest or origin errors.
- Use Trezor User Environment (dev tools) to emulate device responses for automated tests.
Security considerations
Bridge is a critical piece of the trench between web content and the device. Follow these security practices:
- Always download Bridge from the official site and verify any release signatures.
- Ensure Bridge only binds to localhost and does not expose a public interface.
- Use browser manifest files and origin verification to reduce the risk of malicious pages interacting with Bridge.
- Log minimal diagnostic data and never store private keys or seeds in Bridge.
Automated testing & CI
For reliable CI, use the Trezor user environment and emulators to run signing workflows headlessly. Keep tests deterministic by pinning firmware versions and using testnet environments for chain interactions.
- Install headless Bridge or use emulated transports in CI.
- Separate integration tests that require physical devices from unit tests.
- Document test matrix: OS versions, Bridge versions, firmware versions.
Release & update strategy
Bridge should be treated as a first-class component in releases. Provide clear changelogs when updating transport behavior, and use semantic versioning so downstream consumers can pin compatible versions.
- Maintain migration notes when changing handshake or manifest formats.
- Flag breaking changes and provide a grace period with backward compatibility shims.
Useful resources & official links
Quick reference commands
# Check Bridge process (Linux/macOS)
ps aux | grep trezor-bridge
# Windows: check Services or Task Manager for trezor-bridge
# Example: start Suite locally (uses Bridge or native transport)
cd trezor-suite
npm run dev
Final recommendations
When integrating Bridge into your app or contributing to Suite, prioritize clear user communication: show installation prompts, provide troubleshooting steps, and never automate trust decisions that should require on-device approval. Treat Bridge as a simple, auditable relay — small, secure, and user-centric.