使用Why3的以太坊智能合约的演绎证明
Deductive Proof of Ethereum Smart Contracts Using Why3
摘要:
bug或错误是任何软件或计算机程序都可能遇到的常见问题。这可能是由于程序编写不当、键入错误或存储管理不当造成的。然而,如果不安全的程序用于关键系统,错误可能成为一个重大问题。因此,这类系统的形式化方法是非常必要的。在本文中,我们使用一种形式语言,对基于智能合约的以太坊区块链应用程序进行演绎验证,智能合约是自动执行的数字合约。区块链系统操纵加密货币和交易信息。因此,如果区块链中发生错误,可能会发生严重的后果,例如金钱损失。因此,本文的目的是提出一种专门用于演绎验证的语言,称为Why 3,作为编写正式和验证智能合约的新语言,从而避免利用此类合约执行漏洞的攻击。我们首先编写Why 3智能合约程序;接下来我们制定规范以证明不存在运行时错误属性和函数属性,然后我们使用Why 3系统验证程序的行为。最后,我们将Why 3合约编译到以太坊虚拟机(EVM)。此外,我们给出了一组通用的数学语句,可以验证适合任何类型的持有加密货币的智能合约的功能属性,这表明Why 3可以成为编写智能合约的合适语言。为了说明我们的方法,我们描述了其应用到一个现实的工业用例。
英文摘要:
A bug or error is a common problem that any software or computer program may encounter. It can occur from badly writing the program, a typing error or bad memory management. However, errors can become a significant issue if the unsafe program is used for critical systems. Therefore, formal methods for these kinds of systems are greatly required. In this paper, we use a formal language that performs deductive verification on an Ethereum Blockchain application based on smart contracts, which are self-executing digital contracts. Blockchain systems manipulate cryptocurrency and transaction information. Therefore , if a bug occurs in the blockchain, serious consequences such as a loss of money can happen. Thus, the aim of this paper is to propose a language dedicated to deductive verification, called Why3, as a new language for writing formal and verified smart contracts, thereby avoiding attacks exploiting such contract execution vulnerabilities. We first write a Why3 smart contracts program; next we formulate specifications to be proved as absence of RunTime Error properties and functional properties, then we verify the behavior of the program using the Why3 system. Finally we compile the Why3 contracts to the Ethereum Virtual Machine (EVM). Moreover, we give a set of generic mathematical statements that allows verifying functional properties suited to any type of smart contracts holding cryptocurrency, showing that Why3 can be a suitable language to write smart contracts. To illustrate our approach, we describe its application to a realistic industrial use case.
机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。