[#ComputeTaprootMerkleRoot]
= ComputeTaprootMerkleRoot
:mrdocs:

Compute the BIP341 taproot script tree Merkle root from control block and leaf hash&period; Requires control block to have valid length (33 &plus; k&ast;32, with k in &lcub;0,1,&period;&period;,128&rcub;)&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
xref:uint256.adoc[uint256]
ComputeTaprootMerkleRoot(
    std::span&lt;unsigned char const&gt; control,
    xref:uint256.adoc[uint256] const& tapleaf&lowbar;hash);
----

== Return Value

The Merkle root of the script tree&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *control*
| The Taproot control block containing the Merkle branch&period;
| *tapleaf&lowbar;hash*
| The hash of the leaf being spent&period;
|===


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