Skip to content

fix(wallet): fix into_descriptor_key for DescriptorPublicKey #241

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged

Conversation

ValuedMammal
Copy link
Collaborator

Fix into_descriptor_key for DescriptorPublicKey by including the missing match arm for DescriptorPublicKey::MultiXPub when initializing networks.

Test that into_wallet_descriptor correctly parses a multipath descriptor and fails if passed a network that is invalid for the descriptor.

Note that rust-miniscript doesn't support parsing a multipath descriptor containing extended private keys.

fixes #10

Checklists

All Submissions:

  • I've signed all my commits
  • I followed the contribution guidelines
  • I ran cargo +nightly fmt and cargo clippy before committing

New Features:

  • I've added tests for the new feature
  • I've added docs for the new feature

Bugfixes:

  • This pull request breaks the existing API
  • I've added tests to reproduce the issue which are now passing
  • I'm linking the issue being fixed by this PR

..by including the missing match arm for
`DescriptorPublicKey::MultiXPub` when initializing `networks`.

Test that `into_wallet_descriptor` correctly parses a multipath
descriptor and fails if passed a network that is invalid for the
descriptor.

Note that rust-miniscript doesn't support parsing a multipath
descriptor containing extended private keys.
@ValuedMammal
Copy link
Collaborator Author

I reopened this from the original PR bitcoindevkit/bdk#1902.

@ValuedMammal ValuedMammal self-assigned this May 25, 2025
@ValuedMammal ValuedMammal added the bug Something isn't working label May 25, 2025
@ValuedMammal ValuedMammal added this to the Wallet 2.0.0 milestone May 25, 2025
@ValuedMammal ValuedMammal moved this to Needs Review in BDK Wallet May 25, 2025
@coveralls
Copy link

Pull Request Test Coverage Report for Build 15238566419

Details

  • 39 of 39 (100.0%) changed or added relevant lines in 2 files are covered.
  • No unchanged relevant lines lost coverage.
  • Overall coverage increased (+0.06%) to 85.405%

Totals Coverage Status
Change from base Build 15166368710: 0.06%
Covered Lines: 7309
Relevant Lines: 8558

💛 - Coveralls

Copy link
Member

@notmandatory notmandatory left a comment

Choose a reason for hiding this comment

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

ACK 469cfd0

Copy link
Contributor

@oleonardolima oleonardolima left a comment

Choose a reason for hiding this comment

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

ACK 469cfd0

I'd just make sure to word that this fix only parsing in the release notes, in order to not mislead users into thinking that bdk_wallet works with multipath descriptors.

@ValuedMammal ValuedMammal merged commit 29a7374 into bitcoindevkit:master May 28, 2025
20 checks passed
@github-project-automation github-project-automation bot moved this from Needs Review to Done in BDK Wallet May 28, 2025
@ValuedMammal ValuedMammal deleted the fix/into-descriptor-key branch May 28, 2025 15:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
Status: Done
Development

Successfully merging this pull request may close these issues.

Multipath descriptor network association wrong
4 participants