How coldcard/firmware works
Coldcard is a Bitcoin hardware wallet whose firmware guides users through PIN login and wallet operations, authorizes sensitive actions such as transaction signing, and uses device storage and hardware security to protect secrets. The README describes shared high-level code running on both the desktop simulator and embedded hardware, with Mk and Q variants. Major capabilities are represented from the README and source index; unsampled implementation details and external-service wiring are not inferred.
Main entry points: main.py Firmware startup · auth.py Action authorization · pincodes.py PIN login · actions.py Wallet actions
Components 21
Wallet application
- Firmware startup
shared/main.py - Wallet actions
shared/actions.py - Interaction flow
shared/ux.py - Display UI
shared/lcd_display.py - USB interface
shared/usb.py
Wallet security
- Action authorization
shared/auth.py - PIN login
shared/pincodes.py - Secret handling
shared/stash.py - Encrypted settings
shared/nvstore.py - Seed management
shared/seed.py - Wallet backups
shared/backups.py
Bitcoin operations
- Transaction signing
shared/psbt.py - Bitcoin chains
shared/chains.py - Multisig wallets
shared/multisig.py
Device platform
- Secure flash
stm32/mk4-bootloader/storage.c - Bootloader gateway
shared/callgate.py - Embedded firmware
stm32/COLDCARD_MK4/modckcc.c - Hardware detection
shared/version.py
Simulator
- Desktop simulator
unix/simulator.py - Simulated hardware
unix/variant/ckcc.py
Other components
- Wallet user
Connections 21
- Wallet user → Firmware startup: starts device
README.md - Firmware startup → Interaction flow: starts interaction
shared/main.py - Firmware startup → Display UI: initializes display
shared/main.py - Firmware startup → PIN login: loads PIN flow
shared/main.py - Firmware startup → USB interface: starts USB
shared/main.py - Interaction flow → Wallet actions: dispatches actions
shared/ux.py - Wallet actions → Action authorization: requests authorization
shared/actions.py - Wallet actions → Interaction flow: uses interaction
shared/actions.py - Action authorization → Transaction signing: handles PSBT
shared/auth.py - Action authorization → Multisig wallets: confirms import
shared/auth.py - Action authorization → Wallet backups: creates backup
shared/auth.py - Action authorization → Bitcoin chains: selects chain
shared/auth.py - PIN login → Bootloader gateway: calls bootloader
shared/pincodes.py - PIN login → Encrypted settings: updates settings
shared/pincodes.py - PIN login → Secret handling: loads secrets
shared/pincodes.py - Secret handling → Bitcoin chains: derives wallet
shared/stash.py - Bootloader gateway → Secure flash: accesses flash
- Desktop simulator → Simulated hardware: uses simulator hardware
unix/simulator.py - Desktop simulator → Firmware startup: runs shared firmware
README.md - Embedded firmware → Firmware startup: runs shared firmware
README.md - Firmware startup → Hardware detection: probes hardware
shared/main.py