Constants
MAX_VK_BYTES leaves room for a leading STOP byte and a backend byte
under EIP-170’s 24,576-byte runtime-code limit.
Circuit ID
A circuit ID commits to the backend and exact verification-key bytes:backend is the single byte 0x02. Recompiling a circuit may
change its verification key and circuit ID. Circuit names and versions remain
offchain.
ABI
Registration and storage
register performs these steps:
- Require backend
0x02and a verification key between 256 and 24,574 bytes. - Compute the circuit ID from
backend || vk. - Return the existing pointer if the circuit ID is already registered.
- Deploy a
CircuitRegistryBlobwith CREATE2, using the circuit ID as its salt. - Record the pointer and emit
CircuitRegistered.
0x00 is STOP. A call to the pointer halts before the EVM interprets
backend || verificationKey as instructions. The registry skips the STOP byte and
reads the remaining bytes as data using EXTCODECOPY.
Proof request wire
Pass the followingrequest to the ABI function verify(bytes):
verify resolves pointerOf[circuitId], reads the registered key, and inserts
the key material before forwarding this wire to 0xF2:
keyLen includes the one-byte backend tag. The precompile recomputes
keccak256(backend || verificationKey) and requires it to equal circuitId
before verifying the proof.
Send the application wire as the argument to verify(bytes). Sending that wire
directly to 0xF0 without the ABI selector does not invoke verification.
Verification result
verify returns true only when 0xF2 returns the exact 32-byte encoding of
1. It returns false for:
- a request shorter than 32 bytes;
- an unknown circuit ID;
- malformed proof lengths, public-input counts, or trailing bytes;
- invalid stored key shape;
- a backend or key that does not match the circuit ID;
- an invalid proof; or
- a failed or malformed precompile response.
false result as proof rejection. The result does not identify
which check failed.
The 0xF2 precompile charges:
CircuitRegistry and copying the stored key.
Event
Errors
Malformed requests, unknown circuits, and invalid proofs produce a
false
result from verify.
Circuits and proofs
Understand how MIP410 composes its proof system.
Shielded payment circuits
Inspect the sender and recipient proof boundaries.