arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 1912.04051cs.SEcs.SC
收藏

用形式化方法构建可执行的智能合约安全设计模型

Building Executable Secure Design Models for Smart Contracts with Formal Methods

Weifeng Xu, Glenn A. Fink

摘要:

智能合约之所以有吸引力,是因为它们是各方之间的自动执行的商业协议,具有预定义和不可变的义务和权利。然而,与所有软件一样,智能合约可能因设计缺陷而包含漏洞,其中一方可能会利用这些漏洞来欺骗其他方。在本文中,我们展示了一种使用形式化方法为智能合约构建安全设计模型的系统方法。为了构建安全模型,我们首先将参与方的行为建模为状态机,然后,我们对预定义的合同义务和权利进行建模,这些合同规定了状态机之间的交互以实现业务目标。在此之后,我们在TLA+(动作的时间逻辑)中说明了可执行的安全模型设计模式,以在设计层面上针对状态机和义务和权利方面的众所周知的智能合约漏洞。这些漏洞存在于以太坊合约中,包括Call to the unknown、Gasless send、Reentrancy、Lost in the transfer和Unpredictable state。由此产生的TLA+规范称为安全模型。我们说明了我们的方法来检测在设计层面上使用房地产合同的例子的漏洞。

英文摘要:

Smart contracts are appealing because they are self-executing business agreements between parties with the predefined and immutable obligations and rights. However, as with all software, smart contracts may contain vulnerabilities because of design flaws, which may be exploited by one of the parties to defraud the others. In this paper, we demonstrate a systematic approach to building secure design models for smart contracts using formal methods. To build the secure models, we first model the behaviors of participating parties as state machines, and then, we model the predefined obligations and rights of contracts, which specify the interactions among state machines for achieving the business goal. After that, we illustrate executable secure model design patterns in TLA+ (Temporal Logic of Actions) to against well-known smart contract vulnerabilities in terms of state machines and obligations and rights at the design level. These vulnerabilities are found in Ethereum contracts, including Call to the unknown, Gasless send, Reentrancy, Lost in the transfer, and Unpredictable state. The resultant TLA+ specifications are called secure models. We illustrate our approach to detect the vulnerabilities using a real-estate contract example at the design level.

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

↑