[#TxoutType]
= TxoutType
:mrdocs:

Classification of a scriptPubKey into a standard output type&period;

== Synopsis

Declared in `&lt;script&sol;solver&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
enum class TxoutType : int;
----

== Members

[cols="1,4"]
|===
| Name| Description
| `NONSTANDARD` 
| Script that does not match any standard template
| `ANCHOR` 
| anyone can spend script
| `PUBKEY` 
| Pay&hyphen;to&hyphen;public&hyphen;key (P2PK) script
| `PUBKEYHASH` 
| Pay&hyphen;to&hyphen;public&hyphen;key&hyphen;hash (P2PKH) script
| `SCRIPTHASH` 
| Pay&hyphen;to&hyphen;script&hyphen;hash (P2SH) script
| `MULTISIG` 
| Bare multisig script
| `NULL&lowbar;DATA` 
| unspendable OP&lowbar;RETURN script that carries data
| `WITNESS&lowbar;V0&lowbar;SCRIPTHASH` 
| Pay&hyphen;to&hyphen;witness&hyphen;script&hyphen;hash (P2WSH) script
| `WITNESS&lowbar;V0&lowbar;KEYHASH` 
| Pay&hyphen;to&hyphen;witness&hyphen;public&hyphen;key&hyphen;hash (P2WPKH) script
| `WITNESS&lowbar;V1&lowbar;TAPROOT` 
| Pay&hyphen;to&hyphen;taproot (P2TR) script
| `WITNESS&lowbar;UNKNOWN` 
| Only for Witness versions not already defined above
|===


== Non-Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:GetTxnOutputType.adoc[`GetTxnOutputType`]
| Get the name of a TxoutType as a string
| xref:Solver.adoc[`Solver`]
| Parse a scriptPubKey and identify script type for standard scripts&period; If successful, returns script type and parsed pubkeys or hashes, depending on the type&period; For example, for a P2SH script, vSolutionsRet will contain the script hash, for P2PKH it will contain the key hash, etc&period;
|===


[.small]#Created with https://www.mrdocs.com[MrDocs]#
