Skip to content

fix: allow parsing Descriptor<DescriptorPublicKey> from pk with xprv#970

Draft
trevarj wants to merge 1 commit into
rust-bitcoin:masterfrom
trevarj:parse_pk_xprv_desc
Draft

fix: allow parsing Descriptor<DescriptorPublicKey> from pk with xprv#970
trevarj wants to merge 1 commit into
rust-bitcoin:masterfrom
trevarj:parse_pk_xprv_desc

Conversation

@trevarj
Copy link
Copy Markdown
Contributor

@trevarj trevarj commented May 27, 2026

Refactor and fix FromStr for DescriptorPublicKey so that it can parse a
xprv/tprv by doing the conversion into the DescriptorPublicKey.

Added test that reflects what was reported in the issues:
bitcoinfuzz/bitcoinfuzz#70
#785

Refactor and fix FromStr for DescriptorPublicKey so that it can parse a
xprv/tprv by doing the conversion into the DescriptorPublicKey.

Added test that reflects what was reported in the issues:
bitcoinfuzz/bitcoinfuzz#70
rust-bitcoin#785
@apoelstra
Copy link
Copy Markdown
Member

This feels a little dangerous to me. If the user provides secret data and then we irreversibly throw it away, could that cause a loss of the secret?

@trevarj
Copy link
Copy Markdown
Contributor Author

trevarj commented May 28, 2026

we irreversibly throw it away

Yeah, that's a good point. Using parse_descriptor seems like the best route since you get back the KeyMap.
Wonder if FromStr should just be removed. I feel like most people will see parse_descriptor in the API before they consider calling parse(), or maybe that's just me.

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.

2 participants