Your gateway between web apps and hardware wallets
The Trezor Bridge is a secure and lightweight communication layer between client applications (web, desktop, or mobile) and Trezor hardware wallets. It enables seamless, encrypted communication over USB (or WebUSB) and abstracts away underlying OS-level details.
As a developer, you can leverage Bridge to access wallet operations — key management, signing, address derivation, device enumeration, and more — in a cross-platform, user‑friendly manner. This developer portal guides you through all aspects of using and integrating Trezor Bridge into your crypto app ecosystem.
At a high level, the architecture includes:
The workflow:
Here’s a step‑by‑step guide to get started integrating Trezor Bridge into your application:
Provide a link for users to download and install the Trezor Bridge for their OS. Once installed, it runs as a local service (e.g. at http://127.0.0.1:21325/
).
In your web or node-based project, install the official client library. For example:
npm install @trezor/connect
Then import in your code:
import TrezorConnect from "@trezor/connect";
Use the library to connect and request features:
TrezorConnect.init({
manifest: {
email: "developer@yourdomain.com",
appUrl: "https://yourapp.com"
}
});
Example: get Bitcoin address:
TrezorConnect.getAddress({
path: "m/44'/0'/0'/0/0",
coin: "Bitcoin"
})
.then(response => {
if (response.success) {
console.log("Address:", response.payload.address);
} else {
console.error("Error:", response.payload.error);
}
});
Always design your UI to handle cancellations, device disconnection, or version mismatch. The library returns structured errors to assist you.
TrezorConnect.on("DEVICE_EVENT", event => {
console.log("Device event:", event);
});
The client library communicates using a JSON‐RPC 2.0–style protocol. Commands to the Bridge include methods such as:
enumerate
— list connected devicesgetFeatures
— retrieve device metadatasignTransaction
— sign raw transactionsethereumSignMessage
, ethereumSignTransaction
Under the hood, the Bridge translates these calls to proper USB (or WebUSB) commands, ensuring correct framing, version control, and error mapping.
{
"jsonrpc": "2.0",
"id": 42,
"method": "getFeatures",
"params": {}
}
{
"jsonrpc": "2.0",
"id": 42,
"result": {
"vendor": "SatoshiLabs",
"model": "T",
"firmware_version": "2.3.4",
"features": { ... }
}
}
If an error occurs:
{
"jsonrpc": "2.0",
"id": 42,
"error": {
"code": 500,
"message": "Device disconnected"
}
}
The Bridge supports backward-compatible changes, but major version bumps may require updating your integration. Monitor Bridge release notes and enforce a minimum version in your app.
Security is the foundation of any crypto interface. The Bridge and the client library put strong safeguards in place. Below are guidelines and best practices you should follow.
All communication between the client library and Bridge is encrypted and authenticated. The Bridge uses TLS or secure channels (depending on implementation) to prevent man-in-the-middle attacks.
Any critical operation (e.g. signing, exporting keys) must be confirmed by the user on the hardware device. The device uses PIN, passphrase, or security checks as configured.
The Bridge verifies firmware versions, checks signatures, and ensures integrity of commands. As a developer, you should always validate that the returned data matches expected schemas.
Plan for scenarios like device disconnects, user cancellations, or firmware upgrades mid-session. Your UI should guide users to reinitialize sessions gracefully.
Yes — browsers supporting WebUSB can communicate with the installed Bridge. If WebUSB is unavailable, the Bridge provides a fallback via local HTTP/WebSocket endpoints.
Your app should detect this and prompt the user to download & install the Bridge. Provide links for Windows, macOS, and Linux, with guidance for reboot or relaunch.
Yes. Its source is publicly maintained under repositories on GitHub. Developers can audit the code, propose changes, or fork as needed.
Use logging in the client library (if enabled), monitor network/USB traffic, inspect JSON‐RPC flows, and check Bridge logs (if accessible). Also, ensure correct manifest values and origins.
The client library supports many built‑in coin modules — Bitcoin, Ethereum, DOT, etc. For new blockchains, you may implement custom transaction serialization and request signatures via generic `signTransaction` calls.