Add docs + test on required use of xpub for multipath constructor#306
Merged
ValuedMammal merged 1 commit intobitcoindevkit:masterfrom Sep 5, 2025
Merged
Conversation
Pull Request Test Coverage Report for Build 17476589408Details
💛 - Coveralls |
Collaborator
ValuedMammal
approved these changes
Sep 4, 2025
Member
Author
Yeah it's fuzzy for me too but I think the answer probably is in this video if I remember correctly. He goes over the ideas and tricks that make extended keys able to create children keys, and how this ability is broken by the "hardening" process. It's maybe that because you can't ensure that some of the multipath paths are not hardened, miniscript just errors out on all multipath xprv. But also, could you not just error out if one or more of those paths are hardened instead of in all cases? I might be thinking about this wrong. |
ValuedMammal
added a commit
that referenced
this pull request
Sep 8, 2025
f73596e docs: add wording on required use of xpub for multipath constructor (thunderbiscuit) Pull request description: This is just a cherry pick of my #306 PR onto the 2.2 release branch. ACKs for top commit: ValuedMammal: ACK f73596e oleonardolima: ACK f73596e Tree-SHA512: f1e0f2acf9ab832e33fcf071b880de8df09b40bc755236c80f0045c48f667c10e4b38133f50f210acafe6d335e6a62b77037b6a5068d16d44a25dd46e138307c
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
This PR makes explicit a limitation of the
Wallet::create_from_two_path_descriptormethod, in that you must use public descriptors to build the wallet using this constructor, meaning you can only build watch-only wallets.I also added a test to showcase this and the error returned.
See my comment here for more:
From what I can tell the issue is that miniscript cannot parse an xprv (I saw a comment from Sanket about this somewhere but now I can't find it anymore) if the multipath contains hardened derivation paths, and therefore miniscipt cannot ensure the xprv will be parsable into public keys in all cases? Something like that. But our arguments for bdk wallet constructors require the
IntoWalletDescriptortrait:In other words, upon creation, the wallet will always try to parse the descriptor string into its public form, and here since it cannot be done by miniscript we fail to build.
Changelog notice
No changelog notice.
Checklists
All Submissions:
just pbefore pushing