achow101
commented at 10:25 PM on October 5, 2026:
member
The wallet does not store any information about multipath descriptors. When a multipath descriptor is imported, it is first expanded, then the expansion descriptors are imported into the wallet.
This PR adds a field to WalletDescriptor which stores the IDs of the ScriptPubKeyMans of the descriptors that are part of the expansion, in the order that they are expanded. This allows us to use ReconstructMultipath to produce the multipath descriptor when necessary.
This is useful for working with hardware wallets that require policy registration, particularly those that require resending the descriptor that was registered.
listdescriptors is updated to include a multipath_descriptor field which contains the multipath descriptor for each individual descriptor if it originally came from a multipath descriptor.
Lastly, the automatically generated descriptors are now produced and stored as multipath descriptors, so listdescriptors will provide a multipath_descriptor for everything that the wallet automatically generates.
Note that the IDs stored in the wallet are ScriptPubKeyMan IDs, which we cannot compute from a descriptor as we assume to be opaque blobs since #35445.
If your review is incorrectly listed, please copy-paste <code><!--meta-tag:bot-skip--></code> into the comment that the bot should ignore.
<!--174a7506f384e20aa4161008e828411d-->
Conflicts
Reviewers, this pull request conflicts with the following ones:
#36897 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36897.svg"></sub> (wallet, migration: Contain all legacy wallet and migration related things in its own subdirectory, namespace, and classes by achow101)
#36885 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36885.svg"></sub> (wallet, rpc: Add analyzedescriptor for multisig setups by pablomartin4btc)
#36820 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36820.svg"></sub> (refactor: remove more dead code by fanquake)
#36808 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36808.svg"></sub> (iwyu: Fix warnings in src/test/fuzz and treat them as errors by hebasto)
#36648 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36648.svg"></sub> (descriptor, rpc, wallet: do not echo key material in error messages by fametrano)
#36402 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36402.svg"></sub> (refactor: wallet_importdescriptors to separate run_test() contents into specific functions by nebula-21)
#36122 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36122.svg"></sub> (BIP460: CISA for Taproot key path spends by fjahr)
#36070 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36070.svg"></sub> (wallet: Add deriveHDKey interface by PraneethGunas)
#36005 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/36005.svg"></sub> (rpc, descriptor: warn when multipath expansion clones single-path key expressions by pythcoiner)
#35918 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35918.svg"></sub> (descriptor: Expose key expression parsing by pseudoramdom)
#35444 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35444.svg"></sub> (wallet: make descriptor SPKM mutex non-recursive by w0xlt)
#35377 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/35377.svg"></sub> (wallet: Allow importing of descriptors without private keys when the wallet has the private keys by achow101)
#34909 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/34909.svg"></sub> (wallet, refactor: modularise wallet by extracting out legacy wallet migration by rkrux)
#34193 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/34193.svg"></sub> (wallet: make migration more robust against failures by furszy)
#31668 <sub><img src="https://drahtbot.space/ack_count/bitcoin/bitcoin/31668.svg"></sub> (Added rescan option for import descriptors by saikiran57)
If you consider this pull request important, please also help to review the conflicting pull requests. Ideally, start with the one that should be merged first.
<!--5faf32d7da4f0f540f40219e4f7537a3-->
LLM Linter (✨ experimental)
Possible typos and grammar issues:
src/util/bip32.h: give → given [word-form typo in “for a give multipath position”]
Possible places where named args for integral literals may be used (e.g. func(x, /*named_arg=*/0) in C++, and func(x, named_arg=0) in Python):
DrahtBot
commented at 10:36 PM on October 5, 2026:
contributor
<!--85328a0da195eb286784d51f73fa0af9-->
🚧 At least one of the CI tasks failed.
<sub>Task lint: https://github.com/bitcoin/bitcoin/actions/runs/37382356159/job/112007221776</sub>
<sub>LLM reason (✨ experimental): CI failed the Python lint check: wallet_importdescriptors.py has undefined extended_key/xpub names, and wallet_listdescriptors.py has an unused import.</sub>
<details><summary>Hints</summary>
Try to run the tests locally, according to the documentation. However, a CI failure may still
happen due to a number of reasons, for example:
Possibly due to a silent merge conflict (the changes in this pull request being
incompatible with the current code in the target branch). If so, make sure to rebase on the latest
commit of the target branch.
A sanitizer issue, which can only be found by compiling with the sanitizer and running the
affected test.
An intermittent issue.
Leave a comment here, if you need help tracking down a confusing failure.
</details>
DrahtBot added the label Needs rebase on Oct 7, 2026
w0xlt
commented at 6:06 PM on October 8, 2026:
contributor
Concept ACK
Sjors referenced this in commit de8d85c4c6 on Oct 20, 2026
Sjors referenced this in commit 59eb880b15 on Oct 20, 2026
Sjors referenced this in commit 80a95f5644 on Oct 20, 2026
Sjors referenced this in commit 4ac892de26 on Oct 21, 2026
achow101 force-pushed on Nov 5, 2026
DrahtBot removed the label Needs rebase on Nov 5, 2026
DrahtBot added the label Needs rebase on Nov 5, 2026
util: Make KeyPathElement class with private members2f727b3552
util: Change all key path operations to operate with std::vector<KeyPathElement>7fac1374f3
util: Make KeyPath a subclass of std::vector and not only a typedef
We will want to have member functions on KeyPath later, so make it a
class now.
e3a747ca94
util: Store hardened character in KeyPathElementb2205211a6
util: Make KeyPathElement handle multipaths
Moves all of the multipath parsing into ParseHDKeypath, and let
KeyPathElement be a multipath element.
13d56f38eb
descriptor: Get the multipath expansion from a multipath descriptor68fda857b8
descriptor: Produce multipath descriptor in ParseScript
Internally, descriptor parsing will produce multipath descriptor objects
rather than std::vector<DescriptorImpl>. This single multipath
descriptor becomes std::vector<Descriptor> within Parse. Future commits
will return the single multipath descriptor object for all descriptor parsing.
6c4ff42e1c
descriptor: Return multipath descriptor from Parse
Instead of a std::vector<std::unique_ptr<Descriptor>>, Parse can return
a single std::unique_ptr<Descriptor> that contains the multipath
information if the descriptor was multipath. Callers that
require the multipath expansion use GetMultipathExpansion() to get the
expanded descriptors.
wallet: Store multipath relative spkm ids in WalletDescriptorb5c4e04a74
wallet, rpc: Store multipath relative ids on import3b0b34b1ca
wallet, export: Export multipath relative ids for exportwatchonly78e46193fc
wallet, export, rpc: also list original multipath descriptorsce22333956
wallet: Store automatically created descriptors as multipath81b6a29842
test: Check for multipath descriptors in listdescriptors
Check that the correct multipath descriptor appears in listdescriptors
for a typical single key wallet. Also check that the correct
non-multipath descriptors appears, and also do for private
listdescriptors.
f57989d701
achow101 force-pushed on Nov 7, 2026
DrahtBot removed the label Needs rebase on Nov 7, 2026
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-11-20 16:51 UTC
This site is hosted by @0xB10C More mirrored repositories can be found on mirror.b10c.me