KindHML:基于Hennessy-Milner逻辑的智能合约形式验证
KindHML: formal verification of smart contracts based on Hennessy-Milner logic
AI总结:
本文提出一种自动化方法,用于验证智能合约的复杂时间属性,通过将Solidity合约和Hennessy-Milner逻辑的时间规范编码到Lustre中,利用Kind 2模型检查器进行验证,有效检测现有工具无法发现的攻击漏洞。
摘要:
部署在以太坊等区块链上的智能合约经常管理大量资产,其安全性至关重要。实证研究表明,现实世界攻击常利用合约在多个交易中展开的业务逻辑中的漏洞,如流动性攻击或抢先交易攻击。检测这些攻击需要推理超出现有分析工具能力的表达性时间属性。本文提出了一种自动化的方法,用于智能合约的形式验证,使能够指定和验证复杂的时序属性。我们的方法提供了一种完全自动的编码到Lustre——Kind 2模型检查器支持的规范语言——的Solidity合约和基于一阶Hennessy-Milner逻辑的时间规范的子集。这种编码使我们能够利用Kind 2确定合约是否遵守规范。我们实现了一种工具链,集成了翻译和验证步骤,并在智能合约和时间规范的基准上评估了其有效性和性能。我们的结果表明,所提出的方法能够有效验证智能合约的非平凡时间属性,并检测超出现有分析工具范围的违规情况。
英文摘要:
Smart contracts deployed on blockchains such as Ethereum routinely manage large amounts of assets, making their security critical. Empirical studies show that real-world attacks often exploit flaws in the business logic of contracts that unfold across multiple transactions, such as liquidity or front-running attacks. Detecting these attacks requires reasoning about expressive temporal properties beyond the capabilities of existing analysis tools. In this paper, we present an automated approach to the formal verification of smart contracts, enabling the specification and verification of complex temporal properties. Our approach provides a fully automated encoding into Lustre -- the specification language supported by the Kind 2 model checker -- of an expressive subset of Solidity contracts and temporal specifications based on first-order Hennessy-Milner Logic. This encoding allows us to leverage Kind 2 to determine whether the contract respects the specification or not. We implement our approach in a toolchain that integrates the translation and verification steps, and we evaluate its effectiveness and performance on a benchmark of smart contracts and temporal properties capturing complex attack scenarios. Our results show that the proposed approach can effectively verify non-trivial temporal properties of smart contracts and detect violations that are beyond the reach of existing analysis tools.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。