[#BaseSignatureChecker-CheckSchnorrSignature]
= xref:BaseSignatureChecker.adoc[BaseSignatureChecker]::CheckSchnorrSignature
:relfileprefix: ../
:mrdocs:

Verify a BIP340 Schnorr signature for Taproot spends&period;

== Synopsis

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

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
virtual
bool
CheckSchnorrSignature(
    std::span&lt;unsigned char const&gt; sig,
    std::span&lt;unsigned char const&gt; pubkey,
    xref:SigVersion.adoc[SigVersion] sigversion,
    xref:ScriptExecutionData.adoc[ScriptExecutionData]& execdata,
    xref:ScriptError.adoc[ScriptError]* serror = nullptr) const;
----

== Return Value

`true` if the signature is valid&period;

== Parameters

[cols="1,4"]
|===
| Name| Description
| *sig*
| The 64&hyphen; or 65&hyphen;byte Schnorr signature&period;
| *pubkey*
| The 32&hyphen;byte x&hyphen;only public key&period;
| *sigversion*
| The signature version selecting the hashing scheme&period;
| *execdata*
| Per&hyphen;input execution state used by the sighash&period;
| *serror*
| Set to the script error when verification fails&period;
|===


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