Ethereum is a decentralized blockchain technology equipped with so-called Smart Contracts. A contract is a program whose code is public, which can be triggered by any user, and whose actual execution is performed by miners participating in Ethereum. Miners execute the contract on the Ethereum Virtual Machine (EVM) and apply its effect by adding new blocks to the blockchain. A contract that takes too much time to be processed by the miners of the network may result into delays or a denial of service in the Ethereum system. To prevent this scenario, termination of Ethereum's Smart Contracts is ensured using a gas mechanism. Roughly, the EVM consumes gas to process each instruction of a contract and the gas provided to run a contract is limited. This technique could make termination of contracts easy to prove but the way the official definition of the EVM specifies gas usage makes the proof of this property non-trivial. EVM implementations and formal analysis techniques of EVM's Smart Contracts use termination of contracts as an assumption, so having a formal proof of termination of contracts is crucial. This paper presents a mechanized, formal, and general proof of termination of Smart Contracts based on a measure of EVM call stacks.
[1]
Yoichi Hirai,et al.
Defining the Ethereum Virtual Machine for Interactive Theorem Provers
,
2017,
Financial Cryptography Workshops.
[2]
Yi Zhang,et al.
KEVM: A Complete Formal Semantics of the Ethereum Virtual Machine
,
2018,
2018 IEEE 31st Computer Security Foundations Symposium (CSF).
[3]
Matteo Maffei,et al.
Foundations and Tools for the Static Analysis of Ethereum Smart Contracts
,
2018,
CAV.
[4]
Sidney Amani,et al.
Towards verifying ethereum smart contract bytecode in Isabelle/HOL
,
2018,
CPP.
[5]
Yannis Smaragdakis,et al.
MadMax: surviving out-of-gas conditions in Ethereum smart contracts
,
2018,
Proc. ACM Program. Lang..
[6]
Toby Murray,et al.
Empirically Analyzing Ethereum's Gas Mechanism
,
2019,
2019 IEEE European Symposium on Security and Privacy Workshops (EuroS&PW).
[7]
SmaragdakisYannis,et al.
MadMax: surviving out-of-gas conditions in Ethereum smart contracts
,
2018
.
[8]
Daniel Davis Wood,et al.
ETHEREUM: A SECURE DECENTRALISED GENERALISED TRANSACTION LEDGER
,
2014
.
[9]
Matteo Maffei,et al.
A Semantic Framework for the Security Analysis of Ethereum smart contracts
,
2018,
POST.