Skip to content
Research Article Open access CC BY 4.0

Machine Learning Based Attack Detection and Prevention in Blockchain

Richard Essah, Augustine Danquah Yeboah, Kenneth Broni

Asian Journal of Research in Computer Science · pp. 204–220 · Published 31 Mar 2026

10.9734/ajrcos/2026/v19i3844

Abstract

Blockchain systems are increasingly deployed in finance, healthcare, supply chains, and IoT, but their open and decentralized nature exposes them to evolving security threats such as Sybil, eclipse, selfish mining, double-spending, and smart contract exploits. Traditional cryptographic safeguards and policy centered intrusion recognition approaches commonly fail to generalize against new strike variants, suffer from severe class imbalance, and struggle under real-time limitations. To examine these limitations, we present a hybrid deep learning framework that combines three complementary temporal encoders: a 1D Convolutional Neural Network (CNN) for short-term pattern extraction, a Bidirectional Long Short-Term Memory (Bi-LSTM) network for long-range dependencies, and a Transformer encoder for capturing global temporal context. Their outputs are fused with an attention mechanism and integrated into a unified classifier capable of both attack detection and automated prevention actions, such as quarantining suspicious transactions and sandboxing malicious contracts. Using the Cryptojacking Attack Timeseries dataset, the model achieves 97.21% accuracy, 99.16% Precision, 97.21%Recall, 97.98% F1-score, and an ROC-AUC of 0.9526, outperforming state-of-the-art baselines. The results demonstrate that multi-scale temporal fusion significantly enhances robustness and generalization under real-world blockchain conditions. This work contributes a scalable and adaptive detection–prevention pipeline, offering a practical pathway toward more secure decentralized ecosystems.

Attack detection and prevention blockchain deep learning machine learning

Cited by 0

No indexed citations yet.

Article metrics

Real usage data collected on this platform.

38

Page views

0

PDF downloads

4

Outbound clicks

0

Citations

Views over time

Views by country

Approximate, from request IP at view time — not citizenship or institution. Countries with fewer than 5 views are grouped as "Other".

Traffic sources

Referring site, by host.

Views and downloads exclude known bots/crawlers. Citations combines this platform's own DOI-resolved index with each external source's own reported total — see Cited by above for individually listed citing works. Last refreshed 0 seconds ago.