Skip to main content
QUICK REVIEW

[Paper Review] Characterizing Code Clones in the Ethereum Smart Contract Ecosystem

Ningyu He, Lei Wu|arXiv (Cornell University)|May 1, 2019
Advanced Malware Detection TechniquesComputer Science27 references28 citations
TL;DR

This paper presents the first large-scale analysis of code clones in the Ethereum smart contract ecosystem, using a custom fuzzy hashing approach on a dataset of 10 million contracts. It reveals that over 96% of contracts are duplicates or similar, with 9.7% of similar pairs sharing identical vulnerabilities and 41 DApp clusters causing significant financial losses—30% of original market volume—due to plagiarism.

ABSTRACT

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.

Motivation & Objective

  • To systematically characterize code reuse and cloning behavior in the Ethereum smart contract ecosystem at scale.
  • To investigate the security implications of code clones, particularly the propagation of vulnerabilities.
  • To identify and analyze plagiarized decentralized applications (DApps) that have caused financial harm to original creators.
  • To understand the structural and economic drivers behind contract cloning, especially in popular templates like ERC20 and gaming DApps.

Proposed method

  • Collected a dataset of 10 million Ethereum smart contracts deployed between July 2015 and December 2018.
  • Pre-processed contracts by removing function-irrelevant code (e.g., creation and Swarm code) and tokenizing to EVM opcodes only.
  • Applied a customized fuzzy hashing technique to generate fingerprints for similarity comparison.
  • Used a pruning strategy based on meta-features (e.g., opcode length) to accelerate pairwise similarity comparison.
  • Set a similarity threshold of 70 to identify similar contract pairs, enabling scalable detection of clones.
  • Clustered contracts based on similarity to identify common templates and plagiarism patterns, especially in ERC20, ICO, and game DApps.

Experimental results

Research questions

  • RQ1How prevalent is code cloning across the Ethereum smart contract ecosystem?
  • RQ2What is the relationship between code clones and the propagation of security vulnerabilities?
  • RQ3Which types of DApps are most frequently cloned, and what are the economic consequences for original creators?
  • RQ4How do plagiarized DApps compare in market volume and user engagement to their original counterparts?
  • RQ5What are the dominant templates or patterns that drive code reuse and cloning in smart contracts?

Key findings

  • Over 96% of the 10 million smart contracts analyzed were duplicates or highly similar, indicating extreme homogeneity in the ecosystem.
  • Approximately 9.7% of similar contract pairs shared the exact same vulnerabilities, suggesting that vulnerabilities are commonly propagated via code clones.
  • A total of 41 DApp clusters were identified, involving 73 plagiarized DApps that collectively captured 89,565.321 ETH in trading volume—about 30% of the original 304,797.344 ETH volume of the 41 original DApps.
  • In 18 of the 41 clusters, the plagiarized DApps attracted more volume than the original DApps, with some clones drawing two to three times more activity.
  • ERC20 token contracts, ICOs, and game DApps were the most common templates for cloning, with a Pareto-like distribution where a small number of clusters accounted for the majority of contracts.
  • The study confirms a contradiction between the open-source ethos of Ethereum and the lack of copyright protection, as plagiarized DApps cause significant financial harm to original developers.

Read this paper

Open the full text in the Nubint reader and ask about any passage as you read.

Read this paper on Nubint

This review was generated by AI from the original paper. Please check the paper before citing it.