Application of a Community Battery-Integrated Microgrid in a Blockchain-Based Local Energy Market Accommodating P2P Trading

This paper presents the application of a community battery energy storage system (CBESS)-integrated microgrid (MG) in a blockchain-enabled local energy market (LEM). The proposed LEM balances the community energy requirement while facilitating frequent peer-to-peer (P2P) energy transactions between several energy users in the presence of both energy supplier and energy operator. The architecture is formulated by taking a number of local market and network constraints, that include residential battery energy storage system (RBESS) constraints; CBESS constraints; P2P traded price constraints; P2P traded power constraints; margin constraints of the stakeholders; power grid export and import constraints; and network energy balance constraints, so as to not only incentivise energy users but also reduce import/export from/to power grid while keeping the margins of energy supplier and energy operator unaffected. Different types of transactions data including energy users’ P2P pricing bids and P2P traded energy volume are also stored in the blockchain database. Further, the developed LEM framework is also validated through a case study executed on an actual Australian power grid network, comprising 260 residential energy users; two energy suppliers; an energy operator; and a CBESS, and the performance of the proposed P2P trading-based LEM strategy is compared with the existing business-as-usual (BAU) that directs energy users to buy/sell energy at the time-of-use (ToU)/ feed-in-tariff (FiT) rate. The extensive and comparative simulation results confirm the superior performance of the proposed LEM mechanism in terms of minimising energy users’ electricity bill; lowering power grid import and export; and retaining margins of energy suppliers and the energy operator; and thus, emphasise its application suitability in the current electricity market.


I. INTRODUCTION
The local energy market (LEM) provides a marketplace, that is essentially a sub version of a typical electricity market operated and managed locally [1], to permit a number of energy users and stakeholders to trade among themselves respecting different market and network constraints [2]. A distributed The associate editor coordinating the review of this manuscript and approving it for publication was Fabio Mottola .
ledger-based platform, such as blockchain [3], is usually used to accommodate bilateral and multilateral negotiations between the energy users and other residential energy service providers [4]. These sorts of mutual negotiations to settle energy and price locally are termed as peer-to-peer (P2P) energy trading [5]. There could be three types of energy users in general, namely 1) consumers; 2) prosumers (consumers who can generate energy) equipped with solar photovoltaic (PV) systems; and 3) prosumers equipped with solar PVs VOLUME 11, 2023 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ and residential battery energy storage systems (RBESSs) [6]. On the other hand, residential energy service providers primarily include energy suppliers and the energy operator [7].
Most of the recent studies focus on motivating energy users to join in the P2P trading-driven LEM. For instance, the authors in [8] prioritise energy users' preferences to decide on trading quantities, prices, partners, and periods. Energy users are also provided with the ability to trade individually or as a part of a group in [9]. While remaining as part of a power grid network, energy users attain the flexibility to stay aloof from the P2P trading (whenever opted for) in [10]. The application of P2P trading in cutting back the electricity costs of the energy users is also emphasised in [11]. In [12], the importance of formulating a robust P2P decision-making process is highlighted to guarantee notable energy cost minimisation. It is recommended in [13] to set the P2P trading price between the feed-in-tariff (FiT) rate and time-of-use (ToU) price so that both participating sellers and buyers can receive economic benefits in contrast with business-as-usual (BAU). This recommendation is further considered by the authors in [14], and the conducted research study figures out that both sellers and buyers can enlarge their savings by at least around 5% -which could be influential for energy users to join in the LEM.
Some other studies also analyse the benefits of the power grid (and thus energy operator), while P2P transactions are performed, with the intention to increase the acceptability of the LEM in practical power networks. For instance, local energy supply and demand is balanced with the help of P2P selling and buying orders in [15]. An incentivising mechanism is developed in [16] to reward the P2P users willing to serve the power grid in terms of local energy management. Further, grid-dependent demand is handled in a decentralised fashion through P2P trading in [17] to get rid of the supply constraint. As for the energy suppliers, their roles and integration importance are acknowledged in [18]. The impact of involvement of energy suppliers on impacting the features of a well-functioning LEM is analysed in [19]. Moreover, the aggregated prosumers-facilitated energy supplier concept is reported in [20] to design a futuristic LEM.
P2P trading in the community microgrid (MG) domain is also noticeable in the current literature as it can facilitate fruitful coordination and power sharing between distributed energy resources (DERs) and consumers [21]. In particular, the authors in [15] apply P2P trading in a community MG dictated by the engaging energy users. The diversified energy users' interests are also considered in [22] for the urban community MG system. An iterative auction framework is designed by the authors in [23] to conduct P2P trading in a community MG. The energy balance of a community MG is guaranteed in [24] through an innovative P2P trading strategy. To ensure flexible energy sharing in the community MG via P2P technique, a battery control based on two-stage aggregates is discussed in [25]. A P2P trading model, coordinated with aggregated MGs, is designed in [26] to avoid the penalty risk resulting from energy contracts' deviation. Furthermore, optimal sizing and economic scheduling of P2P trading-driven multi-MG and community-MG systems are also reported in [27] and [28] respectively. Moreover, the stochastic management of locally controlled energy-governed MGs is carried out in [29].
For executing peer-to-peer (P2P) trading securely, recent research has mostly used the concept of blockchain technology. Overall, blockchain-based P2P trading platforms have different functions, including data securing, tracking, formulation, and energy trading, to show participants 'benefits. In blockchain, participants are given access to trading output to cross-verify transactions in a trustworthy way [30]. Recently, different blockchain-based P2P trading concepts have been designed. Particularly, authors in [31] develop blockchain-enabled a multi-time-scale autonomous energy trading framework. A blockchain-empowered P2P market flexibility model is proposed in [4], and cryptocurrencydriven token trading is formulated for active participants in [32]. Furthermore, smart contracts on the blockchain are also applied for automated P2P market settlement. However, both participant-and blockchain-oriented case studies do not consider the incorporation of energy suppliers and operators -which are equally important to run the LEM in practice.
Undoubtedly, all the research studies reviewed above have created a significant base to articulate the potency of P2P trading both in LEM and MG domains. However, they are devout towards focusing on either energy users, energy suppliers and operators, or MG as illustrated in Table-1. Also, the integration between LEM and MG domains is missing. This could result in facilitating local energy balance and minimising export/import to/from the upstream power grid further, and thus, reducing the possibility of network congestion. That can also contribute towards cutting down energy transmission and costs substantially in the long run. Given this content, this paper focuses on integrating a community battery energy storage system (CBESS)-facilitated MG -which is assumed to be operated by the energy operator -into a LEM that not only rewards energy users engaged with P2P trading but also ascertains that both the energy operator and energy suppliers do not lose their portions while power grid import and export and are substantially decreased. The proposed CBESS-integrated LEM mechanism is also validated by dint of a case study in the context of Australia. This paper contributes to the literature by making the following advantageous contributions: • A P2P trading strategy is proposed by incorporating various energy users, energy suppliers, and the authorised energy operator in a realistic LEM.
• A CBESS-based MG is integrated with the proposed blockchain-based LEM to ensure local energy balance, leading to lower import/export from/to the power grid.
• A case study with actual data from the Australian power network is showcased to demonstrate the monetary gains for all participating energy users, energy suppliers, and the energy operator and stimulate their presence.
• It is shown that the proposed P2P trading-driven LEM model minimises energy expenditures of all energy users substantially, curtails power grid's export and import considerably, and keeps the margins of other stakeholder unchanged to stimulate their engagement. The structure of the paper is as follows. A CBESSintegrated LEM model is described briefly in Section II, the trading process involving energy suppliers is discussed in Section III. The following section (Section IV) proposes mathematical formulation to develop the designed P2P trading strategy. Section V provides the simulation results to validate the methodology, and Section VI contains the concluding remarks.

II. LEM AND CBESS-DRIVEN MICROGRID: OVERVIEW
LEM is one of the modern energy market solutions that is essentially a catalyst to share energy within the local community, to integrate DERs and minimise power grid problems to some extent. With the additional revenue streams, it encourages energy users to participate in P2P trading and promotes the utilisation of RBESSs [2]. One of the goals of LEM is to extend self-sufficiency within the local community to reduce dependency on the power grid, thus the energy operators are somewhat relieved from power quality and network congestion complexities [5]. Fig. 1 depicts the architecture of the studied blockchainbased LEM model, consisting of 260 energy users in total (including all three types) and two energy suppliers under a single distribution substation and connected through two feeders [33]. As is captured in Fig. 1, Energy Supplier 1 has 140 energy users in total including 60 consumers; 40 prosumers with solar PV; and 40 prosumers with solar PVs and RBESSs [34]. In contrast, Energy Supplier 2 has 120 consumers only (no other types of energy users) [35]. Nevertheless, the installed average capacity of the solar PV system is assumed to be 6 kWp per prosumer and the size of RBESS per prosumer is considered as 3.3 kW/10 kWh [36]. Under the proposed LEM platform, solar PVs, RBESSs, and load profiles are continuously monitored and predicted in the forwardfacing trading market. On top of it, energy users are permitted to put their offers to buy and sell local energy at rates below the ToU and above the FiT rates, respectively. They can decide on and hold their preferred trading quantities and prices through an energy user-friendly web-interface until they set their heart on changing trading parameters. The IoT flow between the proposed blockchain-based LEM platform, CBESS, and energy users is shown.
In short, a LEM platform allows energy users (both consumers and prosumers) to fulfil not only their energy requirements but also attain substantial monetary gains by engaging in P2P energy trading among themselves. They are also enabled to trade with the community MG and power grid while functioning as parts of the LEM framework. In this paper, the community MG, with 250kW/475kWh capacity [37], is assumed to be operated by the energy operator and is connected to the distribution substation through a separate feeder as demonstrated in Fig. 2. A blockchain-enabled LEM platform aims to optimise the energy cost portion of the tariff VOLUME 11, 2023 to reduce the overall tariff, so that energy users can receive monetary benefits (greater incentives are anticipated during peak ToU periods due to higher charges) without the energy supplier and network utility losing their portions. This figure also exhibits how trading among energy users is conducted in the LEM platform in the presence of two energy suppliers. Note that it is not necessary to be customers of the same energy supplier to conduct P2P trading. A seller and a buyer could also be the customers of different energy suppliers. This cross trading in the LEM is described in the following section.

III. LEM CROSS TRADING AND BLOCKCHAIN INTEGRATION
This section explains the LEM cross trading concept, in which one Australian energy operator maintains the network [33], and two Australian energy suppliers designated as Energy Supplier-1 and Energy Supplier-2 are considered to serve 140 and 120 energy users, respectively [34], [35].
Table-2 describes the tariff structure (with various tariff components) of Energy Supplier 1 for both scenarios of BAU and LEM trading. The ToU tariff structure is considered to maximise the benefits of the energy users and increase LEM trading volume. Tariff components, such as daily supply charge; FiT rate; energy operator fee; renewable energy target (RET) charge; energy supplier's margin, and platform cost at peak and off-peak periods are illustrated in Table-2. Note that LEM platform cost applies when energy users participate in the P2P trading. While other tariff components remain mostly unchanged, energy component reduces in P2P compared to BAU depending upon the mutual bids offered by energy users. This leads to overall tariff reduction in P2P. Consequently, the financial interests of P2P buyers are confirmed. On the other hand, P2P sellers can sell at the P2P bought energy price, which is higher than the FiT rate as can be seen from Table-2. Consequently, P2P sellers also benefited.
Likewise, the tariff structure of Energy Supplier 2, with various tariff components, is also displayed in Table-2. Unlike Energy Supplier 1, Energy Supplier 2 contains shoulder periods along with peak and off-peak periods. Table 2 also points out that energy prices at off-peak periods are fewer than the FiT rate. Thus, P2P trading in the LEM platform during off-peak is not profitable for both sellers and buyers. However, energy users can target another two ToU periods to trade among each other in the LEM platform for economic gains. Nonetheless, how customers of Energy Supplier 1 and Energy Supplier 2 trade in the LEM platform is presented in Fig. 3 by a toy example. In this example, a prosumer (customer of Energy Supplier 2) and a consumer (customer of Energy Supplier 1) perform P2P trading to sell and buy 1 kWh of energy. The trading allows the prosumer to earn 9.43 c/kWh, which is 4 c/kWh more than the FiT rate. On the contrary, the consumer pays 34.48 c/kWh instead of 35.1 c/kWh. Energy Supplier 1 and Energy Supplier 2 receive their margins of 1.5 c/kWh and 0.25 c/kWh, respectively. Also, 0.5 c/kWh is attained by the LEM operator as the platform operational charge. P2P energy flow, cash flow, and internet-of-things (IoT) signals in LEM at a given time slot are shown in Fig. 3, where smart contracts are organised to register P2P trading information on a cloud platform and then documented on the blockchain for record and storage. Information about the energy traded volume is sent to the energy supplier for billing reconciliation at the end of a periodical billing cycle.
The Ethereum Virtual Machine (EVM), which is simply software that sits on top of Ethereum nodes for executions, carries out smart contracts settled between LEM users. The EVM measures the amount of computational work required to execute P2P transactions and smart contracts in ''gas.'' The price of gas is expressed in Ether (ETH) and is often expressed in the smallest denomination possible (WEI). One ETH is equivalent to 1018 WEI, and one ETH = 2334.63 AU$ [38]. Since it is a result of blockchain network congestion, it is dynamic in nature. On the Ethereum blockchain, the total cost Z in ETH for transactions and smart contracts that were carried out is determined. as [39]: where g represents the gas amount and z(gas) denotes the gas price measured in WEI. Fig. 4 depicts the three layers that make up the complete blockchain platform process: the LEM architectural layer (virtual and physical); the interface layer; and the blockchain layer powered by smart contracts. In the LEM architectural layer (virtual), prosumers and consumers declare their interests to participate in the LEM based on their energy status (either sellers or buyers); In the interfacing layer, LEM users are connected through user interface (UI) and Web3 interface. Users of the LEM can enter their bid quantities and prices in the UI before each P2P trading interval. On the other hand, the Web3 interface links LEM users to the blockchain layer that is powered by smart contracts. In the smart contracts-driven blockchain layer (monitored by an authorised admin), P2P bidding; mechanism for market clearing; and billing are settled in a decentralised fashion. Particularly, the data information and P2P transaction records are permanently preserved with a possibility of retrieval at any time. The admin, energy supplier, and energy users can all access this data to make final financial agreements. Lastly, prosumers inject the energy while consumers consume it from the physical network in the LEM architectural layer's physical domain.

IV. PROPOSED P2P-DRIVEN LEM FORMULATION
The intention of this work is to propose a P2P-driven LEM that enables energy users to reduce their electricity bills and energy suppliers to keep their margins unaffected. To formulate the LEM trading mechanism the following assumptions are made: • Energy users are assumed to be connected at the same low-voltage (LV) distribution side of an electricity network [40].
• Prosumers equipped with solar PVs and prosumers equipped with solar PV and RBESSs trade as both sellers and buyers in the LEM based on their energy status. On the contrary, consumers only engage in the LEM as sole buyers [41].
• All sellers and buyers are directed to declare their preferred trading quantities and prices at the blockchain-based LEM platform. Sellers' order is arranged based on the least declared prices. Whereas buyers' orders are organised in accordance with the highest declared prices. Hence, the first P2P pair is constituted with the most economical seller and the most expensive buyer, and sequence continues for all sellers and buyers. If two sellers declare the same price, then their intended energy quantities are taken into account, whereby priority is offered to the seller with greater energy quantity. The same is true for the buyers.
• LEM prices are always kept between the FiT and ToU rates to enable all of them to receive better financial returns than BAU [42].
• Once selling and buying energy orders are matched in the LEM, the excess energy (if any) is utilised to charge the CBESS. On the other hand, it discharges if LEM has more energy deficit than available energy.
Let L be the set of feeder lines in a typical LV distribution network, where each feeder line is indicated by l ∈ L. Energy users are connected in different lines, and it is assumed that they participate in the LEM. The set of each energy user c is represented by C, where c ∈ C. The power imported by each energy user via P2P trading in the LEM at any time t ∈ T is indicated by ρ im−l c,l (t) and the import price is symbolised by On the other hand, assume ρ ex−l c,l (t) implies each energy user's power export to the LEM at a price signified by  LEM user can be represented as: ∀c ∈ C, ∀l ∈ L, ∀t ∈ T Subject to: Subsections (A-D) constraints as described in (3) Note that, each prosumer/consumer is permitted to minimise its electricity cost individually in the proposed LEM model through the P2P trading with its preferred peer at a desired price. This is applicable to every time instant considered for the P2P trading. Also, different prosumers/consumers could be connected at different feeder lines under a single distribution substation. Thus, a specific prosumer/consumer is labelled with its connected feeder line while it is performing P2P trading at any time instant.

A. IN-HOUSE CONSTRAINTS
Let ρ im c,l (t) and ρ ex c,l (t) be the total imported and exported power, respectively, by an energy user c ∈ C at time t ∈ T , where T = {t ∈ T , t > 0. Note that a LEM user needs to import/export from/to the power grid if it can not trade at the LEM at any time t ∈ T . In other words, ρ im c,l (t) and ρ ex c,l (t) could be equal or greater than ρ im−1 c,l (t) and ρ ex c,l (t) are calculated as follows: (t) respectively, such that [11]: (t), respectively such that [16]: (t) are calculated as follows: ; where s  (16) and (17).
where ρ pv(p) c,l denotes the peak solar PV power over the course of |T |.
Similarly, peer-discharge ρ b(l)− c,l (t) of an energy user c ∈ C in the LEM is also limited by the peer-discharging rate  (19) and (20).
where ρ ld(p) c,l represents the peak power demand over the course of |T |.
As for the price constraints in the LEM for P2P trading, it is required that x im−l c (t) is lower than x im−g c (t). Whereas x ex−l c (t) is higher than x ex−g c (t) to benefit both buying and selling energy users, such that: where ToU and FiT rates are represented by x im−g (t) and x ex−g (t), respectively. Note that, x im−g (t) is a combination of energy price x im−g1 (t); energy supplier's margin x im−g2 (t); energy operator's margin x im−g3 (t); and RET charge x im−g4 (t) (if applicable) as illustrated in (21) [7].

C. CBESS CONSTRAINTS
Let g ∈ G be the index of the CBESS. In this paper, g = 1 as one CBESS is considered. The CBESS charging and discharging operation along with SoC constraints can be expressed as follows [25]: where s g (t) is the SoC of the CBESS at time t ∈ T , which is bounded by minimum and maximum SoCs, s (t). ρ b+ g,l (t) and ρ b− g,l (t) at t ∈ T are computed as follows: ; ∀g ∈ G, ∀t ∈ T (33)

D. NETWORK POWER CONSTRAINTS
The power bought and sold in the LEM of each energy user c ∈ C at time t ∈ T are also constrained by the maximum consumption and injection limits, indicated by ρ and ρ ex−l(m) c,l (t), respectively as demonstrated in (34) and (35) respectively. These are assumed to be prescribed by the energy operator [43], [44]: Besides, the total import and export balance in the power network with the proposed LEM framework can be evaluated as follows: where ρ im−lg c,l (t) and ρ ex−lg c,l (t) imply power imported and exported respectively from and to the power grid during the LEM operation. These are also required to be lower than grid import power ρ im−g c,l (t) and grid export power ρ ex−g c,l (t) without the LEM operation to help the energy operator avoid network congestion in the network, such that:

V. RESULTS AND ANALYSIS
The proposed framework is simulated on the MATLAB software and the smart contracts are written on REMIX IDE [45]. The Ethereum blockchain is created using a Ganache CLI v6.12.2 and web3.py library acts as a bridge between user interface (UI) and blockchain. The results of the performed case study are illustrated and analysed to demonstrate how the proposed LEM platform benefits energy users, energy suppliers, the power grid, and the network operator. The proposed LEM model is also integrated with a CBESS-based MG to reduce the power grid's import and export further. In order to design the LEM framework, a typical architecture, as displayed in Fig. 1, is considered which consists of two energy suppliers and different combinations of electricity consumers, prosumers equipped with solar PVs and prosumers equipped with solar PV and RBESS (260 in total). This study is based on real world data of a town in New South Wales (NSW), Australia (available in [46]). The load consumption and solar PV generation average profiles for 24 hours are depicted in Fig. 5, illustrating that their values are highest in the evening and afternoon times, respectively.

A. ENERGY USER'S DYNAMIC BIDDING
The energy users have the ability to select buy and sell prices dynamically and place bids into a trading platform between predefined ranges of FiT and grid buy price. These prices are matched according to the merit order with the respective buyer or seller rate and a midway price is chosen as the settlement rate. Fig. 6 shows the resulting trading prices in the LEM with CBESS scenario. They reflect the energy suppliers tariff rate periods as the limits of buy and sell prices are within FiT and grid buy price, therefore P2P prices during peak periods are elevated. The prices are split into buy and sell prices from a) solar PV to load, b) solar PV to BESS and c) BESS to load. As two energy suppliers were chosen for the case study, the P2P prices can be higher than one of the energy supplier grids buy rate. This can be observed between 8:00 and 3:00 pm that P2P prices exceed energy supplier's grid buy rate. However, those are bought prices of consumers in energy supplier 2's portfolio, which has a higher grid buy rate during that time.

B. PARTICIPATION OF ENERGY USERS AND THEIR BENEFITS ANALYSIS
The average electricity costs of electricity consumers, prosumers equipped with solar PVs, and prosumers equipped  with solar PVs and RBESSs are depicted in Fig. 7. On average, participating in P2P-empowered LEM the reduction in electricity costs become 5%; 9%; and 23%, for consumers; prosumers equipped with solar PVs; and prosumers equipped with solar PVs and RBESSs, respectively, compared to BAU. The reduction in electricity cost for prosumers is due to additional income by P2P trading using their own traded price and reduced grid buying/selling volume. The electricity cost of prosumers equipped with solar PVs and RBESSs is further reduced due to their larger self-sufficiency, P2P trading in different ToU intervals and reduced grid buying/selling volume. That can encourage prosumers to make the largest investment on solar PVs and RBESSs to earn maximum benefits. Moreover, consumers are also benefiting moderately as being parts of the LEM platform without making any investment in DERs. Fig. 8(a) and Fig. 8(b) show average daily residential load profiles for BAU vs LEM and BAU vs LEM with CBESS respectively. The results reveal that energy VOLUME 11, 2023 trading with the power grid decreased in the afternoon and evening periods owing to P2P trading in the LEM and trading with CBESS. To provide maximum monetary gains to energy users, RBESSs are charged during day (off-peak) and afternoon (shoulder) periods and discharged during evening (peak) periods. The LEM trading is exhibited in Fig. 7(a), where prosumers equipped with solar PVs have a larger contribution in P2P trading in afternoon times, and in the evening, prosumers equipped with RBESSs discharge to fulfil the load requirement. Fig 7(b) depicts that the CBESS further contributes to meeting load requirements in the late evening, and thus benefits energy users as another income stream.

C. REDUCTION IN POWER GRID'S EXPORT AND IMPORT BY CBESS-INTEGRATED LEM
The export and import of the power grid for a typical day are represented in Fig. 9; BAU and LEM are compared in Fig. 9(a) and BAU and proposed LEM with CBESS are compared in Fig. 9(b). As is seen from Fig. 9(a), in comparison with BAU, the LEM decreases the power grid export by 24% due to RBESS charging and P2P energy trading with neighbouring users during off-peak and shoulder times, and import is lessened by 26% due to RBESS discharging and P2P energy trading with neighbouring users during peak time.
Furthermore, Fig. 9(b) compares BAU and LEM with CBESS, and results show that due to the integration of CBESS with LEM, export and import are further decreased by 32% (off-peak and shoulder times) and by 39% (peak times), respectively. The significant reduction in imports and exports is due to the additional trading volume within energy users and CBESS. The CBESS is controlled by a network operator at the substation level and energy users perform trading at power grid's set prices. This clearly demonstrates that the integration of CBESS with the LEM is not creating any additional benefits for energy users but significantly reduces the power grid's import and export problem.

D. INCOME MARGINS OF ENERGY SUPPLIERS AND NETWORK OPERATOR
Energy suppliers' margins are maintained above or at BAU level as exhibited in Fig. 10(a). Overall, both energy suppliers have different daily fees because of their different number of energy users. Energy Supplier-2 has a larger income with the power grid trading because it consists of consumers only. However, Energy Supplier-2 includes prosumers equipped with RBESSs that reduce the income with the power grid due to energy users' self-sufficiency.
Energy supplier-1 retains a transaction fee of 0.25 c/kWh (an additional fee with all its prosumers) due to energy sold within the P2P trading-driven LEM. An increase in its margin over the course of a typical day by 5% is a result of an additional fees per kWh traded in the LEM and raised trading volume while RBESSs are charged from other energy users. Energy Supplier-2 (without any prosumers), on the other hand, retains the previous margin for every kWh consumed within the LEM. This justifies that energy suppliers can obtain more benefits, in terms of increasing their margins, if the number of prosumers grows within the LEM platform, resulting in an increased volume of P2P transactions. Fig. 10(b) portrays the daily incomes of the network operator both in BAU and LEM scenarios. The results show that for both scenarios the daily fee is identical, that is AU$ 197, because the total energy trading volume does not change. However, due to LEM self-sufficiency, during off-peak and peak periods both power grid export and import are reduced, which marginally reduces the network income. Unlike energy users, the network operator may not receive financial returns largely from the LEM platform. But a well-functioning LEM can mitigate the adverse impacts of local penetration, such as voltage rise issue; increase in power losses; and congestion complexities for example, with the help of P2P trading, resulting in lowering both capital and operational expenses of the network operator.

E. SELF-SUFFICIENCY AND SELF-CONSUMPTION
The LEM has an impact on the self-sufficiency and selfconsumption of the trading group. Self-sufficiency is the ratio of energy provided and consumed by the community and the total consumption of all energy users. Self-consumption is the ratio of energy provided and consumed by the community and the total generation of all prosumers of the LEM. The LEM influences these values by increasing the consumption of locally generated electricity by charging BESS from peers, therefore reducing the energy volume exported to the main grid. The self-sufficiency and self-consumption analysis is split into the parameters a) Own PV referring to the direct use of self-generated solar, b) Own BESS meaning the charge and discharge of self-generated solar for the own household usage, c) Peers PV as the amount of energy traded from solar within the trading group and d) Peers BESS referring to the amount of energy shared from the BESS within the trading group.
Enabling the residential BESS to be shared with the community can increase the self-sufficiency by ∼7.5 % to 51.5 % as shown in Fig. 11 (a) and the self-consumption by ∼ 3 % to 76.0 % as shown in Fig. 11 (b). A CBESS increases these values greatly to 59.0 % and 92.5 % respectively.

F. COMPARATIVE ANALYSIS
In this section, the proposed LEM results are compared with recent research papers [47], [48]. In [47], a minimization objective function is used for regulated electricity price components and social welfare and the LEM results, including a reduction in total fees paid and an increase in self-sufficiency, are compared. In [48], the matchmaking between the buyer and seller is maximised, and the results of grid imports and exports are compared.

1) FEES PAID
As shown in Fig. 12, in [47] total fees paid for BAU are 286 = C, and in LEM they are reduced by 16%, to 239 = C. The proposed LEM architecture reduces electricity bills for consumers by 5%, prosumers by 16%, and prosumers with RBESS by 29%. On average, the proposed LEM structure reduces bills for participants by 17%.

2) SELF-SUFFICIENCY
The self-sufficiency of LEM in [47] has increased by 14% as shown in Table-4. However, it is much more controlled in the case of the proposed LEM, and the results illustrate that LEM  increased the self-sufficiency by 7.5%, and with the proposed LEM and CBESS it increased further to 15%.

3) GRID IMPORT AND EXPORT
The grid export and import were reduced by 19.5% and 23.3%, respectively, in [48] as shown in Fig. 13. However, the grid export and import were further reduced in the proposed LEM by 24% and 26%, respectively. It was found that the addition of CBESS with the proposed LEM caused the most reduction in export and import to 32% and 39%, respectively.   carried out by the EVM, and the related gas quantity in the fourth column indicates how much computational work is involved. The fifth column in Table 2 lists the gas cost for using LEM smart contracts to do a variety of tasks, such as user registration, bidding, P2P trading, billing, and settlement. As shown in Table-5, it is relatively expensive to run a P2P-driven LEM on the Ethereum blockchain platform. Congestion and the Ethereum network's slow transaction speed are to blame for this (approximately 15-17 transactions per second). Other blockchain platforms, such as Solana and Polygon, can assist cut the cost by a factor of a hundred, and this could be a future extension of the created LEM model.

VI. CONCLUSION
A CBESS-integrated LEM framework has been proposed in this paper. The main objectives of this paper have been the development of a power network-compatible LEM model and its financial viability verification. The proposed LEM model has allowed various energy users, that include consumers; prosumers with solar PVs; and prosumers with solar PVs and RBESSs; to trade energy among themselves optimally in a P2P fashion respecting both market and network constraints, while the overall energy in the LEM is balanced primarily by the CBESS-facilitated MG. Further, the developed MG-integrated LEM mechanism has been verified on a real power grid in Australia and the simulation results have been compared with the existing BAU. It has been found from the comparative simulation results that energy users can reduce significant portions of their electricity costs; the power grid can minimise its imports and exports; and energy suppliers and the authorised energy operator can keep their margins unaffected by participating in the developed LEM model. Additionally, the self-sufficiency and self-consumption of the trading group can be increased, resulting in reducing the reliance on the upstream power grid and solar exports; and keeping local generation and consumption matched. Thus, the proposed LEM framework can be regarded as a beneficial model for both energy users and other stakeholders and can be put into practice in today's electricity market.
Further investigation can be carried out on how physical network constraints can be incorporated dynamically (e.g., via the concept of dynamic operating envelope) into the proposed CBESS-integrated LEM structure to maximise the local energy usage with customers' empowerment through P2P energy trading while wide-scale engagement of different stakeholders is always guaranteed. Moreover, the application of the blockchain technology in the proposed LEM framework can be analysed for the fast and secure settlement of P2P transactions. The suggested LEM model on the Solana blockchain will be validated in further work to speed up P2P trading and billing settlement. Besides, grid flexibility and scalability features can be incorporated into the LEM to demonstrate the sustainability of the platform.
JAN PETERS received the B.S. degree in renewable energy systems from the University of Technology and Economics, Berlin, in 2020.
He is currently a Product Analyst with Powerledger, Perth, to analyze and simulate local energy markets, peer-to-peer energy trading, and flexibility services and to conduct research activities in energy markets and environmental commodities. He has experience working for a solar consultancy in Berlin. His research interests include renewable energy integration, grid decentralization, smart and microgrids, power system services, peer-to-peer energy trading, and battery technologies. He is a global executive with decades of global experience in engineering, IT, OT, sales, general management, teaching, and consultancy. He has led the digitalization of projects globally, along with mega projects in energy and sustainability across Asia, North America, Europe, and Australia. He has held leadership positions with Fortune companies as well as budding startups. His experience spans life-cycle projects including technology, leadership, research and development, sales, delivery, and postdelivery services. He is currently the full-time Advisor of digital energy and corporate strategy with Powerledger. He supports the implementation of innovative technology solutions in digital energy markets in addition to strategic guidance on the development of new platform products and business growth. Over the last 38 years, he has served major multinationals of Siemens and ABB as well as premier power utility Tata Electric Companies, India. His experience and expertise in the areas of operational and information technologies in the power sector span five countries in Western Europe, Southeast Asia, the Middle East, and India. He has held several key positions including a Chief Technical Officer in engineering and technology and energy management of Siemens for the ASEAN region, the Head of the Department of Electrical Protection, and the Global Product Manager, Protection Solutions with ABB, Switzerland. He was also responsible for several global flagship projects such as China's Three Gorges, Malaysia's 500-kV corridor, and AMI Smart Meter national rollout. He has spoken at over 35 forums on state-of-the-art best practices in digital energy transformation. He was a regular member of working groups of CIGRE from Switzerland. He is a fellow of the Institution of Engineers, India. His expertise in electrical and electronics engineering and international business makes the connections that push Powerledger forward. He forged a successful career with GE, where he twice won the President's Club Award for performance excellence. He has held many senior roles within the Australian energy sector, previously as the COO of Regen Power, the General Manager of Sales with Perth Energy, and a Senior Advisor to Future Effect. He goes hiking around the hills of WA with his wife and reads Indian poetry to relax.
JEMMA GREEN received the bachelor's degree in commerce from Murdoch University, Perth, Australia, in 2002, the dual master's Diploma degrees in sustainability from the University of Cambridge, and the Ph.D. degree from Curtin University, Perth, in 2017.
She is a Co-Founder and the Chairman of Power Ledger, a technology company that uses blockchain to facilitate energy trading, tracing, and trading. Setting her career trajectory early on, she became the voice of sustainability and corporate social responsibility in the business of big money lending while at JP Morgan in London. She set up the first fossil fuel-free pension fund and has sat on numerous boards championing sustainable businesses such as a Carbon Tracker and Climate-KIC Australia. Her research interests include disruptive innovation, stranded assets, renewable energy, and storage for housing and prefabricated and modular building systems. In 2016, she has won Sir Richard Branson's Extreme Tech Challenge from Powerledger. In 2018, she was made EY Fintech Entrepreneur of the Year. University. He has published more than 250 papers in different journals and international conferences and seven books as the author or editor. His research interests include power system stability and control, electrical machine, FACTS, energy storage systems (ESSs), renewable energy, and HVDC systems. He is a fellow of Engineers Australia. He has been a keynote speaker and an invited speaker at many international conferences, workshops, and universities. He is serving as an Editor/Associate Editor for many prestigious journals from IEEE, IET, and other publishers, including IEEE TRANSACTIONS ON ENERGY CONVERSION, IEEE POWER ENGINEERING LETTERS, IET Renewable Power Generation, and IET Generation, Transmission and Distribution. VOLUME 11, 2023