[#SignatureHashSchnorr]
= SignatureHashSchnorr
:mrdocs:

Compute the BIP341 Taproot signature hash for one input&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;typename T&gt;
bool
SignatureHashSchnorr(
    xref:uint256.adoc[uint256]& hash&lowbar;out,
    xref:ScriptExecutionData.adoc[ScriptExecutionData]& execdata,
    T const& tx&lowbar;to,
    uint32&lowbar;t in&lowbar;pos,
    uint8&lowbar;t hash&lowbar;type,
    xref:SigVersion.adoc[SigVersion] sigversion,
    xref:PrecomputedTransactionData.adoc[PrecomputedTransactionData] const& cache,
    xref:MissingDataBehavior.adoc[MissingDataBehavior] mdb);
----

== Return Value

`true` if the hash was computed successfully&period;

== Template Parameters

[cols="1,4"]
|===
| Name| Description
| *T*
| The transaction type being signed&period;
|===

== Parameters

[cols="1,4"]
|===
| Name| Description
| *hash&lowbar;out*
| Receives the computed signature hash&period;
| *execdata*
| Per&hyphen;input execution state used by the sighash&period;
| *tx&lowbar;to*
| The transaction whose input is being signed&period;
| *in&lowbar;pos*
| Index of the input being signed&period;
| *hash&lowbar;type*
| The sighash type byte&period;
| *sigversion*
| The signature version (TAPROOT or TAPSCRIPT)&period;
| *cache*
| Precomputed transaction data required for Taproot&period;
| *mdb*
| How to react when required spent&hyphen;output data is missing&period;
|===


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