BitBox
BitBox'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 BitBox's firmware
Repository: https://github.com/BitBoxSwiss/bitbox02-firmware (Apache-2.0). Facts below were checked against master at commit 20f799a8 (2026-12-03), tags firmware/v9.27.1 (391864cd) and firmware/v9.29.0 (0e94aae3), and the published release files. Research date: 2026-12-04.
Verdict: feasible, with the best release metadata of the four, but only part of the image is C. The image format is trivial (a 588-byte signature prefix on the build output), the Docker build is documented, reproduced by the maintainers and by WalletScrutiny, and the published unsigned hash can be checked directly. Over the years most of the application logic has moved to Rust (statically linked into the same image), so cverif covers the C platform layer, drivers, secure-chip code and the C libraries (secp256k1-zkp, fatfs), not the coin logic.
1. Devices, MCUs, published images
| device | MCU | other chips | source |
|---|---|---|---|
| BitBox02 (Multi, Bitcoin-only) | Microchip ATSAMD51J20A, Cortex-M4F | secure chip ATECC608B (older) or Infineon OPTIGA Trust M (newer units, src/optiga/) | README.md, CMakeLists.txt (-mcpu=cortex-m4 -mfloat-abi=softfp -mfpu=fpv4-sp-d16 -D__SAMD51J20A__) |
| BitBox02 Nova (Multi, Bitcoin-only) | same MCU, same unsigned firmware binary | Bluetooth: Renesas DA14531 | releases/README.md, src/da14531/, bitbox-da14531-firmware.bin |
| BitBox03 | STM32U5A9 / U5G9 (Cortex-M33) | — | in development in src/rust/bins/bitbox03-* (Rust only); no release |
Since v9.25.0 one tag serves both editions and both products; each release has four signed files (BitBox02 / Nova × Multi / Bitcoin-only). From the release notes and releases/README.md: the unsigned firmware binaries are the same for BitBox02 and Nova (except v9.26.2), so there are two distinct unsigned images per release, Multi and Bitcoin-only.
Published images:
- Firmware:
firmware-<product>-<edition>.vX.Y.Z.signed.binon GitHub releases (from v9.23.1; v9.23.0 has a mix; older:firmware.vX.Y.Z.signed.binandfirmware-btc.vX.Y.Z.signed.bin, up to v9.23.0 also the unsignedfirmware.vX.Y.Z.bin). - Bootloader: two stages since 2026 (
src/bootloader/,bootloader-stage0.ld,bootloader-stage1.ld): stage0 (8 KiB at0x0, version 3) and stage1 (at0x2000, signed, version 1.2.3; 1.2.4 for development builds). Their binaries are committed insrc/bootloader_upgrade/bin/withchecksums.txt, and are delivered to devices embedded in "intermediate" firmware releases (v9.26.2: bootloader v1.2.2; v9.27.2: stage0 v3 and stage1 v1.2.3, perCHANGELOG.md). There is no separate bootloader download, and no reproducibility assertion for the bootloader inreleases/. - DA14531 (Nova) firmware: a binary blob in the repository (
bitbox-da14531-firmware.bin+.sha256), linked only intofactory-setup; out of scope (another chip's code, source not in this repository).
2. Release channel
- Download: GitHub releases,
https://github.com/BitBoxSwiss/bitbox02-firmware/releases/download/firmware%2FvX.Y.Z/<file>. The BitBoxApp installs firmware it bundles (not reviewed here); the GitHub release is the public channel. - Tags:
firmware/vX.Y.Z(Multi; since v9.25.0 also Bitcoin-only), before thatfirmware-btc-only/vX.Y.Zfor Bitcoin-only;bootloader/vX.Y.Z,bootloader-stage0/vN. Tags are GPG-signed (tagger Marko Bencun). Some tags have no release (v9.28.0, whose changes ship in v9.29.0; v9.25.1 has only a simulator). - Metadata per release (body): the "hash shown by the BitBox02 at startup" for each of the four files; GitHub asset digests. The unsigned hash and the commit are in the repository:
releases/firmware-vX.Y.Z/assertion-bitbox02-{multi,btconly}.txtgive tag, commit and sha256 of the unsigned binary, with GPG signatures of maintainers and outside builders (assertion-*-<name>.sig, keys inreleases/pubkeys/). - At
master20f799a8, assertion directories exist up tofirmware-v9.27.1; v9.27.2 and v9.29.0 (released 2026-11-19) have none yet, although the v9.29.0 release body links toreleases/firmware-v9.29.0. So for the newest releases the commit comes from the tag only. - Signatures: inside the signed file (below); keys: 3 root keys in the bootloader, 3 signing keys certified by them in the file.
Checked: for v9.27.1, the BitBox02 and Nova Bitcoin-only files both contain the unsigned image with sha256 4fbf3da0…e24a92, as in assertion-bitbox02-btconly.txt (commit 391864cd, which tag firmware/v9.27.1 resolves to); monotonic version 55.
3. Image format
From releases/describe_signed_firmware.py and src/bootloader/:
| offset | size | content |
|---|---|---|
| 0 | 4 | edition/product magic (big-endian): 653F362B BitBox02 Multi, 11233B0B BitBox02 BTC, 5B648CEB Nova Multi, 48714774 Nova BTC |
| 4 | 388 | signing pubkeys data: version (4) + 3 signing keys (64 each) + 3 root signatures (64 each) |
| 392 | 196 | firmware data: monotonic version (4, little-endian) + 3 signatures (64 each) |
| 588 | — | the firmware binary exactly as the reproducible build outputs it (firmware.bin / firmware-btc.bin) |
- Load address: the firmware binary goes to
FLASH_APP_START=0x10000(src/flags.h: bootloader 56 KiB + 8 KiB shared data;firmware.ld:rom ORIGIN = 0x00010000). The signature data is stored by the bootloader elsewhere; it is not part of the code. - Comparison: strip the first 588 bytes; the rest must equal the local build byte for byte. Nothing has to be zeroed.
- What is signed (and shown on screen): from monotonic version 57,
sha256(0x01 ‖ product_id ‖ version ‖ firmware padded with 0xFF to 884736 bytes), the signature verifier hashing this once more; versions 51–56 without the0x01; up to 50sha256d(version ‖ padded firmware).t_extractcan recompute this and compare it with the hash in the release body (a check that the right bytes were parsed, not of the signatures).
4. Build
- Documented procedure (
releases/README.md,releases/build.sh):./build.sh <tag> "make firmware EDITION=multi"(orEDITION=btc-only; for v9.27.1 and oldermake firmware/make firmware-btc, and per-productmake firmware-blupgrade-…for v9.26.2). The script clones the tag with submodules, fetches tags (the build reads them to decide on pre-release metadata), builds the Docker image from the repository'sDockerfilewith--platform linux/amd64 --no-cache, and runs the make command in it. Output:temp/build-bitbox02-cmake-relwithdebinfo/bin/firmware{,-btc}.bin(v9.28.0+) ortemp/build/bin/…before. - Environment (
Dockerfile):ubuntu:22.04withapt-get upgrade(not pinned), Arm GNU toolchain 15.2.rel1 pinned by sha256, Rust 1.96.0 (rust-toolchain.toml) installed with rustup,cbindgen0.29.2 andbindgen-cli0.72.1 with--locked, Rust crates vendored inexternal/vendor/. The Docker image itself is not published by digest; each verifier builds it. - Known quirks recorded in
build.sh: v9.26.3 needs its own tag deleted after fetching (its binaries accidentally had pre-release metadata); v9.15.0 needs--lockedpatched into the Dockerfile; v4.1.0 and older needpythoninstalled by hand.releases/README.mdsays plainly that binaries are "only practically reproducible for a limited amount of time". - Build: CMake (C,
-Os,RelWithDebInfo,-ffunction-sections -fdata-sections, newlib nano) plus Cargo for a static librarylib<firmware>_rust_c.a(src/rust/bitbox02-rust-c, release profileopt-level = 'z',lto = true,codegen-units = 1). Several Rust crates compile C with thecccrate inside Cargo:bitbox-secp256k1(secp256k1-zkp),fatfs-sys, andbitbox-lvgl-sys(LVGL, used only by the BitBox03 crates). - Reproducibility: claimed, with signed assertions by maintainers and outside builders in
releases/. WalletScrutiny (https://old.walletscrutiny.com/hardware/bitBox2) reports v9.21.0 Multi as reproducible; the current page (https://walletscrutiny.com/hardware/bitBox2, dated 2026-10-30, version 9.27.1) shows verdictsourceavailablewith no newer build result. Not rebuilt here.
5. Language split
Line counts at master (rough, for orientation): about 75k lines of C and headers in src/ outside src/rust, about 85k lines of first-party Rust in src/rust, plus vendored C (external/: ASF4 drivers, cryptoauthlib, OPTIGA Trust M host library, SAMD51 device files, LVGL; secp256k1-zkp and fatfs under src/rust/*/depend) and vendored Rust crates.
- Rust (out of scope): the API and all coin logic (Bitcoin, Ethereum, Cardano, …), the keystore, Noise, the workflows and much of the UI logic (
bitbox02-rust). - C (in scope): startup and platform (
src/platform,src/system.c, memory/flash handlingsrc/memory), USB/HWW/U2F transport, screen and UI primitives, touch, SD card, the secure-chip layers (src/securechip,src/atecc,src/optigaand the vendored cryptoauthlib / OPTIGA libraries: the secure-chip protocol and the key-derivation calls into the chip),src/pukcc(P-256 via the SAMD51 crypto accelerator), and C libraries compiled through Cargo (secp256k1-zkp, fatfs). - Closed blobs: Microchip QTouch libraries (
external/asf4-drivers/qtouch/lib/gcc/ libqtm_*.a, linked into firmware and stage1),external/lib/libarm_cortexM4l_math.a(CMSIS-DSP; whether it is linked in was not checked) and libssp. They show up as unverified bytes.
Best cverif targets: the secure-chip and memory code in the firmware (C, security-relevant); the C crypto (secp256k1-zkp: the signing primitive Rust calls); and bootloader stage0, which is pure C (src/bootloader/stage0/*.c, pukcc, OLED driver; 8 KiB) and checks the stage1 signature. Stage1 links a Rust library too.
6. Plan for targets/bitbox/bitbox02-multi.sh (and -btconly)
| step | what to do |
|---|---|
t_releases | GitHub releases with tag firmware/v* and a firmware-bitbox02-<edition>.v*.signed.bin asset (older naming for < v9.23.1; firmware-btc-only/v* tags for older BTC) |
t_fetch | download the BitBox02 signed file (the Nova file holds the same unsigned image; optionally fetch both and check that); record sha256, GitHub digest, and the assertion file's commit and unsigned hash when it exists |
t_source | clone the tag with submodules, fetch tags (the build needs them), check the GPG-signed tag against the assertion's commit |
t_build | releases/build.sh steps unmodified; then the instrumented rebuild in the same image. Wrap arm-none-eabi-gcc and arm-none-eabi-ar for CMake and for Cargo's cc crate (it calls arm-none-eabi-gcc by name for thumbv7em-none-eabi unless CC_* is set; check in the log) |
t_extract | new fwimage.py bitbox02 parser: magic, versions, sighash recomputation; code.bin = file minus 588 bytes at 0x10000, compared with the local firmware.bin; cpu = cortex-m4 with FPv4 (softfp ABI) |
t_verify, t_report | as usual; report the share of bytes that come from Rust objects (from the link map) separately, so the coverage figure is read over C |
Expected difficulties:
- C objects inside the Rust static library. The
cc-built objects (secp256k1-zkp, fatfs) end up inlib*_rust_c.a, which rustc writes itself, not throughar. The bundle exporter traces archive members through loggedarcalls, so it will not connect those members to their compile calls without help (match by object name and content, or by thecccrate's intermediate archives in Cargo'starget/directory). - Rust code is LLVM-compiled and LTO'd and may inline into or call C in ways the symbol table shows only at function granularity; Rust functions are simply unverified, but C functions whose callers are Rust are still proved on their own (proofs are modular).
- The unpinned Ubuntu base (
apt-get upgrade) means an old release may no longer build identically; then use--discoverwith the bundle. - New releases lack assertion files at first; the commit then rests on the signed tag alone.
- Bootloader stage0 as a separate target: its binaries are committed (
src/bootloader_upgrade/bin/bootloader-stage0-<product>-<edition>-production.v3.bin) and embedded in v9.27.2; it is built with-flto(cross-unit inlining, so function boundaries differ from the sources more than usual), and no reproducibility claim exists for it. Rebuild withmaketargetsbootloader-stage0-…in the same image to get the bundle and compare.
Priority: medium-high. Second after KeepKey: clean format and metadata, but the verified share of the image will be well below Trezor One's, and the report must say that the coin logic is Rust.