A Secure Decentralized Blockchain and Machine Learning Based Peer-to-Peer Energy Trading in a Smart Grid

The growing adoption of renewable energy and small-scale power producers has increased the need for reliable and transparent peer-to-peer (P2P) energy trading. Traditional centralized markets often struggle with high transaction fees, limited transparency, and a greater risk of manipulation, which restrict efficient energy distribution. To overcome these issues, this study presents a decentralized P2P trading framework that implements a fully functional blockchain-based trading system with smart grid simulation and demonstrates a prototype machine learning forecasting module (Random Forest, 84% accuracy) designed for future integration. The trading mechanism is developed using Ethereum smart contracts and a custom ERC-20 token, the TUM Energy Coin (TEC), enabling secure and traceable energy exchange. System security is strengthened through dual confirmation steps, role-based access control, and consensus-driven market clearing. A double-sided auction model is used to match buyers and sellers fairly. Real-time grid behavior such as fluctuating loads, prosumer generation, and consumer demand is modeled using MATLAB Simulink to reflect realistic operating conditions. To enhance decision-making, a Random Forest model is integrated for load forecasting and dynamic pricing, achieving an accuracy of 84%. The simulation results show improved transaction throughput, more stable pricing, and strong resilience against false-data injection attacks. The primary novelty of this work lies in (1) an entirely operational and validated blockchain-trading system simulation with synchronized time using Simulink, (2) a working Random Forest forecasting tool demonstrating feasibility for incorporation in the future, and (3) an analysis of the system’s robustness in the case of FDIA attacks. The authors point out that the ML component used is a prototype and not yet integrated into the functioning block chain.

Authors

Institutions

Publication Details

Journal
Sustainability
Published
2026-08-25
DOI
https://doi.org/10.3390/su18178694
Primary Topic
Smart Grid Security and Resilience
Type
article
Field-Weighted Citation Impact
0.00
Controls
|||
ALL TIME
JAN
FEB
MAR
APR
MAY
JUN
JUL
AUG
SEP
OCT
article

A Secure Decentralized Blockchain and Machine Learning Based Peer-to-Peer Energy Trading in a Smart Grid

Sameen Fatima, Muhammad Junaid Arshad
Sustainability
Smart Grid Security and Resilience
article

A Secure Decentralized Blockchain and Machine Learning Based Peer-to-Peer Energy Trading in a Smart Grid

Sameen Fatima, Muhammad Junaid Arshad
article en

Abstract

The growing adoption of renewable energy and small-scale power producers has increased the need for reliable and transparent peer-to-peer (P2P) energy trading. Traditional centralized markets often struggle with high transaction fees, limited transparency, and a greater risk of manipulation, which restrict efficient energy distribution. To overcome these issues, this study presents a decentralized P2P trading framework that implements a fully functional blockchain-based trading system with smart grid simulation and demonstrates a prototype machine learning forecasting module (Random Forest, 84% accuracy) designed for future integration. The trading mechanism is developed using Ethereum smart contracts and a custom ERC-20 token, the TUM Energy Coin (TEC), enabling secure and traceable energy exchange. System security is strengthened through dual confirmation steps, role-based access control, and consensus-driven market clearing. A double-sided auction model is used to match buyers and sellers fairly. Real-time grid behavior such as fluctuating loads, prosumer generation, and consumer demand is modeled using MATLAB Simulink to reflect realistic operating conditions. To enhance decision-making, a Random Forest model is integrated for load forecasting and dynamic pricing, achieving an accuracy of 84%. The simulation results show improved transaction throughput, more stable pricing, and strong resilience against false-data injection attacks. The primary novelty of this work lies in (1) an entirely operational and validated blockchain-trading system simulation with synchronized time using Simulink, (2) a working Random Forest forecasting tool demonstrating feasibility for incorporation in the future, and (3) an analysis of the system’s robustness in the case of FDIA attacks. The authors point out that the ML component used is a prototype and not yet integrated into the functioning block chain.

SustainabilityVol. 18(17)
University of Engineering and Technology Lahore (PK)
Affordable and clean energy
Openalex Percentile: Top 14%
Smart Grid Security and Resilience
AI Navigator

Ask Laika to Summarize, Analyze, and Connect papers live on the map.

Summarize Papers & Methodologies

Extract key findings, datasets, and comparative methods across publications.

Benchmark Rankings & Visual Analytics

Rank top research institutions, authors, funders, topics, and journals by Field-Weighted Citation Impact (FWCI) and paper volume with instant charts.

Connect Distant Disciplines

Bridge topological clusters on the map to find hidden collaborative intersections.

A Secure Decentralized Blockchain and Machine Learning Based Peer-to-Peer Energy Trading in a Smart Grid — Sameen Fatima, Muhammad Junaid Arshad · Sustainability (2026) | TGRS Research Map | TGRS