A version‐1 taproot destination for a P2TR address.

Synopsis

Declared in <addresstype.h>

struct WitnessV1Taproot
    : XOnlyPubKey

Base Classes

Name

Description

XOnlyPubKey

A BIP340‐style x‐only public key, storing only the 32‐byte x coordinate.

Member Functions

Name

Description

WitnessV1Taproot [constructor]

Constructors

operator=

Copy‐assign an x‐only pubkey from another.

CheckTapTweak

Verify that this is a Taproot tweaked output point, against a specified internal key, Merkle root, and parity.

ComputeTapTweakHash

Compute the Taproot tweak as specified in BIP341, with *this as internal key: ‐ if merkle_root == nullptr: H_TapTweak(xonly_pubkey) ‐ otherwise: H_TapTweak(xonly_pubkey || *merkle_root)

CreateTapTweak

Construct a Taproot tweaked output point with this point as internal key.

GetCPubKeys

Returns this XOnlyPubKey with 0x02 and 0x03 prefixes

GetEvenCorrespondingCPubKey

Get the full public key with an even y coordinate (0x02 prefix) for this x‐only pubkey.

GetKeyIDs

Returns a list of CKeyIDs for the CPubKeys that could have been used to create this XOnlyPubKey. As the CKeyID is the Hash160(full pubkey), the produced CKeyIDs are for the versions of this XOnlyPubKey with 0x02 and 0x03 prefixes. This is needed for key lookups since keys are indexed by CKeyID.

IsFullyValid

Determine if this pubkey is fully valid. This is true for approximately 50% of all possible 32‐byte arrays. If false, VerifySchnorr, CheckTapTweak and CreateTapTweak will always fail.

IsNull

Test whether this is the 0 key (the result of default construction). This implies !IsFullyValid().

Serialize

Serialize the 32‐byte x‐only key data without a length prefix since it is fixed length.

Unserialize

Serialize the 32‐byte x‐only key data without a length prefix since it is fixed length.

VerifySchnorr

Verify a Schnorr signature against this public key.

begin

begin overloads

data

data overloads

end

end overloads

operator[]

Access the byte at the given position.

operator==

Compare two x‐only pubkeys for equality.

operator<

Order two x‐only pubkeys by their key data.

Static Member Functions

Name

Description

Ser

Serialize the 32‐byte x‐only key data without a length prefix since it is fixed length.

SerializationOps

Serialize the 32‐byte x‐only key data without a length prefix since it is fixed length.

Unser

Serialize the 32‐byte x‐only key data without a length prefix since it is fixed length.

size

Number of bytes in an x‐only public key.

Static Data Members

Name

Description

NUMS_H

Nothing Up My Sleeve point H Used as an internal key for provably disabling the key path spend see BIP341 for more details

Created with MrDocs