Detecting Smart Contract Vulnerabilities with Explainable AI
Abstract
The rapid adoption of blockchain technologies has intensified the need for robust security mechanisms in Ethereum smart contracts (SC). Due to immutability, vulnerabilities cannot be patched after deployment, leading to significant financial losses. While traditional static and dynamic analysis tools are widely used, recent research has explored Machine Learning (ML) and Deep Learning (DL) techniques for automated vulnerability detection. However, many existing approaches focus on single-vulnerability detection or suffer from high false positive rates and limited interpretability. To address these challenges, this study proposes an interpretable DL framework for multi-vulnerability detection in SC. The proposed model employs a lightweight One-Dimensional Convolutional Neural Network (1D-CNN) integrated with Integrated Gradients from Explainable AI (XAI) to provide transparent model decisions. SC opcode sequences are transformed into RGB-encoded sequential representations, preserving execution order while enabling efficient feature extraction. This study adopts a multi-class classification setting to evaluate generalization across diverse vulnerability types. The framework is evaluated using the publicly available Messi-Q dataset, containing labeled samples across multiple vulnerability types. Experimental results demonstrate effective multi-class detection, with performance varying across vulnerability types due to dataset imbalance and structural similarities. The model maintains efficiency while providing interpretable insights for selected vulnerability classes. The model provides opcode-level attribution, revealing localized patterns for certain vulnerabilities and more distributed attention for others. These findings demonstrate the practicality of lightweight and interpretable DL methods for scalable SC security analysis.
Community
0 commentsNo discussion yet
Be the first to share a question or observation.