arXivDaily arXiv每日学术速递 周一至周五更新
感恩节,周五至周末无更新,大家顺遂。周一再来吧
arXiv 2104.10274cs.PL
收藏

以太坊智能合约验证的丰富规范

Rich Specifications for Ethereum Smart Contract Verification

Christian Bräm, Marco Eilers, Peter Müller, Robin Sierra, Alexander J. Summers

摘要:

智能合约是在以太坊等区块链内部执行的程序,用于操纵数字资产。由于智能合约中的错误可能会导致重大的财务损失,因此人们对正式证明其正确性非常感兴趣。然而,智能合约的规范和验证面临着在其他应用领域中不会出现的挑战。智能合约经常与未经验证的、可能具有对抗性的外部代码交互,这大大削弱了正式分析可以(合理地)做出的假设。此外,智能合约的核心功能是操纵和转移资源;简明地描述此功能需要专门的规范支持。目前的推理技术并没有完全解决这些挑战,限制在其范围或表现力(特别是,在存在可重入调用),并提供有限的手段来表达合同执行的资源转移。在本文中,我们提出了一种针对智能合约领域的新型规范方法。我们的规范结构和相关的推理技术是第一个实现:(1)在存在未经验证的代码和任意重入的情况下进行合理和精确的推理,(2)关于协作智能合约的模块化推理,以及(3)基于资源和资源转移的特定于域的规范,允许以直观和简洁的方式表达合约的行为,并在默认情况下排除典型错误。我们已经在2 vyper中实现了我们的方法,2 vyper是一个基于SMT的自动验证工具,用于用Vyper语言编写的以太坊智能合约,并证明了它在简洁地捕获和验证真实世界合约的强正确性保证方面的有效性。

英文摘要:

Smart contracts are programs that execute inside blockchains such as Ethereum to manipulate digital assets. Since bugs in smart contracts may lead to substantial financial losses, there is considerable interest in formally proving their correctness. However, the specification and verification of smart contracts faces challenges that do not arise in other application domains. Smart contracts frequently interact with unverified, potentially adversarial outside code, which substantially weakens the assumptions that formal analyses can (soundly) make. Moreover, the core functionality of smart contracts is to manipulate and transfer resources; describing this functionality concisely requires dedicated specification support. Current reasoning techniques do not fully address these challenges, being restricted in their scope or expressiveness (in particular, in the presence of re-entrant calls), and offering limited means of expressing the resource transfers a contract performs. In this paper, we present a novel specification methodology tailored to the domain of smart contracts. Our specification constructs and associated reasoning technique are the first to enable: (1) sound and precise reasoning in the presence of unverified code and arbitrary re-entrancy, (2) modular reasoning about collaborating smart contracts, and (3) domain-specific specifications based on resources and resource transfers, which allow expressing a contract's behavior in intuitive and concise ways and exclude typical errors by default. We have implemented our approach in 2vyper, an SMT-based automated verification tool for Ethereum smart contracts written in the Vyper language, and demonstrated its effectiveness in succinctly capturing and verifying strong correctness guarantees for real-world contracts.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑