TaprootSpendData

Data needed to spend a Taproot output, including its script tree.

Synopsis

Declared in <script/signingprovider.h>

struct TaprootSpendData;

Member Functions

NameDescription
Merge Merge other TaprootSpendData (for the same scriptPubKey) into this.

Data Members

NameDescription
internal_key The BIP341 internal key.
merkle_root The Merkle root of the script tree (0 if no scripts).
scripts Map from (script, leaf_version) to (sets of) control blocks. More than one control block for a given script is only possible if it appears in multiple branches of the tree. We keep them all so that inference can reconstruct the full tree. Within each set, the control blocks are sorted by size, so that the signing logic can easily prefer the cheapest one.

Non-Member Functions

NameDescription
InferTaprootTreeGiven a TaprootSpendData and the output key, reconstruct its script tree.