Repository navigation
Conversation
This was referenced Aug 25, 2026
Closed
Sjors
force-pushed
the
2026/08/multipath-tag
branch
5 times, most recently
from
August 27, 2026 18:47
bd291e0 to
d4db937
Compare
Owner
Author
|
Still need to study and polish this more before upstreaming, in particular:
|
Sjors
force-pushed
the
2026/08/multipath-tag
branch
4 times, most recently
from
August 31, 2026 16:52
50faa46 to
b53ebd3
Compare
This lets the next commit record key positions in the descriptor string while its miniscript expression is parsed in place.
Use it to check whether parsing expands a descriptor into multiple descriptor.
Use util::Expected for ParsePubkeyInner, ParsePubkey, and ParseScript, so errors are returned directly instead of passed through an output argument. The only behavior change is that a preexisting error string is cleared when nested descriptor parsing fails without producing an error message. Previously, the stale error was left intact.
Group the key expression index and signing provider shared by ParsePubkeyInner, ParsePubkey, and ParseScript in ParseState. A later commit extends this state with key replacement collection.
Add an optional Parse() output for the unexpanded multipath descriptor. This is always a public descriptor, so ParseState optionally collects KeyReplacement entries tracking key locations in the input for private-to-public conversion. The replacement sink is null unless the caller requests this output.
Split finding the last hardened derivation step out of BIP32PubkeyProvider::ToNormalizedString. No behavior change. A later commit reuses it when normalizing the keys of a multipath descriptor string.
Split formatting the normalized public form of a derived key, i.e. its origin followed by the extended public key at the last hardened step, out of BIP32PubkeyProvider::ToNormalizedString. No behavior change. A later commit reuses it when normalizing the keys of a multipath descriptor string.
Split merging an outer key origin into an already normalized key expression out of OriginPubkeyProvider::ToNormalizedString. No behavior change. A later commit reuses it when normalizing the keys of a multipath descriptor string.
Private extended keys followed by a fixed hardened prefix are now replaced by their key origin and the extended public key at the last hardened step, merging any explicit origin. This matches Descriptor::ToNormalizedString and produces BIP 388 wallet policy key expressions suitable for registering the multipath descriptor on a signing device. A hardened multipath element or wildcard cannot be represented by a single publicly derivable multipath descriptor. Leave the Parse multipath output unset in those cases. ParsePubkeyInner now returns an optional replacement alongside parsed providers so ParsePubkey can merge explicit key origin information before collecting it.
When importdescriptors expands a BIP 389 multipath descriptor into separate receive and change descriptors, additionally store a record containing the multipath descriptor string, as reported by the parser in public form, along with the IDs of the wallet descriptors it expanded to. Older wallet software ignores the new record.
Add an optional multipath field to getaddressinfo, containing the multipath descriptor that this address' parent descriptor was expanded from, in public form.
Add an optional multipath field to each listdescriptors entry that was expanded from a multipath descriptor, containing the stored multipath descriptor record. Every descriptor from the same multipath descriptor returns the same value, always in public form.
The descriptor IDs in the record are translated to those of the watchonly wallet.
Add SetupDescriptorScriptPubKeyManPair, used by default wallet creation and createwalletdescriptor, which derives the receive and change descriptors of an output type from a single multipath descriptor string, built by a new GenerateMultipathDescriptorString. This commit does not change behavior.
When SetupDescriptorScriptPubKeyManPair creates a descriptor pair, store a record with the normalized multipath descriptor they derive from. When createwalletdescriptor is used with the internal option, the record is stored by whichever call completes the pair.
Sjors
force-pushed
the
2026/08/multipath-tag
branch
from
August 31, 2026 17:33
b53ebd3 to
0948b92
Compare
Owner
Author
|
Upstreamed as bitcoin#36133. |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Implements approach 5 from bitcoin#36075