When to Verify Bytecode Instead of Solidity: An EIP-8282 Case Study

Bytecode vs. Solidity modeling for formal verification
Every formal verification method needs a model of the target: you cannot prove properties about raw text.
Raw bytecode has no types, no variable names, and no function boundaries beyond jump destinations. To write a spec a human can actually review, someone first has to "decompile" it: reconstruct something Solidity-shaped out of the opcodes, well enough to name storage slots and recover control flow. That decompilation is itself the model: it is still bytecode-level verification, with a Solidity-shaped interface layered on top.
Two translations instead of one: compile to bytecode, then decompile it back into something a spec can be written against.
Choosing that route means trusting a decompilation pipeline: bytecode translated back into something that looks like Solidity again. We think that is the wrong thing to trust. The Solidity compiler already makes the same translation in the other direction, deterministically, and it is mature enough that no compiler bugs have surfaced in it to date. Most of the bugs we are actually trying to find live in the Solidity logic, not in the compiler, so it makes more sense to trust the compilation step and spend the verification effort where the risk actually is.
That is why our usual route, when a real Solidity source exists, skips decompilation entirely. The Solidity is translated directly into a Verity model, which can be done deterministically, instead of being compiled and then decompiled to be modeled.
Why did the Ethereum Foundation still choose to verify the bytecode on EIP-8282?
The rule above assumes there is a Solidity source worth trusting a compiler for. EIP-8282 does not have one. It adds two Ethereum protocol predeploys, Builder Deposit and Builder Exit, ahead of the Gloas builder-market changes, written directly in low-level EVM assembly (sys-asm/geas). The reference source is already close to bytecode. Unlike the application contracts we usually verify, these predeploys will run directly on every Ethereum node once the fork activates. The Ethereum Foundation asked Verity to formally verify their frozen EVM bytecode at ethereum/sys-asm@83f9801.
The engagement scopes the proof target explicitly to the frozen EVM bytecode rather than the readable sys-asm/geas source. For a predeploy this critical, installed on every Ethereum node ahead of the fork, the Ethereum Foundation wanted no compiler or assembler pipeline anywhere in the trust boundary.
So we reused EVM Yul Lean, an existing executable Lean 4 model of the EVM and Yul, as the interpreter, and built the EIP-8282-specific guarantees on top of it: literal opcode- and program-counter-level Lean definitions, visible and auditable in the proof artifacts. It is the same reconstruction step described above, made explicit and reviewable, because for this target there is no higher-level source to model instead.
| Solidity Model | Bytecode Model | |
|---|---|---|
| Best fit | Contracts with Solidity as the real source of truth | Assembly-native contracts, or when the compiler itself is out of trust scope |
| What gets modeled | The source, translated deterministically | Bytecode decompiled back into something provable, by tooling or by hand |
| Trust assumption | The mature, deterministic Solidity→bytecode compiler | A manual decompilation pipeline, or no compiler trust at all when there is no Solidity to begin with |
| Cost | Lower | Higher: decompiling has to happen at all |
Learn more
The EIP-8282 Interactive Report
Proof repository and ethereum/EIPs#12120.
What is a formal proof? A short introduction for non-specialists.
Thank you to the Ethereum Foundation team for their collaboration throughout this engagement.