[论文解读] Characterizing Code Clones in the Ethereum Smart Contract Ecosystem
本文首次对以太坊智能合约生态系统中的代码克隆现象进行了大规模分析,采用自定义的模糊哈希方法对1000万份合约数据集进行分析。研究发现,超过96%的合约是重复或相似的,其中9.7%的相似合约对共享相同的漏洞,且41个DApp集群因抄袭行为导致重大财务损失——占原始市场总量的30%。
In this paper, we present the first large-scale and systematic study to characterize the code reuse practice in the Ethereum smart contract ecosystem. We first performed a detailed similarity comparison study on a dataset of 10 million contracts we had harvested, and then we further conducted a qualitative analysis to characterize the diversity of the ecosystem, understand the correlation between code reuse and vulnerabilities, and detect the plagiarist DApps. Our analysis revealed that over 96% of the contracts had duplicates, while a large number of them were similar, which suggests that the ecosystem is highly homogeneous. Our results also suggested that roughly 9.7% of the similar contract pairs have exactly the same vulnerabilities, which we assume were introduced by code clones. In addition, we identified 41 DApps clusters, involving 73 plagiarized DApps which had caused huge financial loss to the original creators, accounting for 1/3 of the original market volume.
研究动机与目标
- 系统性地在大规模范围内表征以太坊智能合约生态系统中的代码复用与克隆行为。
- 探究代码克隆的潜在安全影响,特别是漏洞传播机制。
- 识别并分析因抄袭行为对原始开发者造成财务损害的去中心化应用(DApps)。
- 理解合约克隆背后的结构性与经济驱动因素,特别是ERC20和游戏类DApp等流行模板。
提出的方法
- 收集了2015年7月至2018年12月期间部署的1000万份以太坊智能合约数据集。
- 通过移除与函数无关的代码(如创建代码和Swarm代码)并仅保留EVM操作码,对合约进行预处理。
- 应用定制化的模糊哈希技术,生成用于相似性比较的指纹。
- 基于元特征(如操作码长度)设计剪枝策略,以加速成对相似性比较。
- 设定70%的相似度阈值,以识别相似合约对,实现克隆的可扩展检测。
- 基于相似性对合约进行聚类,识别通用模板与抄袭模式,尤其关注ERC20、ICO和游戏类DApp。
实验结果
研究问题
- RQ1代码克隆在以太坊智能合约生态系统中有多普遍?
- RQ2代码克隆与安全漏洞传播之间存在何种关系?
- RQ3哪些类型的DApp最常被克隆?对原始开发者造成了何种经济后果?
- RQ4抄袭的DApp与原始版本相比,在市场交易量和用户参与度方面有何差异?
- RQ5驱动智能合约代码复用与克隆的主要模板或模式是什么?
主要发现
- 在分析的1000万份智能合约中,超过96%为重复或高度相似合约,表明该生态系统存在极强的同质化特征。
- 约9.7%的相似合约对共享完全相同的漏洞,表明漏洞常通过代码克隆传播。
- 共识别出41个DApp集群,涉及73个抄袭的DApp,合计捕获89,565.321 ETH的交易量——约占原始41个DApp总交易量304,797.344 ETH的30%。
- 在41个集群中的18个,抄袭的DApp吸引了比原始DApp更多的交易量,部分克隆版本的活动量达到原始版本的2至3倍。
- ERC20代币合约、ICO和游戏类DApp是最常见的克隆模板,且呈现类似帕累托分布的特征,即少数几个集群占据了绝大多数合约。
- 本研究证实了以太坊开放源代码理念与缺乏版权保护之间的矛盾:抄袭的DApp对原始开发者造成了显著的财务损害。
更好的研究,从现在开始
从论文设计到论文写作,大幅缩短您的研究时间。
无需绑定信用卡
本解读由 AI 生成,并经人工编辑审核。