Towards Automated Formal Verification of zkEVMs Using LLM-Guided Constraint Synthesis

· Source: cs.SE updates on arXiv.org · Field: Technology & Digital — Artificial Intelligence & Machine Learning, Software Development & Engineering, Blockchain & Distributed Ledger Technology · Depth: Expert, extended

Summary

VeriSynth is a novel LLM-guided framework designed for automated formal verification of Zero-Knowledge Ethereum Virtual Machines (zkEVMs) by synthesizing executable Python/Z3 verification models directly from Rust source code. It addresses the bottleneck of manual specification in zkEVM verification, where subtle bugs like incorrect gas accounting can defeat cryptographic guarantees. VeriSynth employs a hybrid paradigm, using an LLM as a formalization frontend to translate code into symbolic constraints, with an SMT solver acting as the correctness arbiter. The framework integrates semantic decomposition, retrieval-grounded prompting, and verification-guided auto-repair. Evaluated on a 95-sample zkEVM verification benchmark, VeriSynth achieved a 91.6% bug detection rate, significantly outperforming LLM-only (46.3%) and conversational LLM (61.1%) baselines. It also detected 32 more bugs than Scroll's handwritten mutation-testing suite (57.9%), demonstrating its practical value. Each sample consumed approximately 100K tokens, totaling about 9.5M tokens for the benchmark.

Key takeaway

For security engineers and researchers developing or auditing zkEVM implementations, VeriSynth offers a robust approach to detect subtle, implementation-level semantic bugs that manual testing often misses. You should consider integrating LLM-guided constraint synthesis into your verification pipeline to complement existing mutation tests. This can significantly improve bug detection coverage, especially for complex opcode behaviors, by leveraging automated model generation and solver-backed validation to catch inconsistencies before they impact cryptographic guarantees.

Key insights

VeriSynth automates zkEVM formal verification by synthesizing SMT models from Rust code, guided by LLMs and validated by solvers.

Principles

Method

VeriSynth decomposes Rust code into semantic units, retrieves verified examples for grounding, synthesizes Python/Z3 models using an LLM with opcode-aware prompts, and iteratively auto-repairs models based on compiler and solver feedback.

In practice

Topics

Best for: AI Scientist, Research Scientist, Software Engineer

Related on AIssential

Open in AIssential →

Editorial summary, takeaway, and curation by AIssential. Original article published by cs.SE updates on arXiv.org.