Enhancing Blockchain Security Through Smart Contract Vulnerability Classification Using BiLSTM and Attention Mechanism

Main Article Content

👤 Untung Rahardja
🏢 Faculty of Science and Technology, University of Raharja, Tangerang 1511, Indonesia
👤 Qurotul Aini
🏢 Faculty of Science and Technology, University of Raharja, Tangerang 1511, Indonesia

The rapid adoption of blockchain technology has intensified the need for robust smart contract security mechanisms. However, traditional rule-based or static analysis tools often fail to detect context-dependent vulnerabilities embedded in complex contract logic. This study proposes a deep learning framework for automated smart contract vulnerability classification using a Bidirectional Long Short-Term Memory (BiLSTM) network integrated with an Attention Mechanism. The model was trained and evaluated on the SC_Vuln_8label.csv dataset, comprising 12,520 labelled Solidity smart contracts categorized into eight distinct vulnerability types, including Re-entrancy, Integer Overflow, and Short Address Attack. Through bidirectional contextual learning and attention-based feature weighting, the proposed model achieved 93.7% test accuracy, 0.93 precision, and a macro F1-score of 0.92, outperforming baseline models such as CNN, GRU, and standard LSTM by up to 5.3 percentage points. Attention heatmap analysis further revealed the model’s interpretability by highlighting vulnerability-prone code segments (e.g., call.value, send(), and withdraw() functions) consistent with expert-identified risk indicators. These results demonstrate that the BiLSTM + Attention framework not only enhances vulnerability detection accuracy but also provides transparent and explainable reasoning, offering a reliable foundation for AI-assisted smart contract auditing systems in blockchain security.

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. https://doi.org/10.47738/jcrb.v3i1.56

Article Details

Section
Articles

Similar Articles

1 2 3 > >> 

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