Recently, despite the growing popularity of smart contracts, one serious concern is arising among both industry and academia, that is, whether they work autonomously without human intervention really as intended and, when we are not sure, how we can ensure that contracts meet particular requirements. To resolve this, we propose a new formal approach to smart contract development: Instead of defining contracts just as programs in conventional languages, they should be defined using formal logic so that we can verify whether they meet particular requirements and enforce them if necessary. The primary challenge is that expressive formal logic often turns out to be undecidable and consequently executable programs cannot be generated. As a solution, each contract definition is divided into two layers, namely specification layer in a decidable logic called Linear Dynamic Logic for verification and enforcement of requirements and rule layer for defining implementation details, while the consistency between the two layers is systematically guaranteed. Based on this, it also becomes possible to automatically generate executable contract programs from their formal specification, which leads to improving the trustworthiness of contracts. Evaluation on Hyperledger Fabric shows the feasibility and high effectiveness of our approach.
[1]
Nikhil Swamy,et al.
Formal Verification of Smart Contracts: Short Paper
,
2016,
PLAS@CCS.
[2]
Domenic Forte,et al.
SCRIPT
,
2020,
ACM Transactions on Design Automation of Electronic Systems.
[3]
Russell O'Connor,et al.
Simplicity: A New Language for Blockchains
,
2017,
PLAS@CCS.
[4]
K. Bhargavan,et al.
: Formal Verification of Smart Contracts
,
2016
.
[5]
Simon L. Peyton Jones,et al.
Composing Contracts: An Adventure in Financial Engineering
,
2001,
FME.
[6]
Shin Nakajima,et al.
The SPIN Model Checker : Primer and Reference Manual
,
2004
.
[7]
I. Grigg.
The Ricardian contract
,
2004,
Proceedings. First IEEE International Workshop on Electronic Contracting, 2004..
[8]
Nick Szabo,et al.
Formalizing and Securing Relationships on Public Networks
,
1997,
First Monday.
[9]
Giuseppe De Giacomo,et al.
Linear Temporal Logic and Linear Dynamic Logic on Finite Traces
,
2013,
IJCAI.
[10]
Christopher D. Clack,et al.
Smart Contract Templates: foundations, design landscape and research directions
,
2016,
ArXiv.
[11]
Martin Elsman,et al.
Certified symbolic management of financial multi-party contracts
,
2015,
ICFP.
[12]
Dan Boneh.
Solidity
,
1973
.