Skip to content

Fix hardened derivation path error handling in at_derivation_index#913

Merged
apoelstra merged 1 commit into
rust-bitcoin:masterfrom
Velnbur:master
Apr 2, 2026
Merged

Fix hardened derivation path error handling in at_derivation_index#913
apoelstra merged 1 commit into
rust-bitcoin:masterfrom
Velnbur:master

Conversation

@Velnbur

@Velnbur Velnbur commented Mar 27, 2026

Copy link
Copy Markdown
Contributor

Closes #912

@trevarj trevarj left a comment

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

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

Looks correct. No reason to have expects when the DefiniteDescriptorKey::new returns the error.

@apoelstra

Copy link
Copy Markdown
Member

We merged a number of fixes related to this in #830 last July -- particular we changed the contract of DefiniteDescriptorKey::new so that rather than returning None if there are wildcards, it checks multiple conditions and returns an appropriate error.

However, in #830 we didn't fix this callsite, which was assuming the old logic, because I didn't realize that the function wasn't already covering all the possible error cases.

So this looks good to me. Should be backported to 13.x and 12.x (will be slightly nontrivial I think because #830 was nontrivial)

@apoelstra apoelstra left a comment

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.

ACK 97c948d; successfully ran local tests

@apoelstra apoelstra merged commit 4a1fe14 into rust-bitcoin:master Apr 2, 2026
26 checks passed
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.

at_derivation_index panics with "The key should not contain any wildcards at this point"

3 participants