Enhanced DOS Anomaly Detection Framework for Smart Contract Using Blockchain Metadata Analysis


  • Monali Shetty, Sharvari Tamane


Blockchain, Ethereum, Smart Contract, Anomaly Detection, Blockchain Metadata, DOS attack, Machine Learning, Voting Classifier.


Smart contracts (SCs) deployed on blockchain platforms like Ethereum blockchain provide a platform with the purpose of managing commercial arrangements. Though, the visibility of SCs makes them vulnerable to exploitation and misuse, including Denial-of-Service (DoS) attacks. This research introduces an advanced anomaly detection framework aimed at strengthening smart contract security by leveraging blockchain metadata analysis. Unlike traditional methods relying solely on transaction data, this framework incorporates comprehensive metadata like transaction sources, gas fees, and timestamps to provide contextual insights for detecting suspicious activities within smart contracts. This expanded feature set gives useful context for detecting suspicious transactions or activities in smart contracts. Transaction timestamp analysis allows for the identification of temporal patterns and trends, which in turn allows for the detection of anomalous activity, such as sharp spikes or drops in transaction frequency. Transaction-related gas fees provide information on network congestion and transaction complexity, which helps identify anomalies like unusually high or low fees that could be signs of spam or exploit attempts. Also, over the past years, many ML models has been developed to perform anomaly detection from the smart contract. The existing schemes are unable to achieve good performance due to lack in feature reduction and class balancing. In this research article novel framework is proposed which will solve class imbalancing problem and also reduce features efficiently. The Synthetic Minority Over-Sampling Technique (SMOTE) model is used for the class balancing and Principal Component Analysis (PCA) is used for the reduction of attributes. The voting classification technique is put forward to classify anomalies. The voting classification method is the combination of various classifiers like SVM, Random Forest, KNN and it use bagging approach for the final prediction.Diverse parameters, like accuracy, precision, and recall are employed to simulate the projected framework. Such parameters lead to give visions to compute this framework while classifying anomalies and regular transactions at higher accuracy. The results analysed that the projected framework yielded 91% value for all the parameters which is approx. 30% higher than existing methods.


Download data is not yet available.


Xu Y, Hu G, You L, Cao C. A Novel Machine Learning-Based Analysis Model for Smart Contract Vulnerability. Security and Communication Networks. 2021; 7(10): 63-71. doi: 10.1155/2021/

Mandloi J, Bansal P. A Machine Learning-Based Dynamic Method for Detecting Vulnerabilities in Smart Contracts. International Journal of Applied Engineering & Technology. 2022; 4(2): 110-118. doi: ijaet%20v4-2-2022-17.pdf

Chen D et al. Privacy-Preserving Anomaly Detection of Encrypted Smart Contract for Blockchain-Based Data Trading. IEEE Transactions on Dependable and Secure Computing. 2024; 78: 13-20. doi: 10.1109/TDSC.2024.3353827.

Haritha P, Kavitha V and Manimala G. Protection & Privacy Embedding Blockchain Established Fraud Detection. In: International Conference on Applied Artificial Intelligence and Computing (ICAAIC). Salem. India; 2022. p. 1437-1444. doi: 10.1109/ICAAIC53929.2022.9792962.

Chu H, Zhang P and Li W. A survey on smart contract vulnerabilities: Data sources, detection and repair. Information and Software Technology. 2023; 159: 906-914, 10.1016/j.infsof.2023.

Shah H, Shah D, Jadav N K, Gupta R, Tanwar S, Alfarraj O, Tolba A, Raboaca M S, Marina V. Deep Learning-Based Malicious Smart Contract and Intrusion Detection System for IoT Environment. Mathematics. 2023; 11(2): 418-425. doi: 10.3390/math11020418.

Gogineni A K, Swayamjyoti S, Sahoo D, Sahu K K, Kishore R. Multi-Class classification of vulnerabilities in smart contracts using AWD-LSTM, with pre-trained encoder inspired from natural language processing. IOP Science, 2020; 8: 16-24. doi: 10.1088/


Krichen M. Strengthening the Security of Smart Contracts through the Power of Artificial Intelligence. Computers. 2023; 12: 107-116. doi:10.3390/computers12050107.

Sosu R N I, Chen J, Brown-Acquaye W, Owusu E, Boahen E. A Vulnerability Detection Approach for Automated Smart Contract Using Enhanced Machine Learning Techniques. Research Square. 2022; 2: 96-104. doi: 10.21203/rs.3.rs-1961251/v1.

Moubarak J, Chamoun M and Filiol E. Developing a Κ-ary malware using blockchain. In: IEEE/IFIP Network Operations and Management Symposium. Taipei. Taiwan; 2018. p. 1-4. doi: 10.1109/NOMS.2018.8406331.

Liu L, Tsai W-T, Liu M. Blockchain-enabled fraud discovery through abnormal smart contract detection on Ethereum. Future Generation Computer Systems. 2021; 128: 158-166. doi: 10.1016/j.


Demertzis K, Iliadis L, Tziritas N and Kikiras P. Anomaly detection via blockchained deep learning smart contracts in industry 4.0. Neural Computing and Applications. 2020; 32: 36-42. doi: 10.1007/s00521-020-05189-8.

Liu H, Fan Y and Wei Z. Vulnerable smart contract function locating based on Multi-Relational Nested Graph Convolutional Network. Journal of Systems and Software. 2023; 204: 11-22. doi: 10.1016/j.


Haji S H, Lashkari A H and Oskui A M. Unveiling vulnerable smart contracts: Toward profiling vulnerable smart contracts using genetic algorithm and generating benchmark dataset. Blockchain: Research and Applications. 2023; 5(1): 1007-1015, doi: 10.1016/j.bcra.2023.

Wang L, Cheng H and Zhu X. Ponzi scheme detection via oversampling-based Long Short-Term Memory for smart contracts. Knowledge-Based Systems. 2021; 228: 132-139. doi: 10.1016/j.


Su S et al. Detecting Smart Contract Project Anomalies in Metaverse. In: IEEE International Conference on Metaverse Computing, Networking and Applications (MetaCom). Kyoto. Japan; 2023. p. 524-532. doi: 10.1109/MetaCom57706.2023.00095.

Liu X, Jiang F and Zhang R. A New Social User Anomaly Behavior Detection System Based on Blockchain and Smart Contract. In: IEEE International Conference on Networking, Sensing and Control (ICNSC). Nanjing. China; 2020. p. 1-5. doi: 10.1109/ICNSC48988.


Ndiaye M, Konate K and Ndoye E H M. Anomaly Detection Algorithm Based on Smart Contracts Behaviours in Ethereum Ecosystem. In: 3rd International Conference on Electrical, Computer, Communications and Mechatronics Engineering (ICECCME). Tenerife. Canary Islands. Spain; 2023. p. 1-7. doi: 10.1109/ICECCME57830.2023.10252520.

Zkik K, Sebbar A, Fadi O, Mustapha O and Belhadi A. A Graph Neural Network Approach for Detecting Smart Contract Anomalies in Collaborative Economy Platforms Based on Blockchain Technology. In: 9th International Conference on Control, Decision and Information Technologies (CoDIT), Rome. Italy; 2023. p. 1285-1290. doi: 10.1109/CoDIT58514.2023.10284080.

Jiang Z, Chen K and Zheng Z. Applying blockchain-based method to smart contract classification for CPS applications. Digital Communications and Networks. 2022; 8(6): 964-975. doi: 10.1016/j.dcan.2022.08.011.

Reddy C M K, Chandrashekar R and Bajaj R. Smart Contracts and Anomaly Detection in SDN environment using Cloud-Edge Integration Model. In: International Conference on Emerging Research in Computational Science (ICERCS). Coimbatore. India; 2023. p. 1-6. doi: 10.1109/ICERCS57948.2023.10434076.

Samreen N F and Alalfi M H. SmartScan: An approach to detect Denial of Service Vulnerability in Ethereum Smart Contracts. In: IEEE/ACM 4th International Workshop on Emerging Trends in Software Engineering for Blockchain (WETSEB). Madrid. Spain; 2021. p. 17-26. doi: 10.1109/WETSEB52558.2021.00010.

Fadi O, Bahaj A, Zkik K, Ghazi A, Ghogho M and Boulmalf M. Smart Contract Anomaly Detection: The Contrastive Learning Paradigm. Journal of LATEX. 2024; 4(2): 631-639. doi: 10.2139/ssrn.4720935

Duan L, Yang L, Liu C, Ni W and Wang W. A New Smart Contract Anomaly Detection Method by Fusing Opcode and Source Code Features for Blockchain Services. IEEE Transactions on Network and Service Management. 2023; 20(4): 4354-4368. doi: 10.1109/TNSM.2023.3278311.

Ghaleb A, Rubin J and Pattabiraman K. eTainter: Detecting Gas-Related Vulnerabilities in Smart Contracts. International Symposium on Software Testing and Analysis (ISSTA). 2022; 5(7): 728-739. doi: 10.1145/3533767.3534378.

Wang X, He J, Xie Z, Zhao G and Cheung S C, ContractGuard: Defend Ethereum Smart Contracts with Embedded Intrusion Detection. IEEE Transactions on Services Computing. 2020; 13(2): 314-328. doi: 10.1109/TSC.2019.2949561.

Yang H, Gu X and Cui Z. CrossFuzz: Cross-contract fuzzing for smart contract vulnerability detection. Science of Computer Programming. 2024; 234:139-145. doi: 10.1016/j.scico.2023.

Ndiaye M, Diallo T A and Konate K. ADEFGuard: Anomaly detection framework based on Ethereum smart contracts behaviours. Blockchain: Research and Applications. 2023; 4(3): 162-170. doi: 10.1016/j.bcra.2023.100148.

Ashizawa N, Yanai N and Okamura S. Eth2Vec: Learning contract-wide code representations for vulnerability detection on Ethereum smart contracts. Blockchain: Research and Applications. 2022; 24(1): 139-148. doi: 10.1016/j.bcra.2022.100101.

Eshghie M, Artho C and Gurov D. Dynamic Vulnerability Detection on Smart Contracts Using Machine Learning. Evaluation and Assessment in Software Engineering (EASE 2021). 2021; 43(12): 17-25. doi: 10.1145/3463274.3463348.

Hu T, Liu X and Liu Y. Transaction-based classification and detection approach for Ethereum smart contract. Information Processing & Management. 2020; 58(4): 106-113. doi: 10.1016/j.ipm.2020.102462.

Shen X, Jiang S and Zhang L. Mining Bytecode Features of Smart Contracts to Detect Ponzi Scheme on Blockchain. Computer Modeling in Engineering & Sciences. 2021; 45(1): 96-105. doi: 10.32604/cmes.2021.015736.

Huang J, Zhou K, Xiong A and Li D. Smart Contract Vulnerability Detection Model Based on Multi-Task Learning. Sensors (Basel). 2022; 22(5): 1829-1836, doi: 10.3390/s22051829

Zhang L, Chen W and Chen H. CBGRU: A Detection Method of Smart Contract Vulnerability Based on a Hybrid Model. Sensors. 2022; 22(9): 3577-3583.doi: 10.3390/s22093577




How to Cite

Monali Shetty. (2024). Enhanced DOS Anomaly Detection Framework for Smart Contract Using Blockchain Metadata Analysis. International Journal of Intelligent Systems and Applications in Engineering, 12(21s), 3733 –. Retrieved from https://ijisae.org/index.php/IJISAE/article/view/6123



Research Article