Skip to content

wallet: reconstruct or natively support multipath descriptors #36075

Open

Description

@Sjors

BIP389 multipath descriptors can be imported into the wallet, but we forget the original form. A subsequent call to listdescriptors will show a receive and change descriptor, and a call to getaddressinfo returns only the receive or change variant.

This is confusing, but more importantly it's problem with hardware wallets that need a register descriptor or BIP388 policy.

HWI recently added a registerdescriptor command in bitcoin-core/HWI#842. It handles the conversion from descriptor to BIP388 for us, but it does need a multipath descriptor.

There's are several ways we can go about this:

  1. Find matches using simple string manipulation, e.g. replace 1/* in change descriptors with 0/* and see if it matches the receive descriptor.
  2. Advanced string parsing that matches .../n/... change descriptors with .../m/... receive descriptors for any m < n.
  3. Have the Descriptor class match at a lower level, see prototype in wallet: reconstruct multipath descriptors Sjors/bitcoin#123
  4. Make multipath descriptors a first class wallet citizen, see prototype in wallet: implement multipath support Sjors/bitcoin#124
  5. (new) add a wallet record to track multipath parts, see prototype in (wallet: track multipath original  Sjors/bitcoin#125

I think (4) is the better approach, and if done correctly can be expanded to more generic multipath support. Downsides are that it's very involved and such wallets are not backward compatible.

Activity

  1. achow101 commented on Aug 25, 2026

    @achow101
    Member

    Make multipath descriptors a first class wallet citizen

    I strongly dislike this. It completely breaks the current structure we have where all of the scripts from one descriptor are either entirely for receiving addresses, or entirely for change. Combining them makes all everything else so much more complicated.

    I think we could do something where we store in a DescSPKM whether it is a multipath, and then the IDs of the other DescSPKMs that are its multipath partners. Then we can have a multipath reconstruction function on Descriptor which can traverse all of the descriptors in lockstep to figure out where the multipath is.

  2. Sjors commented on Aug 25, 2026

    @Sjors
    MemberAuthor

    I think we could do something where we store in a DescSPKM whether it is a multipath

    Maybe that's simpler yes. Added as item 5 in the issue description, prototype in Sjors#125.

  3. Sjors commented on Aug 31, 2026

    @Sjors
    MemberAuthor

    Implemented approach (5) in #36133.

    We can close this if that PR gets concept ACKs. Otherwise we'll need to consider another approach.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions