Skip to main content
Version: v3.x

Verifier

a Groth16 verifier contract

Proof​

struct Proof {
struct Pairing.G1Point a;
struct Pairing.G2Point b;
struct Pairing.G1Point c;
}

PRIME_Q​

uint256 PRIME_Q

InvalidProofQ​

error InvalidProofQ()

custom errors

InvalidInputVal​

error InvalidInputVal()

verify​

function verify(uint256[8] _proof, struct SnarkCommon.VerifyingKey verifyingKey, uint256[] inputs) public view returns (bool isValid)

Verify a zk-SNARK proof

Parameters​

NameTypeDescription
_proofuint256[8]The proof
verifyingKeystruct SnarkCommon.VerifyingKeyThe verifying key
inputsuint256[]The public inputs to the circuit

Return Values​

NameTypeDescription
isValidboolWhether the proof is valid given the verifying key and public input. Note that this function only supports one public input. Refer to the Semaphore source code for a verifier that supports multiple public inputs.

checkPoint​

function checkPoint(uint256 point) internal pure