Bitcoin Core 31.99.0
P2P Digital Currency
Public Member Functions | Static Public Member Functions | Private Member Functions | List of all members
wallet::ExternalSignerScriptPubKeyMan Class Reference

#include <external_signer_scriptpubkeyman.h>

Inheritance diagram for wallet::ExternalSignerScriptPubKeyMan:
[legend]
Collaboration diagram for wallet::ExternalSignerScriptPubKeyMan:
[legend]

Public Member Functions

util::Result< void > DisplayAddress (const CTxDestination &dest, const ExternalSigner &signer) const
 Display address on the device and verify that the returned value matches. More...
 
std::optional< common::PSBTErrorFillPSBT (PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, const common::PSBTFillOptions &options, int *n_signed=nullptr) const override
 Adds script and derivation path information to a PSBT, and optionally signs it. More...
 
- Public Member Functions inherited from wallet::DescriptorScriptPubKeyMan
util::Result< CTxDestinationGetNewDestination (OutputType type) override
 
bool IsMine (const CScript &script) const override
 
bool CheckDecryptionKey (const CKeyingMaterial &master_key) override
 Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. it decrypts all of the keys handled by it. More...
 
bool Encrypt (const CKeyingMaterial &master_key, WalletBatch *batch) override
 
util::Result< CTxDestinationGetReservedDestination (OutputType type, bool internal, int64_t &index) override
 
void ReturnDestination (int64_t index, bool internal, const CTxDestination &addr) override
 
bool TopUp (unsigned int size=0) override
 Fills internal address pool. More...
 
std::vector< WalletDestinationMarkUnusedAddresses (const CScript &script) override
 Mark unused addresses as being used Affects all keys up to and including the one determined by provided script. More...
 
bool IsHDEnabled () const override
 
bool HavePrivateKeys () const override
 
bool HasPrivKey (const CKeyID &keyid) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
std::optional< CKeyGetKey (const CKeyID &keyid) const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 Retrieve the particular key if it is available. Returns nullopt if the key is not in the wallet, or if the wallet is locked. More...
 
bool HaveCryptedKeys () const override
 
unsigned int GetKeyPoolSize () const override
 
int64_t GetTimeFirstKey () const override
 
std::unique_ptr< CKeyMetadataGetMetadata (const CTxDestination &dest) const override
 
bool CanGetAddresses (bool internal=false) const override
 
std::unique_ptr< SigningProviderGetSolvingProvider (const CScript &script) const override
 
bool CanProvide (const CScript &script, SignatureData &sigdata) override
 Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data. More...
 
std::unique_ptr< FlatSigningProviderGetSigningProvider (const CPubKey &pubkey) const
 
bool SignTransaction (CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, int sighash, std::map< int, bilingual_str > &input_errors) const override
 Creates new signatures and adds them to the transaction. More...
 
SigningResult SignMessage (const std::string &message, const PKHash &pkhash, std::string &str_sig) const override
 Sign a message with the given script. More...
 
std::optional< common::PSBTErrorFillPSBT (PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, const common::PSBTFillOptions &options, int *n_signed=nullptr) const override
 Adds script and derivation path information to a PSBT, and optionally signs it. More...
 
uint256 GetID () const override
 
bool HasWalletDescriptor (const WalletDescriptor &desc) const
 
util::Result< void > UpdateWalletDescriptor (WalletDescriptor &descriptor, const FlatSigningProvider &provider)
 
bool CanUpdateToWalletDescriptor (const WalletDescriptor &descriptor, std::string &error)
 
void WriteDescriptor ()
 
WalletDescriptor GetWalletDescriptor () const EXCLUSIVE_LOCKS_REQUIRED(cs_desc_man)
 
std::unordered_set< CScript, SaltedSipHasherGetScriptPubKeys () const override
 Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches. More...
 
std::unordered_set< CScript, SaltedSipHasherGetScriptPubKeys (int32_t minimum_index) const
 
int32_t GetEndRange () const
 
bool GetDescriptorString (std::string &out, bool priv) const
 
void UpgradeDescriptorCache ()
 
- Public Member Functions inherited from wallet::ScriptPubKeyMan
 ScriptPubKeyMan (WalletStorage &storage)
 
virtual ~ScriptPubKeyMan ()=default
 
virtual util::Result< CTxDestinationGetNewDestination (const OutputType type)
 
virtual bool IsMine (const CScript &script) const
 
virtual bool CheckDecryptionKey (const CKeyingMaterial &master_key)
 Check that the given decryption key is valid for this ScriptPubKeyMan, i.e. it decrypts all of the keys handled by it. More...
 
virtual bool Encrypt (const CKeyingMaterial &master_key, WalletBatch *batch)
 
virtual util::Result< CTxDestinationGetReservedDestination (const OutputType type, bool internal, int64_t &index)
 
virtual void KeepDestination (int64_t index, const OutputType &type)
 
virtual void ReturnDestination (int64_t index, bool internal, const CTxDestination &addr)
 
virtual bool TopUp (unsigned int size=0)
 Fills internal address pool. More...
 
virtual std::vector< WalletDestinationMarkUnusedAddresses (const CScript &script)
 Mark unused addresses as being used Affects all keys up to and including the one determined by provided script. More...
 
virtual bool IsHDEnabled () const
 
virtual bool CanGetAddresses (bool internal=false) const
 
virtual bool HavePrivateKeys () const
 
virtual bool HaveCryptedKeys () const
 
virtual unsigned int GetKeyPoolSize () const
 
virtual int64_t GetTimeFirstKey () const
 
virtual std::unique_ptr< CKeyMetadataGetMetadata (const CTxDestination &dest) const
 
virtual std::unique_ptr< SigningProviderGetSolvingProvider (const CScript &script) const
 
virtual bool CanProvide (const CScript &script, SignatureData &sigdata)
 Whether this ScriptPubKeyMan can provide a SigningProvider (via GetSolvingProvider) that, combined with sigdata, can produce solving data. More...
 
virtual bool SignTransaction (CMutableTransaction &tx, const std::map< COutPoint, Coin > &coins, int sighash, std::map< int, bilingual_str > &input_errors) const
 Creates new signatures and adds them to the transaction. More...
 
virtual SigningResult SignMessage (const std::string &message, const PKHash &pkhash, std::string &str_sig) const
 Sign a message with the given script. More...
 
virtual std::optional< common::PSBTErrorFillPSBT (PartiallySignedTransaction &psbt, const PrecomputedTransactionData &txdata, const common::PSBTFillOptions &options, int *n_signed=nullptr) const
 Adds script and derivation path information to a PSBT, and optionally signs it. More...
 
virtual uint256 GetID () const
 
virtual std::unordered_set< CScript, SaltedSipHasherGetScriptPubKeys () const
 Returns a set of all the scriptPubKeys that this ScriptPubKeyMan watches. More...
 
template<typename... Params>
void WalletLogPrintf (util::ConstevalFormatString< sizeof...(Params)> wallet_fmt, const Params &... params) const
 Prepends the wallet name in logging output to ease debugging in multi-wallet use cases. More...
 

Static Public Member Functions

static std::unique_ptr< ExternalSignerScriptPubKeyManLoadFromStorage (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
 
static std::unique_ptr< ExternalSignerScriptPubKeyManCreateNew (WalletStorage &storage, WalletBatch &batch, int64_t keypool_size, std::unique_ptr< Descriptor > desc)
 
static util::Result< ExternalSignerGetExternalSigner ()
 
- Static Public Member Functions inherited from wallet::DescriptorScriptPubKeyMan
static std::unique_ptr< DescriptorScriptPubKeyManLoadFromStorage (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
 
static std::unique_ptr< DescriptorScriptPubKeyManCreateFromImport (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const FlatSigningProvider &provider)
 
static std::unique_ptr< DescriptorScriptPubKeyManCreateFromMigration (WalletStorage &storage, WalletBatch &batch, WalletDescriptor &descriptor, int64_t keypool_size, const FlatSigningProvider &provider)
 
static std::unique_ptr< DescriptorScriptPubKeyManGenerateNewSingleSig (WalletStorage &storage, WalletBatch &batch, int64_t keypool_size, const CExtKey &master_key, OutputType addr_type, bool internal)
 

Private Member Functions

 ExternalSignerScriptPubKeyMan (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
 Create an ExternalSPKM from existing wallet data. More...
 
 ExternalSignerScriptPubKeyMan (WalletStorage &storage, int64_t keypool_size)
 

Additional Inherited Members

- Public Attributes inherited from wallet::DescriptorScriptPubKeyMan
RecursiveMutex cs_desc_man
 
- Public Attributes inherited from wallet::ScriptPubKeyMan
btcsignals::signal< void()> NotifyCanGetAddressesChanged
 Keypool has new keys. More...
 
btcsignals::signal< void(const ScriptPubKeyMan *spkm, int64_t new_birth_time)> NotifyFirstKeyTimeChanged
 Birth time changed. More...
 
- Protected Member Functions inherited from wallet::DescriptorScriptPubKeyMan
 DescriptorScriptPubKeyMan (WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
 Create a DescriptorScriptPubKeyMan from existing data (i.e. during loading) More...
 
 DescriptorScriptPubKeyMan (WalletStorage &storage, int64_t keypool_size)
 
WalletDescriptor m_wallet_descriptor GUARDED_BY (cs_desc_man)
 
bool TopUpWithDB (WalletBatch &batch, unsigned int size=0)
 Same as 'TopUp' but designed for use within a batch transaction context. More...
 
- Protected Attributes inherited from wallet::ScriptPubKeyMan
WalletStoragem_storage
 

Detailed Description

Definition at line 16 of file external_signer_scriptpubkeyman.h.

Constructor & Destructor Documentation

◆ ExternalSignerScriptPubKeyMan() [1/2]

wallet::ExternalSignerScriptPubKeyMan::ExternalSignerScriptPubKeyMan ( WalletStorage storage,
WalletDescriptor descriptor,
int64_t  keypool_size,
const KeyMap keys,
const CryptedKeyMap ckeys 
)
inlineprivate

Create an ExternalSPKM from existing wallet data.

Definition at line 20 of file external_signer_scriptpubkeyman.h.

Here is the caller graph for this function:

◆ ExternalSignerScriptPubKeyMan() [2/2]

wallet::ExternalSignerScriptPubKeyMan::ExternalSignerScriptPubKeyMan ( WalletStorage storage,
int64_t  keypool_size 
)
inlineprivate

Definition at line 24 of file external_signer_scriptpubkeyman.h.

Member Function Documentation

◆ CreateNew()

std::unique_ptr< ExternalSignerScriptPubKeyMan > wallet::ExternalSignerScriptPubKeyMan::CreateNew ( WalletStorage storage,
WalletBatch batch,
int64_t  keypool_size,
std::unique_ptr< Descriptor desc 
)
static

Definition at line 29 of file external_signer_scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ DisplayAddress()

util::Result< void > wallet::ExternalSignerScriptPubKeyMan::DisplayAddress ( const CTxDestination dest,
const ExternalSigner signer 
) const

Display address on the device and verify that the returned value matches.

Returns
nothing or an error message

Definition at line 66 of file external_signer_scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ FillPSBT()

std::optional< PSBTError > wallet::ExternalSignerScriptPubKeyMan::FillPSBT ( PartiallySignedTransaction psbt,
const PrecomputedTransactionData txdata,
const common::PSBTFillOptions options,
int *  n_signed = nullptr 
) const
overridevirtual

Adds script and derivation path information to a PSBT, and optionally signs it.

Reimplemented from wallet::ScriptPubKeyMan.

Definition at line 89 of file external_signer_scriptpubkeyman.cpp.

Here is the call graph for this function:

◆ GetExternalSigner()

util::Result< ExternalSigner > wallet::ExternalSignerScriptPubKeyMan::GetExternalSigner ( )
static

Definition at line 55 of file external_signer_scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

◆ LoadFromStorage()

std::unique_ptr< ExternalSignerScriptPubKeyMan > wallet::ExternalSignerScriptPubKeyMan::LoadFromStorage ( WalletStorage storage,
WalletDescriptor descriptor,
int64_t  keypool_size,
const KeyMap keys,
const CryptedKeyMap ckeys 
)
static

Definition at line 24 of file external_signer_scriptpubkeyman.cpp.

Here is the call graph for this function:
Here is the caller graph for this function:

The documentation for this class was generated from the following files: