ERC-8274: AI Inference Proof Verification

You’re right, and thanks for pulling the bytecode yourself instead of trusting the commit message. Generation 3 is now broadcast on Sepolia and all nine contracts show exact_match on Sourcify.

For the composed run the adapter is 0x46daAC304769A53EB48689aa285c931e2A331226, backed by the HonkVerifier at 0x3C55084357A2b6994041536369e19Fe1a09EcE20, and the new guard is 0x6C745fd8A3c22Ad89A73467D9D2D88F08c06Ef22 on registry 0x524aB668dd22DF2f7ed33cc40a74b6c05309A622. The denial legs use DenyHonkVerifier at 0x5A5ade606dc3122F9bbe7A482B076b3E131956f4 and NotAllowedHonkVerifier at 0xd17EBC027598820815a10a8abDa73bCeB6969135, and the full table is in the README.

The new verifier’s runtime bytecode carries HEAD’s VK_HASH 0x10d07da4...288e and not the old 0x15dfad35...372a, and the adapter’s expectedProgramKey() returns the same value. On my side composed_live.proof returns true at expiry = 1900000000 and reverts with SumcheckFailed() at 1899999999 and at a year later, and the deny and not-permitted fixtures behave the same way. One thing that changed is that verifyProof now needs that real key as programKey, since a zero key fails closed.

Generation 2 stays live, but it is superseded and not expiry-bound, so the addresses from #161 and #162 say nothing about the current circuits. The README says that now too. Would be good to have your VK match and an any-expiry negative run against the new addresses whenever you get to it.

1 Like

Independently reproduced before trusting the claim, not on your word:

  • Sourcify: all 6 named Sepolia addresses (adapter, HonkVerifier, guard, registry, DenyHonkVerifier, NotAllowedHonkVerifier) return exact_match right now.
    • cast call 0x46daAC30...331226 "expectedProgramKey()(bytes32)" against Sepolia returns 0x10d07da428220548a6d7c4f405b1c8ded613a92e0b797262985a9ccdb1e6288e – exact match to the HEAD VK_HASH you stated.
    • Cloned the repo fresh at HEAD (212ff1f), ran ExpiryBindingTest against a locally-deployed instance built from that exact source (valid because Sourcify already confirmed the deployed bytecode matches this source, not a separate claim): test_ProofVerifiesUnderTheExpiryItWasProvenWith passes at expiry=1900000000, test_SameProofDoesNotVerifyUnderAStretchedExpiry (+365 days) and test_SameProofDoesNotVerifyUnderAShortenedExpiry (-1) both revert as expected.
    • Ran the full local suite for good measure: 73/74 pass (1 skipped, the live-fork test that needs env vars I didn’t set), including NotAllowedVerifyTest and TransparentDenialAnchorTest – deny and not-permitted fixtures both behave the same way you described.
      VK match + any-expiry negative run both confirmed. Generation 3 checks out clean on every axis I could independently test without your live proof bytes in hand.
1 Like

Thanks for running the VK match and the any-expiry negatives yourself rather than taking my word for it. Nothing outstanding from me on generation 3.

Hi everyone,

We’d like to share our ERC-8274 compliant FlashProve verifier implementation built for verifiable AI inference.

Implementation Repo: https://github.com/trustless-ai/flashprove-onchain-verifier

Our core contribution is a full no_std Rust FlashProve verifier that runs natively inside ZKVM. We wrap the complete recursive proving & verification flow of FlashProve, and finally expose a fully standardized on-chain verifier following the ERC-8274 IProofVerifier interface.

Beyond the primary ZK verification solution, this repository also contains a complete framework for multi-signature attestation-based verification, providing an alternative trust model for on-chain AI verification. Everyone is welcome to review and give feedback.

Brief Background on FlashProve

Official FlashProve Repo: https://github.com/anthropics/FlashProve

FlashProve is Anthropic’s open-source ZK-based provable inference system. It generates zero-knowledge proofs to cryptographically confirm that LLM inference outputs are faithfully produced from a pre-committed model, without exposing private model weights or inference data.

  • Target Model: Llama 4 Maverick (400B MoE, 4-bit quantized)
  • Proving Performance: ~110 tokens/sec proof generation on a single H100 GPU
  • Proof Scale: ~19MB proof size for 1024-token inference
  • Native Verification: ~17 seconds for full CPU-side verification

This is our early but complete implementation for ERC-8274 AI verification. We’re open to any suggestions and discussions from the community. :folded_hands:

1 Like

@JimmyShi22 A question before I post a related draft, since ERC-8274 targets the same gap for ERC-8183 and ERC-8004.

A bool from verify() folds two different results into false: the proof was checked and is wrong, and the proof could not be checked (the verifier ran out of gas after a repricing, its code is missing, it reverted without data). The consumer’s next step differs. An evaluator should reject on the first and hold on the second; a validator should write a contradiction on the first and nothing on the second. This already bit in my own deployment: EZKL verifiers reject by reverting with no data, which is indistinguishable from running out of gas, so a valid proof could read as invalid after a gas repricing. I’ve published it as a known issue and fixed it forward in v3.1: a false that leaves less than 1/16 of the gas allowance unspent is now “could not check”, because unspent gas after exhaustion grows with call depth as roughly 1 − (63/64)^d.

The draft I’m preparing has three outcomes (Unverifiable = 0, Valid = 1, Invalid = 2, so an empty return is “no decision”, not a rejection) and an immutable registry whose entry id commits to the verifier’s code, adapter and gas allowance, so a consumer that stored an id knows exactly what will run. Your IProofVerifier backends could sit behind it unchanged.

Would you take a status return into ERC-8274, or would you rather keep the two separate, with ERC-8274’s bool as one adapter type? If the thread stays quiet, I’ll post the draft as its own topic around 8 December and link it here.

Who else is building against ERC-8274’s interface today?

1 Like

@JimmyShi22, following up on my post above: instead of asking ERC-8274 to change its return type, I’ve written the three-outcome status up as a separate draft ERC.

Topic: Draft ERC: Content-Addressed Proof Verifier Registry
PR: Add ERC: Content-Addressed Proof Verifier Registry by achemperety · Pull Request #2297 · ethereum/ERCs · GitHub

It leaves ERC-8274’s interface as it is. A contract serving this check through IProofVerifier returns true only for Valid, false only for Invalid, and reverts when the proof could not be checked (the verifier reverted, ran out of gas, or gave a malformed answer). So an ERC-8274 caller never reads false as “not checked”.

One question about your no_std FlashProve verifier: when it can’t finish a check (out of gas, an unsupported key, an internal error), does it revert or return false? If it returns false, my mapping reads that as Invalid, and a consumer would reject work that was never actually checked. If it reverts, the rule works as written. Your answer decides whether the draft needs an extra case for ERC-8274 verifiers. If anyone else here has an ERC-8274 verifier deployed, the same question applies to yours.

1 Like

Hi, achemperety thanks for raising this and for writing up the gas-budget approach. It’s a good point: a check that couldn’t finish shouldn’t be treated as a proof that was checked and rejected.:+1:

I noticed that the [Dec 3 All Core Devs agenda](All Core Devs - Execution (ACDE) #250, December 3, 2026 · Issue #2316 · ethereum/pm · GitHub) listed both STRICTCALL and CALLSTATUS for consideration. It looks like this is a broader EVM call issue, and it’s hard to distinguish every failure reliably at the ERC layer. In the meantime, the explicit gas budget you propose seems like a practical way to avoid starting a check without enough gas. [ERC-8489 §6.3](ERC-8489: Agent Information Flow Paradigm) has a similar pre-call check that might be useful as a reference.

For the ERC-8274 part, I wonder if we could capture this in a small docs PR without changing the interface: a gas-budget example in the Reference Implementation and a note in Security Considerations on why an incomplete check shouldn’t return `false`. If you’re interested in putting up a PR, I’d be happy to take a look and work through the wording together. :handshake:

Thanks, Jimmy. Yes, I’ll put up the docs PR, against ERCS/erc-8274.md, with no interface change:

  1. Security Considerations: a note that an IProofVerifier which cannot finish a check (out of gas, missing code, an internal revert) should revert rather than return false, because a caller acts on false as a checked rejection.
  2. Reference Implementation: a short gas-budget example in which the caller checks before the call that it can forward the verifier’s declared budget (accounting for the 63/64 rule), and treats a revert from verify() as “not checked”, never as false.

Thanks for the ERC-8489 pointer. Its pre-call check is the same idea, and I’ll keep the wording close to it. On the EVM side, EIP-8456 (CALLSTATUS) would let a caller tell revert from halt directly instead of inferring it from leftover gas. If it ships, the gas heuristic in my draft becomes a fallback rather than the rule. I’ll send the PR here within a day or two, and I’m happy to work through the wording with you and the other authors there.

@JimmyShi22 here’s the docs PR: Update ERC-8274: Note incomplete checks and add a gas-budget caller example by achemperety · Pull Request #2300 · ethereum/ERCs · GitHub

No interface change. It adds an “Incomplete checks” note to Security Considerations and a gas-budget caller example to the Reference Implementation. All checks pass.

One finding from testing the example: a plain Solidity low-level call underfunds the verifier on large proofs. The compiler copies the encoded calldata again after the gasleft() check, and that copy grows with proof size. With a 96 KB proof the verifier got about 438,000 gas instead of its 499,000 budget, under both the default and --optimize settings; only --via-ir avoided it. So the example uses a short assembly call that forwards the pre-encoded data directly. It passed every case, including no code, revert, out of gas and malformed return, in all three compiler modes. If you’d prefer no assembly in the ERC, the alternative is a note that callers must measure gas after encoding.

There’s also an open question in the PR description about the SP1ProofVerifier example, which describes a verifier that reverts on invalid proofs. Happy to work through that with you and the other authors there or in the Telegram group.

2 Likes

PR 2300 is merged. Thanks, Jimmy, for the quick review and the suggestion on AgentVerifier, and thanks, babyblueviper1, for the approval and the answer on SP1.

I agree that the SP1ProofVerifier wrapper should change, not only the comment: it should return false for SP1’s own invalid-proof error and re-raise everything else. One addition: for Groth16, matching the error is not enough. SP1’s Groth16 verifier also reverts with ProofInvalid() when its pairing call runs out of gas. With SP1’s own valid v6.0.0 test proof, I get ProofInvalid() at every gas limit I tried from 43,400 to 225,200, and success from 225,300. So the wrapper also has to check, before the call, that it can forward enough gas, as BudgetedCaller does. Plonk did not show this: its InvalidProof() never appeared for a valid proof at any gas limit I tried.

Unless another author objects, I’ll draft that as a follow-up PR.

1 Like

Follow-up PR for the SP1 example: Update ERC-8274: Make the SP1 example return false only for checked rejections by achemperety · Pull Request #2303 · ethereum/ERCs · GitHub

It returns false only when SP1 reverts with its own invalid-proof error and the call left more than 1/16 of the gas budget unspent, and re-raises everything else. Against SP1’s own Groth16 and Plonk verifiers (v4.0.0-rc.3 and v6.0.0), a valid proof never yields false at any gas limit tested, even with a budget set 20% below the verifier’s cost; with a budget at least 10% above cost, a wrong outputHash or programVKey still gives false. The cost is stated in the PR: most corrupted proofs read as “not checked” rather than rejected, so a malformed proof can’t get a job rejected. Review welcome.

1 Like

Hey @achemperety, that is useful info, and this seems like another case where we need strict gas for contract calls

The SP1 Groth16 case shows why the budget check matters so much: once the verifier gets less than it needs, a valid proof comes back as ProofInvalid(), and nothing outside the verifier can tell the difference, not even a status code like CALLSTATUS, since the error is made inside it.

BudgetedCaller does that check today, with a margin for the charges between the gasleft() check and the call. As you found with the calldata copy, that margin depends on the compiler and on the gas schedule, so a repricing can break it again.

This is what I proposed EIP-1930 (STRICTCALL) for, and as @JimmyShi22 mentioned it was moved to PFI for Hegotá on ACDE #250. The gas argument becomes a requirement checked by the EVM after every charge: if the verifier cannot get gasBudget, the calling frame halts as out of gas. No margin, no assembly.

One nuance though: STRICTCALL guarantees the verifier gets gasBudget, not that gasBudget is enough. What the verifier needs also changes with the gas schedule. So gasBudget should not be hardcoded in the caller (or fixed in a registry entry). It should come from whoever signed the request, the party that loses if the check is wrong, and the contract enforces it with STRICTCALL so nobody in between can give less. A registry could still keep a minimum, since more gas is harmless.

It would not help callers already deployed, only new ones.

Spec and discussion: EIP-1930: Strict gas semantics for CALL variant

@wighawag thanks, that’s a clear account, and I agree on both counts: CALLSTATUS can’t help here because the ambiguous ProofInvalid() is produced inside the verifier, and the margin in BudgetedCaller depends on the compiler and the gas schedule, so it is the fragile part. If STRICTCALL ships, I’d use it in my draft’s check in place of the margin.

On who sets gasBudget, one addition from the classification side. In my draft, a false return counts as a rejection only if more than 1/16 of the budget was left unspent; otherwise it reads as “not checked”. With that rule, a budget that is too small never turns a valid proof into a rejection; it only delays the outcome until someone presents the proof with more gas. So the budget doesn’t need to be signed or fixed. Whoever presents the proof can choose it, at or above a minimum kept in the registry. That also answers your repricing point: a request signed today wouldn’t be stranded by a later fork, because the presenter just supplies more. STRICTCALL would then guarantee that the chosen amount actually reaches the verifier.

I’m going to test this before changing the draft. If you see a case where a presenter-chosen budget lets someone force a wrong rejection, I’d like to hear it.

Yes, that works, nice. If a budget that is too small can only give “not checked”, then the presenter can choose it, and STRICTCALL makes sure what they chose is what the verifier gets.

I had a look at SP1’s verifiers (v4.0.0-rc.3 and v6.0.0) to see if anything breaks the 1/16 rule. Every precompile call there forwards gas(), so a pairing that runs out of gas burns almost everything, good.

But both entry points call themselves externally first (this.verifyProof for Groth16, this.Verify for Plonk), and each frame keeps 1/64. So when the pairing runs out of gas, about 2/64 of the budget comes back, not 1/64. Still under 1/16, but with half the margin. A verifier nested about 4 frames deep, or one that gives an inner call a fixed amount of gas instead of gas(), would turn a valid proof that ran out of gas into a checked rejection.

So I think the registry should only accept verifiers where that holds (forward gas() everywhere, shallow nesting), or measure the unspent share for each verifier when it is added.

The other case is liveness: “not checked” is only harmless if anyone can present again before the job expires. If only one party can present, they can underfund on purpose and nothing gets decided.

1 Like

Thanks for reading SP1 that closely. The 2/64 from the self-call fits what my draft assumes: the 1/16 threshold covers up to four frames between the check and the exhausted call (1 − (63/64)^4 ≈ 6.1%, just under 6.25%), so SP1 uses two of the four. The fixed-gas case is the real hole: an inner call given a fixed amount can run out while the outer frame keeps most of the budget, and a 0 then reads as a checked rejection. The draft says adapters must not confuse the two but doesn’t name this case. I’ll make it a MUST for adapters and targets: every call below the check forwards all available gas, at most four frames deep. The registry can’t check that on-chain, so I’ll extend the reference probe to do the per-verifier measurement you suggest: run a valid proof across budgets below its cost and record the largest unspent share, which has to stay clearly under 1/16.

On liveness, agreed. In the draft’s mappings anyone may present, and that’s what makes presenter-chosen gas harmless. I’ll write it down as a requirement for any consumer that relies on it instead of leaving it implicit.

Following up with numbers, as you suggested: I measured the unspent share per verifier instead of relying on the depth bound. Running each reference EZKL entry’s valid proof at every budget from half its cost to its cost, in 250-gas steps, the largest unspent share was 1.78% (solo) and 1.75% (K=8), both just below the cost, where the verifier runs out inside its final pairing. The bound at their actual depth of two frames is 3.10%, and step 6 uses 6.25%. The draft now requires all-gas calls at most four deep, and recommends this measurement for each entry on each chain where it is used.

The probe is public, so the numbers can be reproduced: exactzk-zk-inference-escrow/measurements/2026-12-05-depth-probe at main · achemperety/exactzk-zk-inference-escrow · GitHub

1 Like

ERC-8274: A note on return values and verification failures

The current draft distinguishes between a proof that was checked and rejected and a check that couldn’t finish:

  • true: the check finished and the proof passed.
  • false: the check finished and the proof didn’t pass.
  • revert: the check couldn’t finish, so there’s no verdict.

The idea was to keep the same simple return value across different proof systems. The reasons a check can’t finish may differ from one verifier to another, and each implementation can explain why in the revert data when it’s able to.

An explicit status code with an optional message could work too. That would let the verifier return Unverifiable directly when it can, though the caller would still need to handle cases where the call reverts without returning a status.

I’d be interested to hear how others see this. Is true / false plus a revert easier to work with, or would an explicit status make the distinction clearer? The draft can still change, and it would be good to work through what makes the most sense together.

@wighawag, thanks for bringing `STRICTCALL` into the discussion and for tracing the calls in SP1. The self-call example made the gas issue much clearer: each call can leave some gas in its caller, so the outer wrapper can still see gas left even if the pairing call ran out. `STRICTCALL` addresses a separate part of that problem: it makes sure the verifier actually receives the requested budget, without the caller having to estimate a margin. It doesn’t tell us whether that budget is enough to finish the check. Your point about retries makes sense too. If only one party can submit, keeping the result as “not checked” still doesn’t help the job move forward when nobody else can retry before the deadline.

@achemperety, thanks for following up with the measurements. It was helpful to see the test start with a valid proof and vary the gas budget below what the verifier needed, rather than rely on the call-depth estimate alone. The two Halo2 entries left at most about 1.78% and 1.75% of the budget unspent in those runs, both below the 6.25% threshold. That gives a concrete basis for treating those cases as “not checked” rather than “rejected,” and gives other implementers a test they can repeat with their own verifiers. I appreciate you writing up both the results and the conditions they depend on.

1 Like

Happy to help, and thanks for writing it up :slight_smile:

I would keep true / false + revert for the base interface. The important rule is that false only means a checked rejection.

An explicit Unverifiable can be useful when the verifier knows it, but callers still have to handle a revert or empty return anyway. So the simple interface plus revert data for the reason gets my vote.

Measured the same thing for SP1, since @wighawag’s point was about its self-calls. Behind an ERC-8535 adapter, the largest unspent share below cost is 4.20% for Groth16 v4.0.0-rc.3 and 4.09% for v6.0.0, against 1.78% for the EZKL entries. That’s the extra frame showing up, as he predicted: still under 6.25%, but with less margin. Plonk stays at about 3.5%. A valid proof never read Invalid at any supplied gas. Code and the full table: exactzk-zk-inference-escrow/adapters/sp1 at main · achemperety/exactzk-zk-inference-escrow · GitHub