Transaction-based classification and detection approach for Ethereum smart contract

Teng Hu,Xiaolei Liu,Ting Chen,Xiaosong Zhang,Xiaoming Huang,Weina Niu,Jiazhong Lu,Kun Zhou,Yuan Liu
DOI: https://doi.org/10.1016/j.ipm.2020.102462
2021-03-01
Abstract:<p>Blockchain technology brings innovation to various industries. Ethereum is currently the second blockchain platform by market capitalization, it's also the largest smart contract blockchain platform. Smart contracts can simplify and accelerate the development of various applications, but they also bring some problems. For example, smart contracts are used to commit fraud, vulnerability contracts are deliberately developed to undermine fairness, and there are numerous duplicative contracts that waste performance with no actual purpose. In this paper, we propose a transaction-based classification and detection approach for Ethereum smart contract to address these issues. We collected over 10,000 smart contracts from Ethereum and focused on the data behavior generated by smart contracts and users. We identified four behavior patterns from the transactions by manual analysis, which can be used to distinguish the difference between different types of contracts. Then 14 basic features of a smart contract are constructed from these. To construct the experimental dataset, we propose a data slicing algorithm for slicing the collected smart contracts. After that, we use an LSTM network to train and test our datasets. The extensive experimental results show that our approach can distinguish different types of contracts and can be applied to anomaly detection and malicious contract identification with satisfactory precision, recall, and f1-score.</p>
computer science, information systems,information science & library science
What problem does this paper attempt to address?
The problem this paper attempts to address is: Although Ethereum smart contracts simplify and accelerate the development of various applications, they also bring some issues, such as being used for fraud, intentionally developing contracts with vulnerabilities to undermine fairness, and the existence of a large number of redundant contracts with no practical use, all of which waste performance. Therefore, this paper proposes a transaction-based classification and detection method aimed at solving these problems. Specifically, the goals of the paper include: 1. **Identifying and classifying smart contracts**: By analyzing the transaction behavior of smart contracts, identify different types of contracts and distinguish between them. 2. **Detecting malicious contracts**: Using classification methods to discover and identify malicious contracts, such as Ponzi schemes. 3. **Improving the security of the blockchain system**: Enhancing the security of the blockchain system through classification and detection methods, reducing security issues caused by smart contracts. 4. **Optimizing performance management**: By identifying inefficient or poorly designed contracts, help users avoid unnecessary Gas consumption, thereby optimizing the performance of the blockchain. To achieve these goals, the paper collected over 10,000 Ethereum smart contracts and manually analyzed transaction data to identify four behavior patterns. These patterns can be used to distinguish different types of contracts. Additionally, the paper constructed 14 basic features to describe the transaction behavior of smart contracts and proposed a data slicing algorithm to address the issue of insufficient datasets. Finally, an LSTM network was used to train and test the data, and the experimental results show that this method has high precision, recall, and F1 score in classification and anomaly detection.