论文标题
智能合约安全框架的正式规格
Formal specification of a security framework for smart contracts
论文作者
论文摘要
随着智能合约的规模和复杂性的增长,确保其正确性和安全性变得越来越困难。由于缺乏隔离机制,该代码中的一个错误或漏洞可能会使整个系统降低,并且由于此智能合同升级可能特别危险。在将代码部署到区块链之前,使用了确保智能合约的安全性(包括DSL,审计和静态分析)的传统方法,因此在部署后不提供任何保护。每次升级后,整个代码都需要再次验证,这是一个容易出现错误的困难且耗时的过程。为了解决这些问题,开发了用于CAP9的智能合约的安全协议和框架。它为开发人员提供了以安全和健壮的方式执行升级的能力,并通过使用基于低级功能的安全模型来提高隔离和透明度。我们已经使用Isabelle/Hol来开发CAP9框架的正式规范,并证明其一致性。本文提出了一种基于完善的方法,我们用来创建规范,并讨论了此过程中一些遇到的困难。
As smart contracts are growing in size and complexity, it becomes harder and harder to ensure their correctness and security. Due to the lack of isolation mechanisms a single mistake or vulnerability in the code can bring the whole system down, and due to this smart contract upgrades can be especially dangerous. Traditional ways to ensure the security of a smart contract, including DSLs, auditing and static analysis, are used before the code is deployed to the blockchain, and thus offer no protection after the deployment. After each upgrade the whole code need to be verified again, which is a difficult and time-consuming process that is prone to errors. To address these issues a security protocol and framework for smart contracts called Cap9 was developed. It provides developers the ability to perform upgrades in a secure and robust manner, and improves isolation and transparency through the use of a low level capability-based security model. We have used Isabelle/HOL to develop a formal specification of the Cap9 framework and prove its consistency. The paper presents a refinement-based approach that we used to create the specification, as well as discussion of some encountered difficulties during this process.