Skip to content

verifereum/verifereum

Repository files navigation

Verifereum

License: GPL v3 Website Zulip

Prove functional correctness of Ethereum smart contracts in higher-order logic.

Verifereum is an open-source project that brings mathematical rigour to Ethereum smart contract verification. Using the HOL4 theorem prover, we're building tools to prove the correctness of smart contracts and eliminate entire classes of vulnerabilities.

Why Verifereum?

  • Beyond Traditional Auditing: While audits can find bugs, mathematical verification proves the absence of entire classes of vulnerabilities
  • High Stakes, Higher Standards: With billions of dollars secured by smart contracts, formal verification offers the strongest security guarantees possible
  • Perfect Fit: Ethereum's deterministic execution model, where code is expensive so applications are small, makes it an ideal candidate for formal verification

Current Status

Project Structure

verifereum/
├── spec/           # Formal EVM specification
│   ├── vfmExecutionScript.sml    # EVM execution semantics
│   ├── vfmOperationScript.sml    # EVM operations
│   ├── vfmStateScript.sml        # EVM state model
│   └── prop/                     # Properties and proofs about EVM
├── prog/           # Program logic for verification
├── util/           # Utilities (RLP, Merkle Patricia Trie, crypto primitives)
│   ├── recursiveLengthPrefixScript.sml
│   ├── merklePatriciaTrieScript.sml
│   ├── secp256k1Script.sml
│   └── contractABIScript.sml
├── examples/       # Example contract verifications
│   └── wrappedEtherScript.sml    # WETH contract verification
├── tests/          # EVM test suite
├── website/        # Project website source
└── docs/           # Documentation

Getting Started

Verifereum is developed in the HOL4 theorem prover, which is written in Standard ML.

Option 1: Build from Source

  1. Install Poly/ML (you may prefer to use a packaged version if available)

    curl -L https://github.com/polyml/polyml/archive/refs/heads/master.zip | bsdtar -xf -
    cd polyml-master
    ./configure --enable-intinf-as-int
    make -j4
    make install
    cd ..
    rm -r polyml-master
  2. Build HOL4

    git clone -b master https://github.com/HOL-Theorem-Prover/HOL
    cd HOL
    poly --script tools/smart-configure.sml
    bin/build

    Add to your .bashrc:

    export HOLDIR=<path-to-HOL>/HOL
    export PATH=$HOLDIR/bin:$PATH
  3. Clone and Build Verifereum

    git clone https://github.com/verifereum/verifereum
    cd verifereum
    Holmake

Option 2: Use Docker

See docs/run-with-docker.md for instructions on running with Docker.

Contributing

We welcome contributors of all experience levels! See the contributor guide for details on:

  • Setting up your development environment
  • Current project areas (EVM formalisation, verification experiments, performance improvements)
  • Editor integration (Emacs, Vim, VSCode, Kakoune)

Get involved:

Related Resources

License

Verifereum is free software, released under the GNU General Public License v3.

About

Prove functional correctness of Ethereum smart contracts in higher-order logic

Resources

License

Stars

Watchers

Forks

Contributors

Languages