Sunday, December 22, 2024

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

To present a bit extra context to Ava Chow’s reply: the explanation why this is not any simpler is that the idea of “importing a personal key” is an inadequate methodology for describing what a pockets ought to do, and the unsuitable manner 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 one of the simplest ways when importing issues. Descriptors and descriptor wallets mean you can be exact about what you need to import, and the importdescriptors RPC permits you to try this.

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

  • Legacy wallets: A legacy pockets is a group of personal keys, and loosely structured extra info comparable to scripts and addresses. Any output which could be spent or noticed with these keys/scripts/addresses is taken into account to “belong” to the pockets. In the event you import a brand new key to a pockets, this instantly ends in treating funds to the P2PK, P2PKH, P2WPKH, P2SH-P2WPKH, and probably extra, addresses derived from that key to be watched. That is inefficient, exhausting to explain and purpose about, and simply does not scale nicely with new pockets constructions being added (e.g. P2TR), and even tougher to cope with when multisig throughout units or contributors is added.
  • Descriptor wallets. In a descriptor pockets, the outputs thought of a part of the pockets could be described precisely utilizing a easy “language” which accommodates all metadata about how the keys are used. If you would like simply P2PKH addresses derived from a key, you’ll be able to say that. If you would like P2SH-wrapped P2WSH multisig throughout a number of units you’ll be able to say that too, and it’ll work precisely the identical.

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

Related Articles

LEAVE A REPLY

Please enter your comment!
Please enter your name here

Latest Articles