bitcoin core – How can a personal key be imported to a descriptor pockets?

0
48


To provide a bit extra context to Andrew Chow’s reply: the rationale why this is not any simpler is that the idea of “importing a personal key” is an inadequate technique for describing what a pockets ought to do, and the fallacious method to consider wallets within the first place. Whereas it’s attainable to transform wallets with keys imported to them to roughly equal descriptor wallets, this doesn’t imply that it is the easiest way when importing issues. Descriptors and descriptor wallets permit you to be exact about what you need to import, and the importdescriptors RPC permits you to do this.

In additional element, that is roughly the philosophy behind the 2 varieties of wallets supported by Bitcoin Core:

  • legacy wallets A legacy pockets is a set of personal keys, and loosely structured extra data akin to scripts and addresses. Any output which might be spent or noticed with these keys/scripts/addresses is taken into account to “belong” to the pockets. If you happen to import a brand new key to a pockets, this instantly leads to treating funds to the P2PK, P2PKH, P2WPKH, P2SH-P2WPKH, and probably extra, addresses derived from that key to be watched. That is inefficient, arduous to explain and motive about, and simply does not scale properly with new pockets constructions being added (e.g. P2TR), and even tougher to take care of when multisig throughout deviced or individuals is added.
  • Descriptor wallets In a descriptor pockets, the outputs thought-about a part of the pockets might be described precisely utilizing a easy “language” which comprises all metadata about how the keys are used. If you’d like simply P2PKH addresses derived from a key, you may say that. If you’d like P2SH-wrapped P2WSH multisig throughout a number of units you may say that too, and it’ll work precisely the identical.

In brief: the outdated mannequin of how we considered wallets wasn’t manageable anymore, and “importing a key” solely made sense in that form of pondering. Within the new mannequin, you do not import keys, you import an outline of precisely what you need the pockets to do.

LEAVE A REPLY

Please enter your comment!
Please enter your name here