Bi-Directional Mutual Energy Trade between Smart Grid and Energy Districts Using Renewable Energy Credits

A central authority, in a conventional centralized energy trading market, superintends energy and financial transactions. The central authority manages and controls transparent energy trading between producer and consumer, imposes a penalty in case of contract violation, and disburses numerous rewards. However, the management and control through the third party pose a significant threat to the security and privacy of consumers’/producers’ (participants) profiles. The energy transactions between participants involving central authority utilize users’ time, money, and impose a computational burden over the central controlling authority. The Blockchain-based decentralized energy transaction concept, bypassing the central authority, is proposed in Smart Grid (SG) by researchers. Blockchain technology braces the concept of Peer-to-Peer (P2P) energy transactions. This work encompasses the SolarCoin-based digital currency blockchain model for SG incorporating RE. Energy transactions from Prosumer (P) to Prosumer, Energy District to Energy District, and Energy District to SG are thoroughly investigated and analyzed in this work. A robust demand-side optimized model is proposed using Genetic Algorithm (GA) and Particle Swarm Optimization (PSO) to maximize Prosumer Energy Surplus (PES), Grid revenue (GR), percentage energy transactions accomplished, and decreased Prosumer Energy Cost (PEC). Real-time averaged energy data of Australia are employed, and a piece-wise energy price mechanism is implemented in this work. The graphical analysis and tabular statistics manifest the efficacy of the proposed model.


Introduction
Smart Grid (SG) has changed the way electricity is generated and consumed due to the adoption of the: (a) Advanced computational platform, (b) bi-directional communication of energy, (c) satisfying consumers need through reduced energy cost, and (d) automated, smart, secure network [1]. Energy Districts (EDs) permit small-scale Renewable Energy (RE) consumers and prosumers to trade energy locally [2], an evolving concept of environmentfriendly energy transfer.
In conventional centralized energy systems, a central authority manages the energy transfer between consumers and prosumers. The central authority is responsible for supervising agreements and accomplishing transparent trading among participants [3]. However, the outlook of energy with the concept of prosumers accompanied with SG is complicated and challenging [4]. The intermittent RE resources demand for storage options to store surplus energy within SG. Therefore, the most important feature of transportation electrification is the Vehicle to Grid (V2G) concept that store the surplus energy and ensure the provision of surplus energy to SG during high load demand. The storage capability of V2G enhances the utilization of renewable energy sources within EDs [5,6]. The nonlinear and stochastic data within SG demands for advanced machine learning methods. Machine learning is an efficient tool to design energy management model for bidirectional energy and data flow between SG and ED [7]. The complex energy future with the need of integrating more and more RE in the power grid cannot be effectively managed through the conventional centralized system; thus, an alternative decentralized market approach is required.
In a traditional centralized network, more time and money of consumers are wasted involving a third party. The consumers encounter high transaction and management costs and have no direct access to the energy market [8]. The critical centralized architecture results in a computational burden on central authority and is greatly at threat of single-point failure [9]. The challenges associated with the conventional centralized energy network can be addressed through a decentralized approach surpassing the central authority. Blockchain technology is a widely emerging decentralized concept. Blockchain provides a platform for consumers and prosumers to buy and sell energy in a peer-to-peer (P2P) fashion [10] directly with each other and with the SG, bypassing the third party. P2P energy transactions reduce the management and transaction cost and permit consumers to have direct access to the energy market. Due to its decentralized nature blockchain is immune to a single-point failure.
The cost of running decentralized networks and mining cryptocurrencies requires a tremendous amount of energy resulting in an expensive decentralized blockchain network. The high cost of mining cryptocurrencies restricts the blockchain network to the moneyed community. Given the aforementioned issues incurred in decentralized blockchain networks, advance research is focusing on a cryptocurrency that assists a cost-effective network [11]. SolarCoin (SLR)-based blockchain is an evolving platform that addresses the issue of high energy consumption of another cryptocurrencies-based blockchain [12]. A cost-effective SLR blockchain network lays out an equal opportunity platform. Any person owning some SLR stakes is invited to join the blockchain network. Besides cracking the energy consumption problem, SLR encourages the transition from fossil fuel to clean green energy. Small or large-scale solar energy producers registered with Solar Coin Foundation (SCF) earns one SLR as a free incentive at the rate of one MW produced. Encouraging the users to install and rely on solar panels rather than the conventional fossil fuel energy method, through disbursing one SLR for each MWh as a free reward, is contributing towards a carbon-free environment. SLRs can be exercised for any purpose or can be converted to fiat currency [13].
Extensive research works have been dedicated to blockchain technology over the last few years [8][9][10][11][12][13][14][15][16][17][18][19][20][21][22][23]. Authors in [14] proposed IBM HyperLedger Fabric blockchain-based P2P crowdsourced energy model. Authors in [15] presented demand-side management permitting users to reduce their electricity bill through effective day-ahead scheduling of energy consumption incorporating the blockchain technology. In [16], authors explored ongoing blockchain-based microgrid projects and came with the idea of establishing a blockchain-based microgrid. Authors in [8] came up with the architecture of solar energy production and distribution incorporating Smart Contracts to establish an energy exchange market. In [3], authors proposed the design and implementation of a Decentralized Transactive platform encompassing fault detection. Authors in [17] proposed the design and implementation of local energy markets on a private blockchain and evaluation of an economic market mechanism.
A case study incorporating implemented Ethereum-based Brooklyn Microgrid (BMG) was evaluated by researchers in [2]. Authors in [18] proposed a privacy-preserving blockchain-enabled trading model. The authors addressed the privacy protection of individuals on consortium blockchain-based energy trading systems through the introduction of a noise-based privacy-preserving approach. In [19], authors evaluated blockchain-based demand-response distributed energy management for SGs. Effective distributed management through the detection of energy unbalances and disbursement of rewards and penalties was implemented using Smart Contracts. Authors in [20] proposed the implementation of blockchain technology to empower Machine-to-Machine (M2M) interactions in a chemical industry based on a proof-of-concept. The employment of Smart Contracts to enhance the speed, security, and scalability of blockchain-based energy exchange was proposed by authors in [21]. Different blockchain solutions were tested on the Pacific Northwest National Lab (PNNL)'s transactive campus to investigate and reduce possible associated cyber risks.
Although the above-mentioned research works successfully explored and implemented the characteristics and applications of blockchain technology in the energy market and SG, they lack in dispensing (a) the SLR blockchain-based Mutual Energy Trade Model (METM) incorporating demand-side management, (b) the evaluation of optimized energy transactions accomplished in a blockchain network considering seasonal variations, and (c) the implementation of energy transactions between prosumers, consumers, and multi-EDs based on SLR blockchain. Moreover, free SLRs disbursement as an incentive for Solar Energy Prosumers was not incorporated in previous works.
Significant contributions of this work based on the previous-mentioned issues are: The performance of the proposed model is evaluated using a Genetic Algorithm and Particle Swarm Optimization considering seasonal variations. In-depth tabular and graphical comparison of GA optimized results and PSO is critically analyzed. Table 1 summarizes the comparative analysis of selected research work conducted on blockchain technology. Table 1 also highlights the contributions of this work compared to existing research work. In Table 1, " " represents the presence of the attributes and "" represents the absence of the attributes.
The rest of the paper is organized as follows. Section 2 presents the proposed SLR blockchain-based METM. A blockchain-based optimization model is discussed in Section 3. Section 4 covers the performance evaluation accompanied by the data analysis, seasonal variations, blockchain implementation, and tabular statistics. The paper concludes with a summary and future directions in Section 5.

SolarCoin (SLR) Blockchain-Based Mutual Energy Trade Model (METM)
This section presents the proposed SLR Blockchain-based METM. The pricing mechanism and mutual energy contracts employed in this work are also explicated in this section. Figure 1 presents the proposed blockchain-based energy model, which comprises three distributed EDs: Two Solar EDs and a wind ED. Each Solar ED includes N-consumers and N-Solar Energy Prosumers (SEPs). Similarly, Wind ED incorporates N-Wind Energy Prosumers (WEPs) accompanied by N-consumers. The energy demand of three EDs cannot be met alone through RE and are interfaced with SG. Three EDs also support SG during peak hours. The energy transactions between multiple prosumers, consumers, EDs, and SG are carried on a P2P SLR blockchain platform, as shown in Figure 1.

System Model
Transactions executed on a digital network eliminating the third party contribute to a cost-effective system. SEPs and WEPs produce energy, satisfy their load requirements, and share the surplus, unused energy with neighboring consumers. Blockchain permits prosumers and consumers to trade energy transparently and securely without relying on the grid. Consumers and Prosumers on the network can buy energy at a reduced cost and are paid for selling excess energy to neighboring users and the grid. Participants on the blockchain network are referred to as nodes. SLR is exchanged among the nodes of the network as a result of energy transactions.
In Figure 1, SEPs and WEPs update their status on the network claiming to sell energy. Consumers wanting to buy energy put requests on the network.
Prosumers and consumers on the blockchain network undertake an agreement under the umbrella of a contract without the need of trusting each other. The nodes must fulfill contract conditions to carry out energy transactions. The contract will be executed automatically after the conditions are satisfied. The system (a) connects prosumer and consumer on the network and scrutinizes (b) energy availability according to consumer's request, (c) Consumer's balance, and SLRs at hand. On satisfactory execution of the contract, the transaction record is dispensed to each node of the network for verification. After verification, the transaction is accomplished, and a block of the transaction is added to the chain of the network.
prosumers and consumers to trade energy transparently and securely without relying on the grid. Consumers and Prosumers on the network can buy energy at a reduced cost and are paid for selling excess energy to neighboring users and the grid. Participants on the blockchain network are referred to as nodes. SLR is exchanged among the nodes of the network as a result of energy transactions.
In Figure 1, SEPs and WEPs update their status on the network claiming to sell energy. Consumers wanting to buy energy put requests on the network. Prosumers and consumers on the blockchain network undertake an agreement under the umbrella of a contract without the need of trusting each other. The nodes must fulfill contract conditions to carry out energy transactions. The contract will be executed automatically after the conditions are satisfied. The system (a) connects prosumer and consumer on the network and scrutinizes (b) energy availability according to consumer's request, (c) Consumer's balance, and SLRs at hand. On satisfactory execution of the contract, the transaction record is dispensed to each node of the network for verification. After verification, the transaction is accomplished, and a block of the transaction is added to the chain of the network.

Pricing Mechanism
The Queensland, Australia-based piece-wise energy price mechanism is implemented in this work. In this pricing mechanism, consumers are charged according to (a) the amount of energy utilized and (b) the day and time of energy utilization. Consumers encounter high energy utilization rates during peak hours. Low energy utilization rates are offered during off-peak hours. No peak hour utilization rates are charged on week-

Pricing Mechanism
The Queensland, Australia-based piece-wise energy price mechanism is implemented in this work. In this pricing mechanism, consumers are charged according to (a) the amount of energy utilized and (b) the day and time of energy utilization. Consumers encounter high energy utilization rates during peak hours. Low energy utilization rates are offered during off-peak hours. No peak hour utilization rates are charged on weekends [22]. The pricing mechanism incorporated in this work is illustrated in Table 2. In Queensland, on 26 February 2020, peak and off-peak utilization rates charged were $325.87/MWhr and $151.73/MWhr, respectively [23]. One USD (United States Dollar) is equal to 34.06690740614567 SLRs as of 23 February 2021 [24]. The proposed blockchain-based EDs offer consumers lower energy prices than the conventional grid. Prosumers rate their surplus energy 10 percent lower than rates offered by the traditional grid. Energy exported to SG is 10 percent higher than the normalized rates. Table 3 demonstrates the pricing mechanism exercised on the proposed blockchain platform.

Mutual Energy Contract (MEC)
The nodes of the network agree upon and sign a desired and flexible mutual energy contract to carry out energy transactions without involving a third party. This energy contract across the blockchain platform is referred to as Smart Contract (SC), which is an enforced agreement holding certain rules that need to be followed by every node of the network. SC empowers transparent and trusted energy transactions among nodes of the network and behaves as the controlling entity of a decentralized network [19]. SC is immutable, self-executing, written in the form of code, and is stored on the blockchain [25].
Prosumer mode: Whenever the energy produced by a participant of the network is more than the energy demand, participants announce themselves as prosumers to sell extra, unused energy to grid or neighboring users.
where P gen h and P dem h refer to prosumer's energy generation and demand at hour h, respectively.
Consumer mode: Whenever the energy produced by the participants is not enough to satisfy their energy demand, participants announce themselves as consumers and put an energy request on the network.
Prosumer energy rate: On the blockchain network, prosumers sell energy at a rate 10 percent less than the normalized rates. Consumers buy energy from prosumers on the network at a price offered less than the traditional grid. Prosumers export energy to SG at a rate 10 percent higher than the normalized rates.
where P Pr h is the real-time energy Price (Pr) offered by the Prosumer (P) to Consumer (C) and SG in a blockchain network at hour h. P R h is the real-time energy price offered by the grid at hour h. Incentives: Solar energy prosumers are rewarded 1 SLR for each MW solar energy produced from the SCF [13].
Energy Transactions: In our proposed model, energy transactions are carried out in four different categories under SC.
(a) Prosumer-to-Consumer (P-C): On the digital blockchain network, prosumers share the information of their energy generation. Consumers reach the prosumer to satisfy load requirements, without relying on the grid.
where C dem h demonstrates the Consumer energy demand at hour h, PES h refers to Prosumer Energy Surplus (PES) at hour h. Arrow indicates the C energy demand satisfying through PES.
(b) Prosumer-to-Prosumer (P-P): Whenever the prosumers' energy produced from RE is not enough to meet their load requirements, prosumers import energy from other prosumers in an ED.
where P 1,dem h , P 2,dem h indicate the first and second Prosumer energy demand at hour h, respectively. The arrow specifies mutual energy trade between two prosumers.
(c) Energy District-to-Energy District (ED-ED): An ED fulfills its load requirements from other ED at times of reduced energy generation from RE.
where ED 1,dem h , ED 2,dem h points out the first ED's and 2nd ED's energy demand at hour h, respectively.
(d) Energy District-to-Smart Grid (ED-SG): The bi-directional feature and addition of prosumer to SG is beneficial to both SG and prosumer. At times of minimum RE generation, EDs import deficient energy from SG, while at times of maximum RE production, EDs sell surplus and unused energy to SG and are incentivized with SLRs.
where SG dem h refers to Smart Grid's energy demand at hour h. Constraints: The following constraints are encoded in our implemented SC.
(a) Prosumers and consumers must be connected on the blockchain network.
where P c h , C c h in Equation (8) refers to prosumer and consumer connectivity in the blockchain network at hour h, respectively.  (10) where Caccount h demonstrates the consumer's account status at hour h and P Pr h refers to th ereal-time energy price offered by prosumer at hour h.
(d) Prosumer must sell energy at a reduced rate.
where P R h in Equation (11) indicates the real-time energy price encounters by the consumer from the grid.

Blockchain-Based Robust Optimization Model
The advanced technical appliances contribute to an elevated consumers' energy consumption profile. The increased energy consumption overturns high energy costs. An effective Demand-Side Management (DSM) technique curtails the consumer's energy consumption and the energy cost incurred by the consumer is substantial. The bi-directional communication in SG assists for an effective DSM [26]. Moreover, it empowers RE prosumers to import surplus energy to neighboring users and the grid.
In this paper, the implemented pricing mechanism assists in the execution of DSM. Consumers are encouraged to shift their energy consumption pattern towards off-peak periods due to low energy prices offered during off-peak hours. The implementation of the DSM technique results in (a) reduced consumer's energy cost, (b) increased production of Prosumer Energy Surplus through maximum utilization of RES, and (c) increased Grid Revenue as a result of maximum RE import to the grid. The multi-objective optimization problem is solved using demand-response algorithms. The Genetic Algorithm (GA) Optimization and the Particle Swarm Optimization (PSO) algorithm are implemented in this work.

Prosumer Energy Surplus (PES)
The prosumer energy generated from solar or wind suffers from fluctuations. At times, the energy generated through RE exceeds the prosumer's energy demand, enabling prosumers to merchandise this excess energy with the neighboring user. This generated energy that outstrips prosumers' energy demand is referred to as Prosumer Energy Surplus (PES) [27].
The system defined in this work maximizes the PES considering certain constraints. The optimization problem of PES is formulated as: Subject to: where P h gen refers to prosumers' energy generated from wind or solar at hour h and P h dem speaks for prosumers' actual energy demand at hour h. P h gen,max and P h dem,max identifies the prosumers' maximum energy generation and demand, respectively. Equation (13) represents the objective function, and Equations (14) and (15) are inequality constraints of an optimization problem.

Prosumer Energy Cost (PEC)
The prosumer energy demand that exceeds wind-or solar-generated energy compels the prosumer to import this deficient energy from the grid or neighboring users to meet energy requirements. The imported energy cost incurred by the prosumer is referred to as Prosumer Energy Cost (PEC).
The presented model focuses on minimizing PEC through optimization of the prosumer energy demand. The mathematical formulation of the optimization problem for PEC is expressed as: Subject to: where Equation (17) specifies the objective function of the presented optimization problem with Equations (18) and (19) acting as inequality constraints. P h R refers to real-time energy price offered by the grid at hour h.

Grid Revenue
The PES exported to the grid results in an incentive for prosumers defined as Grid Revenue (GR), expressed as: Subject to: The proposed model emphasizes the maximization of GR. The optimization problem formulation for GR is illustrated in Equations (21)- (23). Equation (21) presents the objective function of the maximization problem while Equations (22) and (23) are inequality constraints of an optimization problem. P h n is the nominal price proposed to SG on account of prosumer energy export and E h impSG is the energy imported from SG at hour h.

Prosumer Energy Surplus (PES) and Prosumer Energy Cost (PEC)
This research work focuses on the comparative analysis of PES and PEC in one domain subjected to diverse weather fluctuations. The merged mathematical model for the minimization of PEC and maximization of PES is expressed as: Subject to: where ï is the weighting function.

Optimization Algorithm
This research work uses Particle Swarm Optimization (PSO) and Genetic Algorithm (GA) optimization algorithms for the minimization of PEC and maximization of PES, percentage energy transactions accomplished throughout the year, and GR.
Algorithms 1 and 2 solve the multi-objective optimization problem to carry out the objectives of increased PES, GR, and minimized PEC, respectively.
The layout of GA for the optimization of PEC, PES, and GR is presented as:

Proposed Blockchain Optimization Model
Robust demand-side optimization is considered to be a pivotal element in implementing blockchain-based energy transactions. This work aims at accomplishing maximum energy transactions among participants of the SLR blockchain network throughout Subject to: where C h dem,max is the consumer's maximum energy demand at hour h. P h 1,dem,max represents the first prosumer's maximum energy demand and P h 2,dem,max illustrates the second prosumer's maximum energy demand at hour h. ED h 2,dem,max represents ED's maximum demand at hour h.
Energy transactions among multiple participants of the proposed model are accomplished utilizing Algorithms 3 and 4.
The layout of the energy transactions carried out among multiple prosumers, consumers, EDs, and SG is portrayed through the following algorithms: Algorithm 3 Blockchain-based P-C energy transaction algorithm 1: Initialize PES h , C h dem , P h Pr , 2: Gather prosumer's and consumer's active status on the blockchain network 3: Gather consumer's account details. 4: Accomplish energy transaction between Prosumer to the Consumer using (28) subject to the constraints in (32)-(39) 5: If the transaction successful 6: Energy transferred to the consumer, SLRs transferred to prosumer. 7: Else 8: No energy transacted, shift to another prosumer. 9: Repeat step 1-10 for another energy transaction 10: End 11: End Algorithm 4 Blockchain-based P-P, ED-ED, and ED-SG energy transactions algorithm

Performance Evaluation
This section arrays the implementation of SLR blockchain-based METM. An in-depth analysis accompanied by the detailed results of the proposed model is incorporated in this section.

Data Analysis
The proposed model in this article is evaluated regulating Australian-based case studies. The energy generation and consumption data profiles of one year from Queensland (Australia) are considered. For the simulation of each day, energy data of 24 h are considered. We have considered independent solar energy producers, and their energy profiles are taken from Queensland Live Solar Outputs [28]. Two onshore wind farms, Cooper Gap Wind Farm (COOPGWF1) and Mount Emerald Wind Farm (MEWF1), with the generating capacity of 452 and 180 MW, respectively, are considered. Their hourly energy generation data are extracted from Aneroid Energy [29]. The energy demand for Queensland and grid generation data are extracted from AEMO [30].

Seasonal Variations
In our presented case study, blockchain-based energy transactions and DSM are analyzed under the influence of four seasons i.e., Spring, Summer, Autumn, and Winter seasons.

Spring Season
Australian seasons come about at times opposite to the northern hemisphere. The Spring season is observed from September to November [31]. In Queensland, September and October are the months experiencing the best solar performance with 7.25 and 6.28 peak sun h/day [32]. These months are considered as windier months of the year with an average wind speed exceeding 4.2 m/s [33]. Prosumers have enough energy generation, and export surplus energy to neighboring users and the grid. Increased export and decreased import from the grid overturns reduced PEC. Figure 2 shows the unoptimized and optimized PEC, PES, and GR. ED1 and the month of October are considered for graphical analysis. The 9th, 14th, 23rd, 24th, and 29th of October have the maximum solar irradiance resulting in escalated solar energy generation and minimum PEC; while on the 4th, 10th, and 15th of October, minimum solar energy is produced, compelling the prosumer to import energy from the grid, resulting in an increased PEC. The figure demonstrates that the maximum solar energy is produced on the 9th, 14th, 23rd, 24th, and 29th of October due to increased solar radiation resulting in high PES. The minimum solar energy is generated on the 4th, 10th, and 15th of October leading to decreased PES. The maximum generation of PES on the 9th, 14th, 23rd, 24th, and 29th of October permits the prosumer to sell extra energy to the grid, paving the way for an escalated GR; while the minimum PES generation on the 4th, 10th, and 15th of October results in decreased GR. graphical analysis. The 9th, 14th, 23rd, 24th, and 29th of October have the maximum solar irradiance resulting in escalated solar energy generation and minimum PEC; while on the 4th, 10th, and 15th of October, minimum solar energy is produced, compelling the prosumer to import energy from the grid, resulting in an increased PEC. The figure demonstrates that the maximum solar energy is produced on the 9th, 14th, 23rd, 24th, and 29th of October due to increased solar radiation resulting in high PES. The minimum solar energy is generated on the 4th, 10th, and 15th of October leading to decreased PES. The maximum generation of PES on the 9th, 14th, 23rd, 24th, and 29th of October permits the prosumer to sell extra energy to the grid, paving the way for an escalated GR; while the minimum PES generation on the 4th, 10th, and 15th of October results in decreased GR. The energy transactions between P-C, P-P, ED-ED, and ED-SG are presented in Figure 3. The optimized results outweigh the unoptimized results. GA and PSO maximize the PES and GR and minimize PEC. Similarly, more optimized energy transactions are performed than unoptimized transactions due to the maximization of PES. Due to the availability of surplus energy, ED imports surplus unused energy to SG, as shown in

Summer Season
In Australia, the Summer season is observed from December to February. Average solar performance during the summer season is recorded as 6.22 peak sun h/day. The months in the Summer season are considered as the windier part of the year with an average wind speed of 4.2 m/s. February 26th is recorded as the windiest day of the year with an average wind speed of 4.5 m/s [33]. Excellent solar irradiance and wind speed contribute to an increased PES and minimized PEC. Unoptimized and optimized PEC, PES, and GR are presented in Figure 4. Maximum PEC is observed on 10th, 15th, 20th, 23rd, and 31st of January while the 1st, 5th, 12th, 18th, 21st, and 30th of January flag the minimum PEC. Due to high solar irradiance observed on the 1st, 5th, 12th, 18th, 21st, and 30th of January, the maximum energy surplus is produced. On the 10th, 15th, 20th, 23rd, and 31st of January, the minimum energy surplus is produced. The maximum GR is marked on the 3rd of January while minimum GR is observed on the 10th, 15th, and 20th of January due to the minimum energy production. The energy transactions between P-C, P-P, ED-ED, and ED-SG are presented in Figure 5.

Summer Season
In Australia, the Summer season is observed from December to February. Average solar performance during the summer season is recorded as 6.22 peak sun h/day. The months in the Summer season are considered as the windier part of the year with an average wind speed of 4.2 m/s. February 26th is recorded as the windiest day of the year with an average wind speed of 4.5 m/s [33]. Excellent solar irradiance and wind speed contribute to an increased PES and minimized PEC. Unoptimized and optimized PEC, PES, and GR are presented in Figure 4. Maximum PEC is observed on 10th, 15th, 20th, 23rd, and 31st of January while the 1st, 5th, 12th, 18th, 21st, and 30th of January flag the minimum PEC. Due to high solar irradiance observed on the 1st, 5th, 12th, 18th, 21st, and 30th of January, the maximum energy surplus is produced. On the 10th, 15th, 20th, 23rd, and 31st of January, the minimum energy surplus is produced. The maximum GR is marked on the 3rd of January while minimum GR is observed on the 10th, 15th, and 20th of January due to the minimum energy production. The energy transactions between P-C, P-P, ED-ED, and ED-SG are presented in Figure 5.         Due to the availability of energy surplus, enough energy transactions are performed between P-C, P-P, and ED-ED throughout the month. Increased PES permits prosumer to export energy to the grid as illustrated in Figure 5.

Autumn Season
The Autumn season is observed in Queensland, Australia in March, April, and May, where 4.39 peak sun h/day is recorded as the average sun performance during the Autumn season with an average wind speed of 3.5 m/s. The maximum surplus energy generation on the 3rd and 16th of March results in minimized PEC as depicted from Figure 6. The increased PES on the 3rd, 11th, 16th, 20th, and 29th of March permits ED to export energy to the grid, contributing to escalated GR. Figure 7 presents energy transactions performed between P-C, P-P, ED-ED, and ED-SG, respectively.

Winter Season
The Winter season is observed in Queensland, Australia from June to August. June has the worst average solar performance with 5.36 peak sun h/day. The average wind speed in Queensland from June to August is 3.8 m/s. The optimized and unoptimized PEC, PES, and GR are presented in Figure 8. The 4th, 10th, 15th, 24th, and 31st of July have the maximum while the 6th, 13th, 14th, 20th, 26th, and 27th of July have the minimum PEC. The maximum PES is observed on the 6th, 13th, 14th, 20th, 26th, and 27th of July. The 4th, 10th, 15th, 24th, and 31st of July exhibits low PES leading prosumer towards grid energy import and a reduced PEC. Days with low PES (4th, 10th, 15th, 24th, and 31st of July) result in decreased GR while the maximum GR is observed on the days of high PES. Figure 9 demonstrates the number of unoptimized and optimized energy transactions performed between P-C, P-P, ED-ED, and ED-SG throughout the month. Due to the minimum wind speed and solar radiance, minimal energy transactions are accomplished throughout the month. GA maximizes the number of energy transactions more so than PSO as depicted in Figure 9. Due to the availability of energy surplus, enough energy transactions are performed between P-C, P-P, and ED-ED throughout the month. Increased PES permits prosumer to export energy to the grid as illustrated in Figure 5.

Autumn Season
The Autumn season is observed in Queensland, Australia in March, April, and May, where 4.39 peak sun h/day is recorded as the average sun performance during the Autumn season with an average wind speed of 3.5 m/s. The maximum surplus energy generation on the 3rd and 16th of March results in minimized PEC as depicted from Figure 6. The increased PES on the 3rd, 11th, 16th, 20th, and 29th of March permits ED to export energy to the grid, contributing to escalated GR. Figure 7 presents energy transactions performed between P-C, P-P, ED-ED, and ED-SG, respectively.

Winter Season
The Winter season is observed in Queensland, Australia from June to August. June has the worst average solar performance with 5.36 peak sun h/day. The average wind speed in Queensland from June to August is 3.8 m/s. The optimized and unoptimized PEC, PES, and GR are presented in Figure 8. The 4th, 10th, 15th, 24th, and 31st of July have the maximum while the 6th, 13th, 14th, 20th, 26th, and 27th of July have the minimum PEC. The maximum PES is observed on the 6th, 13th, 14th, 20th, 26th, and 27th of July. The 4th, 10th, 15th, 24th, and 31st of July exhibits low PES leading prosumer towards grid energy import and a reduced PEC. Days with low PES (4th, 10th, 15th, 24th, and 31st of July) result in decreased GR while the maximum GR is observed on the days of high PES. Figure 9 demonstrates the number of unoptimized and optimized energy transactions performed between P-C, P-P, ED-ED, and ED-SG throughout the month. Due to the minimum wind speed and solar radiance, minimal energy transactions are accomplished throughout the month. GA maximizes the number of energy transactions more so than PSO as depicted in Figure 9   Optimization of PEC, PES, and GR performed through the GA and PSO algorithms is comparatively analyzed in this work. Optimized results achieved through GA outperform the PSO results. The maximum reduction of PEC is accomplished using GA in all four seasons compared to PSO. Similarly, GA assists in the maximization of PES and GR more effectively than PSO. Table 4 summarizes the average results of GA optimization and PSO for three EDs. The table shows average change observed between unoptimized and optimized results of GA is more than the average change of PSO results and signifies the better performance of GA in this work. 4.2.6. SolarCoin (SLR) Blockchain Implementation Figure 10 demonstrates energy transactions performed between a prosumer and a consumer on the SLR blockchain. The record of the transaction exhibits an encrypted hash of the block, the address of prosumer and consumer, the time of the transaction, and the amount of energy /SLR transacted. A consumer with the address "s0987654321dfghjkl" requests 0.043014 MW of energy on the network. The system searches for a prosumer on the network owning 0.043014 MW surplus energy. The system connects the consumer with the prosumer with the address "x123456789zcvbnm". SC executes and implements the encoded constraints. On successful implementation of constraints, the prosumer sells the required energy to the consumer and the consumer pays the prosumer with 1172 SLRs. requests 0.043014 MW of energy on the network. The system searches for a prosumer on the network owning 0.043014 MW surplus energy. The system connects the consumer with the prosumer with the address "x123456789zcvbnm". SC executes and implements the encoded constraints. On successful implementation of constraints, the prosumer sells the required energy to the consumer and the consumer pays the prosumer with 1172 SLRs.  Figure 11 signifies the impact of the variation of PES on PEC. An increase in the PES on account of the increased peak sun h/day and increased wind speed eliminates the need for energy import from the grid, resulting in a decreased PEC as depicted in Figure 11. For each MWhr rise in PES, PEC subsequently decreases.  Figure 11 signifies the impact of the variation of PES on PEC. An increase in the PES on account of the increased peak sun h/day and increased wind speed eliminates the need for energy import from the grid, resulting in a decreased PEC as depicted in Figure 11. For each MWhr rise in PES, PEC subsequently decreases.

Critical Analysis
The comparative tabular analysis of unoptimized and optimized GA DSM is scrutinized in this sub-section. Aggregate energy transactions accomplished in all four seasons are extensively analyzed. Table 5 presents the comparative statistics of DSM performed on the proposed SLR blockchain-based METM. Unoptimized and GA-optimized results for ED1, ED2, and ED3 enveloping PEC, PES, and GR are manifested in this table. The average change observed between unoptimized and optimized results of the three EDs is analyzed. The table shows GA optimized results surpass the unoptimized results. PEC is effectively minimized throughout the year as a result of optimization of EDs' demand. Similarly, energy surplus is maximized empowering prosumers to satisfy their load requirements and import energy to SG, resulting in an increased GR for prosumers.

Conclusions and Future Work
A central authority supervising energy and financial transactions in an energy sector experiences a substantial computational burden. Stakeholders are being charged for each transaction made by a central authority and the privacy of their transactions' profile is greatly at threat. The trading approach in a decentralized fashion bypassing central authority is greatly in need. Blockchain technology underpins peer-to-peer energy transactions and eliminates the issues associated with the central authority. SLR blockchain-based METM is proposed to permit a decentralized energy trading concept. Two Solar EDs and a Wind ED incorporating N-SEPs, N-WEPs, and N-consumers are deployed in the proposed model. Energy transactions are carried out between P-C, P-P, ED-ED, and ED-SG. SLRs are exchanged among the users as a result of energy trading. The demand-side optimization problem is formulated using GA and PSO for the maximization of PES and GR and minimization of PEC. The performance of the SLR blockchain-based METM is evaluated in all four seasons. The unoptimized, GA-optimized, and PSO results of four seasons are critically and comparatively analyzed. Maximum energy surplus is generated in the Summer and Spring (52 percent) seasons on account of the high wind speed and enough solar radiations. Seventy-one percent of GR is earned in the Summer and Spring seasons. Similarly, the minimum PEC is observed in the Spring and Summer (53 percent) seasons compared to the Autumn and Winter seasons. The GA optimized results outperform the PSO results. GA maximizes PES on average by 29 percent compared to PSO (28 percent). The uncertainty confronted by the RE generation affects the average energy transactions carried out in each season. Thirty-nine percent of energy transactions are accomplished between P-C in the Spring season and 35 percent in the Summer season compared to Autumn (13 percent) and Winter (10 percent) season. Similarly, GA effectively maximizes the percentage of energy transactions accomplished as compared to PSO. A 62 percent average increase in energy transactions carried out between P-C by GA optimization is observed in the Summer season compared to that carried out by PSO (60 percent).
The scalability of our proposed model incorporating multiple energy transactions among numerous EDs and SG at one time is a possible future direction of this work. Furthermore, issues coupled with the scalability of blockchain technology need to be addressed in the future. Speed and security are the major directions of improvement in a scaled blockchain network.