Formalising Decentralised Exchanges in Coq

03/11/2022
by   Eske Hoy Nielsen, et al.
0

The number of attacks and accidents leading to significant losses of crypto-assets is growing. According to Chainalysis, in 2021, approx. 14 billion has been lost due to various incidents, and this number is dominated by Decentralized Finance (DeFi) applications. In order to address these issues, one can use a collection of tools ranging from auditing to formal methods. We use formal verification and provide the first formalisation of a DeFi contract in a foundational proof assistant capturing contract interactions. We focus on Dexter2, a decentralized, non-custodial exchange for the Tezos network similar to Uniswap on Ethereum. The Dexter implementation consists of several smart contracts. This poses unique challenges for formalisation due to the complex contract interactions. Our formalisation includes proofs of functional correctness with respect to an informal specification for the contracts involved in Dexter's implementation. Moreover, our formalisation is the first to feature proofs of safety properties of the interacting smart contracts of a decentralized exchange. We have extracted our contract from Coq into CameLIGO code, so it can be deployed on the Tezos blockchain. Uniswap and Dexter are paradigmatic for a collection of similar contracts. Our methodology thus allows us to implement and verify DeFi applications featuring similar interaction patterns.

READ FULL TEXT

page 3

page 9

page 12

page 13

page 15

research
08/01/2022

Finding smart contract vulnerabilities with ConCert's property-based testing framework

We provide three detailed case studies of vulnerabilities in smart contr...
research
02/05/2021

Smart Proofs via Smart Contracts: Succinct and Informative Mathematical Derivations via Decentralized Markets

Modern mathematics is built on the idea that proofs should be translatab...
research
04/28/2021

MOVO: a dApp for DLT-based Smart Mobility

Plenty of research on smart mobility is currently devoted to the inclusi...
research
05/20/2020

Formal Specification and Verification of Solidity Contracts with Events

Events in the Solidity language provide a means of communication between...
research
01/12/2023

A review of Smart Contract Blockchain Based on Multi-Criteria Analysis: Challenges and Motivations

A smart contract is a digital program of transaction protocol (rules of ...
research
11/27/2022

Who is Gambling? Finding Cryptocurrency Gamblers Using Multi-modal Retrieval Methods

With the popularity of cryptocurrencies and the remarkable development o...
research
07/25/2022

Automatic Fair Exchanges

In a decentralized environment, exchanging resources requires users to b...

Please sign up or login with your details

Forgot password? Click here to reset