5#ifndef BITCOIN_ADDRESSTYPE_H
6#define BITCOIN_ADDRESSTYPE_H
140using CTxDestination = std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown>;
CScriptID ToScriptID(const ScriptHash &script_hash)
bool ExtractDestination(const CScript &scriptPubKey, CTxDestination &addressRet)
Parse a scriptPubKey for the destination.
std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > CTxDestination
A txout script categorized into standard templates.
bool IsValidDestination(const CTxDestination &dest)
Check whether a CTxDestination corresponds to one with an address.
CScript GetScriptForDestination(const CTxDestination &dest)
Generate a Bitcoin scriptPubKey for the given CTxDestination.
CKeyID ToKeyID(const PKHash &key_hash)
#define Assume(val)
Assume is the identity function.
A reference to a CKey: the Hash160 of its serialized public key.
friend bool operator<(const CNoDestination &a, const CNoDestination &b)
friend bool operator==(const CNoDestination &a, const CNoDestination &b)
CNoDestination(const CScript &script)
const CScript & GetScript() const LIFETIMEBOUND
An encapsulated public key.
Serialized script, used inside transaction inputs and outputs.
bool IsPayToAnchor() const
A reference to a CScript: the Hash160 of its serialization.
PKHash(const uint160 &hash)
const CPubKey & GetPubKey() const LIFETIMEBOUND
friend bool operator<(const PubKeyDestination &a, const PubKeyDestination &b)
PubKeyDestination(const CPubKey &pubkey)
friend bool operator==(const PubKeyDestination &a, const PubKeyDestination &b)
ScriptHash(const WitnessV0KeyHash &hash)=delete
ScriptHash(const uint160 &hash)
ScriptHash(const PKHash &hash)=delete
CTxDestination subtype to encode any future Witness version.
WitnessUnknown(int version, const std::vector< unsigned char > &program)
WitnessUnknown(unsigned int version, const std::vector< unsigned char > &program)
friend bool operator<(const WitnessUnknown &w1, const WitnessUnknown &w2)
const std::vector< unsigned char > & GetWitnessProgram() const LIFETIMEBOUND
unsigned int GetWitnessVersion() const
std::vector< unsigned char > m_program
friend bool operator==(const WitnessUnknown &w1, const WitnessUnknown &w2)
WitnessV0KeyHash(const uint160 &hash)
WitnessV0ScriptHash(const uint256 &hash)
WitnessV1Taproot(const XOnlyPubKey &xpk)