Skip to content

fix(signer): validate wildcard derivation paths - #569

Open
busayo-OD wants to merge 1 commit into
bitcoindevkit:masterfrom
busayo-OD:fix/xprv-wildcard-signing
Open

busayo-OD wants to merge 1 commit into
bitcoindevkit:masterfrom
busayo-OD:fix/xprv-wildcard-signing

Conversation

@busayo-OD

@busayo-OD busayo-OD commented Sep 17, 2026

Copy link
Copy Markdown

Fixes #563

Description

SignerWrapper<DescriptorXKey<Xpriv>>::sign_input uses DescriptorXKey::matches() to determine whether a PSBT key origin
matches the signer. Since matches() ignores the final derivation step for wildcard descriptors, a hardened child could be accepted for an unhardened wildcard, and vice versa.

Notes to the reviewers

DescriptorXKey::matches() intentionally ignores the wildcard's final path step, so the additional check is required to validate the wildcard-specific derivation constraint.

Added regression tests covering both hardened and unhardened wildcard descriptors and their valid and invalid derivation paths.

Changelog notice

  • Validate wildcard derivation hardness when signing with an xprv signer

Before submitting

`DescriptorXKey::matches()` ignores the final derivation step for
wildcard descriptors, so the xprv signer must validate its hardenedness
separately before signing.

Add regression tests for both hardened and unhardened wildcard
derivation paths.
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: No status

Development

Successfully merging this pull request may close these issues.

Xprv signer signs for hardened child under an unhardened wildcard descriptor

1 participant