arXivDaily arXiv每日学术速递 周一至周五更新
arXiv 2109.04347cs.CR
收藏

Clockwork Finance:智能合约中经济安全性的自动化分析

Clockwork Finance: Automated Analysis of Economic Security in Smart Contracts

Kushal Babel, Philip Daian, Mahimna Kelkar, Ari Juels

AI总结:

本文提出通用的形式化验证框架 CFF,用于机械化推理组合 DeFi 智能合约的经济安全性,能自动提取所有经济攻击,并引入可提取价值(EV)概念,在以太坊四大协议上验证了其实用性。

摘要:

我们引入了 Clockwork Finance Framework (CFF),这是一个通用的形式化验证框架,用于对组合的去中心化金融智能合约的经济安全属性进行机械化推理。CFF 具有三个关键属性。首先是合约完备性,意味着它可以建模任何智能合约平台及其所有合约——无论是图灵完备还是其他类型。它通过渐近常数级的模型开销实现这一点。其次是构造上的攻击穷举性,意味着它可以自动且机械地提取跨建模合约中对用户加密货币的所有可能经济攻击。得益于这些属性,CFF 能够支持多种目标:开发者对合约的经济安全分析、用户对 DeFi 交易风险的分析、费用用户体验优化,以及机器人或矿工对套利机会的优化。由于 CFF 提供可组合性,它可以通过对任意期望的一组潜在交互的智能合约模型进行推理来支持这些目标。我们将 CFF 实例化为以太坊合约的可执行模型,其中结合了最先进的演绎验证器。基于先前的工作,我们引入了可提取价值(EV),这是组合 DeFi 合约中经济安全性的新形式化概念,它既是 CFF 的基础,也具有普遍的学术意义。我们构建了以太坊中四个已部署的流行 DeFi 协议的模块化、人类可读、可组合的 CFF 模型:Uniswap、Uniswap V2、Sushiswap 和 MakerDAO,截至 2022 年 3 月,这些协议代表了合计 240 亿美元的价值。我们使用这些模型以及闪电贷、空投和投票等其他常见模型进行实验,证明 CFF 具有实用性,并能从真实世界的交易活动中驱动有用的、基于数据的 EV 洞察。在没有任何显式编程攻击策略的情况下,CFF 发现在最近的过去,平均每月有 5600 万美元的预期 EV。

英文摘要:

We introduce the Clockwork Finance Framework (CFF), a general purpose, formal verification framework for mechanized reasoning about the economic security properties of composed decentralized-finance (DeFi) smart contracts. CFF features three key properties. It is contract complete, meaning that it can model any smart contract platform and all its contracts--Turing complete or otherwise. It does so with asymptotically constant model overhead. It is also attack-exhaustive by construction, meaning that it can automatically and mechanically extract all possible economic attacks on users' cryptocurrency across modeled contracts. Thanks to these properties, CFF can support multiple goals: economic security analysis of contracts by developers, analysis of DeFi trading risks by users, fees UX, and optimization of arbitrage opportunities by bots or miners. Because CFF offers composability, it can support these goals with reasoning over any desired set of potentially interacting smart contract models. We instantiate CFF as an executable model for Ethereum contracts that incorporates a state-of-the-art deductive verifier. Building on previous work, we introduce extractable value (EV), a new formal notion of economic security in composed DeFi contracts that is both a basis for CFF and of general interest. We construct modular, human-readable, composable CFF models of four popular, deployed DeFi protocols in Ethereum: Uniswap, Uniswap V2, Sushiswap, and MakerDAO, representing a combined 24 billion USD in value as of March 2022. We use these models along with some other common models such as flash loans, airdrops and voting to show experimentally that CFF is practical and can drive useful, data-based EV-based insights from real world transaction activity. Without any explicitly programmed attack strategies, CFF uncovers on average an expected $56 million of EV per month in the recent past.

机构、总结、中文摘要均由AI分析而来,可能存在错误,请以论文正文为准。

↑