Collaborative Learning Framework to Detect Attacks in Transactions and Smart Contracts (2308.15804v3)
Abstract: With the escalating prevalence of malicious activities exploiting vulnerabilities in blockchain systems, there is an urgent requirement for robust attack detection mechanisms. To address this challenge, this paper presents a novel collaborative learning framework designed to detect attacks in blockchain transactions and smart contracts by analyzing transaction features. Our framework exhibits the capability to classify various types of blockchain attacks, including intricate attacks at the machine code level (e.g., injecting malicious codes to withdraw coins from users unlawfully), which typically necessitate significant time and security expertise to detect. To achieve that, the proposed framework incorporates a unique tool that transforms transaction features into visual representations, facilitating efficient analysis and classification of low-level machine codes. Furthermore, we propose an advanced collaborative learning model to enable real-time detection of diverse attack types at distributed mining nodes. Our model can efficiently detect attacks in smart contracts and transactions for blockchain systems without the need to gather all data from mining nodes into a centralized server. In order to evaluate the performance of our proposed framework, we deploy a pilot system based on a private Ethereum network and conduct multiple attack scenarios to generate a novel dataset. To the best of our knowledge, our dataset is the most comprehensive and diverse collection of transactions and smart contracts synthesized in a laboratory for cyberattack detection in blockchain systems. Our framework achieves a detection accuracy of approximately 94% through extensive simulations and 91% in real-time experiments with a throughput of over 2,150 transactions per second.
- Y. Yuan and F.-Y. Wang, “Blockchain and cryptocurrencies: Model, techniques, and applications,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 48, no. 9, pp. 1421–1428, Sep. 2018.
- V. Buterin, “Ethereum: A next-generation smart contract and decentralized application platform,” Ethereum Foundation, Tech. Rep., Jan. 2014.
- SmartContractSecurity, “SWC Registry - Smart Contract Weakness Classification and Test Cases,” Accessed: Sept. 18, 2022. [Online]. Available: https://swcregistry.io
- S. Wang, L. Ouyang, Y. Yuan, X. Ni, X. Han, and F.-Y. Wang, “Blockchain-enabled smart contracts: architecture, applications, and future trends,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, vol. 49, no. 11, pp. 2266–2277, Feb. 2019.
- E. Banisadr, “How $800k Evaporated from the PoWH Coin Ponzi Scheme Overnight,” Accessed: Feb. 13, 2023. [Online]. Available: https://medium.com/@ebanisadr/how-800k-evaporated-from-the-powh-coin-ponzi-scheme-overnight-1b025c33b530
- J. Huang, S. Han, W. You, W. Shi, B. Liang, J. Wu, and Y. Wu, “Hunting vulnerable smart contracts via graph embedding based bytecode matching,” IEEE Transactions on Information Forensics and Security, vol. 16, pp. 2144–2156, Jan. 2021.
- J. Chen, X. Xia, D. Lo, J. Grundy, X. Luo, and T. Chen, “Defectchecker: Automated smart contract defect detection by analyzing evm bytecode,” IEEE Transactions on Software Engineering, vol. 48, no. 7, pp. 2189–2207, Jan. 2021.
- P. Qian, Z. Liu, Q. He, R. Zimmermann, and X. Wang, “Towards automated reentrancy detection for smart contracts based on sequential models,” IEEE Access, vol. 8, pp. 19 685–19 695, Jan. 2020.
- W. Wang, J. Song, G. Xu, Y. Li, H. Wang, and C. Su, “Contractward: Automated vulnerability detection models for ethereum smart contracts,” IEEE Transactions on Network Science and Engineering, vol. 8, no. 2, pp. 1133–1144, Jan. 2020.
- Q.-B. Nguyen, A.-Q. Nguyen, V.-H. Nguyen, T. Nguyen-Le, and K. Nguyen-An, “Detect abnormal behaviours in ethereum smart contracts using attack vectors,” in International Conference on Future Data and Security Engineering, Nha Trang, Vietnam, Nov. 2019, pp. 485–505.
- N. Ivanov, Q. Yan, and A. Kompalli, “Txt: Real-time transaction encapsulation for Ethereum smart contracts,” IEEE Transactions on Information Forensics and Security, vol. 18, pp. 1141–1155, Jan. 2023.
- B. Lashkari and P. Musilek, “A comprehensive review of blockchain consensus mechanisms,” IEEE Access, vol. 9, pp. 43 620–43 652, Mar. 2021.
- V. Buterin, D. Hernandez, T. Kamphefner, K. Pham, Z. Qiao, D. Ryan, J. Sin, Y. Wang, and Y. X. Zhang, “Combining ghost and casper,” May 2020. [Online]. Available: https://arxiv.org/abs/2003.03052
- H. Chen, M. Pendleton, L. Njilla, and S. Xu, “A survey on ethereum systems security: Vulnerabilities, attacks, and defenses,” ACM Computing Surveys, vol. 53, no. 3, pp. 1–43, May 2021.
- T. V. Khoa, D. H. Son, D. T. Hoang, N. L. Trung, T. T. T. Quynh, D. N. Nguyen, N. V. Ha, and E. Dutkiewicz, “Collaborative learning for cyberattack detection in blockchain networks,” IEEE Transactions on Systems, Man, and Cybernetics: Systems, Feb. 2024, (accepted).
- L. Hollander, “Evm bytecode decompiler,” Accessed: Feb. 10, 2023. [Online]. Available: https://www.npmjs.com/package/evm
- W. Rawat and Z. Wang, “Deep convolutional neural networks for image classification: A comprehensive review,” Neural Computation, vol. 29, no. 9, pp. 2352–2449, Aug. 2017.
- Y. LeCun, Y. Bengio, and G. Hinton, “Deep learning,” Nature, vol. 521, no. 7553, pp. 436–444, May 2015.
- Y. M. Saputra, D. Nguyen, H. T. Dinh, Q.-V. Pham, E. Dutkiewicz, and W.-J. Hwang, “Federated learning framework with straggling mitigation and privacy-awareness for ai-based mobile application services,” IEEE Transactions on Mobile Computing, May 2022.
- D. P. Kingma and J. Ba, “Adam: A method for stochastic optimization,” in 3rd International Conference on Learning Representations, San Diego, CA, USA, May 2015, pp. 1–15.
- J. Konečnỳ, H. B. McMahan, D. Ramage, and P. Richtárik, “Federated optimization: Distributed machine learning for on-device intelligence,” Oct. 2016. [Online]. Available: https://arxiv.org/abs/1610.02527
- Ethereum, “Official Go implementation of the Ethereum protocol,” Accessed: Nov. 18, 2022. [Online]. Available: https://github.com/ethereum/go-ethereum/tree/v1.10.22
- Prysmatic Labs, “Prysm: An Ethereum Consensus Implementation Written in Go,” Accessed: Jan. 10, 2023. [Online]. Available: https://github.com/prysmaticlabs/prysm/tree/v3.2.0
- A. Said, M. U. Janjua, S.-U. Hassan, Z. Muzammal, T. Saleem, T. Thaipisutikul, S. Tuarob, and R. Nawaz, “Detailed analysis of ethereum network on transaction behavior, community structure and link prediction,” PeerJ Computer Science, vol. 7, pp. 1–26, Dec. 2021.
- OpenZeppelin, “A library for secure smart contract development,” Accessed: Sept. 18, 2022. [Online]. Available: https://github.com/OpenZeppelin/openzeppelin-contracts
- T. Fawcett, “An introduction to ROC analysis,” Pattern Recognition Letters, vol. 27, no. 8, pp. 861–874, June 2006.
- D. M. Powers, “Evaluation: from precision, recall and F-measure to ROC, informedness, markedness and correlation,” Journal of Machine Learning Technologies, pp. 37–63, Oct. 2011.
- Etherscan, “Ethereum daily transactions chart,” Accessed: Feb. 10, 2023. [Online]. Available: https://etherscan.io/chart/tx