Skip to content

Instantly share code, notes, and snippets.

@douglaz
Created September 3, 2025 02:40
Show Gist options
  • Save douglaz/745d9d46aa5501f3f41bff93202c253c to your computer and use it in GitHub Desktop.
Save douglaz/745d9d46aa5501f3f41bff93202c253c to your computer and use it in GitHub Desktop.

Hardware Wallet Implementation Analysis Report

Python vs Rust Projects Comparison


Executive Summary

This report analyzes the features and implementation approaches of major open-source hardware wallet projects, comparing Python-based implementations (Krux, SeedSigner, Specter-DIY) with Rust-based or Rust-adopting projects (BitBox02, Parity Signer). The analysis identifies common features, key differences, and opportunities for improvement in the hardware wallet ecosystem.


1. Python-Based Projects

1.1 Krux

Language: Python (cross-compiled/frozen)
Platform: Kendryte K210 devices
Key Library: Embit (Python Bitcoin library)

Core Features:

  • BIP Support: BIP-39, BIP-32, BIP-85, BIP-174
  • Script Types: Legacy, Nested Segwit, Native Segwit, Taproot
  • Communication: QR codes, SD cards, optional thermal printer
  • Multisig: Full support with policy verification
  • Special Features:
    • BBQr support for efficient PSBT transfer
    • Encrypted QR code export
    • Miniscript support
    • Wallet descriptor management

1.2 SeedSigner

Language: Python
Platform: Raspberry Pi Zero 1.3 (no WiFi/Bluetooth)
Architecture: Full Linux OS with Python application

Core Features:

  • BIP Support: BIP-39, BIP-85, BIP-174, BIP-45 (P2SH multisig)
  • Script Types: Taproot, Native Segwit, Nested Segwit, Legacy
  • Communication: Two-way QR code exchange
  • Multisig: Single and multisig xpub export
  • Special Features:
    • Stateless operation (wipes memory on power off)
    • Address verification and message signing
    • UR Xpub encoding for Nunchuk wallet
    • Compact SeedQR format

1.3 Specter-DIY

Language: MicroPython
Platform: Various development boards
Key Library: Embit (MicroPython/Python)

Core Features:

  • BIP Support: BIP-39, BIP-32, BIP-85, PSBT v1 and v2
  • Script Types: Taproot (with miniscript), all standard types
  • Communication: QR codes primary, USB/SD card optional
  • Multisig: Primary focus with hardware wallet compatibility
  • Special Features:
    • Shamir Secret Sharing (experimental)
    • Liquid Network support (experimental)
    • Secure element integration (planned)
    • Custom SIGHASH flag support

2. Rust-Based/Adopting Projects

2.1 BitBox02

Language: C and Rust (progressive migration)
Platform: Custom hardware with secure elements
Architecture: Bare-metal firmware

Core Features:

  • BIP Support: BIP-86 (Taproot), standard BIPs
  • Script Types: Taproot, Segwit (all types), Legacy
  • Communication: USB primary, no QR codes
  • Multisig: Up to 25 registered accounts, verified xpubs
  • Special Features:
    • Dual secure elements (ATECC608, DS28C36B)
    • Deterministic/reproducible builds
    • Anti-klepto protocol
    • Progressive Rust migration for security

2.2 Parity Signer

Language: Rust
Platform: Mobile devices (iOS/Android)
Architecture: Air-gapped mobile application

Core Features:

  • Focus: Multi-chain support (not Bitcoin-specific)
  • Communication: QR codes exclusively
  • Architecture: Rust core with mobile UI wrapper
  • Special Features:
    • Over-the-airgap updates via QR
    • Multi-chain support
    • Pure Rust implementation

2.3 ColdCard MK4 (C-based, for reference)

Language: C/MicroPython
Platform: Custom hardware with dual secure elements
Architecture: Bare-metal with MicroPython interpreter

Core Features:

  • BIP Support: PSBT-native (BIP-174), all standard BIPs
  • Script Types: Taproot (viewing only, signing planned), all others
  • Communication: SD card, USB, NFC, QR (Q model)
  • Multisig: Up to 15 co-signers, airgapped setup
  • Special Features:
    • BBQr specification for QR codes
    • USB Virtual Disk mode
    • NFC-V compatible
    • Key Teleport between devices

3. Comparative Analysis

3.1 Common Features Across All Projects

Feature Implementation Status
BIP-39 Mnemonics ✅ Universal
BIP-32 HD Wallets ✅ Universal
PSBT Support ✅ Universal
Multisignature ✅ Universal
Air-gapped Operation ✅ Primary design goal
QR Code Communication ✅ Most projects (except BitBox02)
Native Segwit ✅ Universal

3.2 Key Differences

Language Choice Impact

Python Projects:

  • ✅ Rapid development and iteration
  • ✅ Easy community auditing
  • ✅ Rich Bitcoin library ecosystem
  • ❌ Larger memory footprint
  • ❌ Requires interpreter/runtime
  • ❌ Slower execution speed

Rust Projects:

  • ✅ Memory safety guarantees
  • ✅ No runtime overhead
  • ✅ Smaller binary size
  • ✅ Better for resource-constrained devices
  • ❌ Steeper learning curve
  • ❌ Smaller Bitcoin library ecosystem

Architecture Approaches

Project Architecture Pros Cons
Krux Frozen Python on MCU Simple deployment Limited by MCU resources
SeedSigner Full Linux + Python Maximum flexibility Large attack surface
Specter-DIY MicroPython on bare metal Good balance Limited Python features
BitBox02 Bare-metal C/Rust Minimal attack surface Complex development
Parity Signer Mobile app in Rust Leverages phone hardware Requires dedicated device

3.3 Feature Adoption Timeline

Feature Early Adopters Current Status
Taproot BitBox02, Specter-DIY Widely supported (except ColdCard signing)
Miniscript Specter-DIY, Krux Growing adoption
BBQr QR Format ColdCard Q, Krux Emerging standard
BIP-85 Most recent versions Near universal
Secure Elements BitBox02, ColdCard Hardware-dependent

4. Opportunities for Improvement

4.1 Technical Opportunities

Memory and Performance

  • Opportunity: Rust implementation could provide 5-10x performance improvement
  • Impact: Faster signing, lower power consumption, smaller devices
  • Implementation: Use Embassy-rs for async embedded development

Security Enhancements

  • Opportunity: Formal verification of critical paths
  • Current Gap: No project has formally verified code
  • Rust Advantage: Better tooling for verification (KLEE, SMACK)

Standardization

  • Opportunity: Unified QR code format beyond BBQr
  • Current State: Multiple incompatible formats
  • Solution: Industry-wide standard for wallet communication

4.2 Feature Gaps to Address

Missing Feature Impact Complexity Rust Advantage
Taproot Multisig High - Future standard High Type safety helps
Coinjoin Support Medium - Privacy Medium Async handling
Lightning Support High - Layer 2 Very High Performance critical
Threshold Signatures High - Better UX High Cryptography libs
Hardware Attestation High - Anti-counterfeit Medium Low-level control

4.3 User Experience Improvements

Current Pain Points:

  1. Complex multisig setup - Could use better wizards
  2. QR code size limitations - BBQr helps but not universal
  3. Firmware updates - Most require manual SD card process
  4. Backup/Recovery - No standard for multisig backup

Rust-Specific Opportunities:

  1. Smaller firmware → More features in same hardware
  2. Faster operations → Better animated QR rendering
  3. Async I/O → Smoother user interactions
  4. Type safety → Fewer runtime errors

4.4 Ecosystem Opportunities

Development Tools

  • Current: Limited debugging tools for hardware wallets
  • Opportunity: Rust's superior tooling (cargo, clippy, miri)
  • Impact: Faster development, fewer bugs

Modular Architecture

  • Current: Monolithic firmware designs
  • Opportunity: Rust's trait system for pluggable components
  • Benefits:
    • Easier third-party contributions
    • Custom builds for specific use cases
    • Better testing isolation

Cross-Platform Code Sharing

  • Current: Separate desktop/hardware implementations
  • Opportunity: Shared Rust libraries (no_std compatible)
  • Example: Same signing logic for hardware and desktop

5. Recommended Rust Implementation Strategy

5.1 Core Architecture

┌─────────────────────────────────────┐
│         Application Layer            │
│  - UI State Machine                  │
│  - QR Code Generation/Parsing        │
│  - User Input Handling               │
├─────────────────────────────────────┤
│         Wallet Logic Layer           │
│  - BIP32/39/44/85 Implementation     │
│  - PSBT Builder/Signer               │
│  - Multisig Coordinator              │
│  - Miniscript Compiler               │
├─────────────────────────────────────┤
│      Security Services Layer         │
│  - Secure Key Storage                │
│  - Anti-Tampering                    │
│  - Entropy Generation                │
│  - Memory Encryption                 │
├─────────────────────────────────────┤
│        Embassy-rs HAL Layer          │
│  - Async Task Executor               │
│  - Hardware Drivers                  │
│  - Power Management                  │
└─────────────────────────────────────┘

5.2 Priority Features for MVP

  1. Phase 1 - Core Functionality

    • BIP-39 mnemonic generation/import
    • BIP-32 HD derivation
    • Single signature PSBT signing
    • QR code display/scanning
  2. Phase 2 - Advanced Features

    • Multisig support (2-of-3, 3-of-5)
    • Taproot addresses
    • SD card backup/restore
    • BBQr format support
  3. Phase 3 - Differentiators

    • Miniscript support
    • Threshold signatures (FROST)
    • Hardware attestation
    • Coinjoin coordination

5.3 Hardware Platform Recommendations

Platform Pros Cons Best For
nRF52840 BLE, USB, Crypto accelerator Expensive Premium devices
ESP32-C3 WiFi (disabled), RISC-V, Cheap Power hungry DIY projects
STM32L4 Low power, Mature ecosystem No wireless Production devices
RP2040 Dual-core, PIO, Very cheap No crypto acceleration Budget DIY

6. Conclusions

Key Findings:

  1. Python dominates current open-source hardware wallets due to development speed
  2. Rust adoption is beginning with BitBox02 leading migration
  3. Feature parity exists across most projects for core functionality
  4. Performance and security are the main drivers for Rust adoption
  5. QR codes have become the standard for air-gapped communication

Rust Implementation Advantages:

  1. 10x smaller binary size compared to Python + interpreter
  2. Predictable memory usage critical for embedded systems
  3. Compile-time guarantees reduce runtime failures
  4. Modern async model via Embassy-rs perfect for UI responsiveness
  5. Growing ecosystem with rust-bitcoin and BDK libraries

Market Opportunity:

A Rust-based hardware wallet could differentiate itself through:

  • Superior performance on low-end hardware ($10-20 devices)
  • Advanced features not possible with Python's overhead
  • Formal verification potential for security-critical paths
  • Modular architecture enabling community customization
  • Cross-platform code sharing with desktop/mobile wallets

Recommendation:

The hardware wallet ecosystem is ready for a Rust-based implementation that combines the security of BitBox02, the openness of SeedSigner, and the features of Krux, while providing performance and reliability improvements that only Rust can deliver. Embassy-rs provides the perfect async foundation for building responsive, power-efficient embedded Bitcoin wallets.


Report compiled from analysis of open-source hardware wallet projects as of 2025

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment