Skip to main content
Version: v2.0_alpha

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 vk, uint256 input) public view returns (bool isValid)

Verify a zk-SNARK proof

Parameters

NameTypeDescription
_proofuint256[8]The proof
vkstruct SnarkCommon.VerifyingKeyThe verifying key
inputuint256The 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