Coldcard
Coldcard's published firmware, checked against its published source with cverif. No device has a verification target yet: below are our research notes on the release channel, image format and build.
About Coldcard's firmware
Repository: https://github.com/Coldcard/firmware. Facts below were checked against master at commit fab5f64a (2026-11-17), the release tag 2026-09-30T2026-v5.6.3 (commit 3e32e32a), and the published files of that release. Research date: 2026-12-04.
Verdict: feasible for the bootloader, partial value for the main firmware. The bootloader is plain C for a Cortex-M4, published byte for byte in the repository (with the vendor's disassembly listing) and inside every factory DFU: a small, high-value target. The main firmware reproduces with make repro, but most of the wallet logic is MicroPython bytecode, which cverif cannot verify; cverif covers the C under it (the MicroPython VM, libngu crypto, Coldcard's C modules).
1. Devices, MCUs, published images
| device | MCU | firmware line | notes |
|---|---|---|---|
| Mk4 | STM32L4S5 (Cortex-M4F) | "Mk" firmware 5.x (-mk-) | Coinkite no longer sells it; still supported |
| Mk5 | STM32L4S5, same firmware as Mk4 | same -mk- image (hw_compat = Mk4 | Mk5) | README.md: "Firmware built for Mk5, supports the Mk4 without any functional differences" |
| Q | STM32L4S5 (Cortex-M4F) | "Q" firmware 1.x (-q1-, version suffix Q) | |
| Mk3 and older | STM32L4 (not checked further) | 4.x, branch v4-legacy | still gets fixes (4.2.0, 2026-07-31) |
MCU: stm32/COLDCARD_MK4/mpconfigboard.mk and stm32/COLDCARD_Q1/mpconfigboard.mk (CMSIS_MCU = STM32L4S5xx); bootloader stm32/mk4-bootloader/Makefile (-mcpu=cortex-m4 -DSTM32L4S5xx). Secure elements: SE1 = Microchip ATECC608, SE2 = Maxim DS28C36B (docs/security-model.md); their firmware is the chip vendors' and not published.
Each release publishes, per hardware line:
<date>T<time>-v<version>-mk-coldcard.dfu: the signed main firmware (one DfuSe element at0x08020000);<date>T<time>-v<version>-mk-coldcard-factory.dfu: the same plus the bootloader as a second element at0x08000000(114688 bytes);- the same pair with
-q1-for the Q. "Edge" releases (6.6.2X,6.6.2QX) have no factory file.
The bootloader binaries are also committed in the repository: stm32/mk4-bootloader/releases/<ver>/bootloader.{bin,dfu,lss} (current 3.3.0) and stm32/q1-bootloader/releases/<ver>/ (current 1.1.0); <ver>.txt gives their sha256 and the build time and commit (3.3.0 time=20260305.091240 git=master@e35f60ed). The Mk firmware build uses BOOTLOADER_VERSION = 3.3.0 (stm32/MK-Makefile) to make the factory DFU.
Checked: the bootloader element of 2026-09-30T2026-v5.6.3-mk-coldcard-factory.dfu is byte-identical to stm32/mk4-bootloader/releases/3.3.0/bootloader.bin (sha256 6bb9350a…43618).
2. Release channel
- Download:
https://coldcard.com/downloads/<file name>(linked from https://coldcard.com/docs/upgrade;stm32/repro-build.shfetches from there too). - Naming and versioning: the file name starts with the release timestamp, which is also the git tag: file
2026-09-30T2026-v5.6.3-mk-coldcard.dfu↔ tag2026-09-30T2026-v5.6.3. Mk and Q releases of the same day have different tags and commits (2026-09-30T2025-v1.5.3Qis4e5ba883). Tags are annotated (tagger Peter D. Gray) but not GPG-signed. - Hashes:
releases/signatures.txtin the repository is a PGP clear-signed list of sha256 for every DFU file (and the change logs). This is the authoritative metadata; it names no commit (the tag does).t_releasescan read the file names from it. - Signature: one secp256k1 signature inside the firmware header (below). Public keys:
stm32/keys/0N.pubkey.*; key 0 is a public test key whose private half is in the repository (stm32/keys/00.pem), production releases use key 1.
Checked: both v5.6.3 Mk files downloaded match signatures.txt (b3a28430…c865b, 5c05c0b8…6f2fb2).
3. Image format
DFU container: standard DfuSe (prefix DfuSe, one target, elements with address and size, 16-byte suffix with CRC). cli/signit.py split takes out the elements.
The firmware element (stm32/sigheader.h, cli/signit.py):
range (from 0x08020000) | content |
|---|---|
0x0000–0x3F7F | MicroPython ISR vectors (firmware0.bin, section at 0x08020000, stm32/COLDCARD_MK4/layout.ld), padded with 0xFF |
0x3F80–0x3FFF | 128-byte header coldcardFirmwareHeader_t at 0x08023F80 |
0x4000– | body (firmware1.bin, linked at 0x08024000), padded with 0xFF to a multiple of 512 |
Header (<I8s8sIIII8s20s64s): magic 0xCC001234, timestamp (BCD-like, from the release time), version string, pubkey_num, firmware_length (= element size), install_flags, hw_compat (0x28 = Mk4 | Mk5 for the "mk" line), best_ts, reserved, signature. The signature is over sha256(sha256(image without its last 64 header bytes)), i.e. the whole image including the header except the signature itself.
To compare with a local build: make repro signs the local build with key 0, so pubkey_num (header offset 20) and the signature differ; the vendor's check-repro (stm32/shared.mk) masks the whole header region (hexdump lines 0x3F80–0x3FF0). For this pipeline: set pubkey_num and the signature to zero on both sides and require everything else to be equal.
The header is written by signit, not by the linker: the ELF has sections in 0x08020000–0x08023F7F and from 0x08024000, so the transplant will report 0x08023F80–0x08023FFF (and the 0xFF padding) as published bytes no section covers; these are accounted for by the header parser.
Checked on v5.6.3: magic, version 5.6.3, pubkey_num 1, firmware_length 1110016 = element size, hw_compat 0x28.
The bootloader element is a raw image at 0x08000000 (objcopy --pad-to --gap-fill 0xff, stm32/mk4-bootloader/Makefile); it carries no signature header (it is the root of trust; how it is protected on the device was not reviewed here).
4. Build
- Documented procedure (
README.md,docs/notes-on-repro.md): check out the tag, put the published DFU inreleases/(or let the script download it),cd stm32 && make -f MK-Makefile repro(orQ1-Makefile). This builds a Docker image fromstm32/dockerfile.build, runsstm32/repro-build.shin it on a read-only copy of the tree, rebuilds, signs with key 0, and compares with the published file (check-repro), ending with "You have built a bit-for-bit identical copy". - Environment:
alpine:3.16.0plusgcc-arm-none-eabiandnewlib-arm-none-eabifrom Alpine edge/testing, and Python packages fromrequirements.txtat build time. The toolchain is therefore not pinned: it is whatever Alpine serves when the image is built. This is the weakest point of the repro, and it may stop working when Alpine moves on.SOURCE_DATE_EPOCHis taken from the DFU file name. - Build system: MicroPython's stm32 port (
external/micropython, Coldcard's fork) with board directories fromstm32/, frozen Python fromshared/viaFROZEN_MANIFEST, libngu. - Reproducibility: claimed and automated by the vendor. WalletScrutiny (https://old.walletscrutiny.com/hardware/coldcardMk4) reports Mk4 v5.4.1 (2025-02-20) and Edge v6.3.5X (2025-02-28) as reproducible. The current page (https://walletscrutiny.com/hardware/coldcardMk4/, dated 2026-10-30, version 5.6.3) shows verdict
sourceavailableand no newer build result. Not rebuilt here. - Bootloader: no documented reproducible build. The release binary, its
.lsslisting (arm-none-eabi-objdump -h -S, with all symbols) and the commit it was built from are committed; the compiler version is not recorded. For cverif this matters less than for a hash comparison: cverif needs the source, the flags and the function addresses, and the.lssgives the vendor's own symbol table for the published bytes.
5. Language split
Main firmware:
- Python (
shared/*.py, about 42k lines): the wallet logic (PSBT, address display, seed handling, UI, backups) is MicroPython, frozen into the image as bytecode (generated C arrays, so it is data in the image). cverif does not verify it. The source bundle's initialised-data comparison would show that these bytes are what the in-treempy-crossproduced from the.pyfiles, which says nothing about what they do. - C: the MicroPython VM and runtime (
external/micropython), libngu (external/libngu: bitcoin-core secp256k1, cifra for AES/SHA/HMAC, sipa's bech32, MicroPython bindings), Coldcard's modules (external/c-modules,stm32/COLDCARD_MK4/*.c,stm32/*.c), the ST HAL and newlib. All Thumb-2 for Cortex-M4F, all in cverif's scope. - No Python is compiled to native code at freeze time (no
@micropython.native/viperinshared/).
Bootloader (stm32/mk4-bootloader/, about 44k lines of C and headers with micro-ecc and ST HAL files): C only. It does PIN handling, SE1/SE2 communication (ae.c, se2.c), firmware signature checking, the firewall setup and the DFU path, i.e. the security core of the device. This is the best cverif target at Coinkite.
6. Plan
Two targets: coldcard/mk-bootloader (and q1-bootloader) first, then coldcard/mk (and q1) for the C part of the main firmware.
coldcard/mk-bootloader:
| step | what to do |
|---|---|
t_releases | bootloader versions from stm32/mk4-bootloader/releases/*.txt (or: the factory DFUs listed in signatures.txt) |
t_fetch | download a factory DFU from coldcard.com/downloads, check it against signatures.txt (PGP-verified), split out the bootloader element; record the matching releases/<ver>/bootloader.bin |
t_source | check out the commit named in <ver>.txt (e35f60ed for 3.3.0), plus the tag of the release it came with |
t_build | no vendor repro exists. Build stm32/mk4-bootloader with its Makefile (make release) in a container with an Arm GCC under the ccwrap wrappers, only to get the source bundle (flags, generated version.o inputs). Byte identity with the release is not expected; take the symbol table from the vendor's bootloader.lss instead of the local link map |
t_extract | raw image at 0x08000000, 112 KiB; cpu = cortex-m4 with FPv4-SP, hard-float ABI (-mfpu=fpv4-sp-d16 -mfloat-abi=hard in the bootloader Makefile) |
t_verify | cverif with the .lss-derived symbols; fall back to --discover where they are not enough |
coldcard/mk (main firmware):
| step | what to do |
|---|---|
t_releases | parse releases/signatures.txt (PGP-checked) for -mk-coldcard.dfu names |
t_fetch | download from coldcard.com/downloads, check the sha256 against signatures.txt |
t_source | tag = file-name prefix; clone with submodules |
t_build | make -f MK-Makefile repro unmodified; then the instrumented rebuild in the coldcard-build image: wrap arm-none-eabi-gcc/ar, run repro-build.sh's make setup; make DEBUG_BUILD=0 all, export the bundle from l-port/build-COLDCARD_MK4/firmware.elf |
t_extract | new fwimage.py coldcard parser: DfuSe elements, header checks (magic, length, hw_compat, sha256d and the secp256k1 signature against stm32/keys/01.pubkey.pem), unsigned.bin with pubkey_num and the signature zeroed, compared to the local firmware-signed.bin treated the same way; code at 0x08020000; cpu = cortex-m4 with FPv4 |
Expected difficulties:
- Most of the firmware's behaviour is in Python bytecode. cverif's result on the main image will cover the VM, crypto and drivers, and must say clearly that wallet logic is out of scope. The coverage figure should be reported over the C code, with the frozen bytecode listed as data.
- The Docker toolchain is unpinned (Alpine edge/testing); a repro of an older release may give a different compiler than the vendor used. If the build no longer reproduces, use
--discoveron the published image with the bundle (the MicroPython runtime is a case cverif's own documentation measures). - The MicroPython build compiles some units with their own flags (for example the frozen content and
mpy-crosshost build);mpy-crossruns on the host and must not end up in the bundle. - Bootloader: the exact compiler is unknown, so the build gives only the bundle; the symbol table comes from the vendor's
.lss. That is a hypothesis like any symbol table (a wrong entry fails, it can't pass wrong code). The.lssshould be checked against the published bytes first (its disassembly must match the image). - The bootloader carries per-device secrets in a separate flash area (
stm32/mk4-bootloadersecrets.h,BL_NVROM_*), not in the image; nothing to strip, but initialised data referring to it will not be in the image.
Priority: medium. Bootloader first (small, C only, security core). Main firmware after KeepKey and BitBox02, with the Python caveat in its report.
Context: Coinkite published an advisory (top of README.md) that releases from 2021 to July 2026 produced seeds with poor entropy, fixed in 5.6.0 / 1.5.0Q / 4.2.0 / 6.6.0X. This is the kind of defect that source verification does not catch by itself (the source was wrong), but it shows where the security-relevant code lives; the advisory's technical background should be read before choosing which functions to report on first.