[#TaprootBuilder-Add] = xref:TaprootBuilder.adoc[TaprootBuilder]::Add :relfileprefix: ../ :mrdocs: 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. == Synopsis Declared in `<script/signingprovider.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- xref:TaprootBuilder.adoc[TaprootBuilder]& Add( int depth, std::span<unsigned char const> script, int leaf_version, bool track = true); ---- == Return Value A reference to this builder for chaining. == Parameters [cols="1,4"] |=== | Name| Description | *depth* | The depth in the Merkle tree to add the script at. | *script* | The script to add as a tapscript leaf. | *leaf_version* | The tapscript leaf version for the script. | *track* | Whether to include the leaf in the GetSpendData() output. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#