Adds parent_desc
field to the getaddressinfo
RPC to export a public descriptor. Using the given address, getaddressinfo
will look up which DescriptorScriptPubKeyMan
can be used to produce that address. It will then return the descriptor for that DescriptorScriptPubKeyMan
in the parent_desc
field. The descriptor will be in a normalized form where the xpub at the last hardened step is derived so that the descriptor can be imported to other wallets. Tests are added to check that the correct descriptor is being returned for the wallet’s addresses and that these descriptors can be imported and used in other wallets.
As part of this PR, a ToNormalizedString
function is added to the descriptor classes. This really only has an effect on BIP32PubkeyProvider
s that have hardened derivation steps. Tests are added to check that normalized descriptors are returned.