Home

Awesome

Casper Proofs

This project provides models and proofs of the Casper blockchain finality system in Coq. The major theorems currently proven are Accountable Safety and Plausible Liveness. These proofs are written to depend only loosely on the details of an underlying blockchain, and are instantiated with models at various levels of detail. We also have a detailed model of the data structures and node behavior in the Beacon Chain protocol.

A more detailed explanation of the models and proofs can be found in the technical report:

<img src="resources/pdf-icon.png" alt="PDF" width="2%" /> Verification of Casper in the Coq Proof Assistant

Project Layout

Casper abstract model and proofs

These files contain the major theorems about Casper. The theorems are proven over an abstract view of block structure and validator sets, and can be instantiated with concrete definitions of various levels of detail without needing to modify these proofs.

Validator and Blockchain models

These files give two different models meeting the abstract assumptions on validator sets:

This file defines a more detailed blockchain model, where checkpoint blocks may include a set of votes:

These files instantiate the Accoutable Safety theorem against some of the models above:

Beacon Chain Model

Utility files

Requirements

Building

We recommend installing dependencies via OPAM:

opam repo add coq-released https://coq.inria.fr/opam/released
opam install coq.8.8.2 coq-mathcomp-ssreflect.1.7.0 coq-fcsl-pcm.1.0.0 coq-hammer.1.0.9+8.8.1 coq-mathcomp-finmap.1.1.0

Then, run make in the project root directory to check all definitions and proofs.

Getting Help

Feel free to report GitHub issues or to contact us at: contact@runtimeverification.com