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
| Name | Type | Description |
|---|---|---|
| received | bytes4 | The verifier selector from the first 4 bytes of the proof. |
| expected | bytes4 | The 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
| Name | Type | Description |
|---|---|---|
| publicValues | bytes | The public values. |
verifyProof
function verifyProof(bytes32 programVKey, bytes publicValues, bytes proofBytes) external view
Verifies a proof with given public values and vkey.
Parameters
| Name | Type | Description |
|---|---|---|
| programVKey | bytes32 | The verification key for the RISC-V program. |
| publicValues | bytes | The public values encoded as bytes. |
| proofBytes | bytes | The proof of the program execution the SP1 zkVM encoded as bytes. |