Skip to content

jakobbotsch/ConCert

 
 

Repository files navigation

ConCert

A framework for smart contract verification in Coq.

See the Papers for details on the development.

How to build

Our development works with Coq 8.11.2. and depends on MetaCoq installed from source, std++ and coq-bignums. The tests depend on QuickChick. Most of the dependencies can be installed through opam.

To set up a switch with the necessary dependencies run the following commands from the root of the project:

opam switch create . 4.07.1
eval $(opam env)
opam repo add coq-released https://coq.inria.fr/opam/released
opam install -j 4 coq.8.11.2 coq-bignums coq-stdpp coq-quickchick
opam pin -j 4 add https://github.com/MetaCoq/metacoq.git#77adb13585d2f357b78642c16b6c4da817f35eff

After completing the procedures above, run make to build the development, and make html to build the documentation. The documentation will be located in the docs folder after make html.

Structure of the project

The embedding folder contains the development of the embedding.

The execution folder contains the formalization of the smart contract execution layer, which allows reasoning about, and property-based testing of, interacting contracts. The tests folder contains example tests. The key generators used for automatically generating blockchain execution traces for testing can be found in TraceGens.v. The testing framework was developed as part of a Master's Thesis at Aarhus University, and the thesis detailing (an earlier state of) the development can be found here.

The extraction folder contains an implemention of extraction based on MetaCoq's certified erasure. It supports Liquidity and Elm as target languages. The extraction also features verified optimisations.

Notes for developers

The execution subproject can be built independently via running make in the execution folder. This also means that the _CoqProject file inside the execution folder must be manually kept in sync with the main _CoqProject in the root.

Papers

Citing the papers

@misc{ConCertAbstract,
  title={Verifying, testing and running smart contracts in ConCert},
  author={Danil Annenkov and Mikkel Milo and Jakob Botsch Nielsen and Bas Spitters},
  year={2020}
}

@article{ConCert,
   title={ConCert: a smart contract certification framework in Coq},
   ISBN={9781450370974},
   url={http://dx.doi.org/10.1145/3372885.3373829},
   DOI={10.1145/3372885.3373829},
   journal={Proceedings of the 9th ACM SIGPLAN International Conference on Certified Programs and Proofs},
   publisher={ACM},
   author={Annenkov, Danil and Nielsen, Jakob Botsch and Spitters, Bas},
   year={2020},
   month={Jan}
}

@inproceedings{smart-contract-interactions,
  author    = {Jakob Botsch Nielsen and
               Bas Spitters},
  title     = {Smart Contract Interactions in Coq},
  booktitle = {{FM} Workshops {(1)}},
  series    = {Lecture Notes in Computer Science},
  volume    = {12232},
  pages     = {380--391},
  publisher = {Springer},
  year      = {2019}
}

About

A framework for smart contract verification in Coq

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors

Languages

  • Rocq Prover 98.5%
  • JavaScript 0.5%
  • CSS 0.4%
  • Makefile 0.3%
  • Shell 0.2%
  • HTML 0.1%