Skip to main content

ORIGINAL RESEARCH article

Front. Energy Res., 06 January 2025
Sec. Smart Grids

Blockchain-driven demand side management in P2P energy markets for islanded microgrid systems

  • 1Department of Electrical and Electronics Engineering, Birla Institute of Technology, Ranchi, India
  • 2School of Electrical Science, IIT Bhubaneswar, Bhubaneswar, Odisha, India

In isolated microgrids, distributed energy resources (DERs) such as small-scale generators, energy storage systems, and flexible loads operate independently from the main grid. The challenge is to optimize these resources to minimize user costs while ensuring microgrid stability and efficiency. This paper presents an optimization framework for DERs, leveraging a game-theoretical approach to demand-side management (DSM) in an isolated microgrid environment. Each participant aims to minimize their total cost by strategically managing renewable energy generation, storage, and consumption. The framework models the DSM problem as a noncooperative game, identifying equilibrium points where no user can unilaterally reduce costs. The proximal decomposition algorithm is employed to iteratively update user strategies, ensuring convergence to a Nash equilibrium. Furthermore, a blockchain-based system with smart contracts is integrated to automate critical processes, including registration, event detection, DSM actions, and incentive distribution. This integration enhances transparency, security, and efficiency in the microgrid. During the registration phase, all devices are authenticated and authorized through a secure, transparent blockchain ledger. Event detection is managed by the microgrid Energy Management System (EMS), which continuously monitors voltage and frequency levels, triggering predefined smart contract responses to maintain stability. DSM actions are automatically executed by smart contracts, adjusting energy loads, generation, and storage to balance supply and demand dynamically. The smart contracts also manage the economic incentives that drive participant engagement. They calculate and distribute incentives based on predefined criteria, ensuring accurate and prompt allocation. This process is recorded on the blockchain, providing an immutable and auditable trail of actions and rewards. By leveraging blockchain technology and a game-theoretical approach, the proposed framework ensures continuous optimal operation despite fluctuations in energy demand and renewable generation. This dynamic and adaptive model promotes decentralized and efficient energy management within the microgrid, fostering a resilient and sustainable energy ecosystem.

1 Introduction

1.1 Motivation and background

The modern energy landscape is undergoing a significant transformation, driven by the increasing adoption of renewable energy sources and the decentralization of energy systems. Traditional centralized energy management approaches face numerous challenges in integrating distributed energy resources (DERs) such as solar panels, wind turbines, and energy storage systems, particularly in isolated or islanded microgrids where connectivity to the main grid is limited or nonexistent. These challenges necessitate the development of advanced energy management strategies that ensure grid stability, optimize energy usage, and facilitate efficient peer-to-peer (P2P) energy trading among prosumers. The motivation for this study stems from the pressing need to address these challenges and harness the potential of decentralized energy management. Isolated microgrids, which operate independently from the main grid, are particularly vulnerable to fluctuations in energy supply and demand. The integration of renewable energy sources, while environmentally beneficial, introduces variability and unpredictability in power generation. This variability can lead to grid instability if not managed effectively. Traditional centralized energy management systems often struggle to cope with the dynamic nature of DERs and the complex interactions among multiple energy producers and consumers.

Blockchain technology, with its inherent features of security, transparency, and decentralization, offers a promising solution to these challenges. By enabling secure and transparent P2P energy trading, blockchain can facilitate the efficient integration of DERs into isolated microgrids. Smart contracts, which are self-executing contracts with the terms of the agreement directly written into code, are a key enabler of blockchain-based energy trading. This automation reduces the need for manual intervention, enhances operational efficiency, and ensures that all transactions are recorded in an immutable and transparent manner. Moreover, the application of non-cooperative game theory in DSM provides a robust framework for modeling the interactions among prosumers. In a non-cooperative game, each prosumer aims to minimize their costs or maximize their benefits independently, while considering the actions of other prosumers. This decentralized decision-making process leads to a Nash equilibrium, where no prosumer can unilaterally improve their outcome by changing their strategy (Cui et al., 2023). By leveraging game theory, we can develop DSM strategies that optimize energy usage, balance supply and demand, and maintain grid stability in isolated microgrids.

1.2 Literature review

The concept presented in this paper leverages blockchain technology for the Microgrid Energy Management System (MEMS), enabling peer-to-peer energy transactions at the distribution level. This approach aims to deliver affordable and high-quality energy to local consumers through microgrids. One significant challenge in microgrid network design is automating the accounting and management of electricity production and consumption (Xu et al., 2015). Blockchain technology provides an effective solution for automated peer-to-peer transactive management through Smart Contracts. Blockchain, a form of distributed ledger technology, is composed of a series of blocks that contain information and hashes. The first block, known as the genesis block, is succeeded by subsequent blocks linked through hashes (Wen et al., 2021). Each block contains its hash and the hash of the previous block, enhancing the security of the blockchain. Any modification to a block’s information will change its hash but not the hash of the subsequent block, ensuring the immutability of stored transaction information. Blockchain data is organized in a Merkle tree. Another essential feature of blockchain is the consensus process, wherein miners use a nonce to validate transactions. The most commonly used consensus algorithm is Proof of Work (PoW), which is utilized in platforms like Bitcoin and Ethereum (Liang, 2020; Umar A. et al., 2022).

Blockchain technology is increasingly being adopted in microgrids to facilitate peer-to-peer energy transactions and manage demand-side power. In (Junaidi et al., 2023), blockchain is used for Demand Side Management (DSM), enabling energy trading among prosumers. Instant trading between prosumers and consumers reduces transaction time by optimizing block size and node number. Blockchain’s decision-making capability through Smart Contracts is emphasized, with transactions initiated by either a generator or a consumer (Zhang et al., 2018; Efanov and Roschin, 2018). These studies focus on developing peer-to-peer networks that allow sellers and buyers to finalize deals instantly. Blockchain networks, known for their high security, when combined with Demand Response (DR) programs, can improve system load profiles and reduce overall electricity costs. Smart meters, IoT devices, and sensors connected over ICTs provide automated solutions for DSM programs that are user-friendly and easily manageable. This research utilizes secured DR programs coded in Ethereum blockchain to offer better solutions for the effective control, monitoring, and secure operation of the entire microgrid energy system.

Microgrids comprise components such as RES sources, critical and non-critical loads, smart meters, Human-Machine Interfaces (HMIs), protective relays, circuit breakers, home appliances, communication networks, and IoT devices. These components work together to operate, monitor, and control power flow and measurements. Traditional cybersecurity techniques are insufficient to meet the security needs of smart grids or microgrids. Researchers and industry experts now believe that blockchain applications can enhance grid security (Musleh et al., 2019). Control and operational aspects of RES integration, battery storage, and electric vehicles in the power grid are broad research areas (Jha et al., 2022). Blockchain technology can address operational aspects of microgrids, including demand-side control and optimized operation, which are emerging research areas. Blockchain technology was integrated for Distributed Energy Resources (DERs) scheduling, providing a secure and transparent platform for all DERs (Zhou et al., 2023; Danzi et al., 2017). Munsing et al. developed a model for scheduling mixed DERs in microgrids based on decentralized optimal power flow (OPF) to optimize and control DERs (Münsing et al., 2017).

Application of blockchain technology for DSM is proposed in (Junaidi et al., 2023), demonstrating how to reduce the Peak-Average ratio (PAR) and smooth load profile dips by supply constraints. A novel approach in (Thomas et al., 2019) uses blockchain for medium voltage DC application control, sharing responsibilities between system operators and the energy system. Blockchain can be implemented by creating a cyber layer into different parts of the smart grid, with each part having its blockchain. Integrating these blockchains can enhance smart grid performance (Agung and Handayani, 2020; Yan et al., 2023). Energy trading with microgrids and distributed generation has become a significant research area. Blockchain has been crucial in peer-to-peer (P2P) energy transactions, providing cyber-physical security and eliminating fraudulent behaviours (Khaqqi et al., 2018). Energy trading using blockchain is secure, reliable, and beneficial for all stakeholders. In P2P systems, transactions are recorded in blocks instantly and independently, without third-party involvement, allowing energy buyers and sellers to choose preferences (Otjacques et al., 2018). Optimization processes have been used in OPF for P2P trading in blockchain (Münsing et al., 2017). Several use cases of blockchain exist worldwide, notably the Brooklyn micro-grid. Power Ledger, an Australian company, facilitates the transfer of excess generation by prosumers to nearby consumers or prosumers. Grid+, SIEMENS, and LO3 Energy are other companies implementing power trading between peers in microgrid systems using blockchain technology (Musleh et al., 2019).

Recent research has shown increasing interest in optimization techniques for DSM in microgrids, including dynamic programming (DP), mixed integer linear programming (MILP), evolutionary algorithms, and game theory (Thirunavukkarasu et al., 2022; Topa et al., 2023; Wang et al., 2015; Jin et al., 2017). A paper formulates multi-objective optimization for load flexibility trade-offs (Chen et al., 2019). A game-theoretical approach to analyze incentive schemes to motivate microgrid consumers is presented in (Li et al., 2022). A non-cooperative game explores solar PV system integration in microgrids for different consumer sets (Wang G. et al., 2017). A study investigated hybrid PV and wind systems integrated into microgrids for size optimization (Amrollahi and Bathaee, 2017). Various frameworks aim at PAR and cost reduction using pricing-based incentive schemes. Other studies incorporate battery storage into DSM frameworks (Wang et al., 2014; Mulleriyawage and Shen, 2021). Many authors have also proposed and investigated DER integration in demand-side energy management (Bakare et al., 2023; Wang X. et al., 2017).

To summarize, upgrading LV/MV distribution systems is necessary to transition from passive to active distribution systems. In such conditions, DR programs are one of the best solutions to help microgrid operators balance generation and load. DR Programs encourage customers to change their electricity usage based on tariffs and incentives, participating in competitive environments and business transactions for better DSM, PAR, and cost reduction. However, challenges remain, such as introducing market concepts in LV/MV systems, coordinating between LV/MV and HV operators, and creating a user-friendly platform to encourage mass participation in market operations.

Moreover, the increasing internet connectivity in smart grid infrastructures has led to various cyber-attacks, such as Advanced Persistent Threats (APT), Denial of Service (DoS), Stuxnet, and Black Energy. A recent cyber-attack on Ukraine’s power grid caused an outage affecting over two hundred thousand consumers, linked to a new variant of Black Energy Trojan named Disakil (Leszczyna, 2018). Securing this complex infrastructure from cyber-attacks is a significant challenge. Blockchain is considered a highly secure and reliable network that can automate transactions using smart contracts in microgrid operations in a cyber-secure manner through encryption technology.

1.3 Research gaps and contributions

Despite the advancements in blockchain technology and game theory, there remains a need for an integrated approach that combines these technologies to enhance DSM in isolated microgrids. Previous studies have focused on either blockchain for P2P energy trading or game theory for DSM. However, they have not fully addressed the combined potential in optimizing DERs and ensuring grid stability. For instance, the paper (Mengelkamp et al., 2018) highlighted the benefits of blockchain in energy markets, but they did not consider the dynamic interactions modelled through game theory. Similarly, the authors of the paper (Hupez et al., 2023) applied game theory to DSM but did not incorporate blockchain for transaction security and transparency.

Additionally, while existing literature has demonstrated the use of blockchain for secure transactions, the detailed design and implementation of smart contracts tailored for energy management in isolated microgrids are often underexplored. Smart contracts in the context of energy trading require a meticulous approach to ensure automated and efficient handling of DSM actions, event detection, incentive distribution, and compliance with grid stability requirements. For example, existing work (Noor et al., 2018) describes the general use of smart contracts but lacks a comprehensive framework that integrates these contracts into a dynamic and adaptive DSM system.

Furthermore, there is a lack of critical evaluation in the literature concerning the automation of complex demand-side management (DSM) actions using smart contracts. These actions include load adjustments, generation modulation, and storage management in response to real-time grid conditions. It is essential to have a discussion on the practical challenges and solutions for implementing detailed smart contracts for maintaining grid stability and optimizing resource utilization.

This paper has the following important contributions:

1. Integration of Blockchain and Smart Contracts for Energy Management: The paper demonstrates the integration of blockchain technology and smart contracts into the microgrid energy management system. This ensures secure, transparent, and tamper-proof transactions, enhancing reliability and efficiency. Smart contracts automate critical processes like device registration, event detection, DSM actions, and incentive distribution, reducing manual intervention.

2. Game-Theoretical Approach to Demand-Side Management: The study applies game theory to the DSM problem in an isolated microgrid environment, modeling it as a non-cooperative game and using the proximal decomposition algorithm to find Nash equilibrium points. This approach ensures decentralized, adaptive, and efficient management of DERs, optimizing the microgrid’s performance.

3. Automated and Transparent DSM Actions: Automated execution of DSM actions through smart contracts is highlighted. These actions adjust energy loads, generation, and storage in response to voltage or frequency deviations, with all actions recorded on the blockchain for transparency and auditability, enhancing trust and compliance.

4. Economic Incentive Mechanism: The study presents a mechanism for calculating and distributing economic incentives based on participants’ DSM actions. Smart contracts evaluate responses and handle incentive distribution, ensuring prompt and accurate allocation. This incentivization encourages active participation and compliance with DSM strategies.

5. Comprehensive Data Analysis and Performance Insights: Detailed analysis of performance data from five prosumers over various DR events provides valuable insights into the benefits of active DSM participation. The analysis covers RES generation, storage, P2P trading, net profit, and maximum demand during DR events, emphasizing strategic energy management and adaptive decision-making in decentralized energy markets.

The paper is organized as follows: Section 2 discusses Demand Side Management (DSM) in isolated microgrids using non-cooperative game theory. It highlights the importance of DSM for maintaining grid stability and optimizing energy usage, and explains how non-cooperative game theory models the interactions among prosumers, leading to a Nash equilibrium. Section 3, Methodology, details the steps involved in implementing DSM using blockchain technology and smart contracts. Section 3.1, Registration Phase, describes how devices are integrated into the blockchain-based system, ensuring proper registration, authentication, and authorization. Section 3.2, Event Detection, explains the continuous monitoring of voltage and frequency by the microgrid EMS, which triggers smart contracts to automate corrective actions. Section 3.3, DSM Actions, outlines the execution of DSM strategies through smart contracts, adjusting energy loads, generation, and storage, and recording these actions on the blockchain. Section 3.4, Incentive Distribution, discusses the calculation and distribution of economic incentives via smart contracts, promoting participant engagement and compliance with DSM strategies. Section 4, Results and Discussions, presents the simulation results, including performance metrics such as RES generation, storage, P2P trading, net profit, and demand during DR events, along with an analysis of these results. Section 5, Conclusions, summarizes the key findings, emphasizing the effectiveness of using non-cooperative game theory and blockchain technology in DSM for isolated microgrids, and suggests potential future research directions.

2 Demand side management in isolated microgrids using non-cooperative game theory

Figure 1 illustrates the operation of an islanded microgrid with various smart components interacting through a central Microgrid Energy Management System (EMS). The main components include Smart Prosumers (Prosumers 1 and 2), a Smart Consumer, and an EV Charging Station, all managed by the Microgrid EMS, with oversight from a Distributed System Operator (DSO). The Smart Prosumers are entities that both consume and produce energy, equipped with renewable energy sources such as solar panels and energy storage systems like batteries. They generate their own electricity, store any excess for future use, or sell it to other participants in the microgrid. The Smart Consumer, on the other hand, is an entity that solely consumes energy, relying on power from other prosumers or the grid. The EV Charging Station provides charging facilities for electric vehicles and acts as a flexible load within the microgrid, drawing power when needed and supplying power to the microgrid participants through P2P energy trading. The Microgrid EMS manages the balance of supply and demand, voltage and frequency regulation, and optimization of energy flows. It interacts with all other components to ensure efficient and reliable operation. The DSO oversees the broader electricity distribution network and interfaces with the microgrid for regulatory and operational purposes. In islanded mode, the microgrid operates independently from the main grid managed by the DSO. IoT and cloud technologies facilitate communication and data exchange between the microgrid components. Smart meters collect and transmit data such as energy production, consumption, and storage levels to the Microgrid EMS. Power flow in the system, represented by solid lines, denotes the actual transfer of electrical energy between different entities in the microgrid. For example, energy generated by Smart Prosumers can be directly used by the Smart Consumer or stored in the EV Charging Station’s batteries. Information flow, depicted by dashed lines, signifies the exchange of data and control signals, essential for the coordination and management of the microgrid. The Microgrid EMS collects data from all connected devices, processes it, and sends control commands to ensure optimal operation. The operation begins with the registration and communication phase, where Smart Prosumers, Consumers, and EV Charging Stations are registered in the microgrid system. These entities continuously communicate their operational status, energy production, consumption, and storage levels to the Microgrid EMS through IoT and cloud services. In the energy management phase, the Microgrid EMS analyzes the data received and determines the optimal energy distribution strategy, considering factors such as energy demand, supply, and storage levels.

Figure 1
www.frontiersin.org

Figure 1. Peer-to-peer (P2P) energy transaction design model for islanded microgrids.

During high demand periods, the Microgrid EMS implements demand response strategies by reducing non-critical loads or shifting them to off-peak periods. It can also incentivize Smart Prosumers to increase their energy production or release stored energy to balance the load. In islanded mode, the microgrid operates independently of the main grid, with the Microgrid EMS ensuring stability by managing local generation and consumption. The system must maintain voltage and frequency within acceptable limits, necessitating real-time adjustments based on dynamic conditions. In an isolated microgrid, distributed energy resources (DERs) such as small-scale generators (e.g., solar panels, wind turbines), energy storage systems (e.g., batteries), and flexible loads (e.g., controllable appliances) are integrated to operate independently from the main grid. These resources are managed locally by individual users but need to be coordinated to ensure the optimal operation of the entire microgrid. The challenge lies in optimizing the use of these distributed resources to minimize costs for the users while maintaining the stability and efficiency of the microgrid. This involves complex decision-making processes where users determine when to generate, store, or consume energy based on factors such as local energy demand, the availability of renewable energy, and the state of charge of storage systems. Given the lack of connection to the main grid, it is crucial to balance generation and consumption within the microgrid to prevent outages and ensure a reliable power supply.

2.1 Objective function

Each participant i aims to minimize their total cost, focusing on renewable energy generation and battery storage as shown in Equation 1:

mint=1TCirest+Cistoraget+CiblockchaintIieit(1)

where

Cirest is the cost of generating renewable energy at time, t.

Cistoraget is the cost associated with charging or discharging storage at time, t.

Ciblockchaint is the total cost of blockchain services for each prosumer i at time t is the sum of the transaction fees, smart contract execution costs, and infrastructure maintenance costs.

Iieit is the incentive term for shifting load to off-peak periods or reducing overall consumption at time, t.

Constraints:

Energy Balance is shown in Equation 2:

dit=git+siteip2pt(2)

where

dit is the demand of participant i at time, t.

git is the generated renewable energy at time, t.

sit is the net storage (positive for charging, negative for discharging) at time, t.

eip2pt is the energy sold to other participants through Peer-to-Peer (P2P) at time, t.

Storage Constraints are shown in Equations 3.a, 3.b, 3.c, 3.d:

SimaxsitSimax(3.a)
0SOCitSOCimax(3.b)
0Pi,chargetSimax(3.c)
0Pi,dischargetSimax(3.d)

where

Simax is the maximum charge/discharge rate.

SOCit is the state of charge of the storage device.

SOCimax is the maximum state of charge of the storage device.

Pi,charget is the power used for charging the storage system at time t.

Pi,discharget is the power used for discharging the storage system at time t.

Generation Constraint is shown in Equation 4:

0gitgimax(4)

where

gimax is the maximum generation capacity.

Demand Response Constraint is shown in Equation 5:

ditdimaxtiDRt(5)

where

dimaxt: Maximum allowable demand during a DR event.

iDRt: Reduction in demand due to DR participation.

Voltage and Frequency Stability Constraints are shown in Equations 6 and 7:

VminVtVmax(6)
fminftfmax(7)

2.2 Cost and incentive calculations

2.2.1 Cost of generating renewable energy

To provide a more realistic representation of the cost associated with renewable energy generation, we use a quadratic cost function as mostly adopted in the literature (Atzeni et al., 2013). This approach reflects the increasing marginal cost of energy production as the output level increases, which is common in many energy generation systems.

The quadratic cost function is expressed in Equation 8 as:

Cirest=ai.git2+bi.git+ci(8)

where:

ai: Represents the quadratic coefficient, capturing the increasing marginal cost of energy production. This term reflects non-linear costs such as wear and tear on equipment, and efficiency losses as production ramps up.

bi: Represents the linear coefficient, capturing the direct proportional costs of energy production. This term includes regular operational and maintenance costs.

ci: Represents the fixed cost component, capturing constant costs independent of the amount of energy produced, such as administrative overheads.

2.2.2 Storage cost

The cost associated with charging or discharging the energy storage system (ESS) for each prosumer i at time t is indeed modeled as a convex function. This cost includes the expenses incurred during the charging and discharging processes.

The battery ESS cost function is defined in Equation 9 as follows:

Cistoraget=ci,charge.Pi,charget+ci,discharge.Pi,discharget(9)

where:

ci,charge: is the cost coefficient for charging the storage system ($/kWh).

ci,discharge: is the cost coefficient for discharging the storage system ($/kWh).

Pi,charget is the amount of energy charged into the storage system by prosumer i at time t (kWh).

Pi,discharget is the amount of energy discharged from the storage system by prosumer i at time t (kWh).

2.2.3 Blockchain service costs

In our decentralized energy management system, blockchain technology is utilized for recording transactions, verifying energy exchanges, and maintaining a transparent and tamper-proof ledger. The costs associated with blockchain services include transaction fees, smart contract execution costs, and infrastructure maintenance costs. These costs are an integral part of the overall cost calculation for each prosumer.

2.3 Cost components

1. Transaction Fees, Citxt:

Each transaction recorded on the blockchain incurs a fee, which is proportional to the size and complexity of the transaction.

For prosumer i at time t, the transaction fee is calculated as in Equation 10:

Citxt=β.Nitxt(10)

where:

β is the cost per transaction.

Nitxt is the number of transactions made by prosumer i at time t.

2. Smart Contract Execution Cost, Cisct:

Smart contracts are executed for various operations such as energy trading, incentive distribution, and demand response actions.

For prosumer i at time t, the smart contract execution cost is calculated as in Equation 11:

Cisct=ρ.Nisct(11)

where:

ρ is the cost per smart contract execution.

Nisct is the number of smart contract executions for prosumer i at time t.

3. Infrastructure Maintenance Costs, Ciinfrat:

These costs include maintaining the blockchain network infrastructure, such as nodes, servers, and storage.

For simplicity, we assume a fixed infrastructure maintenance cost for each prosumer i as in Equation 12:

Ciinfrat=δ(12)

Where:

δ is the fixed maintenance cost per time period.

Total Blockchain Service Cost.

The total cost of blockchain services for each prosumer i at time t is the sum of the transaction fees, smart contract execution costs, and infrastructure maintenance costs as defined in Equation 13:

Ciblockchaint=Citxt+Cisct+Ciinfrat(13)

2.3.1 Incentive calculations

Incentives for Load Shifting and Reductions, Iieit:

Prosumers receive incentives for shifting their energy consumption to off-peak periods or reducing their overall energy consumption as shown in Equation 14:

Iieit=γi.eit(14)

Where γi is the incentive rate and eit is the amount of load shifted or reduced.

Nash Equilibrium Game Theory: It provides a powerful framework for analyzing scenarios where multiple decision-makers (players) interact. In the context of an isolated microgrid, each user (or household) with DERs can be considered a player in a game. Each player’s decisions regarding energy generation, storage, and consumption affect not only their own costs but also the overall operation of the microgrid and the costs incurred by other players. By modeling the demand-side management (DSM) problem as a noncooperative game, we can analyze and find equilibrium points where no user can reduce their costs by unilaterally changing their strategy (Noor et al., 2018; Atzeni et al., 2013; Pilz and Al-Fagih, 2020). This equilibrium is known as the Nash equilibrium, representing a state where no player can improve their payoff by unilaterally changing their strategy, given the strategies of all other players. Decentralized decision-making is a fundamental aspect of an isolated microgrid. Each user makes decisions based on local information and personal objectives, reducing the need for centralized control and enhancing user privacy. This approach ensures that users retain control over their energy resources while contributing to the overall efficiency of the microgrid. The interdependency of strategies plays a critical role in this framework. The decisions made by one user affect the outcomes of others, creating a complex interdependency that must be accounted for in the optimization process. This interconnectedness necessitates careful analysis of each user’s actions and their impact on the microgrid’s overall performance.

Moreover, the game-theoretical model is dynamic and adaptive, capable of responding to changes in the environment. Fluctuations in energy demand or variations in renewable energy generation are common in isolated microgrids, and the model can adjust to these changes, ensuring continuous optimal operation. To apply game theory to DSM in an isolated microgrid, several key elements need to be defined. The players in this game are the users with DERs. Each player has a set of strategies, which include the possible actions they can take, such as the amount of energy to generate, store, or consume at different times.

The payoff functions for each player are critical as they represent the cost incurred based on their strategy and the strategies of others. These functions include the operational costs of DERs, the benefits of utilizing stored energy, and the savings from optimized energy usage.

The payoff function for each user i is represented as in Equation 15:

Jiθi,θi=t=1TCirest+Cistoraget+CiblockchaintIieit(15)

where:

Jiθi,θi is the payoff function for player (prosumer) i.

θi is the strategy of player i.

θi represents the strategies of all other players.

The payoff function Jiθi,θi represents the total cost for player i over the time horizon “T.” It sums up the costs of generating renewable energy and using storage, and subtracts any incentives earned for effective load management. The goal for each player is to minimize this payoff function, which translates to minimizing their total costs while maximizing the benefits from incentives.

Players: All participants (prosumers).

Strategies:

θi=git,sit,eip2pt(16)

where:

eip2pt is the energy sold to other participants through Peer-to-Peer (P2P) at time, t.

The strategy θi as shown in Equation 16 for each player consists of decisions on how much energy to generate, store, and trade at each time step at time, t. These decisions are crucial for optimizing their payoff function.

By modeling the DSM problem as a noncooperative game, it is possible to analyze and find equilibrium points where no user can reduce their costs by unilaterally changing their strategy, ensuring efficient and stable operation of the isolated microgrid. To achieve this, the proximal decomposition algorithm can be employed to iteratively update each user’s strategy in response to the aggregate strategy of all other users, incorporating a regularization term to ensure convergence. This algorithm helps to find the Nash equilibrium, thus enabling decentralized, adaptive, and efficient management of the microgrid’s distributed resources.

2.4 Optimization problem

Each participant i aims to minimize their total cost considering the strategies of other participants θi as defined in Equation 17:

minθiΘiJiθi,θi(17)

where

Θi is the strategy set for player i

The strategy sets Θi for each player i must satisfy the following properties:

Compactness: The strategy sets are bounded and closed as shown in Equation 18:

Θi=θit=git,sit,eip2ptt=1,2,3,,T(18)

Convexity: The strategy sets are convex.

Convexity of the Payoff Function: The convexity of the payoff function Ji with respect to the strategy θi is a crucial requirement for the existence of Nash equilibria. To show that Ji is convex, we examine its Hessian matrix.

Hessian Matrix of Ji: The Hessian matrix Hi of Ji with respect to θi is given by the second-order partial derivatives as shown in Equation 19:

Hi=θi2Jiθi,θi(19)

For Ji to be convex, the Hessian matrix Hi must be positive semidefinite. This requires that all eigenvalues of Hi are non-negative.

Algorithm 1.Proximal Decomposition Algorithm for Nash Equilibrium.

The proximal decomposition algorithm can be used to find the Nash equilibrium in this P2P energy trading setup.

1. Initialization: Set initial strategies θi0 for all users i

2. Initialize the regularization parameter ρ>0.

Iterative steps:

 For each participant i and at each iteration k update their strategy by solving the regularized optimization problem:

1. Proximal Update is shown in Equation 20:

θik+1=argminθiΘiJiθi,θik+ρ2θiθik2(20)

2. Update the centroid using the average of the strategies as defined in Equation 21:

θk+1=1Ni=1Nθik+1(21)

3. Convergence Check:

Terminate the iteration when the relative change in strategies is below a predefined threshold ε.

2.4.1 Steps to calculate equilibrium price and volume

1. Initial Setup:

• Collect initial data on energy generation, storage, and consumption for each prosumer.

• Define the cost coefficients for generation (ai, bi, ci), storage (ci,charge, ci,discharge), and blockchain services (β, ρ, δ).

• Set the incentive rates (γi).

2. Iterative Calculation Using Proximal Decomposition Algorithm 1

3. Market-Clearing Condition:

• Solve for the equilibrium price p* by setting total supply equal to total demand as shown in Equation 22:

iSip*=iDip*(22)

2.5 Model assumptions

Firstly, we assume that all users act rationally, aiming to minimize their costs or maximize their benefits. This is a reasonable assumption as prosumers are incentivized to reduce their energy expenses and optimize their energy usage, especially in a decentralized energy market where individual actions have direct economic implications. Additionally, we assume that users have complete information about the game’s structure, including costs, benefits, and potential actions of other users. This assumption simplifies the model by ensuring that all players make decisions based on the same data set, facilitated by blockchain technology that provides transparent communication. Furthermore, users are assumed to be strategic, considering the actions of others in their decision-making processes. This aligns with the decentralized nature of microgrids, where the actions of one prosumer can affect the outcomes for others and is essential for achieving a Nash equilibrium. Regarding market conditions, we assume perfect competition, ensuring that no single prosumer can influence market prices or outcomes, which is a reasonable approximation for microgrids with numerous small-scale prosumers. The model also assumes relatively stable market conditions, allowing for the use of static game models. While real-world conditions can fluctuate, this assumption helps focus on the core dynamics of DSM and simplifies the analytical process. Consistent availability of renewable energy sources, which can be forecasted with reasonable accuracy, is also assumed. This is supported by advancements in renewable energy forecasting technologies, enabling more predictable energy generation patterns crucial for effective DSM. Technological limitations are addressed by assuming known and constant efficiencies for energy storage systems, which simplifies the model and reflects the current state of technology where efficiency parameters are well-documented. Finally, for model feasibility, we assume homogeneous prosumers, which helps simplify the analysis while providing general insights. Although real-world prosumers have diverse characteristics, this assumption allows for a manageable and clear model that can be extended to more complex scenarios in future research. We also assume a deterministic environment, which simplifies the model by removing uncertainties and allows for a focus on core mechanisms. This assumption can be relaxed in future studies to incorporate stochastic elements.

3 Demand side management implementation using blockchain smart contracts

The blockchain system employed in this study utilizes a decentralized ledger to record all transactions related to energy trading, DSM actions, and incentive distributions. The architecture comprises multiple interconnected nodes, each representing a participant in the microgrid, such as prosumers, renewable energy sources (RES) owners, and the microgrid Energy Management System (EMS) as shown in Figure 2. The blockchain operates on the Ethereum platform, which supports smart contract functionality through the Solidity programming language. Each node maintains a copy of the blockchain ledger, ensuring transparency and security. Transactions are validated through a consensus mechanism, specifically the Proof of Stake (PoS) algorithm. PoS was chosen over Proof of Work (PoW) due to its energy efficiency and faster transaction processing times. In PoS, validators are chosen based on the number of tokens they hold and are willing to “stake” as collateral, which significantly reduces the computational resources required for transaction validation.

Figure 2
www.frontiersin.org

Figure 2. Blockchain-based P2P transaction system for the Microgrid Energy Management System (MEMS).

To ensure the large-scale participation of prosumers, medium-scale renewable energy source (RES) owners, and customers in the Demand Response (DR) program, several steps are necessary to achieve the objective of reducing dependency on thermal units and extensive transmission networks. These steps include the registration of microgrid participants, such as RES owners, prosumers, and consumers. Once participants have submitted their credentials, the system verifies and validates these credentials, accepting or rejecting participation based on predefined criteria. All transaction requests from participants are stored in a cloud-based system for processing. Following the storage of transaction requests, the Microgrid Energy Management System (MEMS) runs the Optimal Power Flow (OPF) to evaluate system constraint parameters and ensure the feasibility of transactions. In the next phase, validated transaction requests are broadcasted to the peer-to-peer (P2P) network. Smart contracts are then deployed to manage these transactions using consensus algorithms, ensuring agreement among network participants. These transactions are subsequently validated by miners to ensure authenticity and accuracy. Once validated, a new block is created containing the validated transactions, and this new block is added to the blockchain, ensuring a secure and immutable record of transactions. The overall process is demonstrated in Figure 2.

Figure 2 illustrates these steps, from transaction initiation to completion. In Step 1, all microgrid participants send requests to the registration authority (RA). Step 2 ensures that only registered participants can engage in transactions, verified through their public keys. In Step 3, all transaction requests are stored in the cloud. Following this, the MEMS runs the OPF on the generation and load data provided by RES producers, consumers, and prosumers to verify system parameters and achieve cost minimization, as outlined in Step 4. In case of a generation shortfall, transaction requests are sent to consumers with an initial incentive rate to solicit DR resources. This cycle continues with updated incentive rates, employing elasticity-based DR modeling to simulate events. If no violations are found, the requested transaction is broadcasted to all peers, as depicted in Step 5. The smart contract is then deployed with DSM using Nash equilibrium game theory to calculate the price for the transaction volume using a consensus algorithm. Subsequently, the transaction is validated by a miner in Step 6. Upon validation, a new block is created in Step 7 and added to the existing blockchain with a new hash, as shown in Step 8.

The Flowchart shown in Figure 3 illustrates a detailed process within a blockchain-based energy trading system, focusing on event detection, demand-side management (DSM) actions, and incentive distribution. The process starts with the event detection phase, where the system continuously monitors voltage and frequency levels within the microgrid. If these parameters remain within predefined limits, the process concludes. However, if deviations are detected, indicating potential instability, the system triggers smart contracts to initiate corrective actions. These smart contracts automate DSM actions, such as adjusting energy loads, modifying generation levels, and managing energy storage systems to restore balance within the microgrid. Once the DSM actions are executed, they are meticulously recorded on the blockchain, ensuring transparency and providing an immutable trail of activities. Following this, the system proceeds to calculate incentives for the participants based on their contributions to the DSM actions. This calculation is divided into two paths: one for reducing load incentives and the other for increasing generation incentives. Both paths lead to recording these incentives on the blockchain. The next step involves the distribution of these calculated incentives, where tokens or credits are transferred to the participants’ accounts. This distribution process is also recorded on the blockchain to maintain transparency and accuracy. Finally, the process concludes with the recording of the incentive distribution on the blockchain, ensuring a comprehensive and verifiable record of all transactions. If no deviations were initially detected, the system directly moves to the end. This flowchart effectively demonstrates a robust, automated system for managing energy distribution, maintaining grid stability, and incentivizing participants, leveraging the security and transparency offered by blockchain technology.

Figure 3
www.frontiersin.org

Figure 3. Flowchart for event detection, DSM actions, and incentive distribution in a blockchain-based energy trading system.

Smart contracts are automated programs written in solidity language on Ethereum blockchain platform and it executes when the agreements conditions between the peers are met without third party’s involvement. Here smart contract is used to define the energy flexibility profiles of each user (consumers, prosumers, and RES aggregators) for taking part in DR programs and the rules for assuring the demand and generation balance at the grid level in automated manner. The set of rules here describe the behaviour of each participant during DR events while keeping the constraints within limits to maintain the grid parameters within the limits, therefore maintaining the stability and reliability intact of the system. These smart contracts are stored in the blockchain, and they are triggered when new energy transactions are taking place. Blockchain nodes keep updating its state after execution of each smart contract. The smart contract works as an agent in the blockchain that has state variables, enforces the associated rules, and it can be triggered at any point after its successful deployment. The voluntary enrolment of each user in a DR event is automatically regulated through smart contracts. Smart contract defines each individual baseline load demand profile, current load profile, expected load profile, and adjustments values in energy flexibility that is required to shift during DR event time. These contracts automate various processes, such as device registration, event detection, DSM actions, and incentive distribution. Below is a detailed description of the key smart contracts used in this study:

3.1 Registration phase

The registration phase is the foundational step in integrating devices into a blockchain-based energy trading and management system. This phase ensures that all devices participating in the microgrid are properly registered, authenticated, and authorized to interact with the network. The use of blockchain technology and smart contracts in this phase provides a secure, transparent, and tamper-proof method for device registration and management. During this phase, participants begin by identifying the devices they wish to register on the blockchain, which can include renewable energy generators, energy storage systems, and flexible loads. Each device must have a unique identifier, such as a serial number or digital certificate, to ensure it can be distinctly recognized within the network. Participants use a blockchain interface to initiate the registration process by submitting device information, including the unique identifier, technical specifications, and ownership details. This information is then packaged into a transaction and sent to the blockchain network.

A smart contract as shown in Algorithm 2, specifically designed for device registration, processes the incoming transaction. It performs several critical functions: validation to check the completeness and correctness of the provided information, authentication by interacting with external systems to verify device credentials, and authorization to ensure the participant is allowed to register the device based on identity and compliance checks. Once verified and authenticated, the smart contract records the device’s details on the blockchain, creating a new record on the blockchain ledger that includes the device’s unique identifier, technical specifications, ownership details, and a timestamp of the registration. It also generates a unique blockchain address or token associated with the device. After storing the device information on the blockchain, the system provides feedback to the participant, including a confirmation of successful registration and relevant details such as the blockchain address or token assigned to the device. Participants receive this confirmation through the blockchain interface, ensuring they have a verifiable record of the registration. The registration phase also includes mechanisms for updating device information. Participants can submit updates, such as changes in ownership, technical upgrades, or maintenance activities, through the blockchain interface. Smart contracts verify and authenticate these updates before recording them on the blockchain, ensuring the ledger remains accurate and up-to-date.

Algorithm 2.Pseudo code for registration phase.

procedure RegisterDevice(deviceID, deviceType, ownerInfo)

 transaction = createTransaction(deviceID, deviceType, ownerInfo)

 sendToBlockchain(transaction)

end procedure

procedure SmartContract_Verification(transaction)

if validateInformation(transaction) and authenticateDevice(transaction.deviceID) then

  authorizeParticipant(transaction.ownerInfo)

  recordOnBlockchain(transaction)

  generateBlockchainAddress(transaction.deviceID)

  sendConfirmation(transaction.ownerInfo)

else

  rejectTransaction(transaction)

end if

end procedure

procedure UpdateDeviceInfo(deviceID, updatedInfo)

 transaction = createTransaction(deviceID, updatedInfo)

 sendToBlockchain(transaction)

end procedure

procedure SmartContract_UpdateVerification(transaction)

if validateUpdateInformation(transaction) and authenticateDevice(transaction.deviceID) then

  recordUpdateOnBlockchain(transaction)

  sendUpdateConfirmation(transaction.ownerInfo)

else

  rejectTransaction(transaction)

end if

end procedure

Using blockchain and smart contracts for device registration offers several benefits: security through blockchain’s cryptographic nature, transparency of all transactions and records, decentralization that eliminates the need for a central authority, efficiency through automated processes, and immutability ensuring that once recorded, information cannot be altered or deleted. In conclusion, the registration phase is a critical step in integrating devices into a blockchain-based energy trading and management system. Leveraging blockchain technology and smart contracts ensures secure, transparent, and efficient device registration and management, laying the groundwork for reliable and optimized operation of the microgrid. This robust framework supports the integrity and functionality of the entire energy trading ecosystem, facilitating seamless interaction between distributed energy resources and enhancing overall grid stability.

3.2 Event detection

The microgrid EMS plays a vital role in maintaining the stability and reliability of the energy trading system. It continuously monitors critical parameters such as voltage and frequency to ensure they remain within predefined thresholds essential for safe and efficient microgrid operation. This real-time monitoring involves collecting data from various distributed energy resources (DERs) and connected devices, allowing the controller to have an up-to-date overview of the microgrid’s operational status. When the microgrid EMS detects that voltage or frequency levels are approaching or exceeding the set thresholds, indicating potential instability or inefficiency, it triggers a pre-programmed response via smart contracts deployed on the blockchain as outlined in Algorithm 3. These smart contracts are designed to automate corrective actions without the need for manual intervention. Upon activation, the smart contracts execute predefined rules to adjust the operation of DERs, such as redistributing loads, adjusting generation levels, or engaging energy storage systems to balance supply and demand.

Algorithm 3.Pseudo code for event detection.

procedure MonitorMicrogrid ()

while true do

  voltage = getVoltage ()

  frequency = getFrequency ()

  if voltage < V_min or voltage > V_max or frequency < f_min or frequency > f_max then

   triggerSmartContract (voltage, frequency)

  end if

  sleep (interval)

end while

end procedure

procedure SmartContract_EventResponse (voltage, frequency)

if voltage < V_min then

  adjustLoad (“increase”)

  adjustGeneration (“decrease”)

else if voltage > V_max then

  adjustLoad (“decrease”)

  adjustGeneration (“increase”)

end if

if frequency < f_min then

  engageStorage (“discharge”)

else if frequency > f_max then

  engageStorage (“charge”)

end if

  recordEventOnBlockchain (voltage, frequency, actions)

end procedure

This automated process ensures timely and precise responses to any deviations in voltage or frequency, thereby preventing potential outages and maintaining the overall stability of the microgrid. By leveraging smart contracts, the microgrid controller not only enhances operational efficiency but also provides a secure and transparent mechanism for implementing real-time adjustments, ensuring continuous optimal performance of the energy trading system.

3.3 DSM actions

Smart contracts play a pivotal role in executing Demand-Side Management (DSM) actions within a blockchain-based energy trading system. Once activated by the microgrid controller in response to voltage or frequency deviations, these smart contracts automatically implement various DSM strategies to restore balance and maintain optimal operation of the microgrid. The DSM actions involve adjusting energy loads, generation, and storage. For instance, the smart contract as outlined in Algorithm 4 reduce the energy consumption of non-critical loads during peak demand periods, shift energy usage to off-peak times, or increase the output from renewable energy sources like solar panels or wind turbines when needed. Additionally, the smart contract can manage energy storage systems by charging batteries during times of surplus generation and discharging them when there is a deficit, ensuring a continuous and reliable power supply.

Algorithm 4.Pseudo code for DSM actions.

procedure SmartContract_DSM (voltage, frequency)

if voltage < V_min or voltage > V_max or frequency < f_min or frequency > f_max then

  dsmActions = determineDSMActions (voltage, frequency)

  executeDSMActions (dsmActions)

  recordDSMActionsOnBlockchain (dsmActions)

end if

end procedure

procedure determineDSMActions (voltage, frequency)

 actions = []

if voltage < V_min then

  actions.append (reduceNonCriticalLoad())

  actions.append (increaseGeneration())

else if voltage > V_max then

  actions.append (increaseNonCriticalLoad())

  actions.append (decreaseGeneration())

end if

if frequency < f_min then

  actions.append (dischargeStorage())

else if frequency > f_max then

  actions.append (chargeStorage())

end if

 return actions

end procedure

procedure executeDSMActions (dsmActions)

for action in dsmActions do

  performAction (action)

end for

end procedure

All these adjustments are meticulously recorded on the blockchain, providing a transparent, immutable, and auditable trail of actions taken. This recording process includes detailed information such as the specific DSM actions executed, the time of execution, the devices involved, and the outcomes achieved. By logging every action on the blockchain, the system ensures accountability and transparency, allowing all stakeholders to verify that the DSM measures are performed as intended and to assess their effectiveness in real-time. This capability not only enhances trust among participants but also facilitates compliance with regulatory requirements and supports continuous improvement of the DSM strategies.

3.4 Incentive distribution

Smart contracts in a blockchain-based energy trading system are not only crucial for executing Demand-Side Management (DSM) actions but also for managing the economic incentives that drive participant engagement. Once DSM actions are triggered and participants respond by adjusting their energy usage, generation, or storage, the smart contracts evaluate these responses to determine the corresponding incentives. The smart contracts are programmed with algorithms that calculate incentives based on predefined criteria such as the amount of load shifted, the degree of energy consumption reduction during peak times, or the extent of energy contributed back to the grid as shown in Algorithm 5. For example, a participant who reduces their energy consumption significantly during a peak demand period might receive a higher incentive compared to one who makes a smaller adjustment. Similarly, those who increase their renewable energy generation or optimize their energy storage usage during critical periods may also earn additional rewards.

Algorithm 5.Pseudo code for incentive distribution.

procedure SmartContract_IncentiveDistribution (dsmActions)

 incentives = calculateIncentives (dsmActions)

 distributeIncentives (incentives)

 recordIncentivesOnBlockchain (incentives)

end procedure

procedure calculateIncentives (dsmActions)

 incentives = []

for action in dsmActions do

  if action.type == “reduceLoad” then

   incentives.append (calculateReductionIncentive (action))

  else if action.type == “increaseGeneration” then

   incentives.append (calculateGenerationIncentive (action))

  end if

end for

return incentives

end procedure

procedure distributeIncentives (incentives)

for incentive in incentives do

  transferTokens (incentive.participant, incentive.amount)

end for

end procedure

After calculating the incentives, the smart contracts automatically handle the distribution process. This automated system ensures that incentives are allocated accurately and promptly without the need for manual intervention, thereby reducing administrative overhead and the potential for errors or delays. The distribution process typically involves transferring digital tokens or credits to participants’ blockchain wallets, which they can use for future transactions or convert into other forms of value within the energy trading ecosystem. By automating the calculation and distribution of incentives, smart contracts not only streamline the operational processes but also enhance transparency and trust. Participants can easily verify their actions and corresponding rewards on the blockchain, fostering a fair and motivating environment. This transparency encourages greater participation and compliance with DSM strategies, ultimately contributing to the overall efficiency and stability of the microgrid.

The reliability of blockchain-based smart contracts is assumed to ensure they function as intended, as blockchain technology is inherently secure and tamper-proof. A robust IoT and communication infrastructure is assumed for real-time monitoring and control, justified by the increasing deployment of IoT devices and advanced communication networks in smart grid systems, enabling efficient data exchange and control. Behavioral economics assumptions include the predictable response of users to economic incentives, based on well-established principles. Prosumers are likely to alter their energy usage in response to financial incentives, crucial for DSM strategies’ success. User compliance with smart contracts is assumed due to the secure and transparent nature of blockchain technology, which ensures fairness and trust.

Transactions within the blockchain are verified through the Proof of Stake (PoS) consensus mechanism, which ensures their authenticity and accuracy. The PoS process includes several steps. First, prosumers create transactions for energy trading, DSM actions, or incentive claims. These transactions are submitted to the blockchain network. Submitted transactions then enter a transaction pool where they await validation by validators. Validators are selected based on the number of tokens they hold and are willing to “stake” as collateral. Validators are chosen to create new blocks and validate transactions proportionally to their staked tokens. The selected validator validates the transactions and creates a new block, which is then broadcast to the network. Other nodes verify the correctness of the block, and once verified, the new block is added to their copy of the blockchain, ensuring consensus across the network. Once added, the block and its transactions become immutable, providing a transparent and tamper-proof record of all actions taken.

Therefore, the approach for blockchain-driven demand-side management (DSM) in peer-to-peer (P2P) energy markets is articulated through a structured process that ensures the secure and efficient management of energy resources within a microgrid, as detailed in Algorithm 6. The process begins with the initialization phase, where the blockchain network is set up, and the microgrid system is configured with N prosumers, each equipped with Distributed Energy Resources (DERs) such as photovoltaic (PV) systems and Battery Energy Storage Systems (BESS). Each prosumer is registered on the blockchain, and all associated devices are authenticated and authorized using smart contracts to ensure secure transactions and interactions within the network.

Following the initialization, the game-theoretical DSM framework is established. This involves the initialization of cost functions, and strategy sets θi for each prosumer i, along with the setting of a convergence tolerance, ϵ. The iterative DSM algorithm then proceeds, where each prosumer calculates their best response strategy by minimizing their individual cost functions. The strategies are updated using a proximal decomposition algorithm, ensuring optimal decision-making in the context of the microgrid’s overall energy management. After each strategy update, the revised strategy is recorded on the blockchain through smart contracts, ensuring transparency and immutability of the actions taken. The algorithm continues to iterate until the strategies of all prosumers converge, indicated by changes in strategies being less than the specified tolerance ϵ, thereby achieving Nash equilibrium.

During the operational phase of the microgrid, the Energy Management System (EMS) is initialized to monitor key grid parameters such as voltage and frequency continuously. The EMS is designed to detect events like load changes or generation fluctuations in real time. Upon detection of such events, corresponding DSM actions are triggered via smart contracts. These actions involve dynamic adjustments to energy loads, generation, and storage to maintain the balance between supply and demand within the microgrid. All DSM actions are securely recorded on the blockchain, providing a transparent and auditable trail of decisions and outcomes.

Finally, the system includes an incentive distribution mechanism, where economic incentives are calculated for each prosumer based on predefined criteria, such as their contribution to load adjustments or energy production. These incentives are distributed through smart contracts, and the transactions are recorded on the blockchain. This mechanism not only promotes active participation in the DSM process but also ensures that prosumers are fairly rewarded for their contributions. The simulation ends after all DSM actions and incentives have been processed, providing a comprehensive framework for blockchain-driven DSM in P2P energy markets. This approach ensures a secure, efficient, and equitable management of energy resources, leveraging the transparency and trust inherent in blockchain technology.

Algorithm 6.Pseudo-code for Blockchain-Driven Demand Side Management in P2P Energy Markets.

//Initialization Phase

Initialize blockchain network

Initialize the microgrid system with N prosumers, each with its own DERs (PV systems, BESS, etc.).

For each prosumer i in the microgrid:

 Register prosumer i on the blockchain

 Authenticate and authorize all devices of prosumer i using smart contracts

//Game-Theoretical DSM Framework

Initialize cost functions for each prosumer i

Initialize strategy set θ_i for each prosumer i

Set convergence tolerance epsilon

//Iterative DSM Algorithm

Repeat until convergence:

For each prosumer i:

  //Strategy Update

  Calculate the best response strategy by minimizing the cost function

  Update strategy θ_i for prosumer i using proximal decomposition algorithm

  //Blockchain Transaction

  Record updated strategy on the blockchain using smart contract

 //Check for Nash Equilibrium

If change in strategies for all prosumers is less than epsilon:

  Convergence achieved

  Break loop

//Event Detection and DSM Actions

Initialize Energy Management System (EMS) to monitor grid parameters (voltage, frequency)

While microgrid is operational:

For each detected event (e.g., load change, generation fluctuation):

  Trigger corresponding DSM action via smart contract

  Adjust energy loads, generation, and storage dynamically to balance supply and demand

  Record all actions on the blockchain

//Incentive Distribution

For each completed DSM action:

 Calculate economic incentives for prosumers based on predefined criteria

 Distribute incentives using smart contracts

 Record incentive distribution on the blockchain

//End of Simulation

4 Results and discussions

In this study, we analyzed the performance of a decentralized energy management system involving five prosumers over five distinct demand response (DR) events T1, T2, T3, T4, and T5. During Event T1, the system begins with a baseline energy demand and generation scenario, focusing on the initial performance of the energy management system in handling typical energy demands. Prosumers generate renewable energy based on available resources, energy storage systems balance supply and demand, and initial P2P trading activities distribute excess energy among participants. In Event T2, there is a moderate increase in energy demand, and the objective is to evaluate the system’s ability to maintain stability. This period sees increased renewable energy generation, enhanced use of energy storage systems to store excess energy during low-demand periods, and intensified P2P trading activities to optimize energy distribution. Event T3 represents the peak demand period where energy demand is at its highest, testing the system’s resilience and efficiency. Maximum utilization of renewable energy sources, strategic use of stored energy to meet peak demand, incentives for load shifting and reduction, and active P2P trading are key actions to dynamically balance energy supply and demand. Following the peak, Event T4 focuses on the system’s capability to adjust to a decrease in demand. There is a gradual reduction in renewable energy generation, controlled discharge of energy storage systems, and continued P2P trading to manage residual demand and supply. Finally, Event T5 is a stabilization period where demand returns to a moderate level. The objective is to evaluate the system’s performance in maintaining stability and optimizing energy usage. Steady renewable energy generation meets moderate demand, optimal management of energy storage prepares for future demand fluctuations, and sustained P2P trading ensures efficient energy distribution among participants.

To evaluate the performance of the decentralized energy management system, we consider specific configurations for each prosumer, including the sizes of their photovoltaic (PV) systems and energy storage systems (ESS). The system configuration for the study involves a microgrid setup comprising 5 prosumers. The dataset utilized for this study is sourced from the Pecan Street Project, which includes energy usage and generation records from residential households in Austin, Texas. This dataset provides real-world consumption and generation patterns, making it highly representative and reliable for the purposes of this study. The use of such empirically measured data ensures that the load profiles and generation patterns are both accurate and reflective of actual residential energy behavior. This data has been used in multiple studies (pecanstreet, 2024; Umar Abdullah et al., 2022; Afzalan and Jazizadeh, 2021; Umar et al., 2024) and is well-recognized within the research community, further validating its appropriateness for this analysis. The Distributed Energy Resources (DERs) integrated within the microgrid include Solar PV systems and Battery Energy Storage Systems (BESS). The sizes of the PV systems range from 7 kW to 14 kW, as shown in Table 1, while the BESS specifications include power ratings from 5 kW to 14 kW and storage capacities ranging from 15 kWh to 17 kWh, as detailed in Table 2. For the blockchain parameters, the network is built on a Remix Ethereum Virtual machine blockchain platform. The consensus mechanism employed is the Proof of Stake (PoS). The block interval, which represents the time taken to generate a new block, was around 15 s, and the smart contract execution time was 3 s on average. Additionally, the smart contract parameters, such as the deployment cost measured in Gas/Wei and the transaction fees converted into USD, are provided in Blockchain Cost Coefficients. In the game-theoretical Demand Side Management (DSM) framework, the cost functions for each prosumer RES generation and BESS and incentive are characterized by coefficients provided in Tables 3, 4. These coefficients are standardized, with typical values or ranges provided for each prosumer. The strategy update method utilized is the proximal decomposition algorithm, with a convergence tolerance of ϵ = 10–3 and a maximum of 100 iterations allowed for achieving convergence.

Table 1
www.frontiersin.org

Table 1. Sizes of the PV systems.

Table 2
www.frontiersin.org

Table 2. BESS storage power and capacity.

Table 3
www.frontiersin.org

Table 3. Coefficients for renewable energy Generation cost function.

Table 4
www.frontiersin.org

Table 4. Battery energy storage cost and incentive coefficients.

The Energy Management System (EMS) monitors grid parameters such as voltage and frequency, maintaining them within specified thresholds (e.g., voltage thresholds between 0.95 p.u. to 1.05 p.u. and frequency thresholds from 49.9 Hz to 50.1 Hz). DSM actions include load adjustments within ±10% of the baseline load and generation curtailment by 5% during overproduction scenarios. BESS operations are managed within an operational range of 20%–80% state of charge (SoC). Incentive mechanisms are designed to reward prosumers based on their energy contributions or load adjustments, with Equation 14 used to calculate these rewards. The assumptions made during the study include the consistency of load profiles with historical data from the Pecan Street Project and the use of typical solar irradiance data for Austin, Texas. Economic assumptions are based on dynamic energy prices on specific market conditions, and no degradation of BESS performance is considered over the simulation period. The primary focus was on the generation, storage, and peer-to-peer (P2P) trading of energy, with each prosumer aiming to optimize their net profit by minimizing costs and maximizing incentives. The simulations were conducted using various software tools. The blockchain simulation environment includes platforms like Truffle Suite or Remix. Game-theoretical modelling was carried out using tools like a Python environment (version 3.12), utilizing libraries such as NumPy for numerical computations, Pandas for data manipulation, Matplotlib for data visualization, and SciPy for optimization tasks. The computations were performed on a system equipped with an Intel Core i7 processor, 16 GB of RAM, and running on a Windows 10 operating system.

Each prosumer is equipped with a photovoltaic (PV) system. The sizes of these PV systems are as follows:

Each prosumer also has a battery energy storage system (BESS) with specific power and capacity sizes:

These configurations represent typical setups for prosumers participating in a decentralized energy management system. The PV system sizes reflect the generation capacity available to each prosumer, while the storage power and capacity sizes indicate their ability to store and manage energy. This data is crucial for analyzing the performance of the system under different demand response (DR) events (T1-T5).

By incorporating these blockchain service costs into the overall cost calculation, we provide a comprehensive and realistic analysis of the energy management framework.

Blockchain Cost Coefficients:

1. Transaction Fee Coefficient (β): $0.001 per transaction.

2. Smart contract execution cost coefficient (ρ): $0.05 per smart contract execution

3. Infrastructure maintenance cost (δ): $0.02 per time-period

The costs associated with renewable energy generation, storage, and incentives , as well as the blockchain service for each prosumer, are summarized in Tables 58 respectively.

Table 5
www.frontiersin.org

Table 5. RES cost Generation data.

Table 6
www.frontiersin.org

Table 6. Battery energy storage system (BESS) cost data.

Table 7
www.frontiersin.org

Table 7. Incentives for 1 kW load reduction.

Table 8
www.frontiersin.org

Table 8. Blockchain service costs (US$).

The bar chart as shown in Figure 4 depicts the Renewable Energy Source (RES) generation in kilowatts (kW) for five prosumers across five distinct time periods (1–5 h). The chart provides a comparative analysis of each prosumer’s generation capabilities during these intervals. Prosumer 1’s generation starts at 7 kW at Time 1 and increases progressively, peaking at 11 kW at Time 5, indicating a steady improvement in RES output. Similarly, Prosumer 2 begins with 8 kW at Time 1 and reaches 11 kW at Time 5, maintaining a consistent generation profile with minimal fluctuations between Time 2 and Time 4. Prosumer 3 exhibits the highest initial generation at 10 kW at Time 1 but experiences a slight dip to 7 kW at Time 4 before stabilizing. Prosumer 4 starts strong with 9 kW at Time 1, peaks at 11 kW at Time 2, and shows minor reductions mid-way but remains stable overall. Prosumer 5 consistently demonstrates the highest RES generation, starting at 14 kW at Time 1, with a slight drop to 7 kW at Time 4, but quickly recovering to maintain high generation values through Time 5. The comparative insights reveal that Prosumers 1, 2, and 5 exhibit stable and progressively increasing or consistently high generation values, whereas Prosumers 3 and 4 show slight fluctuations indicating potential variability in their RES generation. The steady increase observed in Prosumers 1 and 2 suggests more consistent renewable energy sources, while Prosumer 5’s robust and reliable output underscores its leading position in RES generation. These findings highlight the varying levels of RES generation capabilities among the prosumers, with Prosumer 5 leading in terms of maximum output across most time periods. The stability and reliability in RES generation, as demonstrated by Prosumers 1, 2, and 5, are crucial for effective participation in decentralized energy markets. Prosumers 3 and 4, while competitive, may need to address their generation variability to ensure more consistent performance.

Figure 4
www.frontiersin.org

Figure 4. RES Generations during five different DR events periods.

The bar chart in Figure 5 illustrates the energy storage in kilowatts (kW) for five prosumers across five distinct time periods (1–5 h). The chart provides a comparative analysis of each prosumer’s energy storage capabilities during these intervals. Prosumer 1 exhibits high storage values at Time 1 and Time 2, each approximately 14 kW. There is a notable drop at Time 3 to around 9 kW, followed by an increase to around 12 kW at Time 4 and Time 5. This pattern indicates Prosumer 1’s ability to manage storage effectively, with some variability at Time 3. Prosumer 2 starts with 12 kW at Time 1, decreases slightly to around 10 kW at Time 2 and Time 3, then increases back to around 12 kW at Time 4 and Time 5, suggesting stable storage management with minor fluctuations. Prosumer 3 begins with 13 kW at Time 1, drops significantly to around 6 kW at Time 3, and recovers to approximately 11 kW by Time 5. This significant drop and subsequent recovery indicate variability in storage, potentially reflecting changes in storage usage or generation needs. Prosumer 4 shows a high initial storage value of 12 kW at Time 1, which decreases to 8 kW by Time 2 and drops further to 5 kW at Time 3. However, storage levels increase again to 11 kW by Time 5, demonstrating a considerable range of fluctuations and suggesting that Prosumer 4 may be adjusting storage in response to generation or consumption demands. Prosumer 5 starts with the lowest storage value of around 10 kW at Time 1 but increases steadily to 14 kW by Time 4, followed by a slight decrease to 12 kW at Time 5. This steady increase followed by a small drop indicates a generally stable storage pattern with minor adjustments. The comparative analysis of energy storage highlights that Prosumers 1 and 2 have relatively stable storage patterns with minor fluctuations, indicating effective storage management. Prosumer 3 exhibits significant variability, which might be due to dynamic adjustments in storage based on generation and consumption needs. Prosumer 4 shows the most fluctuations, suggesting responsive adjustments to varying energy demands. Prosumer 5 maintains a generally stable pattern with a steady increase, indicating robust storage capabilities.

Figure 5
www.frontiersin.org

Figure 5. Battery storage of Five prosumers BESS over different DR events period.

The bar chart shown in Figure 6 depicts the peer-to-peer (P2P) energy trade in kilowatts (kW) for five prosumers across five distinct time periods (1–5 h). The chart provides a comparative analysis of each prosumer’s P2P trading activities during these intervals. Prosumer 1 shows a gradual increase in P2P trade, starting at around 13 kW at Time 1, decreasing to 9 kW at Time 3, and peaking at approximately 12 kW at Time 5. This indicates Prosumer 1’s active participation in P2P trading with fluctuations that might be aligned with energy generation and storage dynamics. Prosumer 2, on the other hand, maintains a high level of P2P trading, starting at around 14 kW at Time 1 and sustaining similar levels through Time 4, before a slight decrease to 11 kW at Time 5. This consistent high-level trading suggests Prosumer 2’s strong engagement in the P2P energy market. Prosumer 3 also begins with a high trading value of around 14 kW at Time 1, drops to approximately 9 kW at Time 3, and then increases again to 13 kW by Time 5. This pattern indicates variability in trading activities, likely driven by changing energy demands and generation capabilities. Prosumer 4 shows similar high trading levels at Time 1 and Time 4, with values around 14 kW, but experiences a notable decrease to 8 kW at Time 3, before recovering to around 12 kW at Time 5. This fluctuation suggests Prosumer 4’s adaptive trading strategies in response to market conditions and internal energy needs. Prosumer 5 starts with a high trading value of around 14 kW at Time 1, similar to other prosumers, but exhibits a significant drop to approximately 9 kW at Time 2, and then fluctuates around 13 kW by Time 5. The overall trading activity for Prosumer 5 indicates strong engagement with some variability, reflecting responsive adjustments based on energy availability and market dynamics. The comparative analysis of P2P trading highlights that Prosumers 2 and 4 have consistent high-level trading activities, suggesting robust engagement in the P2P energy market. Prosumers 1, 3, and 5 exhibit more variability, with significant fluctuations that indicate responsive adjustments to changing energy conditions and market opportunities. Consistent and high-level trading, as seen with Prosumers 2 and 4, can significantly contribute to overall performance in decentralized energy markets. The variability observed in Prosumers 1, 3, and 5 highlights the need for adaptive strategies to effectively balance energy generation, storage, and trading.

Figure 6
www.frontiersin.org

Figure 6. P2P Energy Trading of Five Prosumers over Different DR events Periods.

The bar chart depicted in Figure 7 illustrates the net profit in US dollars (US$) for five prosumers across five distinct time periods (1–5 h). The chart provides a comparative analysis of each prosumer’s profitability during these intervals. Prosumer 1 achieves the highest net profit at Time 1, with approximately $17.5, indicating strong initial performance. However, there is a noticeable drop at Time 2 to around $10, followed by a dip at Time 3 and a recovery to around $13 at Time 5. This fluctuation suggests that Prosumer 1’s profitability is influenced by varying levels of energy generation, storage, and trading activities. Prosumer 2 also shows high net profit at Time 1, reaching around $16, with a gradual decline to approximately $10 at Time 3. The profitability peaks again at Time 4 with about $15, and stabilizes at $12 at Time 5, indicating consistent high performance with minor fluctuations. Prosumer 3 starts with a moderate net profit of approximately $11 at Time 1, decreasing to around $7 at Time 3, and then increasing again to about $13 by Time 5. This pattern reflects Prosumer 3’s adaptive strategies in energy management, leading to varying profitability. Prosumer 4 shows a lower net profit at Time 1, with around $8, decreasing further at Time 3, but recovering to approximately $12 at Time 5. The variability in Prosumer 4’s net profit suggests responsiveness to changing energy market conditions and internal energy management. Prosumer 5 starts with the lowest net profit of around $7 at Time 1, maintaining a consistent low level through Time 3 but showing a significant increase to $13 at Time 4 and stabilizing at around $9 at Time 5. This pattern indicates Prosumer 5’s initial struggles in profitability, followed by improved performance in later periods. The comparative analysis of net profit highlights that Prosumers 1 and 2 achieve the highest profitability, particularly at Time 1, indicating strong initial performance. Prosumer 3 exhibits moderate but stable profitability with some fluctuations, while Prosumers 4 and 5 show lower initial profits with significant variability.

Figure 7
www.frontiersin.org

Figure 7. Net Profits of Five Prosumers over Different DR events Periods.

The bar chart shown in Figure 8 illustrates the maximum demand during Demand Response (DR) events in kilowatts (kW) for five prosumers across five distinct time periods (1–5 h). The chart provides a comparative analysis of each prosumer’s peak demand during these intervals. Prosumer 1 shows a consistent maximum demand, starting at around 11 kW at Time 1, peaking at approximately 13 kW at Time 2, and maintaining similar levels through Time 5. This indicates stable demand patterns during DR events. Prosumer 2 also demonstrates steady demand, beginning at around 10 kW at Time 1, peaking at 13 kW at Time 3, and stabilizing around 11 kW by Time 5. This suggests effective demand management during DR events. Prosumer 3 starts with the highest initial demand of approximately 14 kW at Time 1, decreasing to around 12 kW at Time 3, and then stabilizing at about 13 kW by Time 5. This pattern reflects Prosumer 3’s variable but high demand during DR events. Prosumer 4 shows significant demand variability, with peaks at around 13 kW at Time 1, decreasing to 12 kW at Time 3, and stabilizing at 11 kW by Time 5. The fluctuations indicate a dynamic approach to managing peak demand. Prosumer 5 exhibits a steady demand pattern, starting at around 12 kW at Time 1, peaking at 14 kW at Time 4, and maintaining around 12 kW by Time 5. This consistent demand pattern highlights Prosumer 5’s stable energy needs during DR events. The comparative analysis of maximum demand during DR events reveals that Prosumers 1 and 2 maintain stable and moderate peak demand levels, indicating effective demand management strategies. Prosumer 3 consistently shows the highest peak demand, reflecting high energy needs during DR events. Prosumer 4’s significant variability suggests a responsive approach to managing peak demand, while Prosumer 5 maintains a stable demand pattern with slight fluctuations. These findings emphasize the importance of managing peak demand effectively during DR events to optimize energy usage and enhance system reliability. Stable demand patterns, as seen with Prosumers 1, 2, and 5, contribute to efficient energy management, while the variability observed in Prosumer 3 and 4 highlights the need for adaptive strategies to balance energy needs and availability.

Figure 8
www.frontiersin.org

Figure 8. Maximum Demands of Five Prosumers during Different DR events Periods.

4.1 A case study conducted to minimize the power flow at the point of common coupling (PCC)

To provide numerical evidence of the convenience for users to operate autonomously and maximize self-consumption, we conducted a simulation for prosumers by regulating the batteries to minimize the power flow at the point of common coupling (PCC).

Simulation results:

Total cost (Autonomous Operation): $ 43.09.

Total power flow at PCC (Autonomous Operation): 107.33 kWh.

Figure 9 shows the power flow at the Point of Common Coupling (PCC) over a 24-h period for the scenario where prosumers operate autonomously to maximize self-consumption and minimize the power flow at the PCC. Initially, the power flow at the PCC fluctuates slightly above and below zero, indicating a balanced state between energy demand and supply with minor exchanges of power. During the midday period (hours 5–10), there is a notable increase in power flow, peaking slightly above 5 kW, corresponding to peak solar PV generation due to maximum sunlight. This excess energy is either stored or exported to the PCC by prosumers.

Figure 9
www.frontiersin.org

Figure 9. Power flow at the Point of Common Coupling (PCC) over a 24-h period.

Between hours 10 and 12, there is a significant reduction in power flow, dipping to around −10 kW, indicating that prosumers are utilizing stored energy to meet their demand, thus reducing the need to draw power from or export power to the PCC. The negative values suggest active discharging of storage systems to manage demand. From hours 12 to 18, the power flow stabilizes with minor fluctuations around zero, reflecting a balanced state where energy generation, consumption, and storage by prosumers are nearly equal.

In the evening hours (18–24), there is an upward trend in power flow, peaking at around 10 kW by the end of the 24-h period, likely due to increased energy demand as prosumers return home. During this time, energy consumption rises, and prosumers may be drawing more power from the PCC due to demand exceeding their generation and storage capacity. These observations indicate effective self-consumption by prosumers, especially during midday and afternoon periods when solar generation is high and stored energy is utilized.

The significant dips below zero during midday and minor fluctuations during the afternoon demonstrate the effective use of battery storage to manage energy demand and reduce reliance on external power sources.

The simulation results provide numerical evidence that prosumers can operate autonomously to a large extent, minimizing power flow at the PCC and maximizing self-consumption. However, during periods of high demand, such as in the evening, there may still be a need to draw power from the PCC. These findings highlight the potential for decentralized energy management systems to balance energy supply and demand, effectively utilize storage systems, and reduce reliance on external power sources while acknowledging the challenges during peak demand periods.

4.2 Blockchain transaction results analysis

In our blockchain-based energy trading and management system, we have five prosumers. The results data for these prosumers from the DSM actions have been analyzed, focusing on the key operations such as registration, event detection, DSM actions, and incentive distribution. This analysis provides a comprehensive understanding of how the system leverages blockchain technology to manage and optimize energy transactions and ensure grid stability.

4.2.1 Registration phase

During the registration phase, transactions are initiated by prosumers to register their devices on the blockchain. Each transaction includes device ID, device type, owner information, and technical specifications depicted in Figure 10. This phase is fundamental to ensuring that all devices participating in the microgrid are authenticated and authorized, thus maintaining the integrity and reliability of the system.

Figure 10
www.frontiersin.org

Figure 10. Registration smart contract deployed on Remix Ethereum using Ganache and MetaMask.

Device ID: Each device is assigned a unique identifier, known as the device ID, which distinguishes it from other devices within the network. This identifier is crucial for tracking the device’s activities and performance over time. By ensuring that each device has a unique ID, the system can prevent conflicts and duplication, which is vital for accurate monitoring and management.

Device Type: The device type specifies the kind of device being registered, such as a solar panel, wind turbine, battery storage, or any other energy-generating or storing equipment. This classification is essential for understanding the device’s role and capabilities within the microgrid. For instance, knowing that a device is a battery allows the system to include it in energy storage and discharge strategies during demand response events.

Owner Information: Owner information includes details about the prosumer who owns the device. This typically encompasses the owner’s name, address, and contact information. This information is crucial for accountability and for managing incentives and rewards within the system. By associating each device with its owner, the system can ensure that rewards and penalties are correctly allocated.

Technical Specifications: Technical specifications provide detailed data about the device, including its capacity, efficiency, make and model, installation date, and maintenance records. This information helps in assessing the device’s performance and integration into the energy management system. For example, knowing the capacity and efficiency of a solar panel allows the system to predict its energy generation potential accurately.

The registration phase thus plays a pivotal role in establishing a secure and trustworthy network of devices within the microgrid. By leveraging blockchain technology, the system ensures that all device registrations are validated, authenticated, authorized, and transparently recorded. This foundational step is crucial for the subsequent phases of event detection, DSM actions, and incentive distribution, as it ensures that only authorized devices participate in these critical operations. The detailed information captured during the registration phase enables precise monitoring, efficient management, and accurate allocation of incentives, thereby supporting the overall goal of optimizing energy use and maintaining grid stability.

4.2.2 Event detection

The event detection phase is critical for maintaining the stability of the microgrid. The Microgrid Energy Management System (EMS) continuously monitors various parameters, including voltage, frequency, energy generation, and consumption. When these parameters deviate from predefined thresholds, the EMS triggers blockchain transactions to log the events. Each transaction in this phase includes detailed data such as the exact voltage and frequency readings at the time of the deviation, the timestamp of the detection, and a description of the issue as shown in smart contract execution Figure 11.

Figure 11
www.frontiersin.org

Figure 11. Event detection smart contract deployed on Remix Ethereum using Ganache and MetaMask.

For instance, if the voltage drops below the acceptable range of 220V, the EMS records this deviation on the blockchain. The smart contract associated with event detection then initiates corrective actions. These actions can include instructing specific prosumers to reduce their energy consumption or activating stored energy from batteries to compensate for the shortfall. This automated response ensures that corrective measures are taken swiftly and efficiently, minimizing the risk of outages and maintaining grid stability.

4.2.3 DSM actions

During the DSM actions phase, transactions document the execution of specific demand-side management strategies. These strategies are designed to balance supply and demand dynamically, adjusting energy loads, generation, and storage based on real-time conditions. Each transaction in this phase includes comprehensive information such as the type of DSM action performed (e.g., load reduction, generation increase, battery discharge), the devices involved, and the timestamp of the action as shown in Figure 12.

Figure 12
www.frontiersin.org

Figure 12. DSM actions smart contract deployed on Remix Ethereum using Ganache and MetaMask.

For example, suppose a sudden increase in energy demand occurs in the evening. In that case, the EMS detects the imbalance and triggers a smart contract to execute DSM actions. The smart contract might reduce non-critical loads by temporarily turning off appliances or delay energy-intensive activities. Simultaneously, it could command batteries to discharge stored energy to meet the increased demand. These actions are recorded on the blockchain, ensuring a transparent and immutable log of all DSM activities.

4.2.4 Incentive distribution

The incentive distribution phase is crucial for encouraging active participation in DSM actions. Transactions in this phase calculate and allocate rewards to prosumers based on their contributions to maintaining grid stability. Each transaction includes details such as the specific DSM actions performed, the calculated incentives, the recipient prosumer’s information, and the timestamp of the distribution as shown in Figure 13.

Figure 13
www.frontiersin.org

Figure 13. Incentive distribution smart contract deployed on Remix Ethereum using Ganache and MetaMask.

For instance, if a prosumer reduces their energy consumption during a peak demand period as part of a DSM action, the smart contract calculates the incentive they earn based on the amount of energy saved and the duration of the reduction. This incentive is then distributed automatically through a blockchain transaction, which records the prosumer’s contribution and the corresponding reward. This transparent and automated incentive mechanism motivates prosumers to participate actively in DSM strategies, ensuring a more balanced and efficient energy system.

The blockchain performance metrics in Table 9 provide insights into the operational efficiency and technical robustness of the decentralized energy management system. Key metrics include transaction fees, smart contract execution costs, and infrastructure maintenance costs, all of which are managed efficiently through the Ethereum blockchain using the Proof of Stake (PoS) consensus mechanism. The block interval and smart contract execution time were optimized to ensure rapid transaction validation and contract execution, which is crucial for maintaining system responsiveness. Additionally, the system’s game-theoretical framework, which leverages a proximal decomposition algorithm, ensures accurate convergence to Nash equilibrium within a set tolerance, facilitating decentralized decision-making. These metrics highlight the blockchain’s role in providing a secure, transparent, and efficient platform for energy trading and management within the microgrid.

Table 9
www.frontiersin.org

Table 9. Blockchain performance metrics.

The economic performance of the decentralized energy management system is evaluated through key metrics such as total cost savings, incentives earned, P2P revenue, total energy cost, net profit, and peak demand management costs, as shown in Table 10. Across the demand response (DR) events, prosumers demonstrated significant cost savings due to optimized energy management and Demand-Side Management (DSM) strategies. Incentives played a crucial role in encouraging active participation, with prosumers earning consistent rewards for load reduction and energy generation. P2P trading emerged as a significant revenue source, though its variability highlighted the dynamic nature of energy markets. Overall, net profits reflected the combined effects of cost savings, incentives, and trading revenue, with fluctuations indicating the need for adaptive strategies. Effective management of peak demand further contributed to minimizing costs, underscoring the importance of strategic energy use in maximizing economic benefits.

Table 10
www.frontiersin.org

Table 10. Economic performance metrics.

5 Conclusion

This study demonstrates the effective implementation of a blockchain-based energy trading and management system for microgrids. By integrating smart contracts, we ensured that all devices participating in the microgrid were properly registered, authenticated, and authorized to interact with the network. This foundational step enhanced the security, transparency, and efficiency of managing device information, providing a robust framework for the reliable and optimized operation of the microgrid. The microgrid Energy Management System (EMS) continuously monitored critical parameters such as voltage and frequency to maintain stability and reliability. When deviations were detected, the EMS triggered smart contracts to automate corrective actions, ensuring timely and precise responses to potential instabilities. This automation prevented outages and maintained the overall stability of the microgrid.

Smart contracts played a pivotal role in executing Demand-Side Management (DSM) actions, automatically implementing various strategies to restore balance and maintain optimal operation. These actions, including adjusting energy loads, generation, and storage, were meticulously recorded on the blockchain, enhancing accountability and transparency. This recording process allowed stakeholders to verify the effectiveness of DSM measures in real-time, fostering trust and compliance with regulatory requirements. The economic incentives managed by smart contracts further encouraged participant engagement. After DSM actions were triggered and participants responded, the smart contracts evaluated these responses to determine and distribute corresponding incentives. This automated distribution ensured accuracy and promptness, reducing administrative overhead and potential errors. The transparency of this process encouraged greater participation and compliance with DSM strategies, contributing to the overall efficiency and stability of the microgrid.

Data analysis from the five prosumers participating in the energy trading system provided valuable insights. RES generation, storage utilization, P2P trade activity, net profit, maximum demand during DR events, and demand reduction were all effectively managed, demonstrating the economic and operational benefits of active participation in DSM actions. The blockchain implementation facilitated the automation and transparency of these actions, with successful deployment and transaction recording ensuring a transparent and verifiable record of all actions taken.

Potential future research directions include exploring more advanced game-theoretical models to better capture the complexities of prosumer interactions in DSM, integrating machine learning algorithms to predict energy demand and optimize energy distribution dynamically, and expanding the blockchain framework to support larger-scale deployments and interoperability with other energy management systems. Additionally, investigating the economic and regulatory implications of widespread blockchain adoption in energy markets, and enhancing the security and privacy of blockchain transactions, are critical areas for further study. These directions aim to improve the scalability, efficiency, and robustness of decentralized energy management systems.

Data availability statement

The original contributions presented in the study are included in the article/supplementary material, further inquiries can be directed to the corresponding author.

Author contributions

AU: Writing–original draft, Writing–review and editing, Investigation, Methodology, Software, Validation. SJ: Visualization, Writing–review and editing, Formal Analysis, Funding acquisition, Methodology, Validation, Writing–original draft. DK: Conceptualization, Project administration, Supervision, Validation, Writing–review and editing. TG: Conceptualization, Formal Analysis, Investigation, Project administration, Supervision, Writing–review and editing. SS: Conceptualization, Funding acquisition, Investigation, Project administration, Resources, Supervision, Visualization, Writing–review and editing.

Funding

The author(s) declare financial support was received for the research, authorship, and/or publication of this article. This work was jointly supported by the NPP, Central Power Research Institute (CPRI), Bangalore- CPRI/R&D/TC/GDEC/2023 and the CRG Project - CRG/2021/007769 of Science and Engineering Research Board (SERB), Department of Science and Technology (DST), Government of India (GoI).

Conflict of interest

The authors declare that the research was conducted in the absence of any commercial or financial relationships that could be construed as a potential conflict of interest.

Publisher’s note

All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article, or claim that may be made by its manufacturer, is not guaranteed or endorsed by the publisher.

References

Afzalan, M., and Jazizadeh, F. (2021). Quantification of demand-supply balancing capacity among prosumers and consumers: community self-sufficiency assessment for energy trading. Energies 14, 4318. doi:10.3390/en14144318

CrossRef Full Text | Google Scholar

Agung, A. A. G., and Handayani, R. (2020). Blockchain for smart grid. J. King Saud University.Computer Inf. Sci. 34, 666–675. doi:10.1016/j.jksuci.2020.01.002

CrossRef Full Text | Google Scholar

Amrollahi, M. H., and Bathaee, S. M. T. (2017). Techno-economic optimization of hybrid photovoltaic/wind generation together with energy storage system in a stand-alone micro-grid subjected to demand response. Appl. Energy 202, 66–77. doi:10.1016/j.apenergy.2017.05.116

CrossRef Full Text | Google Scholar

Atzeni, I., Ordóñez, L. G., Scutari, G., Palomar, D. P., and Fonollosa, J. R. (2013). Demand-side management via distributed energy generation and storage optimization. IEEE Trans. Smart Grid 4 (2), 866–876. doi:10.1109/TSG.2012.2206060

CrossRef Full Text | Google Scholar

Bakare, M. S., Abdulkarim, A., Zeeshan, M., and Shuaibu, A. N. (2023). A comprehensive overview on demand side energy management towards smart grids: challenges, solutions, and future direction. Energy Inf. 6 (1), 4. doi:10.1186/s42162-023-00262-7

CrossRef Full Text | Google Scholar

Chen, S., Wei, Z., Sun, G., Cheung, K. W., Wang, D., and Zang, H. (2019). Adaptive robust day-ahead dispatch for urban energy systems. IEEE Trans. Industrial Electron. 66 (2), 1379–1390. doi:10.1109/TIE.2017.2787605

CrossRef Full Text | Google Scholar

Cui, F., An, D., and Zhang, G. (2023). A game strategy for demand response based on load monitoring in smart grid. Front. Energy Res. 11, 1240542. doi:10.3389/fenrg.2023.1240542

CrossRef Full Text | Google Scholar

Danzi, P., Angjelichinoski, M., Stefanović, Č., and Popovski, P. (2017). Distributed proportional-fairness control in microgrids via blockchain smart contracts. Proc. IEEE Int. Conf. Smart Grid Commun. (SmartGridComm), 45–51. doi:10.1109/SmartGridComm.2017.8340713

CrossRef Full Text | Google Scholar

Efanov, D., and Roschin, P. (2018). The all-pervasiveness of the blockchain technology. Procedia Comput. Sci. 123, 116–121. doi:10.1016/j.procs.2018.01.019

CrossRef Full Text | Google Scholar

Hupez, M., Toubeau, J.-F., Atzeni, I., De Grève, Z., and Vallée, F. (2023). Pricing electricity in residential communities using game-theoretical billings. IEEE Trans. Smart Grid 14 (2), 1621–1631. doi:10.1109/TSG.2022.3206912

CrossRef Full Text | Google Scholar

Jha, S. K., Kumar, D., Tripathi, P. R., Samantaray, S. R., and Kamwa, I. (2022). Demand-side management of self-sustained droop based standalone microgrid using conservation voltage reduction strategy. IEEE Syst. J. 17, 2640–2651. doi:10.1109/jsyst.2022.3221307

CrossRef Full Text | Google Scholar

Jin, X., Wu, J., Mu, Y., Wang, M., Xu, X., and Jia, H. (2017). Hierarchical microgrid energy management in an office building. Appl. Energy 208, 480–494. doi:10.1016/j.apenergy.2017.10.002

CrossRef Full Text | Google Scholar

Junaidi, N., Abdullah, M. P., Alharbi, B., and Shaaban, M. (2023). Blockchain-based management of demand response in electric energy grids: a systematic review. Energy Rep. 9, 5075–5100. doi:10.1016/j.egyr.2023.04.020

CrossRef Full Text | Google Scholar

Khaqqi, K. N., Sikorski, J. J., Hadinoto, K., and Kraft, M. (2018). Incorporating seller/buyer reputation-based system in blockchain-enabled emission trading application. Appl. Energy 209, 8–19. doi:10.1016/j.apenergy.2017.10.070

CrossRef Full Text | Google Scholar

Leszczyna, R. (2018). Standards on cyber security assessment of smart grid. Int. J. Crit. Infrastruct. Prot. 22, 70–89. doi:10.1016/j.ijcip.2018.05.006

CrossRef Full Text | Google Scholar

Li, F., Li, X., Fang, Z., and Zhang, L. (2022). A game optimization scheduling strategy of active distribution network with multi-microgrid sharing energy storage. Front. Energy Res. 10, 906406. doi:10.3389/fenrg.2022.906406

CrossRef Full Text | Google Scholar

Liang, Y. C. (2020). “Blockchain for dynamic spectrum management,” in Dynamic spectrum management. Signals and communication technology (Singapore: Springer). doi:10.1007/978-981-15-0776-2_5

CrossRef Full Text | Google Scholar

Mengelkamp, E., Notheisen, B., Beer, C., Dauer, D., and Weinhardt, C. (2018). A blockchain-based smart grid: towards sustainable local energy markets. Comput. Sci. Res. Dev. 33, 207–214. doi:10.1007/s00450-017-0360-9

CrossRef Full Text | Google Scholar

Mulleriyawage, U. G., and Shen, W. X. (2021). Impact of demand side management on optimal sizing of residential battery energy storage system. Renew. Energy 172, 1250–1266. doi:10.1016/j.renene.2021.03.122

CrossRef Full Text | Google Scholar

Münsing, E., Mather, J., and Moura, S. (2017). Blockchains for decentralized optimization of energy resources in microgrid networks. Proc. IEEE Conf. Control Technol. Appl. (CCTA), 2164–2171. doi:10.1109/ccta.2017.8062773

CrossRef Full Text | Google Scholar

Musleh, A. S., Yao, G., and Muyeen, S. (2019). Blockchain applications in smart grid–review and frameworks. IEEE Access- 7, 86746–86757. doi:10.1109/access.2019.2920682

CrossRef Full Text | Google Scholar

Noor, S., Yang, W., Guo, M., van Dam, K. H., and Wang, X. (2018). Energy Demand Side Management within micro-grid networks enhanced by blockchain. Appl. Energy 228, 1385–1398. doi:10.1016/j.apenergy.2018.07.012

CrossRef Full Text | Google Scholar

Otjacques, B., Hitzelberger, P., Naumann, S., and Wohlgemuth, V. (2018). From science to society. Springer.

Google Scholar

pecanstreet. (2024). Published papers using dataport. Available at: https://www.pecanstreet.org/dataport/papers/ (Accessed May 15, 2024).

Google Scholar

Pilz, M., and Al-Fagih, L. (2020). A dynamic game approach for demand-side management: scheduling energy storage with forecasting errors. Dyn. Games Appl. 10 (4), 897–929. doi:10.1007/s13235-019-00309-z

CrossRef Full Text | Google Scholar

Thirunavukkarasu, G. S., Seyedmahmoudian, M., Jamei, E., Horan, B., Mekhilef, S., and Stojcevski, A. (2022). Role of optimization techniques in microgrid energy management systems—a review. Energy Strategy Rev. 43, 100899. doi:10.1016/j.esr.2022.100899

CrossRef Full Text | Google Scholar

Thomas, L., Zhou, Y., Long, C., Wu, J., and Jenkins, N. (2019). A general form of smart contract for decentralized energy systems management. Nat. Energy 4, 140–149. doi:10.1038/s41560-018-0317-7

CrossRef Full Text | Google Scholar

Topa, A. O., Cruz, N. C., Álvarez, J. D., and Torres, J. L. (2023). On the optimal demand-side management in microgrids through polygonal composition. Sustain. Energy, Grids Netw. 34, 101066. doi:10.1016/j.segan.2023.101066

CrossRef Full Text | Google Scholar

Umar, A., Kumar, D., and Ghose, T. (2022a). “Peer-to-Peer decentralized community energy management system using blockchain technology,” in 2022 IEEE 1st industrial electronics society annual on-line conference (ONCON). kharagpur, India, 1–6. doi:10.1109/ONCON56984.2022.10126748

CrossRef Full Text | Google Scholar

Umar, A., Kumar, D., and Ghose, T. (2022b). Blockchain-based decentralized energy intra-trading with battery storage flexibility in a community microgrid system. Appl. Energy 322, 119544. doi:10.1016/j.apenergy.2022.119544

CrossRef Full Text | Google Scholar

Umar, A., Kumar, D., Ghose, T., Alghamdi, T. A. H., and Abdelaziz, A. Y. (2024). Decentralized community energy management: enhancing demand response through smart contracts in a blockchain network. IEEE Access 12, 80781–80798. doi:10.1109/ACCESS.2024.3409706

CrossRef Full Text | Google Scholar

Wang, C., Zhou, Y., Wu, J., Wang, J., Zhang, Y., and Wang, D. (2015). Robust-index method for household load scheduling considering uncertainties of customer behavior. IEEE Trans. Smart Grid 6 (4), 1806–1818. doi:10.1109/TSG.2015.2403411

CrossRef Full Text | Google Scholar

Wang, D., Ge, S., Jia, H., Wang, C., Zhou, Y., Lu, N., et al. (2014). A demand response and battery storage coordination algorithm for providing microgrid tie-line smoothing services. IEEE Trans. Sustain. Energy 5 (2), 476–486. doi:10.1109/TSTE.2013.2293772

CrossRef Full Text | Google Scholar

Wang, G., Zhang, Q., Li, H., McLellan, B. C., Chen, S., Li, Y., et al. (2017a). Study on the promotion impact of demand response on distributed PV penetration by using non-cooperative game theoretical analysis. Appl. Energy 185, 1869–1878. doi:10.1016/j.apenergy.2016.01.016

CrossRef Full Text | Google Scholar

Wang, X., El-Farra, N. H., and Palazoglu, A. (2017b). Optimal scheduling of demand responsive industrial production with hybrid renewable energy systems. Renew. Energy 100, 53–64. doi:10.1016/j.renene.2016.05.051

CrossRef Full Text | Google Scholar

Wen, Y., Lu, F., Liu, Y., and Huang, X. (2021). Attacks and countermeasures on blockchains: a survey from layering perspective. Comput. Netw. 191, 107978. doi:10.1016/j.comnet.2021.107978

CrossRef Full Text | Google Scholar

Xu, X., Jia, H., Chiang, H. D., Yu, D. C., and Wang, D. (2015). Dynamic modeling and interaction of hybrid natural Gas and electricity supply system in microgrid. IEEE Trans. Power Syst. 30 (3), 1212–1221. doi:10.1109/TPWRS.2014.2343021

CrossRef Full Text | Google Scholar

Yan, M., Li, Z., Lai, C. S., Zhao, Z., Zobaa, A. F., Lai, L. L., et al. (2023). Energy management considering multiple power markets and microgrid storage. Front. Front. Energy Res. 11. doi:10.3389/fenrg.2023.1285270

CrossRef Full Text | Google Scholar

Zhang, C., Wu, J., Zhou, Y., Cheng, M., and Long, C. (2018). Peer-to-Peer energy trading in a Microgrid. Appl. Energy 220, 1–12. doi:10.1016/j.apenergy.2018.03.010

CrossRef Full Text | Google Scholar

Zhou, T., Wang, D., Li, J., and Jia, H. (2023). “Multi-objective planning for integrated energy systems considering both energy quality and renewable energy,” in 2023 IEEE power and energy society general meeting (PESGM). Orlando, FL, USA, 1–5. doi:10.1109/PESGM52003.2023.10253261

CrossRef Full Text | Google Scholar

Keywords: blockchain, smart contract, microgrid, demand response, demand side management, and game theory

Citation: Umar A, Jha SK, Kumar D, Ghose T and Samantaray SR (2025) Blockchain-driven demand side management in P2P energy markets for islanded microgrid systems. Front. Energy Res. 12:1450988. doi: 10.3389/fenrg.2024.1450988

Received: 18 June 2024; Accepted: 28 November 2024;
Published: 06 January 2025.

Edited by:

Bruce Krogh, Carnegie Mellon University, United States

Reviewed by:

Leo Raju, SSN College of Engineering, India
Nor Ashbahani Mohamad Kajaan, Universiti Malaysia Perlis, Malaysia

Copyright © 2025 Umar, Jha, Kumar, Ghose and Samantaray. This is an open-access article distributed under the terms of the Creative Commons Attribution License (CC BY). The use, distribution or reproduction in other forums is permitted, provided the original author(s) and the copyright owner(s) are credited and that the original publication in this journal is cited, in accordance with accepted academic practice. No use, distribution or reproduction is permitted which does not comply with these terms.

*Correspondence: Sumit Kumar Jha, c3VtaXRrdW1hcmpoYTAwQGdtYWlsLmNvbQ==, c2oyNkBpaXRiYnMuYWMuaW4=

ORCID: Tirthadip Ghose, orcid.org/0000-0002-7561-3157

Disclaimer: All claims expressed in this article are solely those of the authors and do not necessarily represent those of their affiliated organizations, or those of the publisher, the editors and the reviewers. Any product that may be evaluated in this article or claim that may be made by its manufacturer is not guaranteed or endorsed by the publisher.