[#InferTaprootTree] = InferTaprootTree :mrdocs: Given a TaprootSpendData and the output key, reconstruct its script tree. == Synopsis Declared in `<script/signingprovider.h>` [source,cpp,subs="verbatim,replacements,macros,-callouts"] ---- std::optional<std::vector<std::tuple<int, std::vector<unsigned char>, int>>> InferTaprootTree( xref:TaprootSpendData.adoc[TaprootSpendData] const& spenddata, xref:XOnlyPubKey.adoc[XOnlyPubKey] const& output); ---- == Description If the output doesn't match the spenddata, or if the data in spenddata is incomplete, std::nullopt is returned. Otherwise, a vector of (depth, script, leaf_ver) tuples is returned, corresponding to a depth‐first traversal of the script tree. == Return Value The reconstructed (depth, script, leaf version) tuples, or std::nullopt on mismatch. == Parameters [cols="1,4"] |=== | Name| Description | *spenddata* | The spend data describing the output's scripts. | *output* | The output key the tree must match. |=== [.small]#Created with https://www.mrdocs.com[MrDocs]#