ERC-8084 · Draft · ERC · 2025-11-10
ERC-8084: Zero-knowledge proof metadata
A draft read-only interface, ZKMeta, that lets a contract using zero-knowledge proofs publish its proof system, circuit ID, version, public-input schema and verification-key location, acting as a kind of ABI for ZK proofs.
What problem does it solve?
A contract that verifies ZK proofs usually exposes something like verify(bytes proof, uint256[] publicInputs). From the outside you cannot tell which proof system it uses, which circuit it expects, what each public input means, or where the verification key lives. Every wallet, explorer, relayer or prover network that wants to integrate has to read the project's docs and write a custom adapter.
ERC-8084 does not try to standardize verification itself (an earlier effort, ERC-1923, took that approach). It standardizes metadata discovery, so tools can automatically:
- decode and label proof inputs in a block explorer, like an ABI decodes calldata;
- let prover markets fetch circuit artifacts and generate proofs without per-app integration;
- alert users when a protocol changes or downgrades its circuit.
How it works
A compliant contract implements IZKMetadata:
| Function | Returns |
|---|---|
proofSystem() |
bytes4 code: 0x0001 Groth16, 0x0002 Plonk, 0x0003 Halo2, 0x0004 zkSTARK, 0x0005 zkVM |
circuitId() |
content hash of the canonical circuit artifact |
circuitVersion() |
uint64: major in the high 32 bits, minor in the low 32 bits; must increase on breaking changes |
publicInputsSchemaHash() |
hash of the public-input schema document |
publicInputsSchemaURI() |
where to fetch that schema |
verificationKeyURI() |
where to fetch the verification key |
Rules for integrity:
- URIs should be content-addressed (
ipfs://,ar://,bzz://). If HTTPS is used, the URI must end with a#0x...fragment holding the Keccak-256 hash of the file. - Tooling must check the fetched schema against
publicInputsSchemaHash(), and should check the verification key against its hash fragment. CircuitMetadataUpdated(circuitId, circuitVersion, proofSystem)is emitted in the same transaction that changes the metadata, so indexers can react without polling.
Existing contracts can adopt it through a separate adapter contract that only serves metadata.
Sample code
An explorer or prover fetching and checking metadata (ethers v6):
import { Contract, JsonRpcProvider, keccak256, toUtf8Bytes } from "ethers";
const provider = new JsonRpcProvider(process.env.RPC_URL);
const zk = new Contract(process.env.VERIFIER!, [
"function proofSystem() view returns (bytes4)",
"function circuitId() view returns (bytes32)",
"function circuitVersion() view returns (uint64)",
"function publicInputsSchemaHash() view returns (bytes32)",
"function publicInputsSchemaURI() view returns (string)",
"function verificationKeyURI() view returns (string)",
], provider);
const version: bigint = await zk.circuitVersion();
const major = version >> 32n;
const minor = version & 0xffffffffn;
const schemaUri: string = await zk.publicInputsSchemaURI();
const schemaText = await fetchFromUri(schemaUri); // ipfs:// or https://...#0xhash
if (keccak256(toUtf8Bytes(schemaText)) !== await zk.publicInputsSchemaHash()) {
throw new Error("schema hash mismatch: do not trust labels");
}
console.log(`circuit v${major}.${minor}`, JSON.parse(schemaText));
fetchFromUri stands in for your own IPFS/HTTPS loader. The schema's format itself is not defined by the ERC.
Things to know
- Status: Draft.
- The ERC does not define the schema document's format, so decoding still requires a convention between publisher and tool.
proofSystem()returnsbytes4, but the registry lists two-byte codes such as0x0001; how these are padded is not spelled out. New codes are to be coordinated in the discussion thread.- The spec says both "SHOULD" and "MUST" for emitting
CircuitMetadataUpdatedatomically; treat it as required. - Metadata is only as trustworthy as the contract's update permissions. The reference adapter's update function has no access control and is explicitly marked as an example only.
- Hash checks matter: without them a gateway could serve an altered schema that mislabels inputs, or swap a verification key behind an HTTPS URL.