[#WitnessV1Taproot]
= WitnessV1Taproot
:mrdocs:

A version&hyphen;1 taproot destination for a P2TR address&period;

== Synopsis

Declared in `&lt;addresstype&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct WitnessV1Taproot
    : xref:XOnlyPubKey.adoc[XOnlyPubKey]
----

== Base Classes

[cols="1,4"]
|===
| Name| Description
| `xref:XOnlyPubKey.adoc[XOnlyPubKey]`
| A BIP340&hyphen;style x&hyphen;only public key, storing only the 32&hyphen;byte x coordinate&period;
|===

== Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:WitnessV1Taproot/2constructor-0d.adoc[`WitnessV1Taproot`]         [.small]#[constructor]#
| Constructors
| xref:XOnlyPubKey/operator_assign.adoc[`operator&equals;`] 
| Copy&hyphen;assign an x&hyphen;only pubkey from another&period;
| xref:XOnlyPubKey/CheckTapTweak.adoc[`CheckTapTweak`] 
| Verify that this is a Taproot tweaked output point, against a specified internal key, Merkle root, and parity&period;
| xref:XOnlyPubKey/ComputeTapTweakHash.adoc[`ComputeTapTweakHash`] 
| Compute the Taproot tweak as specified in BIP341, with &ast;this as internal key&colon; &hyphen; if merkle&lowbar;root &equals;&equals; nullptr&colon; H&lowbar;TapTweak(xonly&lowbar;pubkey) &hyphen; otherwise&colon; H&lowbar;TapTweak(xonly&lowbar;pubkey &verbar;&verbar; &ast;merkle&lowbar;root)
| xref:XOnlyPubKey/CreateTapTweak.adoc[`CreateTapTweak`] 
| Construct a Taproot tweaked output point with this point as internal key&period;
| xref:XOnlyPubKey/GetCPubKeys.adoc[`GetCPubKeys`] 
| Returns this XOnlyPubKey with 0x02 and 0x03 prefixes
| xref:XOnlyPubKey/GetEvenCorrespondingCPubKey.adoc[`GetEvenCorrespondingCPubKey`] 
| Get the full public key with an even y coordinate (0x02 prefix) for this x&hyphen;only pubkey&period;
| xref:XOnlyPubKey/GetKeyIDs.adoc[`GetKeyIDs`] 
| Returns a list of CKeyIDs for the CPubKeys that could have been used to create this XOnlyPubKey&period; As the CKeyID is the Hash160(full pubkey), the produced CKeyIDs are for the versions of this XOnlyPubKey with 0x02 and 0x03 prefixes&period; This is needed for key lookups since keys are indexed by CKeyID&period;
| xref:XOnlyPubKey/IsFullyValid.adoc[`IsFullyValid`] 
| Determine if this pubkey is fully valid&period; This is true for approximately 50% of all possible 32&hyphen;byte arrays&period; If false, VerifySchnorr, CheckTapTweak and CreateTapTweak will always fail&period;
| xref:XOnlyPubKey/IsNull.adoc[`IsNull`] 
| Test whether this is the 0 key (the result of default construction)&period; This implies !IsFullyValid()&period;
| xref:WitnessV1Taproot/Serialize.adoc[`Serialize`] 
| Serialize the 32&hyphen;byte x&hyphen;only key data without a length prefix since it is fixed length&period;
| xref:WitnessV1Taproot/Unserialize.adoc[`Unserialize`] 
| Serialize the 32&hyphen;byte x&hyphen;only key data without a length prefix since it is fixed length&period;
| xref:XOnlyPubKey/VerifySchnorr.adoc[`VerifySchnorr`] 
| Verify a Schnorr signature against this public key&period;
| xref:XOnlyPubKey/begin-06.adoc[`begin`] 
| `begin` overloads
| xref:XOnlyPubKey/data-00.adoc[`data`] 
| `data` overloads
| xref:XOnlyPubKey/end-00.adoc[`end`] 
| `end` overloads
| xref:XOnlyPubKey/operator_subs.adoc[`operator&lsqb;&rsqb;`] 
| Access the byte at the given position&period;
| xref:XOnlyPubKey/operator_eq.adoc[`operator&equals;&equals;`] 
| Compare two x&hyphen;only pubkeys for equality&period;
| xref:XOnlyPubKey/operator_lt.adoc[`operator&lt;`] 
| Order two x&hyphen;only pubkeys by their key data&period;
|===


== Static Member Functions

[cols="1,4"]
|===
| Name| Description
| xref:WitnessV1Taproot/Ser.adoc[`Ser`] 
| Serialize the 32&hyphen;byte x&hyphen;only key data without a length prefix since it is fixed length&period;
| xref:WitnessV1Taproot/SerializationOps.adoc[`SerializationOps`] 
| Serialize the 32&hyphen;byte x&hyphen;only key data without a length prefix since it is fixed length&period;
| xref:WitnessV1Taproot/Unser.adoc[`Unser`] 
| Serialize the 32&hyphen;byte x&hyphen;only key data without a length prefix since it is fixed length&period;
| xref:XOnlyPubKey/size.adoc[`size`] 
| Number of bytes in an x&hyphen;only public key&period;
|===


== Static Data Members

[cols="1,4"]
|===
| Name| Description
| xref:XOnlyPubKey/NUMS_H.adoc[`NUMS&lowbar;H`] 
| Nothing Up My Sleeve point H Used as an internal key for provably disabling the key path spend see BIP341 for more details
|===



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