[#TaprootBuilder-Add]
= xref:TaprootBuilder.adoc[TaprootBuilder]::Add
:relfileprefix: ../
:mrdocs:

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;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:TaprootBuilder.adoc[TaprootBuilder]&
Add(
    int depth,
    std::span&lt;unsigned char const&gt; script,
    int leaf&lowbar;version,
    bool track = true);
----

== Return Value

A reference to this builder for chaining&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *depth*
| The depth in the Merkle tree to add the script at&period;
| *script*
| The script to add as a tapscript leaf&period;
| *leaf&lowbar;version*
| The tapscript leaf version for the script&period;
| *track*
| Whether to include the leaf in the GetSpendData() output&period;
|===


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