用可控大模型自动构建智能合约形式化模型,大幅降低验证门槛。
Accessible Smart Contracts Verification: Synthesizing Formal Models with Tamed LLMs
- 分三步合成形式化模型:代码转桩、LLM填空、迭代修复
- 相较人工建模提速数倍,支持快速开展合约正确性审计
- 适合安全团队、开发者快速落地形式化验证
当区块链被称为无信任时,实际上意味着所有信任都寄托于软件。因此,确保区块链软件正确至关重要——其中的漏洞可能造成数百万损失并导致企业崩溃。形式化方法是保障软件正确性的强大手段,但其应用需要大量时间和专业知识。本文通过自动化生成形式化模型(即软件系统的数学抽象)来克服这一障碍。我们采用三阶段方法:首先将代码转换为模型模板;接着利用大语言模型填充空白;最后在语法和语义层面迭代修复生成模型。该方法显著缩短了构建形式化模型所需时间,提升了依赖此类模型的软件验证方法的可及性。研究背景是缩短智能合约正确性审计中形式化模型的使用周期,加速价值实现。
原文摘要 · Abstract (English)
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.
Thank you to arXiv for use of its open access interoperability. PaperDance 不是 arXiv 官方产品;中文卡片由大模型生成,请以原文为准。