[#TaprootBuilder]
= TaprootBuilder
:mrdocs:

Utility class to construct Taproot outputs from internal key and script tree&period;

== Synopsis

Declared in `&lt;script&sol;signingprovider&period;h&gt;`

[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&period; Add() operations must be called in depth&hyphen;first traversal order of binary tree&period; If track is true, it will be included in the GetSpendData() output&period;
| xref:TaprootBuilder/AddOmitted.adoc[`AddOmitted`] 
| Like Add(), but for a Merkle node with a given hash to the tree&period;
| xref:TaprootBuilder/Finalize.adoc[`Finalize`] 
| Finalize the construction&period; Can only be called when IsComplete() is true&period; internal&lowbar;key&period;IsFullyValid() must be true&period;
| xref:TaprootBuilder/GetOutput.adoc[`GetOutput`] 
| Compute scriptPubKey (after Finalize())&period;
| xref:TaprootBuilder/GetSpendData.adoc[`GetSpendData`] 
| Compute spending data (after Finalize())&period;
| 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&period;
| xref:TaprootBuilder/IsValid.adoc[`IsValid`] 
| Return true if so far all input was valid&period;
| xref:TaprootBuilder/operator_eq.adoc[`operator&equals;&equals;`] 
| Compare two builders by the script trees they represent&period;
|===


== 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())&period;
|===



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