论文标题
COQ中的分散交流形式化
Formalising Decentralised Exchanges in Coq
论文作者
论文摘要
攻击和事故的数量导致加密资源的重大损失正在增加。根据链分析,在2021年,大约由于各种事件,损失了140亿美元,该数字由分散的金融(DEFI)申请主导。为了解决这些问题,可以使用从审核到正式方法的工具集合。我们使用正式验证,并在捕获合同互动的基础证明助手中首次正式化Defi合同。我们专注于Dexter2,这是一种与以太坊上的UNISWAP相似的TEZOS网络的分散的,非习惯的交换。 Dexter实施由几个智能合约组成。由于复杂的合同相互作用,这给正式化带来了独特的挑战。我们的形式化包括有关Dexter实施合同的非正式规范功能正确性的证明。此外,我们的形式化是第一个具有分散交易所交互的智能合约的安全性证明的证明。我们已将合同从COQ提取到Cameligo代码中,因此可以将其部署在Tezos区块链上。 UNISWAP和DEXTER是类似合同的收集的范式。因此,我们的方法使我们能够实施和验证具有相似交互模式的DEFI应用程序。
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.