Modeling and Security Verification of State-Based Smart Contracts
Paper in proceeding, 2022

Smart contracts are programs that are stored on a blockchain ledger with code immutable after deployment. Thus, verifying the correct behavior of smart contracts before deployment is vital. This paper demonstrates how a security vulnerability verification in a casino smart contract can be transformed to non-blocking verification. To this end, the contract is first modeled as interacting extended finite state machines (EFSM), with one EFSM for each function. Modeling the security vulnerability as a condition in the EFSM system, non-blocking verification reveals the system to be blocking. Investigating the counterexample produced by the verification shows that a transfer that is refused by its receiver may block the casino so that all remaining funds are forever locked into the contract, thus revealing a severe vulnerability. It is then demonstrated how the same technique can show the absence of this vulnerability, by verifying that the EFSM model of an improved casino contract is indeed non-blocking. Copyright (C) 2022 The Authors.

nonblocking

security

verification

smart contract

Extended finite state machine

Author

Sahar Mohajerani

Chalmers, Electrical Engineering, Systems and control

Wolfgang Ahrendt

Chalmers, Computer Science and Engineering (Chalmers), Formal methods

Martin Fabian

Chalmers, Electrical Engineering, Systems and control

IFAC-PapersOnLine

2405-8963 (ISSN) 24058963 (eISSN)

Vol. 55 28 356-362

16th IFAC Workshop on Discrete Event Systems (WODES)
Prague, Czech Republic,

Subject Categories

Computational Mathematics

Computer Science

Computer Systems

DOI

10.1016/j.ifacol.2022.10.366

More information

Latest update

10/27/2023