journal article·2025-04-07Open access

Hybrid Quantum–Classical Deep Neural Networks Based Smart Contract Vulnerability Detection

Sinan Durgut, Ecir Uğur Küçüksille, Mahmut Tokmak

Applied Sciences· Volume 15· Issue 7

Abstract

The increasing adoption of blockchain technology has presented significant challenges in maintaining the security and reliability of smart contracts. This study addresses the problem of identifying security flaws in smart contracts, which may result in monetary damages and diminished confidence in blockchain systems. A Hybrid Quantum–Classical Deep Neural Network (HQCDNN) approach was proposed, combining quantum computing principles with classical deep learning methods to identify various vulnerability types, including access control, arithmetic, front-running, reentrancy, time manipulation, denial of service, and unchecked low calls. The SmartBugs Wild Dataset was used for training, with TF-IDF employed as a preprocessing technique optimized for hybrid architectures. Experiments were conducted using hybrid architectures with 2-qubit and 4-qubit quantum layers, alongside a classical deep neural network (DNN) model for comparative analysis. The HQCDNN model attained accuracy levels ranging from 96.4% to 78.2% and F1-scores between 96.6% and 80.2%, showcasing enhanced performance compared to the classical and deep learning models referenced in the literature. These results highlight the capability of HQCDNNs to improve the identification of security flaws in smart contracts. Future work could focus on evaluating the model on actual quantum devices and expanding its application to larger datasets for further validation.
Source: crossref · Quality: baseline

Research context

OpenAlex topics: Blockchain Technology Applications and Security · Adversarial Robustness in Machine Learning · Imbalanced Data Classification Techniques

SciVX discovery tags are terminology-based. OpenAlex topics are source-provided classifications.

Affiliations

Institute of Natural and Applied Sciences, Suleyman Demirel University, Isparta 32200, Türkiye

Department of Computer Engineering, Engineering and Natural Sciences Faculty, Suleyman Demirel University, Isparta 32200, Türkiye

Department of Management Information Systems, Bucak Zeliha Tolunay School of Applied Technology and Management, Burdur Mehmet Akif Ersoy University, Burdur 15300, Türkiye

References (75)

Show source-provided references
1. Nakamoto, S. (2024, November 13). Bitcoin: A Peer-to-Peer Electronic Cash System. Available online: https://www.klausnordby.com/bitcoin/Bitcoin_Whitepaper_Document_HD.pdf.
2. A Next-Generation Smart Contract and Decentralized Application Platform
3. Wu, H., Dong, H., He, Y., and Duan, Q. (2023). Smart Contract Vulnerability Detection Based on Hybrid Attention Mechanism Model. Appl. Sci., 13.10.3390/app13020770 ↗
4. Ethereum Smart Contract Analysis Tools: A Systematic Review10.1109/ACCESS.2022.3169902 ↗
5. Ethereum: A Secure Decentralised Generalised Transaction Ledger
6. Zheng, Z., Xie, S., Dai, H., Chen, X., and Wang, H. (2017, January 25–30). An Overview of Blockchain Technology: Architecture, Consensus, and Future Trends. Proceedings of the 2017 IEEE International Congress on Big Data (BigData Congress), Honolulu, HI, USA.10.1109/BigDataCongress.2017.85 ↗
7. Antonopoulos, A.M., and Wood, G. (2018). Mastering Ethereum: Building Smart Contracts and Dapps, O’reilly Media.
8. Brenner, M., Rohloff, K., Bonneau, J., Miller, A., Ryan, P.Y.A., Teague, V., Bracciali, A., Sala, M., Pintore, F., and Jakobsson, M. (2017, January 3–7). Defining the Ethereum Virtual Machine for Interactive Theorem Provers. Proceedings of the Financial Cryptography and Data Security, Sliema, Malta.10.1007/978-3-319-70278-0 ↗
9. Szabo, N. (1997). Formalizing and Securing Relationships on Public Networks. First Monday, Available online: https://firstmonday.org/ojs/index.php/fm/article/view/548.10.5210/fm.v2i9.548 ↗
10. Luu, L., Chu, D.-H., Olickel, H., Saxena, P., and Hobor, A. (2016, January 24–28). Making Smart Contracts Smarter. Proceedings of the 2016 ACM SIGSAC Conference on Computer and Communications Security, Vienna, Austria.10.1145/2976749.2978309 ↗
11. A Survey of Attacks on Ethereum Smart Contracts (SoK)10.1007/978-3-662-54455-6_8 ↗
12. Kalra, S., Goel, S., Dhawan, M., and Sharma, S. (2018, January 18–21). Zeus: Analyzing Safety of Smart Contracts. Proceedings of the Ndss, San Diego, CA, USA.10.14722/ndss.2018.23082 ↗
13. Team, C. (2025, March 13). Wormhole Hack: Lessons From The Wormhole Exploit. Available online: https://www.chainalysis.com/blog/wormhole-hack-february-2022/.
14. (2025, March 13). Hackers Steal More than $600 Million from Maker of Axie Infinity. Available online: https://www.nbcnews.com/tech/tech-news/hackers-steal-600-million-maker-axie-infinity-rcna22031.
15. Wu, Z., Li, S., Wang, B., Liu, T., Zhu, Y., Zhu, C., and Hu, M. (2022, January 24–26). Detecting Vulnerabilities in Ethereum Smart Contracts with Deep Learning. Proceedings of the 2022 4th International Conference on Data Intelligence and Security (ICDIS), Shenzhen, China.10.1109/ICDIS55630.2022.00016 ↗
16. A Survey on Privacy Protection in Blockchain System10.1016/j.jnca.2018.10.020 ↗
17. Zhuang, Y., Liu, Z., Qian, P., Liu, Q., Wang, X., and He, Q. (2021, January 7–15). Smart Contract Vulnerability Detection Using Graph Neural Networks. Proceedings of the Twenty-Ninth International Conference on International Joint Conferences on Artificial Intelligence, Yokohama, Japan.10.24963/ijcai.2020/454 ↗
18. Durieux, T., Ferreira, J.F., Abreu, R., and Cruz, P. (July, January 27). Empirical Review of Automated Analysis Tools on 47,587 Ethereum Smart Contracts. Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea.
19. Katı, B.E., Küçüksille, E.U., and Sarıman, G. (2025). Enhancing Deepfake Detection Through Quantum Transfer Learning and Class-Attention Vision Transformer Architecture. Appl. Sci., 15.10.3390/app15020525 ↗
20. Quantum Machine Learning10.1038/nature23474 ↗
21. Machine Learning & Artificial Intelligence in the Quantum Domain: A Review of Recent Progress10.1088/1361-6633/aab406 ↗
22. Kashif, M., and Al-Kuwari, S. (2021). Design Space Exploration of Hybrid Quantum–Classical Neural Networks. Electronics, 10.10.3390/electronics10232980 ↗
23. Kea, K., Kim, D., Huot, C., Kim, T.-K., and Han, Y. (2024). A Hybrid Quantum-Classical Model for Stock Price Prediction Using Quantum-Enhanced Long Short-Term Memory. Entropy, 26.10.3390/e26110954 ↗
24. Schuld, M., and Petruccione, F. (2018). Quantum Information. Supervised Learning with Quantum Computers, Springer International Publishing.10.1007/978-3-319-96424-9 ↗
25. Detection of Vulnerabilities of Blockchain Smart Contracts10.1109/JIOT.2023.3241544 ↗
26. Wu, H., Zhang, Z., Wang, S., Lei, Y., Lin, B., Qin, Y., Zhang, H., and Mao, X. (2021, January 25–28). Peculiar: Smart Contract Vulnerability Detection Based on Crucial Data Flow Graph and Pre-Training Techniques. Proceedings of the 2021 IEEE 32nd International Symposium on Software Reliability Engineering (ISSRE), Wuhan, China.10.1109/ISSRE52982.2021.00047 ↗
27. Enhancing Oyente: Four New Vulnerability Detections for Improved Smart Contract Security Analysis10.1007/s41870-024-01909-8 ↗
28. Ahrendt, W., Beckert, B., Bubel, R., and Johnsen, E.B. (2022). Symbolic Execution: Foundations, Techniques, Applications, and Future Perspectives. The Logic of Software. A Tasting Menu of Formal Methods: Essays Dedicated to Reiner Hähnle on the Occasion of His 60th Birthday, Springer International Publishing.10.1007/978-3-031-08166-8 ↗
29. (2023, August 12). Consensys Mythril. Available online: https://github.com/ConsenSys/mythril.
30. Nikolić, I., Kolluri, A., Sergey, I., Saxena, P., and Hobor, A. (2018, January 3–7). Finding The Greedy, Prodigal, and Suicidal Contracts at Scale. Proceedings of the 34th Annual Computer Security Applications Conference, San Juan, PR, USA.10.1145/3274694.3274743 ↗
31. Tsankov, P., Dan, A., Drachsler-Cohen, D., Gervais, A., Bünzli, F., and Vechev, M. (2018, January 15–19). Securify: Practical Security Analysis of Smart Contracts. Proceedings of the 2018 ACM SIGSAC Conference on Computer and Communications Security, Toronto, ON, Canada.10.1145/3243734.3243780 ↗
32. Feist, J., Grieco, G., and Groce, A. (2019, January 27). Slither: A Static Analysis Framework For Smart Contracts. Proceedings of the 2019 IEEE/ACM 2nd International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB), Montreal, QC, Canada.10.1109/WETSEB.2019.00008 ↗
33. Pani, S., Nallagonda, H.V., Prakash, S., Vigneswaran, R., Medicherla, R.K., and Rajan, M.A. (2022, January 4–8). Smart Contract Fuzzing for Enterprises: The Language Agnostic Way. Proceedings of the 2022 14th International Conference on COMmunication Systems & NETworkS (COMSNETS), Bangalore, India.10.1109/COMSNETS53615.2022.9668512 ↗
34. Jiang, B., Liu, Y., and Chan, W.K. (2018, January 3–7). ContractFuzzer: Fuzzing Smart Contracts for Vulnerability Detection. Proceedings of the 33rd ACM/IEEE International Conference on Automated Software Engineering, Montpellier, France.10.1145/3238147.3238177 ↗
35. He, J., Balunović, M., Ambroladze, N., Tsankov, P., and Vechev, M. (2019, January 11–15). Learning to Fuzz from Symbolic Execution with Application to Smart Contracts. Proceedings of the 2019 ACM SIGSAC Conference on Computer and Communications Security, London, UK.10.1145/3319535.3363230 ↗
36. EtherFuzz: Mutation Fuzzing Smart Contracts for TOD Vulnerability Detection
37. Nguyen, T.D., Pham, L.H., Sun, J., Lin, Y., and Minh, Q.T. (July, January 27). sFuzz: An Efficient Adaptive Fuzzer for Solidity Smart Contracts. Proceedings of the ACM/IEEE 42nd International Conference on Software Engineering, Seoul, Republic of Korea.
38. Murray, Y., and Anisi, D.A. (2019, January 24–26). Survey of Formal Verification Methods for Smart Contracts on Blockchain. Proceedings of the 2019 10th IFIP International Conference on New Technologies, Mobility and Security (NTMS), Canary Islands, Spain.10.1109/NTMS.2019.8763832 ↗
39. Hildenbrandt, E., Saxena, M., Rodrigues, N., Zhu, X., Daian, P., Guth, D., Moore, B., Park, D., Zhang, Y., and Stefanescu, A. (2018, January 9–12). Kevm: A Complete Formal Semantics of the Ethereum Virtual Machine. Proceedings of the 2018 IEEE 31st Computer Security Foundations Symposium (CSF), Oxford, UK.10.1109/CSF.2018.00022 ↗
40. Meiklejohn, S., and Sako, K. (2018). Designing Secure Ethereum Smart Contracts: A Finite State Machine Based Approach. Financial Cryptography and Data Security, Springer.
41. Amani, S., Bégel, M., Bortin, M., and Staples, M. (2018, January 8–9). Towards Verifying Ethereum Smart Contract Bytecode in Isabelle/HOL. Proceedings of the 7th ACM SIGPLAN International Conference on Certified Programs and Proofs, Los Angeles, CA, USA.10.1145/3167084 ↗
42. Tikhomirov, S., Voskresenskaya, E., Ivanitskiy, I., Takhaviev, R., Marchenko, E., and Alexandrov, Y. (June, January 27). SmartCheck: Static Analysis of Ethereum Smart Contracts. Proceedings of the 1st International Workshop on Emerging Trends in Software Engineering for Blockchain, Gothenburg, Sweden.
43. Liu, Z., Qian, P., Wang, X., Zhu, L., He, Q., and Ji, S. (2021, January 19–27). Smart Contract Vulnerability Detection: From Pure Neural Network to Interpretable Graph Feature and Expert Pattern Fusion. Proceedings of the Thirtieth International Joint Conference on Artificial Intelligence, Montreal, QC, Canada.10.24963/ijcai.2021/379 ↗
44. Sendner, C., Zhang, R., Hefter, A., Dmitrienko, A., and Koushanfar, F. (2023). G-Scan: Graph Neural Networks for Line-Level Vulnerability Identification in Smart Contracts. arXiv.
45. Chen, Y. (2024). Vulnerability-Hunter: An Adaptive Feature Perception Attention Network for Smart Contract Vulnerabilities. arXiv.
46. Qian, P., Liu, Z., He, Q., Huang, B., Tian, D., and Wang, X. (2022). Smart Contract Vulnerability Detection Technique: A Survey. arXiv.
47. Li, J., Lu, G., Gao, Y., and Gao, F. (2023). A Smart Contract Vulnerability Detection Method Based on Multimodal Feature Fusion and Deep Learning. Mathematics, 11.10.3390/math11234823 ↗
48. Zhang, L., Chen, W., Wang, W., Jin, Z., Zhao, C., Cai, Z., and Chen, H. (2022). Cbgru: A Detection Method of Smart Contract Vulnerability Based on a Hybrid Model. Sensors, 22.10.3390/s22093577 ↗
49. Wang, M., Xie, Z., Wen, X., Li, J., and Zhou, K. (2023). Ethereum Smart Contract Vulnerability Detection Model Based on Triplet Loss and BiLSTM. Electronics, 12.10.3390/electronics12102327 ↗
50. Deng, W., Wei, H., Huang, T., Cao, C., Peng, Y., and Hu, X. (2023). Smart Contract Vulnerability Detection Based on Deep Learning and Multimodal Decision Fusion. Sensors, 23.10.3390/s23167246 ↗
51. Bani-Hani, R.M., Shatnawi, A.S., and Al-Yahya, L. (2024). Vulnerability Detection and Classification of Ethereum Smart Contracts Using Deep Learning. Future Internet, 16.10.3390/fi16090321 ↗
52. Nielsen, M.A., and Chuang, I.L. (2010). Quantum Computation and Quantum Information, Cambridge University Press.
53. Blockchain Security: A Survey of Techniques and Research Directions10.1109/TSC.2020.3038641 ↗
54. Evaluating Hybrid Quantum-Classical Deep Learning for Cybersecurity Botnet DGA Detection10.1016/j.procs.2021.12.135 ↗
55. Text Mining: Use of TF-IDF to Examine the Relevance of Words to Documents
56. KNN with TF-IDF Based Framework for Text Categorization10.1016/j.proeng.2014.03.129 ↗
57. Ou, J., Chen, Y., and Tian, W. (2024). Lossless Acceleration of Large Language Model via Adaptive N-Gram Parallel Decoding. arXiv.10.18653/v1/2024.naacl-industry.2 ↗
58. An Introduction to Quantum Machine Learning10.1080/00107514.2014.964942 ↗
59. Grover, L.K. (1996, January 22–24). A Fast Quantum Mechanical Algorithm for Database Search. Proceedings of the Twenty-Eighth Annual ACM Symposium on Theory of Computing—STOC ’96, Philadelphia, PA, USA.10.1145/237814.237866 ↗
60. Hidary, J.D. (2021). Quantum Computing: An Applied Approach, Springer International Publishing.10.1007/978-3-030-83274-2 ↗
61. Quantum Algorithm for Linear Systems of Equations10.1103/PhysRevLett.103.150502 ↗
62. The End of Moore’s Law: A New Beginning for Information Technology10.1109/MCSE.2017.29 ↗
63. Quantum Algorithms: An Overview10.1038/npjqi.2015.23 ↗
64. Schuld, M., and Petruccione, F. (2018). Supervised Learning with Quantum Computers, Springer International Publishing. Quantum Science and Technology.10.1007/978-3-319-96424-9 ↗
65. Supervised Learning with Quantum-Enhanced Feature Spaces10.1038/s41586-019-0980-2 ↗
66. Quantum Supremacy Using a Programmable Superconducting Processor10.1038/s41586-019-1666-5 ↗
67. Parameterized Quantum Circuits as Machine Learning Models10.1088/2058-9565/ab4eb5 ↗
68. Barren Plateaus in Quantum Neural Network Training Landscapes10.1038/s41467-018-07090-4 ↗
69. Quantum Circuit Learning10.1103/PhysRevA.98.032309 ↗
70. Variational Quantum Algorithms10.1038/s42254-021-00348-9 ↗
71. (2025, March 20). Qml.BasicEntanglerLayers. Available online: https://docs.pennylane.ai/en/stable/code/api/pennylane.BasicEntanglerLayers.html.
72. Paayas, P., Sridevi, S., Kanimozhi, T., Valliammai, M., Mohanraj, J., Kumar, V., Bakiya, A., and Rithani, M. (2023, January 6–8). Hybrid Classical Quantum Neural Network Based Classification of Photonic Band Gap Crystal Structure Defects. Proceedings of the 2023 14th International Conference on Computing Communication and Networking Technologies (ICCCNT), Delhi, India.10.1109/ICCCNT56998.2023.10307283 ↗
73. (2025, March 20). Solidity 0.4.11 Release Announcement. Available online: https://soliditylang.org/blog/2017/05/03/solidity-0.4.11-release-announcement/.
74. Filatov, S., and Auzinsh, M. (2024). Towards Two Bloch Sphere Representation of Pure Two-Qubit States and Unitaries. Entropy, 26.10.3390/e26040280 ↗
75. Guo, J., Lu, L., and Li, J. (2024). Smart Contract Vulnerability Detection Based on Multi-Scale Encoders. Electronics, 13.10.20944/preprints202312.2325.v1 ↗