2023 IEEE 22ND INTERNATIONAL CONFERENCE ON TRUST, SECURITY AND PRIVACY IN COMPUTING AND COMMUNICATIONS, TRUSTCOM, BIGDATASE, CSE, EUC, ISCI 2023(2024)
Guangzhou Univ
被引用0|浏览12
摘要
Ethereum is a blockchain platform that allows developers to create smart contracts. Smart contracts are programs that can automatically execute and handle cryptocurrency funds. However, over a hundred thousand new smart contracts are deployed every day and inevitably contain vulnerabilities due to programming errors. Once deployed, smart contracts cannot be fixed or changed, leaving funds at risk. To mitigate it, we use deep learning to detect vulnerabilities in smart contracts. First, we create our own dataset of labeled smart contracts based on opcode sequences, since few smart contract codes and labeled datasets are publicly available. We collect opcode sequences by replaying real-world transactions from the Ethereum Mainnet in our fully synchronized node while we leverage a plugin called "SODA" to label opcode sequences with vulnerability classes. Second, after data collection, we preprocess the data by removing duplicate opcode sequences, normalizing the sequences to the same length, and converting them into vectors. Finally, to detect vulnerabilities in smart contracts, we train a deep classification model using LSTM neural networks. Our model achieved an average accuracy of 82.63% and an F1-score of 79.74% across seven types of vulnerabilities, which is important for securing funds and logic in smart contracts.