A Binary Classification Detection Method for Smart Contract Honeypots Based on LSTM-Attention-CNN
Keywords:
Smart Contract, Smart Contract Honeypot, LSTM, Attention Mechanism; TextCNNAbstract
To address the technical bottlenecks of existing smart contract honeypot detection methods, such as reliance on expert rules, low detection efficiency, and difficulty in identifying new honeypots, this paper proposes a binary classification detection method for smart contract honeypots based on the fusion of Long Short-Term Memory (LSTM) network, Attention mechanism, and Convolutional Neural Network (CNN). Taking smart contract source code as the research object, this method converts code into trainable sequence data through data preprocessing, and designs a hybrid LSTM-Attention-CNN model to jointly capture temporal dependency features and local key patterns of code, so as to accurately distinguish smart contract honeypots from normal contracts. The cross-entropy loss function and Adam optimization algorithm are introduced, combined with the early stopping strategy to avoid model overfitting and improve detection stability. Experiments are carried out based on the Ethereum smart contract dataset. The results show that the accuracy, recall rate and F1-score of the proposed model on the test set reach 98.97%, 98.82% and 98.89% respectively. Compared with single LSTM, CNN and BLSTM-ATT models, the detection performance is significantly improved, and the detection efficiency meets the requirements of large-scale batch contract detection, providing an efficient and reliable technical means for smart contract security audit.
References
Nakamoto, S. (2008). Bitcoin: A peer-to-peer electronic cash system. Working Paper.
Buterin, V. (2014). Ethereum: A next-generation smart contract and decentralized application platform. White Paper.
Ronin Network. (2022). Ronin bridge exploit post-mortem. Technical Report.
Torres, C. F., Steichen, M., & State, R. (2019). The art of the scam: Demystifying honeypots in Ethereum smart contracts. In Proceedings of the 28th USENIX Security Symposium (pp. 1591–1607). USENIX Association.
Torres, C. F., & Steichen, M. (2019). The art of the scam: Demystifying honeypots in ethereum smart contracts. In 28th USENIX Security Symposium (USENIX Security 19) (pp. 1591-1607).
Liu, Z., Jiang, M., Zhang, S., Zhang, J., & Liu, Y. (2023). A smart contract vulnerability detection mechanism based on deep learning and expert rules. IEEE Access, 11, 77990-77999.
Kim, Y. (2014). Convolutional neural networks for sentence classification. In Proceedings of the 2014 Conference on Empirical Methods in Natural Language Processing (pp. 1746–1751).
Hochreiter, S., & Schmidhuber, J. (1997). Long short-term memory. Neural Computation, 9(8), 1735–1780.
Bahdanau, D., Cho, K., & Bengio, Y. (2014). Neural machine translation by jointly learning to align and translate. arXiv preprint arXiv:1409.0473.
Zhang, Y., & Wallace, B. (2015). A sensitivity analysis of convolutional neural networks for sentence classification. arXiv preprint arXiv:1510.03820.
Kingma, D. P., & Ba, J. (2014). Adam: A method for stochastic optimization. arXiv preprint arXiv:1412.6980.
Rahardja, U., & Aini, Q. (2026). Enhancing Blockchain Security Through Smart Contract Vulnerability Classification Using BiLSTM and Attention Mechanism. Journal of Current Research in Blockchain, 3(1), 28-45.
Otoum, Y., Asad, A., & Nayak, A. (2025). Blockchain meets adaptive honeypots: A trust-aware approach to next-gen iot security. IEEE Transactions on Network Science and Engineering.
