论文标题
规格是法律:以太坊智能合约的安全创建和升级
Specification is Law: Safe Creation and Upgrade of Ethereum Smart Contracts
论文作者
论文摘要
智能合约是“代码是法律”范式的基础:智能合约的代码无疑地描述了其资产的管理方式 - 一旦创建,其代码通常是不可变的。错误的智能合约提供了反对本范式实用性的最重要证据;它们有充分的记录,并导致资产值得大量的资金受到损害。为了解决这个问题,以太坊社区提出了(i)审核/分析智能合约的工具和流程,以及(ii)设计模式,实施了一种使合同代码可变的机制。单独,(i)和(ii)仅部分解决了“法规是法律”范式提出的挑战。在本文中,我们结合了(i)和(ii)的元素,以创建一个系统的框架,该框架从“代码是法律”中移开,并产生了新的“规范是法律”范式。它允许创建和升级合同,但前提是它们符合相应的正式规范。该框架以\ emph {值得信赖的部位}为中心:一种正式验证和执行这种符合概念的链服务。我们已经制定了该框架,并研究了其适用于实施两个广泛使用的以太坊标准的合同:ERC20代币标准和ERC1155多代币标准,结果有令人鼓舞的结果。
Smart contracts are the building blocks of the "code is law" paradigm: the smart contract's code indisputably describes how its assets are to be managed - once it is created, its code is typically immutable. Faulty smart contracts present the most significant evidence against the practicality of this paradigm; they are well-documented and resulted in assets worth vast sums of money being compromised. To address this issue, the Ethereum community proposed (i) tools and processes to audit/analyse smart contracts, and (ii) design patterns implementing a mechanism to make contract code mutable. Individually, (i) and (ii) only partially address the challenges raised by the "code is law" paradigm. In this paper, we combine elements from (i) and (ii) to create a systematic framework that moves away from "code is law" and gives rise to a new "specification is law" paradigm. It allows contracts to be created and upgraded but only if they meet a corresponding formal specification. The framework is centered around \emph{a trusted deployer}: an off-chain service that formally verifies and enforces this notion of conformance. We have prototyped this framework, and investigated its applicability to contracts implementing two widely used Ethereum standards: the ERC20 Token Standard and ERC1155 Multi Token Standard, with promising results.