[Paper Review] Formal Verification of Solidity contracts in Event-B
This paper proposes a formal verification method for Solidity smart contracts using Event-B, translating a restrained subset of Solidity into Event-B models to enable rigorous property verification. The approach supports hierarchical refinement and proof obligation generation, which are discharged using the Rodin platform, thereby enabling certification of safety and security properties in Ethereum smart contracts.
Smart contracts are the artifact of the blockchain that provide immutable and verifiable specifications of physical transactions. Solidity is a domain-specific programming language with the purpose of defining smart contracts. It aims at reducing the transaction costs occasioned by the execution of contracts on the distributed ledgers such as the Ethereum. However, Solidity contracts need to adhere safety and security requirements that require formal verification and certification. This paper proposes a method to meet such requirements by translating Solidity contracts to Event-B models, supporting certification. To that purpose, we define a restrained Solidity subset and a transfer function which translates Solidity contracts to Event-B models. Then we take advantage of Event-B method capabilities to refine models at different levels of abstraction to verify Solidity contracts' properties. And we can verify the generated proof obligations of the Event-B model with the help of the Rodin platform.
Motivation & Objective
- To address the critical need for formal verification of Solidity smart contracts due to security vulnerabilities and high-value transaction risks.
- To define a restricted subset of Solidity that is amenable to formal modeling and verification.
- To establish a systematic translation from Solidity contracts to Event-B models for formal analysis.
- To leverage Event-B's refinement capabilities to verify contract properties at multiple abstraction levels.
- To enable certification of smart contract properties through automated proof obligation discharge using the Rodin platform.
Proposed method
- A restricted subset of Solidity is defined, excluding complex features such as inheritance and complex control flow, to ensure compatibility with formal modeling.
- A formal translation function is designed to map Solidity contract constructs into corresponding Event-B constructs, preserving semantic equivalence.
- Event-B models are constructed to represent the state and behavior of Solidity contracts, including variables, invariants, and event-based transitions.
- The method employs hierarchical refinement in Event-B to model contracts at increasing levels of abstraction, enabling modular verification.
- Proof obligations are automatically generated during model construction and are discharged using the Rodin platform’s theorem prover.
- The approach supports certification by ensuring that all verification conditions are formally proven, thus guaranteeing correctness properties.
Experimental results
Research questions
- RQ1Can a restricted subset of Solidity be formally translated into Event-B models while preserving semantic correctness?
- RQ2How can the hierarchical refinement capabilities of Event-B be leveraged to verify complex smart contract properties step-by-step?
- RQ3To what extent can the Rodin platform automate the discharge of proof obligations arising from Solidity-to-Event-B translation?
- RQ4Can this method effectively verify safety and security properties of real-world smart contracts?
- RQ5Is the translation process sound and scalable enough to support practical smart contract verification?
Key findings
- The proposed translation from Solidity to Event-B successfully models key contract constructs such as state variables, functions, and invariants with formal semantics.
- The use of Event-B refinement enables stepwise verification of contract properties, improving modularity and maintainability of proofs.
- Proof obligations generated from the Event-B models are successfully discharged using the Rodin platform, confirming the correctness of the verified properties.
- The method supports certification of security and safety properties, such as absence of reentrancy and state consistency, through formal proof.
- The approach demonstrates feasibility on representative smart contract examples, showing that formal verification is achievable even for complex contract logic.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.