Foundational Refinement Proofs for EVM Bytecode, at the Price of Tokens
Abstract
Relating executable code to a high-level model of its behavior has been a central concern of programming-language research for decades. Formally verified compilers, translation validators and certifying compilers address this problem through different trade-offs between proof effort, automation, generality, and the size of the trusted base. Recently, large language models (LLMs) have begun to change the economics of formal verification. Agentic proof development is now capable of producing machine-checked proofs, sometimes unsupervised, at a scale and speed that were previously out of reach. We propose a verification architecture that takes advantage of this shift. An executable obtains a machine-checked proof that it behaves according to a high-level model, independently of the compiler that produced it. The proof is written by an LLM agent. We evaluate the feasibility of this architecture for the Ethereum Virtual Machine (EVM). We build EquiVM, a foundational framework in Lean comprising an executable EVM semantics and a formal specification language, Stele, that gives a high-level authoritative model of the bytecode's behavior, but commits to no source language or compilation toolchain. We state what it means for EVM bytecode to refine a Stele spec and we build a proof library to facilitate proof construction. We evaluate the capabilities of frontier LLMs to construct such proofs, as well as the cost of proof production and repair. Our results show that agents prove 35 real production contracts end to end, without modifying their source or bytecode, among them core contracts of Safe, Morpho, Compound and Uniswap protocols, with bytecode of size close to the maximum the EVM allows. Several proofs need only the initial prompt, the rest a handful of human inputs, and existing proofs are repaired in a fraction of the original time when the source or the compiler configuration changes.
Create a lesson
Related papers
C-to-Rust Translation Validation at the LLVM IR Level via AI-Assisted Refinement Proof
Shared title terminologycs.PLEunsu Kim, Sukyoung Ryu, Jaemin Hong
Flex: A Foundational Proof-Producing Horn Solver
Shared title terminologycs.PLJam Kabeer Ali Khan, Petros Markopoulos, Niki Vazou et al.
CIRT: Calculus of Inductive Refinement Types
Shared title terminologycs.PLAlessio Ferrarini, Niki Vazou, G. A. Kavvos
Mathematical foundations for symmetric programming and reasoning
Shared title terminologycs.PLOhad Kammar, Matija Pretnar
Curriculum proof repair with learned counterexamples
Shared title terminologycs.PLYuechun Sun, Jun Yang, Kexin Pei
Parametric Proof-Carrying Compilation for Quantum Error-Correction
Shared title terminologycs.PLJohn Zhuoyang Ye, Jens Palsberg