[#TaprootBuilder] = TaprootBuilder :mrdocs: Utility class to construct Taproot outputs from internal key and script tree. == Synopsis Declared in `<script/signingprovider.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- class TaprootBuilder; ---- == Member Functions [cols="1,4"] |=== | Name| Description | xref:TaprootBuilder/Add.adoc[`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. | xref:TaprootBuilder/AddOmitted.adoc[`AddOmitted`] | Like Add(), but for a Merkle node with a given hash to the tree. | xref:TaprootBuilder/Finalize.adoc[`Finalize`] | Finalize the construction. Can only be called when IsComplete() is true. internal_key.IsFullyValid() must be true. | xref:TaprootBuilder/GetOutput.adoc[`GetOutput`] | Compute scriptPubKey (after Finalize()). | xref:TaprootBuilder/GetSpendData.adoc[`GetSpendData`] | Compute spending data (after Finalize()). | xref:TaprootBuilder/GetTreeTuples.adoc[`GetTreeTuples`] | Returns a vector of tuples representing the depth, leaf version, and script | xref:TaprootBuilder/HasScripts.adoc[`HasScripts`] | Returns true if there are any tapscripts | xref:TaprootBuilder/IsComplete.adoc[`IsComplete`] | Return whether there were either no leaves, or the leaves form a Huffman tree. | xref:TaprootBuilder/IsValid.adoc[`IsValid`] | Return true if so far all input was valid. | xref:TaprootBuilder/operator_eq.adoc[`operator==`] | Compare two builders by the script trees they represent. |=== == Static Member Functions [cols="1,4"] |=== | Name| Description | xref:TaprootBuilder/ValidDepths.adoc[`ValidDepths`] | Check if a list of depths is legal (will lead to IsComplete()). |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#