Classification of a scriptPubKey into a standard output type.
Declared in <script/solver.h>
enum class TxoutType : int;
| Name | Description |
|---|---|
NONSTANDARD | Script that does not match any standard template |
ANCHOR | anyone can spend script |
PUBKEY | Pay-to-public-key (P2PK) script |
PUBKEYHASH | Pay-to-public-key-hash (P2PKH) script |
SCRIPTHASH | Pay-to-script-hash (P2SH) script |
MULTISIG | Bare multisig script |
NULL_DATA | unspendable OP_RETURN script that carries data |
WITNESS_V0_SCRIPTHASH | Pay-to-witness-script-hash (P2WSH) script |
WITNESS_V0_KEYHASH | Pay-to-witness-public-key-hash (P2WPKH) script |
WITNESS_V1_TAPROOT | Pay-to-taproot (P2TR) script |
WITNESS_UNKNOWN | Only for Witness versions not already defined above |
| Name | Description |
|---|---|
GetTxnOutputType | Get the name of a TxoutType as a string |
Solver | Parse a scriptPubKey and identify script type for standard scripts. If successful, returns script type and parsed pubkeys or hashes, depending on the type. For example, for a P2SH script, vSolutionsRet will contain the script hash, for P2PKH it will contain the key hash, etc. |