![]() |
Bitcoin Core 30.99.0
P2P Digital Currency
|
#include <attributes.h>#include <pubkey.h>#include <script/script.h>#include <uint256.h>#include <util/check.h>#include <util/hash_type.h>#include <algorithm>#include <variant>#include <vector>Go to the source code of this file.
Classes | |
| class | CNoDestination |
| struct | PubKeyDestination |
| struct | PKHash |
| struct | ScriptHash |
| struct | WitnessV0ScriptHash |
| struct | WitnessV0KeyHash |
| struct | WitnessV1Taproot |
| struct | WitnessUnknown |
| CTxDestination subtype to encode any future Witness version. More... | |
| struct | PayToAnchor |
Typedefs | |
| using | CTxDestination = std::variant< CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown > |
| A txout script categorized into standard templates. More... | |
Functions | |
| CKeyID | ToKeyID (const PKHash &key_hash) |
| CScriptID | ToScriptID (const ScriptHash &script_hash) |
| CKeyID | ToKeyID (const WitnessV0KeyHash &key_hash) |
| bool | IsValidDestination (const CTxDestination &dest) |
| Check whether a CTxDestination corresponds to one with an address. More... | |
| bool | ExtractDestination (const CScript &scriptPubKey, CTxDestination &addressRet) |
| Parse a scriptPubKey for the destination. More... | |
| CScript | GetScriptForDestination (const CTxDestination &dest) |
| Generate a Bitcoin scriptPubKey for the given CTxDestination. More... | |
Variables | |
| static const std::vector< unsigned char > | ANCHOR_BYTES {0x4e, 0x73} |
| Witness program for Pay-to-Anchor output script type. More... | |
| using CTxDestination = std::variant<CNoDestination, PubKeyDestination, PKHash, ScriptHash, WitnessV0ScriptHash, WitnessV0KeyHash, WitnessV1Taproot, PayToAnchor, WitnessUnknown> |
A txout script categorized into standard templates.
Definition at line 143 of file addresstype.h.
| bool ExtractDestination | ( | const CScript & | scriptPubKey, |
| CTxDestination & | addressRet | ||
| ) |
Parse a scriptPubKey for the destination.
For standard scripts that have addresses (and P2PK as an exception), a corresponding CTxDestination is assigned to addressRet. For all other scripts. addressRet is assigned as a CNoDestination containing the scriptPubKey.
Returns true for standard destinations with addresses - P2PKH, P2SH, P2WPKH, P2WSH, P2TR and P2W??? scripts. Returns false for non-standard destinations and those without addresses - P2PK, bare multisig, null data, and nonstandard scripts.
Definition at line 49 of file addresstype.cpp.
| CScript GetScriptForDestination | ( | const CTxDestination & | dest | ) |
Generate a Bitcoin scriptPubKey for the given CTxDestination.
Returns a P2PKH script for a CKeyID destination, a P2SH script for a CScriptID, and an empty script for CNoDestination.
Definition at line 166 of file addresstype.cpp.
| bool IsValidDestination | ( | const CTxDestination & | dest | ) |
Check whether a CTxDestination corresponds to one with an address.
Definition at line 171 of file addresstype.cpp.
| CKeyID ToKeyID | ( | const WitnessV0KeyHash & | key_hash | ) |
Definition at line 34 of file addresstype.cpp.
| CScriptID ToScriptID | ( | const ScriptHash & | script_hash | ) |
|
static |
Witness program for Pay-to-Anchor output script type.
Definition at line 121 of file addresstype.h.