Introduction
Welcome to the Trezor Suite® – Getting Started™ Developer Portal. This guide provides developers with a complete overview of how to integrate and extend Trezor Suite within their applications. Whether you are building a browser-based wallet, a desktop client, or an automation tool for secure transactions, this portal will help you understand the key concepts and APIs available in the Trezor ecosystem.
Trezor Suite is an open-source platform developed by SatoshiLabs, designed to deliver a secure, unified environment for managing cryptocurrencies using Trezor hardware wallets. It is built with privacy, transparency, and user sovereignty in mind. Developers can use Suite’s APIs and libraries to extend its capabilities, integrate hardware wallet functions into third-party software, and automate secure signing workflows.
What You’ll Learn
- How to install and configure Trezor Suite for development.
- How to communicate with Trezor devices using WebUSB or Bridge.
- How to use the Suite API and Trezor Connect JavaScript library.
- Best practices for key management and transaction signing.
- Example implementations and troubleshooting tips.
1. Environment Setup
Before you begin coding, ensure that your environment meets the minimum requirements. Trezor Suite is compatible with most major operating systems and browsers.
System Requirements
- Operating System: macOS, Windows, or Linux.
- Browser: Chrome, Firefox, or Brave (for WebUSB access).
- Node.js ≥ 18.x for JavaScript development.
- Trezor Bridge (optional) for non-WebUSB environments.
Installing Trezor Suite
You can install Trezor Suite from the official website or build it locally from source. Building locally is recommended if you plan to integrate custom modules or test new features.
# Clone the Suite repository
git clone https://github.com/trezor/trezor-suite.git
cd trezor-suite
# Install dependencies
yarn install
# Run Suite locally
yarn dev
Once started, Suite runs a local Electron app or web interface. You can connect your hardware wallet via USB and start interacting with it.
2. Using the Trezor Suite API
The Suite API exposes programmatic access to Trezor device operations and user data workflows. It’s primarily used via Trezor Connect, a high-level JavaScript library that communicates with Trezor devices through WebUSB or Bridge.
Installation
npm install trezor-connect
Initialization
Initialize the Trezor Connect client with your app’s configuration parameters. You can define the manifest to identify your application to the user.
import TrezorConnect from 'trezor-connect';
TrezorConnect.manifest({
email: 'developer@yourapp.com',
appUrl: 'https://yourapp.com'
});
Fetching Account Information
const result = await TrezorConnect.getAccountInfo({
coin: 'btc',
path: "m/84'/0'/0'/0/0"
});
if (result.success) {
console.log('Balance:', result.payload.balance);
} else {
console.error('Error:', result.payload.error);
}
The API provides functions for address generation, signing transactions, message verification, and device management. Each call triggers an interactive prompt on the Trezor device, ensuring that all critical actions require explicit user approval.
3. WebUSB Integration
WebUSB enables browsers to communicate directly with hardware wallets without needing additional bridge software. It simplifies setup and improves user privacy by keeping communication within the browser sandbox.
Enabling WebUSB Access
- Ensure you’re using a secure context (
https://). - Request user permission to access the device.
- Handle disconnections gracefully.
navigator.usb.requestDevice({ filters: [{ vendorId: 0x534C }] })
.then(device => device.open())
.then(() => console.log('Trezor connected'))
.catch(err => console.error('USB Error:', err));
Note that not all browsers support WebUSB equally. For older browsers or enterprise systems, Trezor Bridge provides a secure alternative communication layer.
4. Security Principles
Security is central to Trezor’s design philosophy. As a developer, you must ensure your application does not compromise the trust model established by the hardware wallet.
Key Best Practices
- Never store private keys or seeds on the host device.
- Use the Trezor device to perform all signing operations.
- Validate user actions through on-device confirmation screens.
- Use cryptographically secure communication channels (TLS/SSL).
- Keep dependencies up-to-date and verify package integrity.
End-to-End Transaction Flow
- Application requests a transaction signing operation.
- Trezor displays transaction details for user confirmation.
- User approves or rejects the transaction physically.
- Device returns the signed payload to the app.
This workflow ensures that no malware or compromised software can alter the transaction details without user awareness.
5. Example Integrations
Example: Bitcoin Transaction
const tx = await TrezorConnect.signTransaction({
inputs: [{
address_n: [2147483692, 2147483648, 2147483648, 0, 0],
prev_hash: 'a3c2...',
prev_index: 0,
amount: '100000',
script_type: 'SPENDWITNESS',
}],
outputs: [{
address: 'bc1qexampleaddress...',
amount: '90000',
script_type: 'PAYTOADDRESS',
}],
coin: 'btc',
});
if (tx.success) {
console.log('Signed TX:', tx.payload.serializedTx);
}
Example: Message Signing
const sign = await TrezorConnect.signMessage({
path: "m/44'/0'/0'/0/0",
message: 'Hello from Trezor Suite Developer Portal!',
coin: 'btc'
});
if (sign.success) {
console.log('Signature:', sign.payload.signature);
}
You can adapt these examples for Ethereum, Cardano, and other supported assets using the same interface, simply by changing the coin parameter.
6. Frequently Asked Questions
Q1: Do I need a physical Trezor device to develop?
While most integration testing requires a real device, you can use the Trezor Emulator (available in the Suite repository) for automated testing and CI pipelines.
Q2: What is the difference between Trezor Connect and Suite API?
Trezor Connect is a JavaScript SDK that communicates with Trezor devices through Suite or Bridge, while Suite API includes additional desktop-specific modules for account synchronization, labeling, and coin management.
Q3: Is Trezor Suite open-source?
Yes. All components, including Trezor Suite, Connect, and Firmware, are open-source and publicly available on GitHub under the MIT or GPL licenses.
Q4: Can I build custom plugins for Suite?
Suite supports modular extensions through custom UI components and API hooks. Plugins can interact with account data, transactions, and notifications while respecting Suite’s security sandbox.
Q5: How do I report a security vulnerability?
Responsible disclosure is encouraged. Contact the Trezor security team via security@satoshilabs.com or use their PGP key for encrypted reports.
7. Conclusion
You are now ready to start building secure, user-friendly applications powered by Trezor hardware and Trezor Suite. By integrating these open technologies, you empower users to retain full control of their keys and digital assets while benefiting from the convenience of modern software interfaces.
Continue exploring advanced topics in the Developer Portal, such as firmware customization, device event handling, or UI integration within Electron apps. The Trezor community and documentation on GitHub are valuable resources for collaboration and troubleshooting.
Next Steps:
- Visit the Trezor Developer Docs.
- Join the Trezor Community Forum.
- Contribute to the Suite GitHub repository.