Accessible Smart Contracts Verification: Synthesizing Formal Models with Tamed LLMs

📅 2025-01-22
📈 Citations: 0
Influential: 0
📄 PDF
🤖 AI Summary
Formal verification of smart contracts faces high modeling barriers and excessive time investment, particularly for non-experts. Method: This paper proposes a three-stage automated modeling approach: (1) code translation to generate formal model stubs; (2) prompt-engineering-driven fine-tuning of large language models (LLMs) to inject precise semantic content; and (3) iterative refinement guided jointly by a syntax validator and semantic equivalence feedback. Contribution/Results: It establishes the first controlled application of LLMs in formal model synthesis, jointly optimizing syntactic correctness and semantic fidelity. Experiments demonstrate substantial reduction in model construction time, enabling non-formal-methods experts to perform high-confidence correctness audits efficiently. The approach significantly lowers the practical barrier to adopting formal verification in smart contract development.

Technology Category

Application Category

📝 Abstract
When blockchain systems are said to be trustless, what this really means is that all the trust is put into software. Thus, there are strong incentives to ensure blockchain software is correct -- vulnerabilities here cost millions and break businesses. One of the most powerful ways of establishing software correctness is by using formal methods. Approaches based on formal methods, however, induce a significant overhead in terms of time and expertise required to successfully employ them. Our work addresses this critical disadvantage by automating the creation of a formal model -- a mathematical abstraction of the software system -- which is often a core task when employing formal methods. We perform model synthesis in three phases: we first transpile the code into model stubs; then we"fill in the blanks"using a large language model (LLM); finally, we iteratively repair the generated model, on both syntactical and semantical level. In this way, we significantly reduce the amount of time necessary to create formal models and increase accessibility of valuable software verification methods that rely on them. The practical context of our work was reducing the time-to-value of using formal models for correctness audits of smart contracts.
Problem

Research questions and friction points this paper is trying to address.

Formal Model Checking
Smart Contracts
Blockchain Software
Innovation

Methods, ideas, or system contributions that make the work stand out.

Large Language Models
Formal Verification
Blockchain Smart Contracts
🔎 Similar Papers
No similar papers found.