feat: add BIP-85 child mnemonic derivation + Lynx coin#385
Open
BitHighlander wants to merge 5 commits intodevelopfrom
Open
feat: add BIP-85 child mnemonic derivation + Lynx coin#385BitHighlander wants to merge 5 commits intodevelopfrom
BitHighlander wants to merge 5 commits intodevelopfrom
Conversation
- Point device-protocol and python-keepkey submodules to upstream master (includes BIP-85, Solana, Tron, TON wire IDs and proto definitions) - Add nanopb .options files for Solana, Tron, TON (field size constraints) - Add Bip85Mnemonic.mnemonic max_size:241 to messages.options - Update lib/transport/CMakeLists.txt with new proto sources, options, headers, and protoc compilation commands - Fix CI: use pre-installed clang-format instead of apt-get install (eliminates 3-minute timeout on GitHub runners) - Update Zcash transparent branch ID from Sapling to NU6
4443d4c to
d798048
Compare
Add Lynx cryptocurrency support to the firmware coins table. Parameters sourced from Lynx Core (Bitcoin v26 fork with PoS): - SLIP-44 coin type: 191 (0x800000BF) - Address type: 45 (pubkey hash), 22 (script hash) - SegWit enabled with bech32 prefix "lynx" - Taproot enabled - Standard Bitcoin xpub/ypub/zpub magic numbers - Signed message header: "Bitcoin Signed Message:\n" (matches upstream) - 8 decimal places, secp256k1 curve
Add BIP-85 support for deriving child mnemonics from the device seed. Supports 12, 18, and 24 word mnemonics via HMAC-SHA512 derivation on path m/83696968'/39'/0'/<word_count>'/<index>'. New files: - bip85.h/bip85.c: Core derivation using trezor-crypto primitives - fsm_msg_bip85.h: FSM handler for GetBip85Mnemonic message Integration: fsm.h, fsm.c, messagemap.def, firmware CMakeLists.txt device-protocol bumped to 17b38803e (includes BIP-85 message defs)
- Reject index >= 0x80000000 to prevent hardened-bit derivation collision - Add has_word_count/has_index field presence checks - Change confirmation text from "Derive" to "Export" to convey secret export - Add second confirmation before sending child mnemonic to host
d798048 to
b22ed09
Compare
Required proto fields don't generate has_ members in nanopb. word_count and index are guaranteed present by the proto schema. Co-Authored-By: Claude Opus 4.6 <[email protected]>
b22ed09 to
85ce014
Compare
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.
Motivation
BIP-85: Users need deterministic child mnemonics derived from their master seed for isolated wallet compartments (e.g., hot wallet derived from cold storage seed). BIP-85 (Deterministic Entropy From BIP32 Keychains) is the established standard for this, supported by Trezor, Coldcard, and others. Without it, users must manage multiple independent seeds.
Lynx: Community-requested UTXO coin addition. Lynx (LYNX) is a Bitcoin fork with identical transaction structure — the coins table entry is sufficient, no new signing logic required.
Changes
BIP-85 (
lib/firmware/bip85.c,fsm_msg_bip85.h):m/83696968'/39'/0'/{index}'"bip-entropy-from-k"per specGetBip85Mnemonic(120) →Bip85Mnemonic(121)Code review fixes applied:
has_checks on required nanopb fieldsmemzero()in all exit pathsLynx:
coins.deftable (name, shortcut, SLIP44 coin type, address prefix)Risk assessment
bip32andhmacprimitives from trezor-crypto. Key material is derived and displayed but never stored.Testing
requires_firmware()