Skip to main content

SP1VerifierGroth16

SP1Verifier

This contracts implements a solidity verifier for SP1.

WrongVerifierSelector

error WrongVerifierSelector(bytes4 received, bytes4 expected)

Thrown when the verifier selector from this proof does not match the one in this verifier. This indicates that this proof was sent to the wrong verifier.

Parameters

NameTypeDescription
receivedbytes4The verifier selector from the first 4 bytes of the proof.
expectedbytes4The verifier selector from the first 4 bytes of the VERIFIER_HASH().

InvalidProof

error InvalidProof()

Thrown when the proof is invalid.

VERSION

function VERSION() external pure returns (string)

VERIFIER_HASH

function VERIFIER_HASH() public pure returns (bytes32)

Returns the hash of the verifier.

hashPublicValues

function hashPublicValues(bytes publicValues) public pure returns (bytes32)

Hashes the public values to a field elements inside Bn254.

Parameters

NameTypeDescription
publicValuesbytesThe public values.

verifyProof

function verifyProof(bytes32 programVKey, bytes publicValues, bytes proofBytes) external view

Verifies a proof with given public values and vkey.

Parameters

NameTypeDescription
programVKeybytes32The verification key for the RISC-V program.
publicValuesbytesThe public values encoded as bytes.
proofBytesbytesThe proof of the program execution the SP1 zkVM encoded as bytes.