EVM bytecode, verified in Lean 4

Nothing but
the bytes.

Blanc proves theorems about Ethereum contracts as they are deployed: the exact bytes at mainnet addresses — compiled by solc and Vyper, or written by hand in assembly — read without trusting the tools that produced them.

Every theorem is stated against Jaune, an executable semantics of the EVM and of block processing that passes all 73,345 blockchain-test cases of Ethereum’s [email protected] fixtures for the forks from Byzantium through BPO2. Lean’s kernel checks every proof, and none uses an axiom beyond Lean’s three standard ones. Gas is exact, so a theorem can say not only that a contract keeps its books, but that a transaction sent to it is admitted, and exactly what it costs.

Historical exhibits outside paper v2, including WETH9, Beacon deposit, Lido, Uniswap and Blanc-native programmes, are preserved in the archived corpus. The archive is outside the live corpus and is not promised to build against later revisions.

The corpus

The live deployed artifacts. None written for a verifier.

Two source languages and hand-written assembly (solc 0.4.24 and 0.6.12, Vyper 0.2.4, 0.2.15 and 0.3.7, and assembly). The bytes are the ones separately operated providers return for each address; Blanc reads them through certificates the kernel checks, and nothing was recompiled.

ArtifactProduced byRuntimeDeployedWhat is proved
USDCA proxy, its implementation and a signature library solc 0.4.24, 0.6.1227,391 BAug 2018 Its ledger, read through the implementation’s own decoder, obeys the token laws, signed messages included, under a governance premise.
Curve 3CrvLP token of Curve’s DAI/USDC/USDT pool Vyper 0.2.42,276 BSep 2020 Every successful call is exactly a step of a token model; storage replays exactly the committed calls; supply equals the sum of balances.
Curve 3poolCurve’s DAI/USDC/USDT pool Vyper 0.2.421,199 BSep 2020 Storage replays the pool’s model over exactly the committed calls; its liquidity functions run at exact gas, given the coins’ answers; in one history with 3Crv, the LP supply moves by exactly the pool’s mints and burns; its virtual price is shown not to be monotone.
Curve pool, vulnerableBehind three pools drained in July 2023 Vyper 0.2.1517,535 BJul 2021 The cross-function reentrancy, executed from deployment: the ledger ends with a supply of 1,800 against an attacker balance of 1,906.
Curve pool, fixedBehind the ETH/stETH-ng pool Vyper 0.3.718,320 BApr 2023 Inside any of its five mutating guarded functions, until the lock is released, no call nested at any depth enters any of its seven guarded functions, whatever code runs in between, provided no hash the pool computes lands on the lock’s slot.
EIP-7002 contractThe protocol’s withdrawal-request queue assembly504 BFeb 2025 The end-of-block call succeeds whatever storage holds; each block’s requests are exactly the oldest pending submissions, in order; the EIP’s fee guarantee is refuted for these bytes.

Full addresses, code hashes and recorded creation provenance are on each artifact’s page and in the claim map; USDC and the 3pool, which have no page yet, are in the claim map only.

What a result should answer

Six questions to ask of any verification result.

Each has been answered before; to our knowledge, never all six at once. For the live artifacts above, Blanc addresses every one; the claim map says how far each answer goes.

Is it about the code that runs?

About the deployed bytes themselves, not the source and not a recompilation, so no compiler stands in the trust base. In 2023 that distinction cost Curve’s pools: their source asked for one shared reentrancy lock, and the compiler emitted one lock per function.

What does the proof rest on?

Lean’s kernel and its three standard axioms, propext, Classical.choice and Quot.sound. A walk from every constant of the library reaches nothing else: no sorry, no native evaluation, no axiom about Keccak-256.

Was the code written for the verifier?

No. solc 0.4.24 and 0.6.12, Vyper 0.2.4, 0.2.15 and 0.3.7, and 504 bytes of hand-written assembly the protocol runs. None of it was shaped for Blanc’s tools.

Is the machine the real machine?

Jaune defines the machine, every transaction type, block validation, system calls, withdrawals and requests, every precompile from ecrecover to BLS12-381, and fork selection by schedule — and it runs: 73,345 of 73,345 blockchain-test cases pass, Byzantium through BPO2, run through the core of the block transition the theorems quantify over.

Does the theorem matter?

The properties are the ones people rely on: withdrawal requests delivered first in, first out, a lock that actually excludes, a ledger that balances.

Does it say the contract works?

A contract that always reverts satisfies every invariant. Exact gas lets Blanc construct successful executions too, as the EIP-7002 system-call result below illustrates.

And a seventh: does a theorem’s starting point hold of the live contract?

For the EIP-7002 contract, yes: at the last block before Prague, mainnet’s storage held exactly the model’s initial state, with the storage root it had at deployment.

Selected results

What the theorems say.

The protocol’s own code

A system call that cannot fail, and a queue that cannot cheat.

EIP-7002 contract · 0x0000…7002 · 504 bytes · hand-written assembly

Since Prague, every withdrawal request triggered from the execution layer passes through a 504-byte contract, and a block whose end-of-block call to that contract fails is invalid. With its canonical code installed, Blanc proves that this call succeeds whatever the contract’s storage holds, using at most 210,000 gas, and that no history removes the code. Each block’s requests are exactly the oldest pending submissions — at most sixteen, in order, none dropped, duplicated, reordered or emitted early — and an entry at position q of the queue is emitted exactly ⌊q/16⌋ blocks later.

The same bytes refute the EIP’s own fee guarantee. The specification computes its fee over unbounded integers; the bytecode computes it in 256-bit words. Blanc proves the bytecode’s fee never exceeds the specified one, equals it exactly when no intermediate value wraps, and builds a three-block history in which a committed submission paid less than the EIP requires. By direct computation the two fees first differ where the specified one already exceeds all the ether in existence more than 1047 times; two pre-deployment audits had flagged the overflow.

EIP-7002, in full
Curve StableSwap pools

The bug that compiled, and the fix.

Vyper 0.2.15 · 0x6326…B43E · and Vyper 0.3.7 · 0x847e…4ed9

On 30 July 2023, attackers drained several Curve pools. Their source marked every liquidity function @nonreentrant('lock'), asking for one shared lock; Vyper 0.2.15, 0.2.16 and 0.3.0 gave each function a lock of its own. A proof about the source would have certified the guard.

Blanc reads the bytes. On the vulnerable implementation behind three of the drained pools, Jaune executes the attack from deployment: remove_liquidity takes its lock in slot 2 and sends ether; the callback enters add_liquidity, whose lock sits in slot 0, and mints; the outer call writes back a stale supply. The ledger ends at a supply of 1,800 against an attacker balance of 1,906. On an implementation compiled by Vyper 0.3.7, Blanc proves that while any of its five mutating guarded functions holds the lock, no frame beneath it enters any of the seven guarded functions — whatever code runs in between, given only that no hash the pool computes lands on the lock’s slot.

The two pools, in full

How it works

Read the bytes, check the reading, prove about the reading.

EVM bytecode has no structured control flow, and recovering it is a heuristic art. Blanc does not trust whoever performs it. An untrusted program proposes a certificate, a structured reading of the bytes; a decision procedure evaluated by Lean’s kernel accepts it or rejects it against the literal bytes; and generic theorems, proved once for every certificate, carry reasoning about the reading back to the bytes.

  1. Runtime bytesexactly as deployed
  2. Produceruntrusted; proposes entries, abstract stacks and trees
  3. Kernel checkCert.check, Cert.jumpsOk against the literal bytes
  4. Generic theoremslift_sound, lift_exact, the cursor
  1. Frameone execution of the code
  2. Messagechild calls, reverts, settlement
  3. TransactionprocessTransaction: validity, intrinsic gas, refunds, fees
  4. Historyany valid chain of blocks from a checkpoint

lift_sound

Every successful execution of the bytes from program counter 0, on a covered fork, is a run of the certificate’s program — so safety properties of the program hold of the bytes.

lift_exact

Every gas-exact run of the program is a successful execution of the bytes — so a run built forward, one node at a time, becomes a real execution with its exact cost.

The cursor

Places every step of an execution, whatever its outcome, at a checked node of the certificate. A reentrancy lock needs this: a frame that later reverts has still run.

The method in full: committed replay, hashes without axioms, exact gas, deployment, controls

What you trust

A small kernel, three axioms, and two facts the proofs take from the world.

73,345conformance cases Jaune passes, of 73,345 selected, at the revision Blanc pins
29gates in the catalogue

Checked by the kernelEverything that is proved

  • Every proof, including every certificate check against the literal bytes it reads.
  • The axioms: one from-scratch walk over every declaration of the library reaches propext, Classical.choice and Quot.sound and nothing else. It does not rely on #print axioms, which can under-report.
  • The statements: an example per pin restates each headline theorem, and each definition its claim is stated through, exactly.
  • The public account: a gate resolves every declaration the claim map cites to its file and line and recomputes every artifact’s code hash from the lifted bytes.

Trusted, and testedWhat the proofs do not establish

  • That Jaune’s definitions match Ethereum. Not provable; tested by the fixtures above, run through the core of the block transition the theorems quantify over.
  • That the lifted bytes are the chain’s. At least two separately operated providers return identical code for every address read from mainnet; this is recorded provenance, not yet a proof from a block’s state root.

And every theorem has premises. Whoever applies one must discharge its hypotheses, and its statement is its specification: the kernel checks proofs, not whether a statement says what a reader wants. The statements are written to be read, and the claim map locates every one.

Blanc, the language

For bytes not yet written: a language whose compiler is a theorem.

Blanc began as a programming language: the EVM’s own instructions, arranged by four constructors. Its compiler’s correctness is a Lean theorem, so a property proved of a Blanc program is a fact about the bytes that deploy. Its former contract corpus is archived; the history, settlement and liveness machinery it developed also supports the lift of deployed bytecode.

Writing in Blanc buys what reading cannot: authoring lets one choose proof-friendly layouts. Its former contract corpus is archived (see the archive note above).

The language

Blanc/Semantics.lean — the whole syntax
inductive Func : Type
  | branch : Func → Func → Func
  | last : Linst → Func
  | next   : Ninst → Func → Func
  | call   : Nat → Func

structure Prog : Type where
  (main : Func)
  (aux : List Func)

-- Blanc/CommonCore.lean: every successful EVM execution
-- of the compiled bytes is a run of the source program.
theorem correct (sevm : Sevm) (pre : Devm) (p : Prog) (post : Devm)
    (exc : Exec 0 sevm pre (.ok post))
    (eq : some sevm.code.toList = p.compile) :
    Prog.Run sevm pre p post
Four constructors — branch, last, next, call — and nothing else; the compiler’s one real job is placing jumps.

Who wrote the proofs

Written by agents. Checked by the kernel.

The lift of deployed bytecode was written by AI agents, under one author’s direction and on top of the existing stack. The retained Blanc library contains 467,521 lines of Lean, counting Blanc.lean and sources under Blanc/; executable, audit-script and dependency sources are excluded. The historical 2026-09-25–10-09 lift campaign remains a separate, dated measurement. The coordinator–worker workflow they ran in, Creme, accepts a result only on the gate catalogue’s verdict for the exact commit.

Lean’s kernel checks an agent’s proof exactly as it checks a person’s. The trust never lived in the author; it lives in the kernel, the axioms, and the statements, which are there to be read.

Limits

Where the theorems stop.

Each artifact’s page and the claim map state these precisely; here they are in one place.

Every disclosure, item by item

  1. Live state. The theorems that start from an actual creation transaction assume that mainnet’s history since is valid under Jaune’s rules, and take the creation block’s facts as fetched from providers.
  2. Amsterdam. Jaune runs it, but no theorem here is stated for it: every history theorem requires each block to run under a fork no later than BPO2.
  3. Premises. Signature recovery, for theorems over every signed transaction; callee behaviour, where success depends on another contract; hash separation over the keys a history touches.
  4. Byte identity. That the lifted bytes are mainnet’s rests on providers agreeing, not on a proof from a block header’s state root.
  5. Few compositions. The Curve 3pool is composed with 3Crv over one history; elsewhere a theorem takes the answers of the contracts it calls as inputs.
  6. Witness scope. The message-level Vyper witnesses use sequences of messages with synthetic token, attacker and receiver code. The separate vulnerable-pool transaction witness has its own stated premises.
  7. Admission, not inclusion. Liveness theorems execute a transaction at a given state or block position and say exactly what it does and costs; whether any block will include it is outside them.
  8. Constant jump targets. Certificates accept a jump only to a known constant destination or a function’s own return address; code that jumps to computed targets cannot yet be certified.

Check it yourself

One clone, one build, and the gates.

You need git, curl, Python 3 and elan, Lean’s toolchain manager. Blanc pins Jaune by an immutable commit in its lakefile, so “which semantics was this proved against” always has a one-line answer.

The axiom walk follows every constant of the library once and reports the leaf results; the pin gate elaborates every pinned statement; the claim-map gate checks the public account of the deployed results against the tree; the certificate gate regenerates every certificate from its input and compares it byte for byte. scripts/check-gates.sh --fresh runs the whole catalogue, whose commands and pass criteria are in scripts/GATES.md.

$ git clone https://github.com/skbaek/blanc && cd blanc$ lake exe cache get$ scripts/check.sh$ scripts/check-claims.sh$ scripts/check-deployed-claim-map.sh$ scripts/check-lift-certificates.sh

scripts/check.sh builds the library before it walks the axioms. The two verdict lines illustrate successful runs at the generated counts; run the commands to obtain a verdict for your checkout. At the historical pre-retirement commit 5048a51f, rebuilding its 1,482 root-imported modules from source, with the toolchain and pinned dependencies already built, took 4,380 seconds on a 10-core Apple M5 with 24 GiB of memory. This is not a timing or module count for the current paper-v2 tree.