6 #ifndef BITCOIN_SCRIPT_SIGNINGPROVIDER_H 7 #define BITCOIN_SCRIPT_SIGNINGPROVIDER_H 33 for (
const auto&
id : pubkey.
GetKeyIDs()) {
34 if (
GetKey(
id, key))
return true;
41 for (
const auto&
id : pubkey.
GetKeyIDs()) {
49 for (
const auto&
id : pubkey.
GetKeyIDs()) {
79 std::map<CKeyID, std::pair<CPubKey, KeyOriginInfo>>
origins;
80 std::map<CKeyID, CKey>
keys;
81 std::map<XOnlyPubKey, TaprootBuilder>
tr_trees;
97 using KeyMap = std::map<CKeyID, CKey>;
158 virtual std::set<CKeyID>
GetKeys()
const;
169 #endif // BITCOIN_SCRIPT_SIGNINGPROVIDER_H
virtual bool GetPubKey(const CKeyID &address, CPubKey &vchPubKeyOut) const override
virtual ~SigningProvider()
std::map< CScriptID, CScript > ScriptMap
virtual bool GetCScript(const CScriptID &hash, CScript &redeemScriptOut) const override
bool GetPubKeyByXOnly(const XOnlyPubKey &pubkey, CPubKey &out) const
const SigningProvider & DUMMY_SIGNING_PROVIDER
const SigningProvider * m_provider
RecursiveMutex cs_KeyStore
CPubKey GetPubKey() const
Compute the public key from a private key.
virtual bool HaveCScript(const CScriptID &scriptid) const
std::map< CKeyID, CKey > keys
virtual bool AddCScript(const CScript &redeemScript)
virtual std::set< CScriptID > GetCScripts() const
virtual std::set< CKeyID > GetKeys() const
std::map< CKeyID, std::pair< CPubKey, KeyOriginInfo > > origins
bool GetTaprootSpendData(const XOnlyPubKey &output_key, TaprootSpendData &spenddata) const override
bool GetCScript(const CScriptID &scriptid, CScript &script) const override
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override
bool GetKeyOriginByXOnly(const XOnlyPubKey &pubkey, KeyOriginInfo &info) const
virtual bool GetTaprootSpendData(const XOnlyPubKey &output_key, TaprootSpendData &spenddata) const
virtual bool GetPubKey(const CKeyID &address, CPubKey &pubkey) const
std::map< CScriptID, CScript > scripts
virtual bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const
bool GetPubKey(const CKeyID &keyid, CPubKey &pubkey) const override
An encapsulated public key.
bool GetKey(const CKeyID &keyid, CKey &key) const override
Fillable signing provider that keeps keys in an address->secret map.
std::map< CKeyID, CPubKey > pubkeys
virtual bool HaveKey(const CKeyID &address) const
void ImplicitlyLearnRelatedKeyScripts(const CPubKey &pubkey) EXCLUSIVE_LOCKS_REQUIRED(cs_KeyStore)
std::variant< CNoDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, WitnessUnknown > CTxDestination
A txout script template with a specific destination.
virtual bool GetCScript(const CScriptID &scriptid, CScript &script) const
virtual bool GetKey(const CKeyID &address, CKey &key) const
virtual bool GetKey(const CKeyID &address, CKey &keyOut) const override
FlatSigningProvider & Merge(FlatSigningProvider &&b) LIFETIMEBOUND
bool GetTaprootBuilder(const XOnlyPubKey &output_key, TaprootBuilder &builder) const override
Utility class to construct Taproot outputs from internal key and script tree.
#define EXCLUSIVE_LOCKS_REQUIRED(...)
bool GetCScript(const CScriptID &scriptid, CScript &script) const override
Map from output key to Taproot tree (which can then make the TaprootSpendData.
bool GetKey(const CKeyID &keyid, CKey &key) const override
bool GetTaprootBuilder(const XOnlyPubKey &output_key, TaprootBuilder &builder) const override
An interface to be implemented by keystores that support signing.
std::map< CKeyID, CKey > KeyMap
Serialized script, used inside transaction inputs and outputs.
bool GetKeyOrigin(const CKeyID &keyid, KeyOriginInfo &info) const override
A reference to a CKey: the Hash160 of its serialized public key.
virtual bool HaveCScript(const CScriptID &hash) const override
A reference to a CScript: the Hash160 of its serialization (see script.h)
virtual bool AddKeyPubKey(const CKey &key, const CPubKey &pubkey)
HidingSigningProvider(const SigningProvider *provider, bool hide_secret, bool hide_origin)
An encapsulated private key.
bool GetKeyByXOnly(const XOnlyPubKey &pubkey, CKey &key) const
CKeyID GetKeyForDestination(const SigningProvider &store, const CTxDestination &dest)
Return the CKeyID of the key involved in a script (if there is a unique one).
virtual bool GetTaprootBuilder(const XOnlyPubKey &output_key, TaprootBuilder &builder) const
bool GetPubKey(const CKeyID &keyid, CPubKey &pubkey) const override
std::vector< CKeyID > GetKeyIDs() const
Returns a list of CKeyIDs for the CPubKeys that could have been used to create this XOnlyPubKey...
bool GetTaprootSpendData(const XOnlyPubKey &output_key, TaprootSpendData &spenddata) const override
virtual bool AddKey(const CKey &key)
KeyMap mapKeys GUARDED_BY(cs_KeyStore)
Map of key id to unencrypted private keys known by the signing provider.
std::map< XOnlyPubKey, TaprootBuilder > tr_trees
virtual bool HaveKey(const CKeyID &address) const override