SmartTrans: Advanced Similarity Analysis for Detecting Vulnerabilities in Ethereum Smart Contracts
- 3 March 2025
- journal article
- Published by Institute of Electrical and Electronics Engineers (IEEE) in IEEE Transactions on Dependable and Secure Computing
- Vol. 22 (4) , 4412-4427
Abstract
In the ever-evolving landscape of Ethereum smart contracts, the specter of vulnerabilities intensified by code reuse presents a significant challenge to the security of the blockchain. Recent studies employ deep learning for similarity analysis to identify these vulnerabilities, yet their effectiveness wanes as the volume of analyzed code increases. This paper introduces SmartTrans, an advanced similarity analysis model designed to efficiently and accurately retrieve similar vulnerabilities within Ethereum bytecodes. Leveraging a novel jump-aware Transformer-based model, our approach captures the semantics and control flow of bytecodes. It not only refines the representation of functions by integrating program analysis with natural language processing techniques but also innovates a contract-level similarity detection scheme tailored for the expansive scale of contracts. Our experiments show that SmartTrans outperforms state-of-the-art techniques at both function and contract levels, proving its capability to detect n-day vulnerabilities across Ethereum bytecodes accurately. Vulnerabilities recalling experiments show that SmartTrans achieves 95.43% and 99.37% accuracy at two levels. Furthermore, we stand out as the first work to retrieve N-day vulnerabilities across the Ethereum bytecode corpus, unveiling 4,988 vulnerable contracts. Our methodology secures an accuracy of 88.60%, which is 1.30 times higher than the best baseline.Keywords
Funding Information
- National Key Research and Development Program of China (2021YFB2701000)
This publication has 42 references indexed in Scilit:
- SmartMixModel: Machine Learning-based Vulnerability Detection of Solidity Smart Contracts2022
- SMARTIAN: Enhancing Smart Contract Fuzzing with Static and Dynamic Data-Flow Analyses2021
- Code cloning in smart contracts: a case study on verified contracts from the Ethereum blockchain platformEmpirical Software Engineering, 2020
- Characterizing Code Clones in the Ethereum Smart Contract Ecosystem2020
- Natural Language Processing2020
- SAFE: Self-Attentive Function Embeddings for Binary Similarity2019
- Zero-Shot Learning — The Good, the Bad and the Ugly2017
- Compiler-Agnostic Function Detection in Binaries2017
- FaceNet: A unified embedding for face recognition and clustering2015
- Dimensionality Reduction by Learning an Invariant Mapping2006