mirror of
https://github.com/bitcoin/bitcoin.git
synced 2026-09-12 13:42:10 +02:00
a39cc16b43doc: Release note for addhdkey (Ava Chow)89b9a01b4ewallet, rpc: Disallow importing unused() to wallets without privkeys (Ava Chow)35bbee6374wallet, rpc: Disallow import of unused() if key already exists (Ava Chow)f3f8bcbd1dwallet: Add addhdkey RPC (Ava Chow)82bc280de4test: Simple test for importing unused(KEY) (Ava Chow)80c29bc6f1descriptor: Add unused(KEY) descriptor (Ava Chow) Pull request description: It is sometimes useful for the wallet to have keys that it can sign with but are not (initially) involved in any scripts, e.g. for setting up a multisig. Ryanofsky [suggested](https://github.com/bitcoin/bitcoin/pull/26728#issuecomment-1867721948) A `unused(KEY)` descriptor which allows for a key to be specified, but produces no scripts. These can be imported into the wallet, and subsequently retrieved with `gethdkeys`. Additionally, `listdescriptors` will output these descriptors so that they can be easily backed up. In order to make it easier for people to add HD keys to their wallet, and to generate a new one if they want to rotate their descriptors, an `addhdkey` RPC is also added. Without arguments, it will generate a new HD key and add it to the wallet via a `unused(KEY)` descriptor. If provided a private key, it will construct the descriptor and add it to the wallet. See also: https://github.com/bitcoin/bitcoin/pull/26728#issuecomment-1866961865 Based on #29130 as `gethdkeys` is useful for testing this. ACKs for top commit: Sjors: utACKa39cc16rkrux: lgtm ACKa39cc16b43Tree-SHA512: c1288c792ab01ca2eaddd24b0e7d11c259cd59e79042465d0d1eb656fd559c1200dc19750b4d84acc762b5b599935a06df214c18226e662087842ea91ec3011b