Suite Desktop Architecture
Trezor Suite Desktop is an Electron-based application that provides a full-featured, offline-capable interface for managing Trezor hardware wallets. It combines the power of Node.js with a modern React frontend.Overview
Suite Desktop is built using:Electron 40.1.0
Cross-platform desktop framework
React 19.1.0
UI rendering and component architecture
Redux Toolkit
State management and data flow
Node.js 24
Backend runtime for native features
Architecture Layers
Key Components
1. Renderer Process
The renderer process runs the React-based UI in a Chromium browser context.- UI Layer
- IPC Proxy
- Security
@trezor/suite PackageThe main Suite UI package provides:
- React components for all screens
- Redux store for state management
- Routing and navigation
- Business logic
2. Main Process
The main process handles all Node.js operations and system integrations.@trezor/suite-desktop-core
@trezor/suite-desktop-core
Core functionality for the Electron main process:Window Management
- Create and manage application windows
- Handle window state (minimize, maximize, close)
- Multi-window support
- Check for application updates
- Download and install updates
- Notify user of available updates
- Read/write application data
- Manage logs
- Export/import wallet data
- Process messages from renderer
- Invoke native APIs
- Return results to renderer
Trezor Connect in Main Process
Trezor Connect in Main Process
Connect runs in Node.js context in main process:Benefits:
- Direct USB/HID access
- No WebUSB limitations
- Better performance
- Offline capabilities
Native Modules
Native Modules
Integration with native system features:Trezor Bridge
- USB/HID device communication
- Device detection and monitoring
- Low-level protocol handling
- Bundled Tor binary
- SOCKS5 proxy configuration
- Privacy-enhanced connections
- Bitcoin privacy features
- Coordinator communication
- Transaction mixing
Key Differences: Desktop vs Web
- Trezor Connect
- Firmware Binaries
- Device Communication
- Privacy Features
Desktop
- Connect runs in Node.js (main process)
- Imported as regular node_module
- No Connect files on renderer
- IPC proxy in renderer
Web
- Connect is part of JavaScript bundle
- Uses
@trezor/connect-web - Runs in browser context
- WebUSB for device communication
See webpack config for web replacement logic.
Application Structure
Package Organization
Build Process
Environment Configurations
Suite Desktop runs in different modes with separate data directories:| Environment | App ID | Name | Data Dir | Use Case |
|---|---|---|---|---|
| Production | com.trezor.suite | Trezor Suite | @trezor/suite-desktop | Released builds |
| Development | com.trezor.suite.dev | Trezor Suite Dev | @trezor/suite-desktop-dev | Built dev versions |
| Local Dev | com.github.Electron | Trezor Suite Local | @trezor/suite-desktop-local | yarn suite:dev:desktop |
Data Directory Locations by OS
Data Directory Locations by OS
macOSWindowsLinux
Development
Running Dev Server
- Starts Webpack dev server for renderer
- Compiles main process with watch mode
- Launches Electron with hot reload
React DevTools are available. To use them, reload the renderer process (Ctrl+R / Cmd+R) while DevTools are open.
Keyboard Shortcuts
| Action | Shortcut (macOS) | Shortcut (Windows/Linux) |
|---|---|---|
| Reload | Cmd+R / F5 | Ctrl+R / F5 |
| Hard Reload | Shift+Cmd+R | Shift+Ctrl+R |
| Restart | Option+F5 | Alt+F5 |
| DevTools | Cmd+Shift+I | Ctrl+Shift+I / F12 |
Debugging
- Renderer Process
- Main Process
- Logging
Chrome DevToolsPress
F12 or Cmd+Shift+I to open DevTools.Features:- React component inspection
- Network monitoring
- Console logs
- Redux DevTools (if enabled)
Build & Distribution
Building for Release
- macOS
- Windows
- Linux
packages/suite-desktop/build-electron/Trezor Suite-[version]-arm64.dmg(Apple Silicon)Trezor Suite-[version]-x64.dmg(Intel)mac-arm64/Trezor Suite.appmac-x64/Trezor Suite.app
Auto-Updates
Suite Desktop includes built-in auto-update functionality:Auto-updates use electron-updater with delta updates for efficiency.
Advanced Features
Tor Integration
How It Works
How It Works
- Bundled Tor binary included with app
- Automatically started when Tor mode enabled
- SOCKS5 proxy on
localhost:9050 - All network traffic routed through Tor
Configuration
Configuration
Tor settings in Suite:
- Settings → Application → Tor
- Enable/disable Tor
- Snowflake bridges for censored networks
- Custom bridges
Technical Details
Technical Details
Location:
@trezor/suite-desktop-core/src/modules/tor.tsFeatures:- Automatic Tor binary management
- Bootstrap progress tracking
- Circuit building
- Bridge configuration
Anonymous Mode
Run Suite with fresh data on every start (like incognito mode): See anon-mode docsExtracting Application
For debugging or inspection, you can extract the packaged app:- macOS
- Linux
- Windows
Performance Optimization
Code Splitting
Lazy load routes and heavy components
IPC Batching
Batch multiple IPC calls when possible
Asset Optimization
Compress images and bundle only needed resources
Memory Management
Proper cleanup of listeners and subscriptions
Troubleshooting
Build fails
Build fails
App won't start
App won't start
Check logs:
- macOS:
~/Library/Logs/Trezor Suite/ - Windows:
%APPDATA%\Trezor Suite\logs\ - Linux:
~/.config/Trezor Suite/logs/
Device not detected
Device not detected
- Install/restart Trezor Bridge
- Try different USB cable
- Check USB permissions (Linux)
- Restart Suite
Next Steps
Suite Web Architecture
Compare with web version architecture
Debugging Guide
Advanced debugging techniques
Runtime Flags
Command-line options
Desktop Updates
Update mechanism details