Manages the minimum data needed to load and migrate a legacy wallet.
Synopsis
Declared in <wallet/scriptpubkeyman.h>
class LegacyDataSPKM
: public ScriptPubKeyMan
, public FillableSigningProvider
Base Classes
Name |
Description |
A class implementing ScriptPubKeyMan manages some (or all) scriptPubKeys used in a wallet. It contains the scripts and keys related to the scriptPubKeys it manages. A ScriptPubKeyMan will be able to give out scriptPubKeys to be used, as well as marking when a scriptPubKey has been used. It also handles when and how to store a scriptPubKey and its related scripts and keys, including encryption. |
|
Fillable signing provider that keeps keys in an address‐>secret map |
Member Functions
Name |
Description |
|
Add a redeem or witness script. |
Stores an inactive HD chain, keyed by its seed id. |
|
|
Add a private key, deriving its public key. |
|
Add a private key together with its public key. |
|
Returns true if the wallet can give out new addresses. This means it has keys in the keypool or can generate new keys |
|
Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data. |
|
Checks whether the given master key decrypts all keys handled by this spkm. |
|
Delete the state stored for a MuSig2 signing session. |
Delete the legacy wallet records from disk. |
|
|
Encrypts this ScriptPubKeyMan's keys with the given master key, writing changes to the batch. |
|
Adds script and derivation path information to a PSBT, and optionally signs it. |
|
Return all known MuSig2 aggregate pubkeys and their participants. |
Look up a script by its script id. |
|
|
Return the ids of all known scripts. |
Returns the active HD chain model. |
|
|
Returns the fixed identifier for the legacy spkm. |
|
|
Look up a private key by any key id derived from an x‐only pubkey. |
|
|
Retrieves the key origin (derivation path and fingerprint) for the given key id. |
Look up key origin info by any key id derived from an x‐only pubkey. |
|
|
Returns the number of keys currently available in the keypool. |
|
Return the ids of all known private keys. |
|
Returns the key metadata for the given destination, or nullptr if none is known. |
|
Return the MuSig2 participant pubkeys for an aggregate pubkey. |
|
Retrieve the MuSig2 secret nonce for a signing session. |
|
Returns a new destination of the given output type, or an error if unsupported. |
Retrieves scripts that were imported by bugs into the legacy spkm and are simply invalid, such as a sh(sh(pkh())) script, or not watched. |
|
|
|
Look up a public key by any key id derived from an x‐only pubkey. |
|
|
Reserves a destination from the keypool and returns it, keeping the reservation index. |
|
Returns the set of scriptPubKeys watched by this spkm. |
|
Returns a SigningProvider able to solve the given script. |
|
Look up the Taproot builder for an output key. |
|
Look up the Taproot spend data for an output key. |
|
Returns the creation time of the earliest key, used as the wallet's birth time. |
Fetches a pubkey from mapWatchKeys if it exists there |
|
Report whether a script with the given id is known. |
|
|
Returns whether this ScriptPubKeyMan holds any encrypted private keys. |
|
Returns whether the private key for the given address is held. |
|
Returns whether this ScriptPubKeyMan holds any unencrypted private keys. |
Returns whether the watch‐only script is in the wallet |
|
|
Returns true if HD is enabled |
|
Returns whether the given script is owned by this ScriptPubKeyMan. |
|
Marks a previously reserved destination as used so it is not handed out again. |
Adds a CScript to the store |
|
Adds an encrypted key to the store, without saving it to disk (used by LoadWallet) |
|
Load a HD chain model (used by LoadWallet) |
|
Adds a key to the store, without saving it to disk (used by LoadWallet) |
|
|
Load metadata (used by LoadWallet) |
|
Loads metadata for a watch‐only script (used by LoadWallet). |
Adds a watch‐only address to the store, without saving it to disk (used by LoadWallet) |
|
|
Mark unused addresses as being used Affects all keys up to and including the one determined by provided script. |
Get the DescriptorScriptPubKeyMans (with private keys) that have the same scriptPubKeys as this LegacyDataSPKM. Does not modify this LegacyDataSPKM. |
|
|
Returns a previously reserved destination to the keypool for reuse. |
|
Store a MuSig2 secret nonce for a signing session. |
|
Sign a message with the given script |
|
Creates new signatures and adds them to the transaction. Returns whether all inputs were signed |
|
Fills internal address pool. Use within ScriptPubKeyMan implementations should be used sparingly and only when something from the address pool is removed, excluding GetNewDestination and GetReservedDestination. External wallet code is primarily responsible for topping up prior to fetching new addresses |
Prepends the wallet name in logging output to ease debugging in multi‐wallet use cases |
Data Members
Name |
Description |
Keypool has new keys |
|
Birth time changed |
|
Mutex guarding the key and script maps. |
|
Map from Script ID to key metadata (for watch‐only keys). |
|
Map from Key ID to key metadata. |
Using Declarations
Name |
Description |
Inherit the ScriptPubKeyMan constructors. |
Protected Type Aliases
Protected Member Functions
Name |
Description |
Record the scripts implied by a public key without persisting them. |
Protected Data Members
Name |
Description |
The wallet storage this ScriptPubKeyMan uses to persist and query wallet‐wide state. |
|
Map of key id to unencrypted private keys known by the signing provider. Map may be empty if the provider has another source of keys, like an encrypted store. |
|
Map of script id to scripts known by the signing provider. |
Non-Member Functions
Name |
Description |
Return the CKeyID of the key involved in a script (if there is a unique one). |
|
Check whether a scriptPubKey is known to be segwit. |
|
Produce a script signature using a generic signature creator. |
|
Signs a PSBTInput, verifying that all provided data matches what is being signed. |
|
Updates a PSBTOutput with information from provider. |
Created with MrDocs