Skip to content

feat: Add Multipath descriptor support - #238

Closed
tvpeter wants to merge 3 commits into
bitcoindevkit:masterfrom
tvpeter:feat/multipath-desc-support
Closed

tvpeter wants to merge 3 commits into
bitcoindevkit:masterfrom
tvpeter:feat/multipath-desc-support

Conversation

@tvpeter

@tvpeter tvpeter commented Feb 7, 2026 •

Copy link
Copy Markdown
Collaborator

Description

This PR enables support for BIP389 multipath descriptors. It uses the existing external descriptor and verifies whether the provided descriptor is a multipath descriptor. If it is, a wallet will be created using the Wallet::create_from_two_path_descriptor() method. If not, the standard wallet creation logic will be applied.

Fixes #195

Changelog notice

  • Add support for BIP389 multipath descriptors

Checklists

All Submissions:

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

New Features:

  • I've added tests for the new feature
  • I've updated CHANGELOG.md

@tvpeter
tvpeter force-pushed the feat/multipath-desc-support branch from 9d2027d to c63d511 Compare February 7, 2026 22:09
@coveralls

coveralls commented Feb 7, 2026 •

Copy link
Copy Markdown

Pull Request Test Coverage Report for Build 21787788027

Details

  • 89 of 108 (82.41%) changed or added relevant lines in 2 files are covered.
  • 1 unchanged line in 1 file lost coverage.
  • Overall coverage increased (+4.0%) to 14.733%

Changes Missing Coverage Covered Lines Changed/Added Lines %
src/utils.rs 89 92 96.74%
src/handlers.rs 0 16 0.0%
Files with Coverage Reduction New Missed Lines %
src/handlers.rs 1 12.92%
Totals Coverage Status
Change from base Build 21153868360: 4.0%
Covered Lines: 381
Relevant Lines: 2586

💛 - Coveralls

@tvpeter
tvpeter force-pushed the feat/multipath-desc-support branch from c63d511 to 1433513 Compare February 7, 2026 22:16
@tvpeter
tvpeter requested a review from notmandatory February 7, 2026 22:59

@AmosOO7 AmosOO7 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.

tACK 1433513

@tvpeter tvpeter moved this to Ready to Review in BDK-CLI Feb 23, 2026
@tvpeter tvpeter added this to the CLI 3.0.0 milestone Feb 26, 2026
tvpeter added 2 commits March 12, 2026 12:02
- Update wallet initialization/creation to check
if external descriptor is multipath for both
persisted and non persisted wallets
- add error variant for when both multipath and
internal descriptors are provided
@tvpeter tvpeter removed this from the CLI 3.0.0 milestone Mar 12, 2026
@tvpeter
tvpeter force-pushed the feat/multipath-desc-support branch from 1433513 to b03ebc7 Compare March 13, 2026 09:32
@codecov

codecov Bot commented Mar 13, 2026 •

Copy link
Copy Markdown

Codecov Report

❌ Patch coverage is 82.72727% with 19 lines in your changes missing coverage. Please review.
✅ Project coverage is 15.00%. Comparing base (a675935) to head (b03ebc7).
⚠️ Report is 27 commits behind head on master.

Files with missing lines Patch % Lines
src/handlers.rs 0.00% 16 Missing ⚠️
src/utils.rs 96.80% 3 Missing ⚠️
Additional details and impacted files
@@            Coverage Diff             @@
##           master     #238      +/-   ##
==========================================
+ Coverage   10.86%   15.00%   +4.13%     
==========================================
  Files           8        8              
  Lines        2466     2553      +87     
==========================================
+ Hits          268      383     +115     
+ Misses       2198     2170      -28     
Flag Coverage Δ
rust 15.00% <82.72%> (+4.13%) ⬆️

Flags with carried forward coverage won't be shown. Click here to find out more.

☔ View full report in Codecov by Sentry.
📢 Have feedback on the report? Share it here.

🚀 New features to boost your workflow:
  • ❄️ Test Analytics: Detect flaky tests, report on failures, and find test suite problems.

@Musab1258

Musab1258 commented Apr 21, 2026 •

Copy link
Copy Markdown
Contributor

Concept ACK.
But I noticed the if/else block determining the Wallet builder is repeated in both new_persisted_wallet (lines 293-299) and new_wallet (lines 321-327) functions in src/utils.rs . To keep things DRY, would it make sense to extract that logic into an helper function like build_wallet_creator?

Something like:

fn build_wallet_creator(
     ext_descriptor: String,
     int_descriptor: Option<String>,
 ) -> CreateParams {
     if let Some(int_descriptor) = int_descriptor {
         Wallet::create(ext_descriptor, int_descriptor)
     } else if is_multipath_desc(&ext_descriptor) {
         Wallet::create_from_two_path_descriptor(ext_descriptor)
     } else {
         Wallet::create_single(ext_descriptor)
     }
 }

@tvpeter tvpeter moved this from Ready to Review to In Progress in BDK-CLI May 6, 2026
@tvpeter tvpeter added this to the CLI 4.1.0 milestone Jun 30, 2026
@tvpeter tvpeter self-assigned this Jun 30, 2026
@tvpeter

tvpeter commented Jul 29, 2026

Copy link
Copy Markdown
Collaborator Author

Closing this PR in favour of #309

@tvpeter tvpeter closed this Jul 29, 2026
@github-project-automation github-project-automation Bot moved this from In Progress to Done in BDK-CLI Jul 29, 2026
tvpeter added a commit that referenced this pull request Sep 11, 2026
5afbc8a feat(multipath): Add checks for desc pair (Vihiga Tyonum)
48b3314 feat(multipath): Add tests for multipath desc (Vihiga Tyonum)
697fe0b feat(multipath): limit multipath desc to two paths (Vihiga Tyonum)
5316134 feat(multipath): add multipath desc support (Vihiga Tyonum)

Pull request description:

  <!-- You can erase any parts of this template not applicable to your Pull Request. -->

  ### Description

  This PR enables support for BIP389 multipath descriptors. It uses the existing `external descriptor` and verifies whether the provided descriptor is a multipath descriptor. If it is, a wallet will be created using the `Wallet::create_from_two_path_descriptor()` method. If not, the standard wallet creation logic will be applied.

  Fixes #195

  Replaces #238

  ### Notes to the reviewers

  -  `is_multipath_descriptor` helper parses the descriptor and accepts only  **two-path** multipath descriptors (external/internal).

  <!-- In this section you can include notes directed to the reviewers, like explaining why some parts
  of the PR were done in a specific way -->

  ## Changelog notice

  - Add support for BIP389 multipath descriptors

  ### Checklists

  #### All Submissions:

  * [x] I've signed all my commits
  * [x] I followed the [contribution guidelines](https://github.com/bitcoindevkit/bdk-cli/blob/master/CONTRIBUTING.md)
  * [x] I ran `cargo fmt` and `cargo clippy` before committing

  #### New Features:

  * [x] I've added tests for the new feature
  * [ ] I've added docs for the new feature
  * [x] I've updated `CHANGELOG.md`

ACKs for top commit:
  vadim-anfv:
    tACK 5afbc8a

Tree-SHA512: f5892d86a4965a18518c09f2e86ea9882f78fac04ee7b492e1ccea27216a590d2135b4d0c5f3bb2e6ef4f332e9f6bff48dee7ce539080ba801c3693c22a45b3e
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

Status: Done

Development

Successfully merging this pull request may close these issues.

Add support for BIP389 Multipath descriptors

4 participants