Skip to content

HWI parity: complete Ledger registered-wallet signing - #78

Open
trevarj wants to merge 4 commits into
wizardsardine:mainfrom
trevarj:trevarj/ledger_registered_signing
Open

HWI parity: complete Ledger registered-wallet signing#78
trevarj wants to merge 4 commits into
wizardsardine:mainfrom
trevarj:trevarj/ledger_registered_signing

Conversation

@trevarj

@trevarj trevarj commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator

Closes #70.

Summary

  • complete Ledger HWI signtx support for default policies and registered classic sorted multisig
  • discover mixed policies across PSBT inputs, sign them sequentially, and merge signatures into the original PSBT
  • validate policy derivations, scripts, UTXOs, and retained registration HMACs with contextual errors for unsupported shapes
  • fix Ledger Merkle lookups for optional missing PSBT keys used during legacy signing
  • document the supported parity set and add direct, CLI, and differential emulator coverage

Validation

  • cargo fmt --all --check
  • cargo clippy --all --all-features --all-targets -- -A dead_code -D warnings
  • cargo test --verbose --no-default-features
  • cargo test --verbose --color always -- --nocapture
  • cargo test --all --exclude "bhwi-e2e-*" --verbose --color always -- --nocapture
  • Ledger direct and CLI emulator cases passed; aggregate runs encountered a cumulative Speculos UnicodeDecodeError, and the affected cases passed individually on a fresh emulator
  • nix run .#hwi-parity-ledger -- candidate_signtx_matches_reference -- --test-threads=1
  • nix run .#hwi-upstream-ledger (22 passed, 6 expected skips)

Compatibility

  • no public API changes
  • native register-wallet and sign-psbt behavior is unchanged

Comment thread bhwi/src/ledger/store.rs
.ok_or(StoreError::UnknownHash)?;
.ok_or(StoreError::UnknownMerkleRoot)?;

let leaf_index = tree.get_leaf_index(hash).ok_or(StoreError::UnknownHash)?;

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

nice catch to finally return a proper response instead of having an error.

trevarj added 4 commits July 31, 2026 10:40
- return the protocol not-found response for optional PSBT keys
- preserve request context when mapping Ledger store errors
- discover and validate default and registered policies across PSBT inputs
- sign each policy sequentially and merge signatures into the original PSBT
- support classic sorted multisig with retained registration HMACs
- exercise legacy, nested, and native classic multisig policies
- verify retained HMAC signing through direct and CLI workflows
- compare default, registered, and mixed-policy PSBTs with HWI
- describe supported default and classic multisig policies
- record Ledger signtx parity coverage and limitations
@trevarj
trevarj force-pushed the trevarj/ledger_registered_signing branch from 8998b35 to 0f27f45 Compare July 31, 2026 10:43
@trevarj
trevarj requested a review from edouardparis July 31, 2026 14:33
@trevarj

trevarj commented Jul 31, 2026

Copy link
Copy Markdown
Collaborator Author

Fixed conflict and ready to merge

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

HWI parity: complete Ledger registered-wallet signing

2 participants