Please describe the feature you’d like to see added.
Descriptor wallets currently do not support the “legacy” import commands importprivkey
, importpubkey
, importaddress
, addmultisigaddress
, importmulti
, and importwallet
. This was done because the semantics of these RPC cannot be replicated in descriptor wallets, as they just fundamentally work differently (being explicit about what to watch rather than “whatever matches the bag of keys and scripts we have”).
I want to suggest the possibility to reconsider that. The exact semantics cannot be replicated, but ignoring that, for many of these RPCs, the almost certain intent of the RPCs can be replicated:
importprivkey
andimportpubkey
can be mapped to acombo()
descriptorimportaddress
can be mapped to anaddr()
descriptoraddmultisigaddress
can be mapped to amulti()
descriptor, wrapped insh()
,sh(wsh())
, orwsh()
depending on the address type (already returned as thedescriptor
field in the RPC output).importmulti
andimportwallet
are more involved, but do contain enough information for mapping to descriptors.
For the simpler ones out of these, it makes sense too. importprivkey
is simpler to use than learning the descriptor syntax, and no less safe. A reason not to do this is if a user would reasonably expect different semantics, or if there are guides out there that use certain RPCs in a way that relies on the “bag of keys and scripts” behavior, but I doubt it. Another reason not to do this is lack of taproot support in these RPCs, though that could be addressed with warnings, or in some cases, extensions (e.g. nothing prevents us from adding a taproot variant to addmultisigaddress
).
Is your feature related to a problem, if so please describe it.
I’ve seen several complaints about how hard importdescriptors
is in use for importing a private key, or creating a multisig address.
Describe the solution you’d like
No response
Describe any alternatives you’ve considered
No response
Please leave any additional context
No response