Towards Trustworthy Smart Contract Security: Explainable Multi-Class Vulnerability Detection Using Machine Learning

Main Article Content

👤 Musbah J. Aqel
🏢 Applied Science University, Amman, Jordan

Smart contracts have become a fundamental component of blockchain ecosystems, enabling decentralized applications and automated transactions without intermediaries. However, vulnerabilities in smart contracts can lead to severe financial losses and security breaches, highlighting the need for effective automated vulnerability detection mechanisms. This study proposes an explainable machine learning framework for multi-class smart contract vulnerability detection using TF-IDF feature extraction, XGBoost classification, and SHAP (SHapley Additive exPlanations) analysis. The proposed approach was evaluated on a dataset containing 6,387 Solidity smart contracts categorized into eight vulnerability classes: Block Dependency (BD), Dangerous Delegatecall (DC), Front Running Exposure (FE), Integer Overflow/Underflow (IOU), Reentrancy (RE), Selfdestruct Exposure (SE), Timestamp Dependency (TD), and Unchecked Call (UC). Experimental results show that the XGBoost model achieved an average accuracy of 65.15% and a macro-F1 score of 65.14% under 5-fold stratified cross-validation, outperforming the Random Forest baseline across all evaluation metrics. Class-level analysis revealed strong detection performance for Dangerous Delegatecall, Integer Overflow/Underflow, and Timestamp Dependency vulnerabilities, while Reentrancy and Unchecked Call remained challenging due to their similar behavioral characteristics. Furthermore, SHAP-based explainability identified security-relevant Solidity tokens such as call, delegatecall, block number, and now as the most influential features contributing to vulnerability classification. These findings demonstrate that the proposed framework provides a transparent and effective approach for smart contract vulnerability detection, supporting the development of trustworthy blockchain security analysis systems.

Aqel, M. J. (2026). Towards Trustworthy Smart Contract Security: Explainable Multi-Class Vulnerability Detection Using Machine Learning. Journal of Current Research in Blockchain, 3(3), 152–167. https://doi.org/10.47738/jcrb.v3i3.74

Article Details

Section
Articles

Similar Articles

1 2 3 4 > >> 

You may also start an advanced similarity search for this article.