🤖 AI Summary
This work addresses subtle vulnerabilities in zkEVM implementations—such as incorrect gas computations—that can yield semantically flawed yet formally valid zero-knowledge proofs, thereby compromising system security. Existing formal verification approaches rely on manually crafted specifications, limiting their scalability. To overcome this, the paper introduces VeriSynth, a novel hybrid framework that uniquely combines large language models (LLMs) as a formalization frontend with SMT solvers as correctness oracles. Through semantic decomposition, retrieval-augmented prompting, and verification-guided self-repair, VeriSynth automatically translates Rust-based zkEVM opcodes into executable symbolic constraint models in Python/Z3, enabling closed-loop constraint synthesis and repair. Evaluated on the first source-level zkEVM verification benchmark, VeriSynth achieves over 90% vulnerability detection accuracy, substantially outperforming pure LLM approaches, conversational baselines, and industrial-grade handcrafted test suites, with ablation studies confirming the necessity of each component.
📝 Abstract
Zero-Knowledge Ethereum Virtual Machines (zkEVMs) secure Ethereum rollups by generating zero-knowledge proofs that guarantee off-chain execution correctness. However, subtle implementation bugs (e.g., incorrect gas accounting) can lead to valid proofs certifying semantically faulty states, thereby silently defeating cryptographic guarantees. Formal verification via SMT solvers can prevent this, but is bottlenecked by specification: current zkEVM development practice lacks automated methods to translate Rust opcode handlers into verification models. Current practices rely on unsustainable manual specifications, while LLM-based approaches suffer from hallucination and lack formal guarantees. To address this, we propose VeriSynth, a framework that synthesizes executable Python/Z3 verification models from Rust zkEVM code. VeriSynth enforces a hybrid paradigm: an LLM acts strictly as a formalization frontend to translate code into symbolic constraints, while an SMT solver serves as the correctness arbiter. To handle complex multi-component state transitions, VeriSynth integrates semantic decomposition, retrieval-grounded prompting, and verification-guided auto-repair into a closed-loop pipeline. We evaluate VeriSynth on the first source-level zkEVM verification benchmark, encompassing both correct and faulty opcode implementations. VeriSynth achieves a bug detection rate of over 90%, substantially outperforming direct and conversational LLM baselines, as well as a production-grade handwritten mutation-testing suite. Ablation studies confirm that each pipeline component is critical to the framework's overall effectiveness.