TaprootBuilder

Utility class to construct Taproot outputs from internal key and script tree.

Synopsis

Declared in <script/signingprovider.h>

class TaprootBuilder;

Member Functions

NameDescription
Add Add a new script at a certain depth in the tree. Add() operations must be called in depth-first traversal order of binary tree. If track is true, it will be included in the GetSpendData() output.
AddOmitted Like Add(), but for a Merkle node with a given hash to the tree.
Finalize Finalize the construction. Can only be called when IsComplete() is true. internal_key.IsFullyValid() must be true.
GetOutput Compute scriptPubKey (after Finalize()).
GetSpendData Compute spending data (after Finalize()).
GetTreeTuples Returns a vector of tuples representing the depth, leaf version, and script
HasScripts Returns true if there are any tapscripts
IsComplete Return whether there were either no leaves, or the leaves form a Huffman tree.
IsValid Return true if so far all input was valid.
operator== Compare two builders by the script trees they represent.

Static Member Functions

NameDescription
ValidDepths Check if a list of depths is legal (will lead to IsComplete()).