Skip to content

fix(wallet_policy): apply template derivation in into_descriptor - #1018

Open
trevarj wants to merge 1 commit into
rust-bitcoin:masterfrom
trevarj:fix/wallet-policy-template-derivation
Open

fix(wallet_policy): apply template derivation in into_descriptor#1018
trevarj wants to merge 1 commit into
rust-bitcoin:masterfrom
trevarj:fix/wallet-policy-template-derivation

Conversation

@trevarj

@trevarj trevarj commented Aug 9, 2026

Copy link
Copy Markdown
Contributor

BIP-388 key information items are bare KEY expressions and the derivation
comes from the template's key placeholders, but the translator returned the
key information item verbatim, so wpkh(@0/**) materialized as wpkh(xpub...)
instead of wpkh(xpub.../<0;1>/*).

  • take the derivation path and wildcard from the placeholder when
    materializing a descriptor key
  • reject a key information item that is not an extended key, since there is
    nothing to append a derivation to

Fixes #1014

BIP-388 key information items are bare KEY expressions and the derivation
comes from the template's key placeholders, but the translator returned the
key information item verbatim, so wpkh(@0/**) materialized as wpkh(xpub...)
instead of wpkh(xpub.../<0;1>/*).

- take the derivation path and wildcard from the placeholder when
  materializing a descriptor key
- reject a key information item that is not an extended key, since there is
  nothing to append a derivation to

Fixes rust-bitcoin#1014
@trevarj

trevarj commented Aug 9, 2026

Copy link
Copy Markdown
Contributor Author

Reminder to cherry pick into #1009 (comment) once merged

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.

WalletPolicy::into_descriptor drops template derivation paths

1 participant