Bitcoin Core 31.99.0
P2P Digital Currency
external_signer_scriptpubkeyman.h
Go to the documentation of this file.
1// Copyright (c) 2019-present The Bitcoin Core developers
2// Distributed under the MIT software license, see the accompanying
3// file COPYING or http://www.opensource.org/licenses/mit-license.php.
4
5#ifndef BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
6#define BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
7
9
10#include <memory>
11#include <util/result.h>
12
13struct bilingual_str;
14
15namespace wallet {
17{
18private:
20 ExternalSignerScriptPubKeyMan(WalletStorage& storage, WalletDescriptor& descriptor, int64_t keypool_size, const KeyMap& keys, const CryptedKeyMap& ckeys)
21 : DescriptorScriptPubKeyMan(storage, descriptor, keypool_size, keys, ckeys)
22 {}
23
24 ExternalSignerScriptPubKeyMan(WalletStorage& storage, int64_t keypool_size)
25 : DescriptorScriptPubKeyMan(storage, keypool_size)
26 {}
27
28public:
29 static std::unique_ptr<ExternalSignerScriptPubKeyMan> LoadFromStorage(WalletStorage& storage, WalletDescriptor& descriptor, int64_t keypool_size, const KeyMap& keys, const CryptedKeyMap& ckeys);
30 static std::unique_ptr<ExternalSignerScriptPubKeyMan> CreateNew(WalletStorage& storage, WalletBatch& batch, int64_t keypool_size, std::unique_ptr<Descriptor> desc);
31
33
39
40 std::optional<common::PSBTError> FillPSBT(PartiallySignedTransaction& psbt, const PrecomputedTransactionData& txdata, const common::PSBTFillOptions& options, int* n_signed = nullptr) const override;
41};
42} // namespace wallet
43#endif // BITCOIN_WALLET_EXTERNAL_SIGNER_SCRIPTPUBKEYMAN_H
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
Definition: addresstype.h:143
Enables interaction with an external signing device or service, such as a hardware wallet.
A version of CTransaction with the PSBT format.
Definition: psbt.h:1240
static std::unique_ptr< ExternalSignerScriptPubKeyMan > LoadFromStorage(WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
static std::unique_ptr< ExternalSignerScriptPubKeyMan > CreateNew(WalletStorage &storage, WalletBatch &batch, int64_t keypool_size, std::unique_ptr< Descriptor > desc)
ExternalSignerScriptPubKeyMan(WalletStorage &storage, WalletDescriptor &descriptor, int64_t keypool_size, const KeyMap &keys, const CryptedKeyMap &ckeys)
Create an ExternalSPKM from existing wallet data.
static util::Result< ExternalSigner > GetExternalSigner()
std::optional< common::PSBTError > FillPSBT(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.
util::Result< void > DisplayAddress(const CTxDestination &dest, const ExternalSigner &signer) const
Display address on the device and verify that the returned value matches.
ExternalSignerScriptPubKeyMan(WalletStorage &storage, int64_t keypool_size)
Access to the wallet database.
Definition: walletdb.h:197
Descriptor with some wallet metadata.
Definition: walletutil.h:64
std::map< CKeyID, std::pair< CPubKey, std::vector< unsigned char > > > CryptedKeyMap
std::map< CKeyID, CKey > KeyMap
Bilingual messages:
Definition: translation.h:24
Instructions for how a PSBT should be signed or filled with information.
Definition: types.h:32
Definition: musig.c:31