Skip to main content
QUICK REVIEW

[Paper Review] Towards a Smart Contract Verification Framework in Coq.

Danil Annenkov, Bas Spitters|arXiv (Cornell University)|Jul 24, 2019
Blockchain Technology Applications and SecurityComputer Science6 citations
TL;DR

This paper presents a Coq-based verification framework that combines deep and shallow embeddings of functional smart contract languages using meta-programming, enabling formal reasoning about both meta-theory and concrete contracts. It establishes a soundness theorem connecting the two embeddings and demonstrates the approach by verifying a crowdfunding contract in the Oak language.

ABSTRACT

We propose a novel way of embedding functional smart contract languages into the Coq proof assistant using meta-programming techniques. Our framework allows for developing the meta-theory of smart contract languages using the deep embedding and provides a convenient way for reasoning about concrete contracts using the shallow embedding. The proposed approach allows to make a connection between the two embeddings in a form of a soundness theorem. As an instance of our approach we develop an embedding of the Oak smart contract language in Coq and verify several important properties of a crowdfunding contract. The developed techniques are applicable to all functional smart contract languages.

Motivation & Objective

  • To develop a unified formal verification framework for functional smart contract languages within Coq.
  • To bridge the gap between meta-theoretical reasoning and concrete contract verification using embedding techniques.
  • To enable sound, machine-checked proofs of smart contract properties through a connection between deep and shallow embeddings.
  • To provide a reusable methodology applicable to any functional smart contract language.

Proposed method

  • Employing meta-programming in Coq to embed the syntax and semantics of functional smart contract languages deeply into the proof assistant.
  • Using shallow embedding for convenient, high-level reasoning about individual smart contracts within Coq.
  • Formalizing a soundness theorem that connects the deep embedding (meta-theory) with the shallow embedding (concrete contracts).
  • Defining a domain-specific language for smart contracts within Coq that supports formal verification of behavioral properties.
  • Leveraging Coq’s dependent types and inductive families to ensure type safety and correctness of the embeddings.
  • Applying the framework to the Oak smart contract language as a concrete instantiation.

Experimental results

Research questions

  • RQ1How can deep and shallow embeddings of smart contract languages be formally connected within a proof assistant?
  • RQ2What techniques enable scalable and modular verification of smart contract properties using Coq?
  • RQ3Can a single framework support both meta-theoretical analysis and concrete contract verification?
  • RQ4How can meta-programming in Coq be used to safely embed functional smart contract languages?
  • RQ5What properties of smart contracts can be formally verified using this integrated approach?

Key findings

  • The framework successfully establishes a soundness theorem linking deep and shallow embeddings, ensuring consistency between meta-theory and concrete contract execution.
  • The approach enables formal verification of a crowdfunding contract in the Oak language, demonstrating practical applicability.
  • The use of meta-programming in Coq allows for safe and modular integration of smart contract language semantics.
  • The framework is generalizable to any functional smart contract language, not limited to Oak.
  • The combination of deep and shallow embeddings supports both high-level reasoning and low-level correctness proofs.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.