Closed chappjc closed 2 years ago
Spent a couple hours on this and I seem to have it worked out.
listdescriptors private=true
is giving the wallet's actual master key (not just an account/branch extended key) followed by the path to the point where a range of addresses get derived (indicated by a *
). e.g. tprv8Zg.../84'/1'/0'/0/*
getaddressinfo
gives the full path to the address, where the master key from listdescriptors
is represented by its fingerprint (first 4 bytes of hash160 of the public key). e.g. [b940190e/84'/1'/0'/0/0]
Everything agrees and I can both identify the master key from listdescriptors
based on the finger print in getaddressinfo
, and derive the address from the master key and path.
Assigning myself to make this happen for descriptor wallets in place of dumpprivkey
.
Bitcoin Core v23 was tagged a few days ago, and it includes the ability to get private keys with descriptor wallets. However, this is not done with
dumpprivkey
, but vialistdescriptors
with theprivate
option: https://github.com/decred/dcrdex/pull/1367Of importance is that v23 also makes descriptor wallets by default: https://github.com/bitcoin/bitcoin/issues/20160 / https://github.com/bitcoin/bitcoin/pull/23002. As such, we should really support descriptor wallets.
I suspect it's more than just
dumpprivkey
that was the problem and there may be other RPCs that we'll have to deal with, butdumpprivkey
was the showstopper at the last release.Specification of "output script descriptors": https://github.com/bitcoin/bips/blob/master/bip-0380.mediawiki#key-expressions Unfortunately
getaddressinfo
does not similarly have a private option, or contain the key afaict.