TL;DR
This paper provides a comprehensive survey of formal modeling, specification, and verification techniques for smart contracts, analyzing 202 foundational papers published between 2014 and 2020. By establishing a clear taxonomy that distinguishes between high-level contract behavior and low-level program execution, the authors map out how formal methods are currently used to secure blockchain applications and highlight critical gaps for future research.
What Problem Does This Paper Address?
Smart contracts are self-executing programs deployed on blockchains that manage billions of dollars in digital assets across finance, supply chain, and legal sectors. Because blockchain deployment is immutable, a single software bug can lead to catastrophic, irreversible financial losses—as demonstrated by the infamous DAO hack and Parity wallet freezes.
While traditional software testing and ad-hoc security tools help, establishing absolute correctness requires formal verification (mathematically proving that code matches its intended specification). However, the smart contract verification landscape is highly fragmented. Researchers use wildly different modeling formalisms (e.g., Petri nets, process algebras, control-flow graphs) and specification logics. This paper addresses this fragmentation by providing a unified taxonomy to help researchers and engineers understand the common trends, tool capabilities, and open challenges in the field.
Methods
The authors systematically collected and reviewed 202 relevant publications using targeted search queries on Google Scholar, ACM, IEEE, and Springer databases, followed by snowballing techniques.
They organized their analysis into a four-layer framework:
- Modeling Formalisms: Classified into Contract-Level Models (treating contracts as black boxes interacting with users/blockchains using process algebras or state-transition systems) and Program-Level Models (white-box representations analyzing source code or bytecode using Abstract Syntax Trees, Control Flow Graphs, or program logics).
- Specification Formalisms: Categorized by how properties are written (e.g., Temporal Logics like LTL/CTL for behavioral progress, Hoare Logic for pre/post-conditions, and Deontic Logic for legal obligations).
- Verification Techniques: Grouped into model checking, theorem proving, symbolic execution, program verification, and runtime verification.
- Application Domains: Properties were classified by domain, including Finance (tokens, wallets), Social Games (auctions, voting), and Asset Tracking (supply chains).
For instance, a contract-level specification might model an auction using a finite state machine to ensure that bids cannot be placed after the auction closes, as illustrated below:
Datasets
As a survey paper, this work does not introduce a new empirical dataset or machine learning benchmark. Instead, it curates a comprehensive publication repository of the 202 analyzed papers, which the authors host in an open-access online repository to serve as a foundational resource for the community.
Key Insights and Ideas
- The Level of Abstraction Trade-off: There is a sharp divide between contract-level and program-level verification. Contract-level models excel at verifying complex temporal properties (like liquidity and fairness) using model checking but ignore low-level execution realities. Program-level models capture exact EVM mechanics (like gas limits and memory layouts) but struggle to reason about high-level temporal behavior.
- Dominant Tool Pairings: The survey reveals that Model Checking is almost exclusively used with contract-level state-transition systems and temporal logic to verify functional business logic. Conversely, Symbolic Execution and Program Verification dominate the program level, where they are used to scan bytecode for specific security vulnerabilities (e.g., reentrancy, integer overflows).
- Blockchain-Specific Challenges: Formal verification for blockchains is uniquely difficult because tools must model intricate, platform-dependent environmental factors. These include gas consumption mechanics, non-deterministic transaction ordering (miner manipulation), fallback functions, and the possibility of blockchain forks.
Key Results
The survey quantifies the distribution of verification techniques across the 202 analyzed papers:
- Program Verification is the most heavily researched area with 42 publications, frequently utilizing intermediate verification languages like Boogie, LLVM, or WhyML.
- Runtime Verification & Testing accounts for 26 papers, focusing on on-chain monitors or enhanced blockchain clients.
- Symbolic Execution (22 papers) remains a primary driver for automated vulnerability detection tools like Oyente and Mythril.
- Theorem Proving (20 papers) and Model Checking (18 papers) provide the highest correctness guarantees but require more manual expertise or suffer from state-explosion limits.
- Platform Focus: The overwhelming majority of research targets the Ethereum ecosystem (Solidity and EVM bytecode), though emerging work addresses Bitcoin, Tezos, Hyperledger Fabric, and EOS.
Limitations and Future Work
The authors identify several critical limitations in the current state-of-the-art:
- Pattern-Based Blind Spots: Most program-level security tools rely on predefined vulnerability templates. If an exploit does not match a known pattern, the tool will miss it.
- Unsound Abstractions: To combat the "path explosion" problem, many static analysis tools use simplified models of the EVM memory and gas mechanics, leading to false positives or missed bugs.
- Runtime Overhead: Runtime verification techniques that instrument code with assertions consume extra gas and increase bytecode size, making them expensive to deploy on-chain.
Promising Future Directions:
- Safe-by-Design Languages: Shifting away from Turing-complete languages toward domain-specific, restricted languages (like Marlowe or Move) that inherently eliminate entire classes of bugs.
- Self-Healing Contracts: Leveraging AI planning and genetic mutation techniques to automatically generate gas-aware patches for vulnerable contracts at runtime.
- Hybrid Analyses: Combining contract-level temporal logic with low-level program verification to achieve both high-level behavioral guarantees and bytecode-level precision.
Summary updated