Thanks for contributing.
- Rust stable toolchain (2024 edition support)
just(optional, but recommended)- For Linux BLE builds:
libdbus-1-devandpkg-config
cargo fmt --all
cargo clippy --workspace --all-targets --all-features -- -D warnings
cargo test --workspaceOr use just:
just fmt
just lint
just test
just build
just cijust cli-scan
just cli-pair
just cli-address-eth
just cli-sign-eth
just cli-help
just cli-sign-message-ethDirect examples:
cargo run -p hw-cli -- -vv pair
cargo run -p hw-cli -- -vv address --chain eth --include-public-key
cargo run -p hw-cli -- -vv sign eth --path "m/44'/60'/0'/0/0" --tx '{"to":"0x000000000000000000000000000000000000dead","nonce":"0x0","gas_limit":"0x5208","chain_id":1,"max_fee_per_gas":"0x3b9aca00","max_priority_fee":"0x59682f00","value":"0x0"}'
cargo run -p hw-cli -- -vv sign-message eth --message "hello"Notes:
- Pairing state is stored at
~/.hw-core/thp-host.json - Use
pair --forceto reset credential flow
Generate Swift/Kotlin bindings:
just bindingsManual generation:
cargo run -p hw-ffi --features bindings-cli --bin generate-bindings --auto target/bindings/swift target/bindings/kotlinCI runs the T3W1 emulator to test the full BLE→THP stack end-to-end.
These tests are #[ignore]d and only run when the harness env vars are set.
# 1. Install system deps
sudo apt-get install -y libdbus-1-dev pkg-config dbus libsdl2-dev libsdl2-image-dev
# 2. Install Python deps
pip install trezor dbus-fast click typing-extensions
# 3. Download or build the emulator binary (see below)
# Place it at tests/fixtures/trezor-emu-core-T3W1
# 4. Run the tests
TREZOR_EMU_BINARY=./tests/fixtures/trezor-emu-core-T3W1 \
BRIDGE_DIR=./tests/fixtures \
cargo test -p hw-cli --test emu_ble -- --ignored --nocaptureThe T3W1 emulator must be built from trezor-firmware.
CI downloads it from the emu-fixtures GitHub release.
To rebuild (requires Nix):
git clone --recursive https://github.com/trezor/trezor-firmware
cd trezor-firmware
TREZOR_MODEL=T3W1 PYOPT=0 nix-shell --run "UV_PYTHON=3.13 uv run make -C core build_unix_frozen"
# Output: core/build/unix/trezor-emu-coreThe binary must match the CI runner architecture (Linux x86_64 for ubuntu-latest).
On Apple Silicon, build inside Docker with --platform linux/amd64.
Upload a new binary:
gh release upload emu-fixtures core/build/unix/trezor-emu-core#trezor-emu-core-T3W1 \
--repo hewigovens/hw-core --clobberThe vendored bridge at tests/fixtures/bluez_emu_bridge/ comes from
trezor-firmware/core/tools/. To update, copy the files from a newer commit
and update the SHA in tests/fixtures/README.md.
- Project roadmap:
docs/roadmap.md - Consolidated execution plan:
docs/plan.md - Canonical smoke matrix:
docs/smoke-matrix.md - Release checklist:
docs/release-checklist.md - Security policy:
SECURITY.md
- Keep changes scoped and cohesive
- Add or update tests for behavior changes
- Run
just cilocally before opening PR - Update docs when public behavior or workflow changes