IMDEA Software

IMDEA initiative

Home > News > 2022 > Multi: a Formal Playground for Multi-Smart Contract Interaction

October 6, 2022

Multi: a Formal Playground for Multi-Smart Contract Interaction

Blockchains are maintained by a network of participants, miner nodes, that run algorithms designed to maintain collectively a distributed machine tolerant to Byzantine attacks. From the point of view of users, blockchains provide the illusion of centralized computers that perform trustable verifiable computations, where all computations are deterministic and the results cannot be manipulated or undone.

IMDEA Software researchers Martín Ceresa and César Sánchez publish “Multi: A Formal Playground for Multi-Smart Contract” in which they implement an execution model that allows the study of smart contract interactions.

Every blockchain is equipped with a crypto-currency. Programs running on blockchains are called smart-contracts and are written in a special-purpose programming language with deterministic semantics. Each transaction begins with an invocation from an external user to a smart contract. Smart contracts have local storage and can call other contracts, and more importantly, they store, send and receive cryptocurrency.

Once installed in a blockchain, the code of the smart-contract cannot be modified. Therefore, it is very important to guarantee that contracts are correct before deployment. However, the resulting ecosystem makes it very difficult to reason about program correctness, since smart-contracts can be executed by malicious users or malicious smart-contracts can be designed to exploit other contracts that call them. Many attacks and bugs are caused by unexpected interactions between multiple contracts, the attacked contract and unknown code that performs the exploit.

Moreover, there is a very aggressive competition between different blockchains to expand their user base. Ideas are implemented fast and blockchains compete to offer and adopt new features quickly.

In this paper, the researchersw propose a formal playground that allows reasoning about multi-contract interactions and is extensible to incorporate new features, study their behaviour and ultimately prove properties before features are incorporated into the real blockchain. they implemented a model of computation that models the execution platform, abstracts the internal code of each individual contract and focuses on contract interactions. Even though the Coq implementation is still a work in progress, they show how many features, existing or proposed, can be used to reason about multi-contract interactions.