test: GetAddress returns BIP-86 taproot addresses - #28
Open
BitHighlander wants to merge 1 commit into
Open
Conversation
Drives the emulator through the full GetAddress path for SPENDTAPROOT -- fsm_msgGetAddress, path_mismatched's m/86' branch, compute_address, the BIP-86 tweak and bech32m encoding -- none of which the firmware's C unit tests reach. Expected values are the three official BIP-86 vectors. BIP-86 publishes them against the "abandon abandon ... about" mnemonic, which is exactly what setup_mnemonic_abandon loads, so these are the spec's constants and not values our implementation produced. Verified against a locally built emulator: 1 passed. Also mutation checked -- flipping one character of the first expected address makes it fail, so the assertions are not vacuous. NOTE: gated at 7.16.0 via TAPROOT_FIRMWARE_VERSION. develop is currently 7.15.0, so this SKIPS until the project version bumps. A gate that is never reached is a test that is silently green forever -- keep the constant in step with CMakeLists.txt.
BitHighlander
added a commit
to BitHighlander/keepkey-firmware
that referenced
this pull request
Jul 31, 2026
Bumps deps/python-keepkey by one commit to pick up tests/test_msg_getaddress_taproot.py (BitHighlander/python-keepkey#28), which drives the emulator through the full SPENDTAPROOT GetAddress path and asserts the three official BIP-86 addresses. Verified against a locally built kkemu: 1 passed, and mutation checked so the assertions are known not to be vacuous. The test gates on firmware 7.16.0 and CMakeLists is 7.15.0, so it SKIPS until the project version bumps. Deliberate: gating at 7.15.0 would make released 7.15.0-rcN firmware without taproot fail rather than skip.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Emulator coverage for
SPENDTAPROOT, supporting the taproot work inBitHighlander/keepkey-firmware#328.Drives the full GetAddress path —
fsm_msgGetAddress→path_mismatched's newm/86'branch →compute_address→ BIP-86 tweak → bech32m → protobuf. None of that is reachable from the firmware's C unit tests, which stop at the crypto.Ground truth, not self-confirmation
Expected values are the three official BIP-86 vectors. BIP-86 publishes them against the
abandon abandon … aboutmnemonic, which is exactly whatsetup_mnemonic_abandon()loads — so these are the spec's constants, not values our implementation produced. A test written against theallallallseed would have had to use addresses we generated, which proves nothing.Verified
Built kkemu from the taproot firmware branch and ran it: 1 passed.
Mutation checked — flipping one character of the first expected address gives
FAILED, so the assertions are not vacuous.Two things a reviewer should know
This test SKIPS today. It gates on
TAPROOT_FIRMWARE_VERSION = "7.16.0"whileCMakeLists.txtis7.15.0. A gate that is never reached is a test that is silently green forever, so the constant has to move in step with the project version. Gating at 7.15.0 instead is wrong — released 7.15.0-rcN firmware without taproot would fail rather than skip, which is the whole point of the gate.The base branch is unusual on purpose.
taproot/baseis pinned atd88a073a, the exact commitkeepkey-firmwarerecords for this submodule, so the diff here is one file. Basing ondevelopwould not work:develop's generatedkeepkeylib/types_pb2.pyhas noSPENDTAPROOT(it pins device-protocol22ca1d98, whiled88a073apinsf2246ceb— the same one the firmware uses), soproto.SPENDTAPROOTwould raiseAttributeError.That lineage gap is pre-existing and worth fixing separately:
developis behind on protocol, and the commit the firmware pins lives only onagent/x402-solana-metadata.