Trezõr brïdge® | Connect Your Web3 World Securely™
A lightweight connection layer for hardware wallets — private, auditable, and developer friendly.
What is Trezõr brïdge®?
Trezõr brïdge® is the official bridge software designed to connect hardware wallets to web applications. It acts as a small, secure, local service that communicates with your device and exposes a limited, permissioned API to trusted web pages. Designed with privacy-first principles, it never transmits private keys and always requires user confirmation on the hardware device for signing operations.
Private by design
No private keys leave your hardware wallet. Bridge only forwards signed payloads after on-device user approval.
Minimal surface
Small attack surface, audited communications, and strict origin checks make the connection resilient.
Developer friendly
Simple JavaScript plugin, example dApp integrations, and TypeScript types to get you started in minutes.
Cross-platform
Runs on Windows, macOS, and Linux as a lightweight background service — with a minimal UI for diagnostics.
Who should use it?
If you build dApps, payment flows, or internal tooling that relies on hardware-backed keys (Ledger, Trezor, or similar), Trezõr brïdge® provides a standard, secure integration layer. Wallet users who want stronger security and privacy when interacting with web apps will also benefit.
Security summary
Local-only RPC: no remote key transmission.
Origin whitelisting: the bridge verifies the requesting page's origin and prompts users for trust.
Signed manifests: dApps can publish a manifest that the bridge checks for integrity before allowing operations.
Auditable logs: locally stored, user-readable logs for every request (consent and signing events).
Below is an opinionated HTML template for a dApp page and an embeddable JS plugin. Copy both files into your project, keep the plugin served from your origin (or a trusted CDN), and call the API as shown.
HTML template (drop-in)
Save this file as wallet-integration.html. It includes a simple UI for connect, account listing, and signing a message.
This tiny plugin exposes a promise-based API and performs origin check and graceful retries. Save as /plugins/trezor-bridge-plugin.js or serve from your hosting/CDN.
// trezor-bridge-plugin.js (minimal, production you should add robust error handling & types)
(function(global){
const DEFAULT_PORTS = [21325, 21326]; // example local ports
let bridgeUrl = null
const tryFetch = async (url, body) =>{
const res = await fetch(url, {
method:'POST',
headers:{'Content-Type':'application/json'},
body: JSON.stringify(body),
credentials: 'omit'
})
if(!res.ok) throw new Error('Bridge responded with '+res.status)
return res.json()
}
const locate = async ()=>{
if(bridgeUrl) return bridgeUrl
for(const p of DEFAULT_PORTS){
const candidate = `http://127.0.0.1:${p}/v1`;
try{
const r = await fetch(candidate+'/ping',{method:'GET'})
if(r.ok){ bridgeUrl = candidate; return bridgeUrl }
}catch(e){/*ignore*/}
}
throw new Error('Trezor Bridge not found. Please install and run it.')
}
const apiRequest = async (payload)=>{
const base = await locate()
// origin header helps bridge verify caller origin (bridge must enforce CORS/origin checks)
payload._origin = location.origin
return await tryFetch(base+'/rpc', payload)
}
const ensureAvailable = async ()=>{
await locate()
return true
}
const request = async (opts)=>{
if(!opts || !opts.method) throw new Error('Method required')
const res = await apiRequest(opts)
if(res.error) throw new Error(res.error.message || 'Unknown bridge error')
return res.result
}
// export
global.TrezorBridge = Object.freeze({
ensureAvailable,
request
})
})(window);
Server-side notes
The bridge intentionally keeps logic client-side. However, dApps often want to publish a manifest describing permitted operations (for better UX). Host a JSON manifest at /.well-known/trezor-bridge-manifest.json with fields like name, logo, redirects, and allowedMethods. The bridge can optionally consume and verify this file before allowing any long-lived permission grants.
Developer reference: API summary
The bridge API is intentionally small. Each request uses the shape {method: string, params?: object}. Responses follow {result: any, error?: {message:string, code?:number}}.
Common methods
getAccounts — Returns a list of accounts, addresses, metadata (public key, address, chain).
signMessage — Prompts the device to sign an arbitrary message.
signTransaction — Prompts to sign a chain-specific transaction payload.
ping — Lightweight health check for bridge availability.
No. Trezõr brïdge never sees private keys or seed material. All signing requests require explicit physical confirmation on the device.
Q: Can a malicious page access my funds when the bridge is running?
The bridge enforces origin checks. Integrations must include the manifest and the bridge will prompt users to approve any new origin. Users should only approve trusted sites.
Q: Do I need to trust a CDN-hosted plugin?
For maximum safety host the plugin on your own origin. A CDN can be convenient but increases the trust surface.