forked from ElementsProject/elements
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge #16528: Native Descriptor Wallets using DescriptorScriptPubKeyMan
223588b Add a --descriptors option to various tests (Andrew Chow) 869f7ab tests: Add RPCOverloadWrapper which overloads some disabled RPCs (Andrew Chow) cf06062 Correctly check for default wallet (Andrew Chow) 886e0d7 Implement CWallet::IsSpentKey for non-LegacySPKMans (Andrew Chow) 3c19fdd Return error when no ScriptPubKeyMan is available for specified type (Andrew Chow) 388ba94 Change wallet_encryption.py to use signmessage instead of dumpprivkey (Andrew Chow) 1346e14 Functional tests for descriptor wallets (Andrew Chow) f193ea8 add importdescriptors RPC and tests for native descriptor wallets (Hugo Nguyen) ce24a94 Add IsLegacy to CWallet so that the GUI knows whether to show watchonly (Andrew Chow) 1cb42b2 Generate new descriptors when encrypting (Andrew Chow) 82ae02b Be able to create new wallets with DescriptorScriptPubKeyMans as backing (Andrew Chow) b713baa Implement GetMetadata in DescriptorScriptPubKeyMan (Andrew Chow) 8b9603b Change GetMetadata to use unique_ptr<CKeyMetadata> (Andrew Chow) 72a9540 Implement FillPSBT in DescriptorScriptPubKeyMan (Andrew Chow) 84b4978 Implement SignMessage for descriptor wallets (Andrew Chow) bde7c9f Implement SignTransaction in DescriptorScriptPubKeyMan (Andrew Chow) d50c8dd Implement GetSolvingProvider for DescriptorScriptPubKeyMan (Andrew Chow) f1ca5fe Implement GetKeypoolOldestTime and only display it if greater than 0 (Andrew Chow) 586b57a Implement ReturnDestination in DescriptorScriptPubKeyMan (Andrew Chow) f866957 Implement GetReservedDestination in DescriptorScriptPubKeyMan (Andrew Chow) a775f7c Implement Unlock and Encrypt in DescriptorScriptPubKeyMan (Andrew Chow) bfdd073 Implement GetNewDestination for DescriptorScriptPubKeyMan (Andrew Chow) 58c7651 Implement TopUp in DescriptorScriptPubKeyMan (Andrew Chow) e014886 Implement SetupGeneration for DescriptorScriptPubKeyMan (Andrew Chow) 46dfb99 Implement writing descriptorkeys, descriptorckeys, and descriptors to wallet file (Andrew Chow) 4cb9b69 Implement several simple functions in DescriptorScriptPubKeyMan (Andrew Chow) d1ec3e4 Add IsSingleType to Descriptors (Andrew Chow) 953feb3 Implement loading of keys for DescriptorScriptPubKeyMan (Andrew Chow) 2363e9f Load the descriptor cache from the wallet file (Andrew Chow) 46c46ae Implement GetID for DescriptorScriptPubKeyMan (Andrew Chow) ec2f9e1 Implement IsHDEnabled in DescriptorScriptPubKeyMan (Andrew Chow) 741122d Implement MarkUnusedAddresses in DescriptorScriptPubKeyMan (Andrew Chow) 2db7ca7 Implement IsMine for DescriptorScriptPubKeyMan (Andrew Chow) db7177a Add LoadDescriptorScriptPubKeyMan and SetActiveScriptPubKeyMan to CWallet (Andrew Chow) 78f8a92 Implement SetType in DescriptorScriptPubKeyMan (Andrew Chow) 834de03 Store WalletDescriptor in DescriptorScriptPubKeyMan (Andrew Chow) d813266 Add a lock cs_desc_man for DescriptorScriptPubKeyMan (Andrew Chow) 3194a7f Introduce WalletDescriptor class (Andrew Chow) 6b13cd3 Create LegacyScriptPubKeyMan when not a descriptor wallet (Andrew Chow) aeac157 Return nullptr from GetLegacyScriptPubKeyMan if descriptor wallet (Andrew Chow) 96accc7 Add WALLET_FLAG_DESCRIPTORS (Andrew Chow) 6b8119a Introduce DescriptorScriptPubKeyMan as a dummy class (Andrew Chow) 0662030 Introduce SetType function to tell ScriptPubKeyMans the type and internal-ness of it (Andrew Chow) Pull request description: Introducing the wallet of the glorious future (again): native descriptor wallets. With native descriptor wallets, addresses are generated from descriptors. Instead of generating keys and deriving addresses from keys, addresses come from the scriptPubKeys produced by a descriptor. Native descriptor wallets will be optional for now and can only be created by using `createwallet`. Descriptor wallets will store descriptors, master keys from the descriptor, and descriptor cache entries. Keys are derived from descriptors on the fly. In order to allow choosing different address types, 6 descriptors are needed for normal use. There is a pair of primary and change descriptors for each of the 3 address types. With the default keypool size of 1000, each descriptor has 1000 scriptPubKeys and descriptor cache entries pregenerated. This has a side effect of making wallets large since 6000 pubkeys are written to the wallet by default, instead of the current 2000. scriptPubKeys are kept only in memory and are generated every time a descriptor is loaded. By default, we use the standard BIP 44, 49, 84 derivation paths with an external and internal derivation chain for each. Descriptors can also be imported with a new `importdescriptors` RPC. Native descriptor wallets use the `ScriptPubKeyMan` interface introduced in #16341 to add a `DescriptorScriptPubKeyMan`. This defines a different IsMine which uses the simpler model of "does this scriptPubKey exist in this wallet". Furthermore, `DescriptorScriptPubKeyMan` does not have watchonly, so with native descriptor wallets, it is not possible to have a wallet with both watchonly and non-watchonly things. Rather a wallet with `disable_private_keys` needs to be used for watchonly things. A `--descriptor` option was added to some tests (`wallet_basic.py`, `wallet_encryption.py`, `wallet_keypool.py`, `wallet_keypool_topup.py`, and `wallet_labels.py`) to allow for these tests to use descriptor wallets. Additionally, several RPCs are disabled for descriptor wallets (`importprivkey`, `importpubkey`, `importaddress`, `importmulti`, `addmultisigaddress`, `dumpprivkey`, `dumpwallet`, `importwallet`, and `sethdseed`). ACKs for top commit: Sjors: utACK 223588b (rebased, nits addressed) jonatack: Code review re-ACK 223588b. fjahr: re-ACK 223588b instagibbs: light re-ACK 223588b meshcollider: Code review ACK 223588b Tree-SHA512: 59bc52aeddbb769ed5f420d5d240d8137847ac821b588eb616b34461253510c1717d6a70bab8765631738747336ae06f45ba39603ccd17f483843e5ed9a90986
- Loading branch information
Showing
40 changed files
with
2,802 additions
and
335 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.