Extracting Smart Contracts Tested and Verified in Coq

12/16/2020
by   Danil Annenkov, et al.
0

We implement extraction of Coq programs to functional languages based on MetaCoq's certified erasure. As part of this, we implement an optimisation pass removing unused arguments. We prove the pass correct wrt. a conventional call-by-value operational semantics of functional languages. We apply this to two functional smart contract languages, Liquidity and Midlang, and to the functional language Elm. Our development is done in the context of the ConCert framework that enables smart contract verification. We contribute a verified boardroom voting smart contract featuring maximum voter privacy such that each vote is kept private except under collusion of all other parties. We also integrate property-based testing into ConCert using QuickChick and our development is the first to support testing properties of interacting smart contracts. We test several complex contracts such as a DAO-like contract, an escrow contract, an implementation of a Decentralized Finance (DeFi) contract which includes a custom token standard (Tezos FA2), and more. In total, this gives us a way to write dependent programs in Coq, test them semi-automatically, verify, and then extract to functional smart contract languages, while retaining a small trusted computing base of only MetaCoq and the pretty-printers into these languages.

READ FULL TEXT

page 1

page 2

page 3

page 4

research
08/06/2021

Extracting functional programs from Coq, in Coq

We implement extraction of Coq programs to functional languages based on...
research
07/24/2019

Towards a Smart Contract Verification Framework in Coq

We propose a novel way of embedding functional smart contract languages ...
research
09/26/2018

Towards Safer Smart Contracts: A Survey of Languages and Verification Methods

With a market capitalisation of over USD 205 billion in just under ten y...
research
07/24/2019

ConCert: A Smart Contract Certification Framework in Coq

We present a new way of embedding functional languages into the Coq proo...
research
05/16/2022

Prisma: A Tierless Language for Enforcing Contract-Client Protocols in Decentralized Applications (Extended Version)

Decentralized applications (dApps) consist of smart contracts that run o...
research
08/06/2021

Certified Compilation of Financial Contracts

We present an extension to a certified financial contract management sys...
research
12/21/2022

NFTrig

NFTrig is a web-based application created for use as an educational tool...

Please sign up or login with your details

Forgot password? Click here to reset