TaprootBuilder::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.

Synopsis

Declared in <script/signingprovider.h>

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

NameDescription
depthThe depth in the Merkle tree to add the script at.
scriptThe script to add as a tapscript leaf.
leaf_versionThe tapscript leaf version for the script.
trackWhether to include the leaf in the GetSpendData() output.