论文标题
声明性的智能合约
Declarative Smart Contracts
论文作者
论文摘要
本文介绍了Decon,这是一种宣言性的编程语言,用于实施智能合约和指定合同级别的属性。在观察到智能合同操作和合同级别可以自然表示为关系约束的情况下,DeCon将每个智能合约模型作为存储交易记录的一组关系表。智能合约的这种关系表示,可以方便地规范合同财产,促进对潜在财产违规行为的运行时间监控,并使通过数据出处提出清晰的合同调试。具体而言,DECON计划包括一组关于关系表示形式的声明性规则和违规规则,分别描述了智能合同实施和合同级别的属性。我们已经开发了一种工具,可以将DECON程序编译到可执行的坚固性程序中,并具有用于运行时属性监视的仪器。我们的案例研究表明,DeCon可以实施现实的智能合约,例如ERC20和ERC721数字令牌。我们的评估结果表明,与开源参考的实施相比,DeCon的边缘开销,导致14%的气体开销供执行,另外16%的中位气体开销进行运行时验证。
This paper presents DeCon, a declarative programming language for implementing smart contracts and specifying contract-level properties. Driven by the observation that smart contract operations and contract-level properties can be naturally expressed as relational constraints, DeCon models each smart contract as a set of relational tables that store transaction records. This relational representation of smart contracts enables convenient specification of contract properties, facilitates run-time monitoring of potential property violations, and brings clarity to contract debugging via data provenance. Specifically, a DeCon program consists of a set of declarative rules and violation query rules over the relational representation, describing the smart contract implementation and contract-level properties, respectively. We have developed a tool that can compile DeCon programs into executable Solidity programs, with instrumentation for run-time property monitoring. Our case studies demonstrate that DeCon can implement realistic smart contracts such as ERC20 and ERC721 digital tokens. Our evaluation results reveal the marginal overhead of DeCon compared to the open-source reference implementation, incurring 14% median gas overhead for execution, and another 16% median gas overhead for run-time verification.