[#SignatureHash]
= SignatureHash
:mrdocs:

Compute the signature hash for one input under the selected signature version&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
template&lt;class T&gt;
xref:uint256.adoc[uint256]
SignatureHash(
    xref:CScript.adoc[CScript] const& scriptCode,
    T const& txTo,
    unsigned int nIn,
    int32&lowbar;t nHashType,
    xref:CAmount.adoc[CAmount] const& amount,
    xref:SigVersion.adoc[SigVersion] sigversion,
    xref:PrecomputedTransactionData.adoc[PrecomputedTransactionData] const* cache = nullptr,
    xref:SigHashCache.adoc[SigHashCache]* sighash&lowbar;cache = nullptr);
----

== Return Value

The 256&hyphen;bit signature hash&period;

== Template Parameters

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

== Parameters

[cols="1,4"]
|===
| Name| Description
| *scriptCode*
| The script being executed for this input&period;
| *txTo*
| The transaction whose input is being signed&period;
| *nIn*
| Index of the input being signed&period;
| *nHashType*
| The sighash type byte controlling which parts are committed&period;
| *amount*
| The value of the output being spent&period;
| *sigversion*
| The signature version selecting the hashing scheme&period;
| *cache*
| Optional precomputed transaction data reused across inputs&period;
| *sighash&lowbar;cache*
| Optional cache of SHA256 midstates for repeated computations&period;
|===


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