Skip to main content
QUICK REVIEW

[论文解读] Not so immutable: Upgradeability of Smart Contracts on Ethereum

Mehdi Salehi, Jeremy Clark|arXiv (Cornell University)|Jun 1, 2022
Blockchain Technology Applications and Security被引用 5
一句话总结

本文分析以太坊智能合约中的可升级性模式,识别出基于 DELEGATECALL 的设计最为普遍。通过一种新颖的测量框架,作者发现存在 140 万个代理合约,其中 50% 由单一外部拥有账户(EOA)控制,揭示了所谓‘不可变’智能合约中存在显著的中心化风险。

ABSTRACT

A smart contract that is deployed to a blockchain system like Ethereum is, under reasonable circumstances, expected to be immutable and tamper-proof. This is both a feature (promoting integrity and transparency) and a bug (preventing security patches and feature updates). Modern smart contracts use software tricks to enable upgradeability, raising the research questions of how upgradeability is achieved and who is authorized to make changes. In this paper, we summarize and evaluate six upgradeability patterns. We develop a measurement framework for finding how many upgradeable contracts are on Ethereum that use certain prominent upgrade patters. We find 1.4 million proxy contracts which 8,225 of them are unique upgradeable proxy contracts. We also measure how they implement access control over their upgradeability: about 50% are controlled by a single Externally Owned Address (EOA), and about 14% are controlled by multi-signature wallets in which a limited number of persons can change the whole logic of the contract.

研究动机与目标

  • 理解以太坊智能合约如何在承诺不可变的前提下实现可升级性。
  • 对实践中广泛使用的六种可升级性模式进行分类与评估。
  • 测量以太坊上可升级合约的普遍性及其访问控制机制。
  • 评估由单密钥或多重签名管理员控制所引入的中心化风险。
  • 开发一种可推广的检测框架,用于识别超越特定标准或库的可升级模式。

提出的方法

  • 作者设计了一种基于模式的测量框架,通过静态分析和字节码模式匹配,检测以太坊智能合约中的可升级性模式。
  • 他们分析合约字节码,识别出六种可升级性模式的签名,包括 DELEGATECALL、CALL、基于 CREATE2 的形态变换,以及 UUPS。
  • 该框架可检测代理合约并映射其管理员控制机制,区分外部拥有账户(EOA)、多重签名钱包和基于治理的系统。
  • 作者通过已知合约和人工检查验证其检测模型,并对多重签名检测中的假阴性情况进行调整。
  • 他们使用 ArchiveNode 提供的区块链数据,分析了 206 万个区块周期(2020 年 9 月至 2021 年 7 月)内的合约。
  • 研究包含对 UUPS 模式检测的案例研究,展示了该框架在大规模识别易受攻击合约方面的能力。

实验结果

研究问题

  • RQ1现实世界中的以太坊智能合约如何实现可升级性模式?
  • RQ2在以太坊上,哪些可升级性模式最为普遍,原因是什么?
  • RQ3谁控制着可升级合约的管理权限,其相关的信任与安全风险是什么?
  • RQ4可升级合约在多大程度上破坏了区块链系统中不可变性的原则?
  • RQ5是否可以开发一种通用检测框架,在不依赖特定库或标准的前提下识别可升级模式?

主要发现

  • 作者在以太坊上识别出 140 万个代理合约,其中 8,225 个为独特的可升级代理合约。
  • 基于 DELEGATECALL 的模式是最为普遍的可升级机制,因其简洁性和较低的代码注入开销而受到青睐。
  • 约 50% 的可升级合约由单一外部拥有账户(EOA)控制,形成单点故障。
  • 约 14% 的合约由多重签名钱包管理,一小撮签名者可修改合约逻辑。
  • 剩余 29% 的合约由去中心化治理或未知机制控制,但人工检查显示多重签名检测存在假阴性。
  • 本研究证明,可升级性显著削弱了不可变性的核心承诺,48% 的合约可通过单个私钥被攻破。

更好的研究,从现在开始

从阅读论文到最终审阅,大幅缩短您的研究时间。

无需绑定信用卡

本解读由 AI 生成,并经人工编辑审核。