Firmware code of the BitBox02 hardware wallet
  • C 62.7%
  • Rust 25.1%
  • Python 4.9%
  • HTML 3.3%
  • Standard ML 1.8%
  • Other 2.1%
Find a file
2026-03-26 09:54:12 +01:00
.ci chore: Move args to black one level up 2026-03-23 14:08:04 +01:00
.github/workflows ci: pin mattermost notify action 2026-03-11 09:16:15 +01:00
doc simulator-graphical: Initial commit 2025-11-13 12:58:56 +01:00
external simulator: LVGL init 2026-03-23 22:32:13 +01:00
messages eth: implement streaming for typed data messages 2026-03-25 18:49:14 +01:00
py eth: implement streaming for typed data messages 2026-03-25 18:49:14 +01:00
releases chore: Extract generation of headers from CMake 2026-03-23 20:53:01 +01:00
scripts chore: Extract generation of headers from CMake 2026-03-23 20:53:01 +01:00
src Port USB report queue to Rust 2026-03-26 09:42:20 +01:00
test Port USB report queue to Rust 2026-03-26 09:42:20 +01:00
tools license: replace Shift Apache headers 2025-12-22 19:08:18 +01:00
.clang-format formatting: Indent preprocessor directives 2025-11-05 10:30:05 +01:00
.clang-tidy docker: Add new target 2026-02-16 10:01:41 +01:00
.codecov.yml Enable coverage reports from codecov 2019-07-01 13:53:16 +02:00
.containerversion Dockerfile: Use python3 executable. 2026-03-17 12:59:09 +01:00
.dockerignore docker: spsed up docker build 2021-11-11 15:51:18 +01:00
.gitattributes .gitattributes: fix path to vendor folder 2026-02-06 07:42:39 +01:00
.gitignore gitignore: ignore .venv directories 2025-12-21 07:57:49 +01:00
.gitmodules simulator: LVGL init 2026-03-23 22:32:13 +01:00
.pylintrc tooling: Bump python tools to latest version 2025-05-14 09:26:14 +02:00
AGENTS.md Port USB report queue to Rust 2026-03-26 09:42:20 +01:00
arm.cmake build: Avoid hard coding path to compiler 2026-01-30 22:56:10 +01:00
bitbox-da14531-firmware.bin da14531: firmware v2 2025-06-05 14:02:17 +02:00
bitbox-da14531-firmware.bin.sha256 ci: check da14531 firmware hash 2025-06-05 14:09:54 +02:00
bootloader.ld Debug: Adds RTT support to bootloader 2025-04-22 19:03:02 +02:00
BUILD.md scripts: add dev-exec.sh 2026-03-18 14:24:14 +01:00
CHANGELOG.md eth: implement streaming for typed data messages 2026-03-25 18:49:14 +01:00
CMakeLists.txt chore: Extract generation of headers from CMake 2026-03-23 20:53:01 +01:00
CONTRIBUTING.md BitBox02 public release 2019-06-06 23:19:25 +02:00
Dockerfile Dockerfile: Use python3 executable. 2026-03-17 12:59:09 +01:00
firmware.ld Debug: Adds RTT support to bootloader 2025-04-22 19:03:02 +02:00
LICENSE update LICENSE year 2025-12-22 19:08:17 +01:00
Makefile simulator: LVGL init 2026-03-23 22:32:13 +01:00
README.md simulator-graphical: Initial commit 2025-11-13 12:58:56 +01:00
SECURITY.md shiftcrypto.ch -> bitbox.swiss 2025-04-28 22:27:42 +02:00
versions.json chore: Extract generation of headers from CMake 2026-03-23 20:53:01 +01:00

CI

The BitBox02 is a hardware wallet that simplifies secure handling of crypto coins through storing private keys and signing transactions. The content of this repository is the bootloader and firmware used on the device. The BitBox02 is meant to be used primarily with the BitBoxApp, although third party integration is possible through the BitBox02 API.

The main functionality of the firmware is the following:

  • Safely receive and send coins.
  • Interacting with the user through touch sliders and a display.
  • Back up the seed to a microSD card.
  • Back up the seed by displaying the BIP39 mnemonic encoding on the screen.
  • Import 12, 18 or 24 word BIP39 mnemonics
  • Generate a random seed from multiple strong sources of entropy.
  • Protect the seed from attackers.
  • Derive keys from the seed according to BIP39 and BIP32.
  • Return the extended public key for a keypath so that the app can find all unspent transaction outputs.
  • Display the receive address for the keypath, coin and script/address type.
  • Display the receive address, transaction amount and network fee and sign each input after confirmation.

Architecture

The main chip on the device is the microcontroller from Microchip (ATSAMD51J20A). This chip is used for communication to the BitBoxApp via USB, to the user via the sliders and to the secure element (ATECC608B) via I2C.

Sliders

The sliders along the edges of the device are used for user input. There are three input gestures:

  • Tap
  • Slide
  • Hold to confirm

USB

The USB communication is implemented using the request-response pattern with encrypted protobuf messages. The encryption protocol used is Noise with out-of-band authentication.

Hardware docs

PCB schematics v2.1

PCB bill of materials (BOM) v2.1

PCB x-ray v2.1

Contributing

The instructions for setting up a development environment can be found in BUILD.md. Please also read our CONTRIBUTING.md before filing issues and pull requests.

Simulator

To test without hardware there are two kinds of simulators. One with GUI and one without. See more details in BUILD.md.

Installing/upgrading firmware

There are two main ways to install or upgrade firmware on a BitBox02:

  1. by running the BitBoxApp
  2. by running ./py/load_firmware.py after installing the bitbox02 Python package, e.g. ./py/load_firmware.py firmware-btc.v9.12.0.signed.bin.

Reporting a vulnerability

See our security policy.