Smart Contract Interactions in Coq

  title={Smart Contract Interactions in Coq},
  author={Jakob Botsch Nielsen and Bas Spitters},
  booktitle={FM Workshops},
We present a model/executable specification of smart contract execution in Coq. Our formalization allows for inter-contract communication and generalizes existing work by allowing modelling of both depth-first execution blockchains (like Ethereum) and breadth-first execution blockchains (like Tezos). We represent smart contracts programs in Coq's functional language Gallina, enabling easier reasoning about functional correctness of concrete contracts than other approaches. In particular we… 

Formal Verification of Solidity contracts in Event-B

A restrained Solidity subset and a transfer function which translates Solidity contracts to Event-B models, supporting certification is defined and the generated proof obligations of the event-B model can be verified with the help of the Rodin platform.

A Survey of Smart Contract Formal Specification and Verification

This survey investigates formal models and specifications of smart contracts presented in the literature and presents a systematic overview in order to understand the common trends and identify gaps.

ConCert: a smart contract certification framework in Coq

We present a new way of embedding functional languages into the Coq proof assistant by using meta-programming. This allows us to develop the meta-theory of the language using the deep embedding and

Extracting smart contracts tested and verified in Coq

A verified boardroom voting smart contract featuring maximum voter privacy such that each vote is kept private except under collusion of all other parties is contributed.

Smart Contract Engineering

The roadmap of an iterative refinement-based, model-driven formal design methodology is introduced, not only to validate smart contracts but also to support the whole life cycle of their engineering.

Verifying, testing and running smart contracts in ConCert

This work extends ConCert with an extraction functionality, implement anonymous voting based on the Open Vote Network protocol and integrate property-based testing using QuickChick, building on the ConCert framework for embedding smart contracts in Coq and the execution model introduced in [8].

Multi: a Formal Playground for Multi-Smart Contract Interaction

A model of computation is implemented that models the execution platform, abstracts the internal code of each individual contract and focuses on contract interactions, and shows how many features, existing or proposed, can be used to reason about multi-contract interactions.

Formalising Decentralised Exchanges in Coq

This work uses formal verification and provides the first formalisation of a DeFi contract in a foundational proof assistant capturing contract interactions on Dexter2, a decentralized, non-custodial exchange for the Tezos network similar to Uniswap on Ethereum.

Inter-Blockchain Protocols with the Isabelle Infrastructure Framework

The concept of Inter-blockchain (IBC) is proved by defining the generic property of global consistency and prove it in Isabelle and an instantiation of the Isabelle Infrastructure framework is introduced to model blockchains.

A Formally Verified Static Analysis Framework for Compositional Contracts

A general framework for statically analyzing digital contracts, formal specifications of such contracts, expressed in Contract Specification Language (CSL), and the semantics of CSL, the abstract interpretation framework and its correctness theorem, the analyses and their proofs of satisfying the Abstract interpretation framework requirements have been mechanized in the Coq proof assistant.



Temporal Properties of Smart Contracts

Preliminary results of mechanically verifying some of such properties of smart contracts by embedding a smart contract language into the Coq proof assistant are reported on.

Scilla: a Smart Contract Intermediate-Level LAnguage

The automata-based model of Scilla is described, its programming component is presented and it is shown how contract definitions in terms of automata streamline the process of mechanised verification of their safety and temporal properties.

ConCert: a smart contract certification framework in Coq

We present a new way of embedding functional languages into the Coq proof assistant by using meta-programming. This allows us to develop the meta-theory of the language using the deep embedding and

VerX: Safety Verification of Smart Contracts

VerX is the first automated verifier able to prove functional properties of Ethereum smart contracts, based on a careful combination of three techniques, enabling it to automatically verify temporal properties of infinite- state smart contracts.

A Semantic Framework for the Security Analysis of Ethereum smart contracts

The first complete small-step semantics of EVM bytecode is presented, which is formalized in the F* proof assistant, obtaining executable code that is successfully validate against the official Ethereum test suite.

Towards a Smart Contract Verification Framework in Coq

This work proposes a novel way of embedding functional smart contract languages into the Coq proof assistant using meta-programming techniques and develops an embedding of the Oak smart contract language in Coq and verify several important properties of a crowdfunding contract.

Simplicity: A New Language for Blockchains

Simplicity is a typed, combinator-based, functional language without loops and recursion, designed to be used for crypto-currencies and blockchain applications, and can express any finitary function.

Afgjort - A Semi-Synchronous Finality Layer for Blockchains

This work identifies the following properties to be crucial for a finality layer: finalized blocks form a chain, all parties agree on the finalized blocks, the last finalized block does not fall too far behind the last block in the underlying blockchain (updated), and all finalized blocks at some point have been on the chain adopted by at least k honest parties (k-support).

A Coq Library for Internal Verification of Running-Times

A Coq library that lifts an abstract yet precise notion of running-time into the type of a function and proves that red-black tree insertion and search, merge sort, insertion sort, Fibonacci, iterated list insertion, BigNum addition, and Okasaki’s Braun Tree algorithms all have their expected running times.

Type system for resource bounds with type-preserving compilation

It is demonstrated that TiML can be used as a new language to write smart contracts, and the generated TiEVM code is equipped with types proving that its resource usage – “gas” in Ethereum terminology – is bounded.