wallet: reconstruct or natively support multipath descriptors #36075

issue Sjors opened this issue on August 25, 2026
  1. Sjors commented at 9:55 AM on August 25, 2026: member

    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 https://github.com/bitcoin-core/HWI/pull/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 https://github.com/Sjors/bitcoin/pull/123
    4. Make multipath descriptors a first class wallet citizen, see prototype in https://github.com/Sjors/bitcoin/pull/124
    5. (new) add a wallet record to track multipath parts, see prototype in (https://github.com/Sjors/bitcoin/pull/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.

  2. achow101 commented at 5:15 PM on August 25, 2026: 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.

  3. Sjors commented at 5:24 PM on August 25, 2026: member

    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 https://github.com/Sjors/bitcoin/pull/125.

  4. Sjors commented at 6:12 PM on August 31, 2026: member

    Implemented approach (5) in #36133.

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


github-metadata-mirror

This is a metadata mirror of the GitHub repository bitcoin/bitcoin. This site is not affiliated with GitHub. Content is generated from a GitHub metadata backup.
generated: 2026-09-04 08:51 UTC

This site is hosted by @0xB10C
More mirrored repositories can be found on mirror.b10c.me