Blockchain-Based Local Energy Market Enabling P2P Trading: An Australian Collated Case Study on Energy Users, Retailers and Utilities

This paper presents a collated case study on local energy market (LEM) in Australia, in which energy users take part frequently in peer-to-peer (P2P) energy trading among themselves considering the agile presence of energy retailers and distribution utilities. To do so, first, an overview is provided in regard to LEM architecture, trading model with energy retailers, and the blockchain structure. Then, a new P2P trading mechanism is proposed in the LEM that enables both energy users, i.e., sellers and buyers, to reap financial benefits compared to the existing business-as-usual (BAU) model — where local power is exported and imported via feed-in-tariff (FiT) and time-of-use (ToU) rates. The proposed LEM framework also exploits residential battery energy storage systems (RBESSs); and the community battery energy storage systems (CBESSs) to balance local supply and demand appropriately and contributes towards lowering exports/imports from/to power grids by means of bilateral P2P transactions while the inclusion of responsible energy retailers are assured. Moreover, the margins of both energy retailers and distribution utilities are kept unchanged or increased to some extent by the proposed trading model to incorporate them in the LEM framework effectively. Finally, diverse case studies are provided to validate the proposed LEM mechanism with various studied models and demonstrate the superior performance in contrast with the present-day BAU model.


I. INTRODUCTION A. BACKGROUND
In today's world, the owners of small-scale distributed energy resources (DERs), such as rooftop solar photovoltaic (PV) systems; residential battery energy storage systems (RBESSs); and community battery energy storage systems (CBESSs), are becoming interested to receive attractive financial returns in lieu of energy export [1]. In the last decade, feed-in-tariff (FiT) has emerged as such a mechanism that allows these owners, commonly called prosumers, The associate editor coordinating the review of this manuscript and approving it for publication was Salvatore Favuzza . to export excess energy at a price fixed by the energy retailer in a centralised manner, which could be static or dynamic depending upon the location, energy requirement, and network policy [2]. To expedite the rooftop solar PV uptake, a high FiT rate was chosen. For instance, it was approximately 40 c/kWh in Western Australia (WA), leading to a significant number of WA homes equipped with solar PVs [3]. However, it could not last long due to unplanned installation of solar PVs at the residential level, causing excessive export into the power grid, and energy price hike for non-solar PV customers [4]. Currently, it is capped at around 3 c/kWh in WA [5], making prosumers dissatisfied. Therefore, a better incentivising mechanism is required to satisfy prosumers financially. VOLUME 10, 2022 This work is licensed under a Creative Commons Attribution 4.0 License. For more information, see https://creativecommons.org/licenses/by/4.0/ A local energy market (LEM) is essentially a sub electricity market that allows energy management, trading, and flexibility services in a transactive environment following required rules and regulation set by the LEM operator (LEMO)which coordinates with the authorised distribution utility and energy retailer [6]. It is technically and economically feasible to stimulate clean energy integration into the power grid [7]. A LEM is characteristically different from existing DER management systems, such as distributed resource management systems (DERMS) and advanced distribution management systems (ADMS), as it is operated by mutual negotiations between prosumers, consumers, and LEMO with a view to benefiting them to a greater extent [8]. Peer-to-peer (P2P) trading is one of the aspects of LEM, empowering both prosumers and consumers to trade energy among themselves simultaneously in a decentralised fashion to control localscale DERs fully and operate as independent energy contractors [9]. A distributed ledger technology, such as blockchain, can be adopted to accommodate smart contracts for energy trading between various prosumers and consumers [10].
P2P trading operates in two levels: 1) financial layer and 2) physical layer. Financial layer deals with local trading setup and decision-making strategy using a secured information platform. Whereas the physical layer is responsible for energy dispatch in actual power grids respecting network constraints prescribed by authorised energy retailers [11]. P2P trading in the LEM could be conducted in three different structures: 1) fully decentralised; 2) community-based; and 3) hybrid. While a fully decentralised P2P trading is executed without the involvement of a centralised entity, a community operator manages community-based P2P trading structure. In contrast, in a hybrid P2P trading structure, the financial part is carried out in a decentralised manner between various entities and a responsible LEMO only guarantees the safe operation of the power grid. Due to its operational suitability, hybrid P2P trading structure can readily be applicable in modern power grids [12].

B. LITERATURE REVIEW, LIMITATIONS, AND MOTIVATIONS
A large number of recent research studies devout towards prioritising energy users' preferences to motivate them to engage in P2P trading in LEM. Energy users' beliefs related to their perceived behaviour, subjective norms, and attitudes are analysed and an appropriate model is designed in [13] to demonstrate the preferences concerning P2P trading. In a competitive LEM, energy users are permitted to declare their preferred P2P trading quantities, prices, periods, and partners in [14]. Energy users are also given the flexibility to perform P2P trading individually or as a part of a group in [15]. It is recommended in [16] to formulate effective P2P trading decisions to reap maximum benefit from the LEM via P2P trading. The authors in [17] report that while P2P trading decisions are heavily dependent on climate change; place attachment; and political orientation, difference in trust plays the primary role.
Further, electricity cost reduction is regarded as one of the key drivers in [18], [19] that can influence P2P trading decisions extensively. The authors in [20] acknowledge this fact and develop a robust P2P decision-forming strategy that guarantees a minimisation in energy users' energy bills. The energy users are directed to trade between the FiT rates and time-of-use (ToU) tariffs in [21] so that P2P trading becomes lucrative both for sellers (energy users have more generation than demand) and buyers (energy users have more demand than generation). The application of RBESSs is exercised in [22], [23] to cut down electricity costs of both sellers and buyers as RBESSs facilitate them to govern their local generation, consumption, and dispatch autonomously. The authors in [24] also introduce the concept of P2P negawatt trading to lessen their energy costs further through rescheduling energy usage behaviour. Moreover, P2P trading in the LEM is analysed from social attributes' point of view in [25] with the purpose of enhancing its preference among energy users.
The scopes of integrating the power grid and distribution utilities in the LEM are also reported in some research studies. A grid-satisfactory P2P trading mechanism is proposed in [26], where power demand is handled by means of community instructions. A bilateral negotiation-driven peak demand management strategy is proposed in [27] -this type of P2P trading is labelled as a potential alternative to traditional demand response. To balance supply and demand within a local energy community, P2P trading orders are utilised in [28]. The authors in [29] incentivise the energy users optimally who show their interests to assist in balancing local energy supply and demand. The uncertainty of DERs is also considered in [30] while P2P orders are settled to avoid any imbalance in demand and supply. The activation of present-day and futuristic potential flexibilities in the power grid is also explored in [31], [32].
As for the distribution utilities, an integrated usersdistribution utility approach is applied in [33] to maintain the power grid constraints, that include power loss [34]; congestion [35]; voltage limit [36]; and thermal resistance [37], in the LEM. The power grid usage charge is included in the P2P trading model in [38] to help the distribution utility maintain the financial part of the network. The authors in [39] also acknowledge the importance of the presence of energy retailers in practical LEMs. For this reason, the role of an energy retailer is justified by the authors in [40]. Besides, the transition of aggregated prosumers into a prospective energy retailer for a futuristic LEM is also discussed in [41].
Several research studies also deal with the application of P2P trading-driven LEM in community microgrids (MGs). The sizing and planning of this type of LEM framework are explained in [42] and [43] respectively. To guarantee monetary gains for all entities in a MG, a new method is implemented in [44]. In addition, data-and model-driven approaches are proposed for home MGs in [28]. The authors in [45] consider diversified P2P energy users' factors to deploy the LEM-MG mechanism in an urban area. An innovative algorithm is added to the P2P trading in [46] to ascertain energy balance within the MG. A two-stage control is proposed to share energy in a defined MG in the most flexible way in [47]. The physical nature of energy flow is brought into the decision-making processes in a well-functioning MG in [48]. A novel multi-hierarchical approach is also reported in [49] to conduct P2P bidding among different community MGs. Finally, a strategy is developed in [50] to enhance the resilience of networked MGs via P2P trading.
Clearly, all these literatures lay the foundation to promote P2P trading-facilitated LEM models from various perspectives to increase wider acceptability. An example of energy and information flow of such LEM models are shown in Fig. 1. However, these research studies are usually specific to convince one particular entity of the LEM at a time, i.e., energy users/power grid and distribution utilities/energy retailers. In other words, the existing works are either energy users-centric, power grid and distribution utilities-centric, or energy retailers-centric. This may not be motivational to involve all parties simultaneously in the LEM for P2P trading in today's electricity market and thus, it is required to extend the available LEM models by incorporating various energy users, power grid and distribution utilities, and energy retailers. To this end, the importance of developing a unique LEM framework with different possible models is stressed in this paper involving various energy users; power grid and distribution utilities; and energy retailers. Further, a collated case study to validate the proposed framework is also provided in this paper to: 1) articulate if an innovative LEM can create a win-win scenario for all types of energy users, the power grid, the distribution utility, and energy retailers; 2) demonstrate the advantageous feature of integrating a CBESS-enabled MG in the LEM; 3) highlight the suitability of LEM in countries like Australia, where the national electricity market (NEM) has recently suffered from sudden price hike; and 4) take the pioneering step to speed up the LEM software development confirming the present-day electricity market suitability.

C. CONTRIBUTIONS
This paper focuses on developing a LEM framework; in which P2P transactions are executed in a decentralised fashion assuming a blockchain-assisted platform, and the financial interests of all entities -such as various energy users; power grid and distribution utilities; and energy retailersare guaranteed for real deployment in today's electricity market. The main contributions of this paper are summarised as follows: • A succinct overview is provided to introduce the LEM system required to settle P2P contracts and transactions.
• A P2P trading-driven LEM framework is proposed satisfying operational and financial constraints to use, sell, and buy locally generated energy effectively.
• A collated case study is conducted using real data from different parts of Australia, where various entities are considered, and their benefits are evaluated in comparison with the existing BAU model.
• The developed LEM model reduces energy bills of all energy users, minimises power grid's export and import, and keeps margins of distribution utilities and energy retailers unaffected.

D. PAPER STRUCTURE
The reminder of this paper is organised as follows. LEM architecture, energy retailer's model, the use of blockchain technology in the LEM framework are provided in Section II. Section III presents the mathematical formulation of the proposed LEM model. The following sections (Section IV and Section VI) demonstrate the considered power grids' models followed by simulation results to evaluate the performance of our proposed LEM. Finally, Section VI wraps up the paper with concluding remarks and a number of future work directions.

II. LEM SYSTEM OVERVIEW
This section demonstrates an overview of the LEM system. Particularly, a LEM architecture is discussed in Subsection II-A. Besides, single energy retailer and cross retailers trading concepts are introduced in the following subsection (Subsection II-B). Lastly, the fundamentals of blockchain and its use in the LEM are narrated briefly in Subsection II-C.
A. LEM ARCHITECTURE LEM permits energy users to trade energy among themselves in a P2P fashion to utilise their DERs and RBESS optimally and attain monetary gains [12]. Fig. 2 describes the high-level architecture of a LEM consisting of various types of energy VOLUME 10, 2022 users connected through feeder lines and fed by distribution substations. Energy users interested in LEM participation could be connected at the same feeder (fed by the same distribution substation) or different feeders (fed either by the same distribution substation or different ones). In general, energy users could be of three types: 1) traditional consumers (without solar PVs and RBESSs); 2) prosumers with solar PVs; and 3) prosumers with PVs and RBESSs. An example of P2P trading in the LEM platform among different energy users within the considered LEM architecture, as depicted in Fig. 2, is illustrated in Fig. 3. In other words, Fig. 3 represents a part of Fig. 2; where the P2P trading among several energy users in the LEM platform is captured as an example, and also shown blockchain integration. Both prosumers with solar PVs (second type of energy users) and prosumers with PVs and RBESSs (third type of energy users) can sell and buy energy in the LEM platform. Whereas traditional consumers (first type of energy users) can only buy energy in the LEM platform through P2P trading.
In a forward-facing market, as presented in Fig. 3, energy users' demand; solar PV generation; and storage status are forecast and monitored continuously in the LEM trading platform. Energy users are guided to announce their chosen rates in the range between FiT and ToU prices to enable both energy sellers and buyers to get economic benefits. They are also provided with the option to sustain their chosen trading prices prior to their decision to replace (e.g., by using a web interface in a user-friendly way).
The LEM platform basically follows an optimised mechanism to finalise bilateral biddings for selling and buying energy in the virtual presence of an energy retailer and a distribution utility. The subsequent matching results are disclosed to successful energy users and associated control and price signals are transmitted to RBESS control systems. The CBESS is also adopted to balance the total energy flow in the LEM following the instruction given by the authorised distribution utility. The results are also sent to the energy retailer to settle energy bills at the end of a billing cycle.
While energy users are physically connected at a distribution substation through feeders, there is no physical connection between the energy retailer and the substation. The virtual presence of the energy retailer is shown in Fig. 3 while settling P2P transactions among energy users. LEM architecture has two main parts -energy flow and money flow. Money flows between the energy users/producers through a retailer. This is controlled by smart contracts, and the transactions is stored in the blockchain.

B. BLOCKCHAIN PLATFORM AND LEM INTEGRATION
Blockchain is a secure, distributed, and encrypted database of shared information -called transaction [51]. It incorporates a chronologically organised set of transactions termed as blocks -that are immutable and irreversible, and maintained by unambiguous consensus-empowered protocols. Thus, the requirement of an intermediate third party can be excluded [52]. Fig. 4 demonstrates the blockchain structure which connects blocks in a single-way direction (new blocks are added chronologically).
There are two main components of each block, namely block header and block body [53]. The block header contains block number, hash values of the block and previous block, nounce, timestamp, and address of the block creator. Whereas an automatic hash algorithm generates the hash/merkle tree to store all transaction data in the block body. The Merkle  root connects the block header and block body [55]. Nonetheless, once transaction data is validated and stored in the blockchain, it does not allow any further alteration or deletion to ensure the data storage immutability [56]. To materialise all of these aspects, a convergence of various modern technologies related to network; data; identity; communication; automation; and consensus is requisite [57].
Smart contracts are predominantly adopted to guarantee the occurrence of the transactions in the blockchain in an auto-mated fashion. They are essentially computerised transaction protocols arranged to satisfy the legal terms and conditions of archetypal contracts [58]. The purpose is to evade an intermediary service while the contractual clauses, such as terms of agreement and diverse conditions, are converted into embedded codes in a deterministic way [59]. Besides, the deployment of these embedded codes on the blockchain ascertains that they remain unchanged [60]. The reduction of malicious circumstances can also be expedited by dint of smart contracts [61]. A smart contract structure -in the context of blockchain -is exhibited in Fig. 5, which depicts that a smart contract is triggered generally by the transaction, assigned with an address (unique), and saved on the blockchain as a script.
There could be four types of blockchain structures in general, that includes public, private, consortium, and hybrid blockchains as displayed in Fig. 6. Public blockchains are entirely decentralised in nature (no central authority), enabling anyone to join with equal rights without any permission (permissionless). Examples include Ethereum, Bitcoin, and Litecoin. On the contrary, private blockchains are completely controlled by a single authority and permission is required for everyone to join. Hyperledger is an example of this form of blockchain. Longer validation and vulnerability to bad actors are major downsides of public and private blockchains respectively, which are addressed in consortium and hybrid blockchains. The permission is required in consortium blockchains, but these are governed by a group of authorities rather than a single authority like private blockchains, leading to more decentralisation and greater security. In contrast, hybrid blockchains are controlled by a single authority with some processes that do not need permission [62].
The distributed feature of blockchain and its capability of preserving transaction history are well-suited to accommodate bilateral P2P trading in the LEM. Thus, blockchain technology has been rated as one of the most promising P2P trading platforms in many recent research studies and tech companies. For instance, smart contracts are designed and evaluated for a blockchain-enabled LEM in [63], which are irreversible in nature. Smart contracts on the blockchain are also exercised to balance energy and demand in the LEM in [64] and address cost concerns in [65] respectively. The privacy and security of a blockchain-based LEM is guaranteed through specifying the requirements of message authenticity code or a digital signature, confidentiality in both symmetric and asymmetric encryption, entity authentication challenge-response protocol, authorisation to counter elevation of privilege attacks, non-repudiation adopting asymmetric cryptography, participant's privacy-preservation using pseudonyms and signature schemes, and availability for detecting attacks; and classifying and filtering messages in [66]. A multiagent deep reinforcement learning mechanism is also incorporated in [67] to validate the scalability of the LEM operation.
In fig. 7 blockchain integration with LEM is shown, where energy exchange between users takes place at the infrastructure layer, and each user is physically connected with a distribution line. Through the user interface (UI) the user connects to the blockchain and accesses their smart contract details. The same UI is also used to place the bids. In the third layer, smart contract and blockchain execute market clearing mechanism, billing and settlement, and stores/record bidding transactions.

C. ENERGY RETAILERS
In this paper, two different LEM models with a single energy retailer and two energy retailers are considered; where AGL is energy retailer-1 (for both single energy retailer and cross energy retailer models) and Origin is energy retailer-2 (for cross energy retailer model). In order to ensure maximum benefits for the energy users and increase P2P trading volumes, a ToU tariff structure is used.

1) SINGLE ENERGY RETAILER MODEL
A LEM with a single energy retailer model is considered in this subsection for P2P trading. Table 1 captures the electricity rates for BAU fixed by the AGL (energy retailer-1). Without a loss of generality, a case of two energy users (one prosumer and one consumer) is taken into account in this table who intend for P2P trading in the LEM but remain as customers of energy retailer-1. It is observed that energy prices of them are varied (assumed values) compared to BAU through P2P buying executed with other energy users in the LEM at different time periods although P2P trading involves a certain amount of LEM platform cost. Also, LEM allows the prosumer to sell energy at a different price than the FiT rate. However, daily supply charge; network fees, renewable energy target (RET), and energy retailer-1's margin remain the same.
The energy flow, cash flow and price signals of a single energy retailer-based LEM is illustrated in Fig. 8, which  reveals that a prosumer sells 1 kWh at 12.87 c (P2P energy price in the LEM). On the contrary, to get 1 kWh, the contracted consumer pays 37.92 c, which is a combined price of P2P energy price (12.87 c), network fee (21.3 c), LEM platform cost (0.5 c), energy retailer-1 margin (1.75 c) and taxes (1.5 c). In the trading platform money flow is managed through smart contracts and all placed bids are stored in blockchain. In this example, both prosumer and consumer receive 1.53 c and 0.78 c more benefits than the BAU respectively.

2) CROSS ENERGY RETAILERS' MODEL
A P2P trading-driven LEM model with two energy retailers is considered in this part. Table 1 and Table 2 show the electricity rates for BAU fixed by the AGL (energy retailer-1) and Origin (energy retailer-2) respectively. In cross energy retailers' model, two energy users (one prosumer and one consumer) are considered who intend for P2P trading and are customers of two different energy retailers, e.g., the prosumer and consumer are customers of energy retailer-1 and energy retailer-2 respectively. The tables demonstrate that prosumer and consumer conduct P2P trading in the LEM at prices different from BAU keeping daily supply charge, network fees, RET, and energy retailer-2's margin unchanged. Further, energy retailer-1 receives an additional margin to allow its prosumer to take part in the LEM.
The energy flow, cash flow and price signals of a cross energy retailer-facilitated LEM are displayed in Fig. 9, that indicates that a prosumer sells 1 kWh at 12.37 c (P2P energy price in the LEM). In contrast, 37.43 c is paid by the contracted consumer to buy 1 kWh. This brought amount includes P2P energy price (12.37 c), network fee (21.3 c), LEM platform cost (0.5 c), energy retailer-2 margin (1.50 c), energy retailer-1 margin (0.25 c), and taxes (1.5 c). All the money flow is organised through smart contracts and the transactions are securely stored in blockchain. LEM trading platform sends price signals and volume of energy to retailers for settlement. This case enables prosumer and consumers to gain 7.37 c and 0.74 c profit and saving in comparison with BAU respectively.

III. PROPOSED P2P TRADING FORMULATION IN THE LEM
In the proposed LEM strategy, some relevant assumptions are considered such as: 1) all energy users are connected at a single low-voltage (LV) distribution network; 2) while energy users without solar PVs and BESSs can participate as sole energy buyers, energy users' with either only solar PVs or both solar PVs and RBESSs can join in the LEM as both sellers and buyers; 3) sellers and buyers are directed to declare their preferred trading prices between FiT and ToU prices to receive maximum financial benefits through P2P trading in the LEM; 4) charged and discharged power of RBESSs are sold in the LEM once all solar PVs' power are sold; and 5) the CBESS helps in balance power in the LEM.
Let each feeder line of a typical LV distribution network be indexed by f ∈ F, where F refers to the set of all feeder lines. Assume this network has the total number of |K | energy users, k and K imply index of each energy user and the set of all energy users respectively. The sets of energy users who are sole energy users (without solar PVs and RBESSs), energy users with solar PVs, and energy users with both solar PVs and RBESSs are subsets of K .
Let solar PV power and demand of each energy user k ∈ K be symbolised by P pv k,f ,t and P dm k,f ,t respectively at any time t ∈ T . RBESS's self-charged and self-discharged power are indicated P cr k,f ,t and P dc k,f ,t , respectively. The net power status of each energy user k ∈ K is calculated as: where P cr k,f ,t and P dc k,f ,t signify each RBESS's charged and discharged power respectively. Note that P cr k,f ,t comprises both self-charged power P cr k,f ,t (sf ) and P2P-charged power P cr k,f ,t (pr). Similarly, P dc k,f ,t is the summation of selfdischarged power P dc k,f ,t (sf ) and P2P discharged P dc k,f ,t (pr). The excess power (after meeting self-power requirements) and insufficient power (after using self-generation) of each energy user k ∈ K are expressed as: In BAU, P cr k,f ,t (pr) , P dc k,f ,t (pr) = 0. As per (2) and (3) is imported from the network at the ToU price λ tu t . Assume a LEM structure, in which the indices of each seller and each buyer are denoted by x ∈ X ⊂ K and y ∈ Y ⊂ K , respectively. Sets X and Y are the sets of all sellers VOLUME 10, 2022 and all buyers respectively. A seller x can trade with multiple buyers in Y . Suppose y∈Y P lm x,f ,t (y) and y∈Y P dc x,f ,t (y) symbolise sold solar PV power and RBESS discharged power respectively by each seller x ∈ X in the LEM trading platform at time t and price λ lm x,t (y). Likewise, a buyer y can also trade with multiple sellers in X . Let x∈X P lm y,f ,t (x) to buy power from solar PV and RBESSs' discharge power and x∈X P cr y,f ,t (x) be bought power by each buyer y ∈ Y at time t and price λ lm y,t (x) at meet up load demand and charge its RBESS respectively.
The total earning β lm x,t of each seller x ∈ X by participating in the LEM is described as: where P cr x,f ,t (cs) denotes the power sold to charge the CBESS by each seller x at λ The total equivalent earning β bu x,t of each seller x ∈ X , if equivalent LEM quantities, i.e., both y∈Y P lm x,f ,t (y) and y∈Y P dc x,f ,t (y) = 0 (in BAU), are sold at λ ft t rate -as per BAU -is calculated as: Note that the second part of (4) and (5) are the same as they capture the power traded with the CBESS and power grid. However, the first part of (4) and (5) are the profit decider for each seller x, as they seek to trade in the LEM at a price higher than the FiT rate. In other words, λ lm x,t (y) > λ ft t . The total expense β lm y,t of each buyer y ∈ Y by participating in the LEM is written as: where P dc y,f ,t (cs) represents the power brought from the discharge of CBESS by each buyer y at λ tu t rate. Whereas the power brought from the power grid by each buyer y at λ tu t rate is represented by P tu y,f ,t . Note that if there are not enough sellers in X , a buyer y buys power first from the CBESS and then from the power grid at λ tu and λ ub t respectively. The LEM platform cost is indicated by λ lm t . Nonetheless, the total equivalent expense β bu y,t of each buyer y ∈ Y if equivalent LEM quantities, i.e., both x∈X P lm y,f ,t (x) and x∈X P cr y,f ,t (x) = 0 (in BAU), are brought at λ tu t (= λ eg t + λ tx t + λ rm t + λ um t ) -as per BAU -is written as: Note that the second part of (6) and (9) are the same as they capture the power traded with the CBESS and power grid. However, the first part of (6) and (9) are the saving decider for each buyer y, as they seek to trade in the LEM at a price cheaper than the ToU price. In other words, (λ lm y,t (x) + λ lm t + λ rl t + λ ul t ) < (λ eg t + λ tx t + λ rm t + λ um t ). The main objective of the proposed P2P trading-driven LEM is to provide sellers and buyers with profits and savings respectively so that they reduce their electricity costs in contrast to BAU. Note that at different time intervals, over the course of T, sellers can also play the role of buyers and vice versa depending upon the power status. Thus, electricity cost reduction can demonstrate the overall benefit.
The formulated objective function OF (defined for each seller x ∈ X and each buyer y ∈ Y ) along with all constraints (defined for the entire LEM) are illustrated as follows: x,t and β bu y,t − β lm y,t refer to profit and saving for each seller x and each buyer y at time t.
Subject to constraints illustrated in . P2P trading price constraints: λ lm (11)-(14) describe the price constraints for P2P trading in the LEM. Sellers and buyers are sorted according to minimum, and maximum declared prices (first) and maximum declared amounts (if necessary) in X and Y respectively. At each P2P trading slot t, P2P contract prices λ lm x,t (y) and (λ lm y,t (x) + λ lm t ) for each seller x ∈ X and buyer y ∈ Y are considered as in between the FiT and ToU (energy and tax components only) rates. The margins of the energy retailer and distribution utility are kept the same or above the BAU so as to encourage them to participate in the LEM. RBESS self-charging and self-discharging constraints: The RBESS constraints for charging and discharging are demonstrated in (15)(16)(17)(18). π k,f ,t represents the stateof-charge (SoC), which maintains the RBESS operation and is bounded by minimum and maximum SoCs π k,f ,t (min) and π k,f ,t (max) respectively. γ cr k and γ dc k refer to RBESS charging and discharging efficiencies respectively. RBESS self-charged power P cr k,f ,t (slf ) is bounded by minimum and maximum charging capacities α cr k,f (max) and α cr k,f (min) respectively. Similarly, RBESS self-discharged power P dc k,f ,t (slf ) is also bounded by minimum and maximum discharging capacities α dc k,f (max) and α dc k,f (min) at time length t. RBESS P2P-charging and P2P-discharging constraints: (19)-(21) explain RBESS charging constraints for P2P trading in the LEM platform. The RBESS P2P-charging order P cr k,f ,t (pr) in the LEM is bounded by the P2P-charging ratē α cr k,t and the power available to execute P2P-charging order P cr k,f ,t (av). P pv k,f (pk) implies peak time solar PV. In addition, RBESS discharging constraints for P2P trading in the LEM platform are depicted in (22)(23)(24). The RBESS P2P-discharging order P dc k,f ,t (pr) in the LEM is bounded by the P2P-discharging rateᾱ dc k,t and power available to execute P2P-discharging order P dc k,f ,t (av). P dm k,f (pk) refers to peak time load demand.
CBESS charging and discharging constraints: π cs,f ,t = π cs,f ,t−1 + (γ cr cs P cr cs,f ,t × t π cs,f ,t (min) ≤ π cs,f ,t ≤ π cs,f ,t (max) ; ∀t ∈ T (26) (25-28) represent CBESS charging and discharging constraints. The operation of CBESS is controlled by the SoC, which is bounded by minimum and maximum SoCs π cs,f ,t (min) and π cs,f ,t (max) respectively. γ cr cs and γ dc cs refer to CBESS charging and discharging efficiencies respectively. CBESS charged power P cr cs,f ,t = P cr x,f ,t (cs) is bounded by minimum and maximum charging capacities α cr cs,f (max) and α cr cs,f (min) respectively. Similarly, CBESS discharged power P dc cs,f ,t = P dc y,f ,t (cs) is also bounded by minimum and maximum discharging capacities α dc cs,f (max) and α dc cs,f (min) at time length t.
Local power balance constraints: If ideal case, The power balance constraints in the LEM are captured (29)(30)(31)(32)(33). In the LEM, the total power of the sellers should be equal to the total power of the buyer, i.e., P X f ,t = P Y f ,t as is shown in (31) to clear the market. However, it is an ideal case. If P X f ,t > P Y f ,t ; (P X f ,t − P Y f ,t ) is stored in the CBESS. Once the CBESS is full, but the entire excess power is not consumed, the rest of the power is exported into the network at the FiT rate. (32) illustrates this power balance case.
is satisfied via CBESS discharge first and from the power grid (once CBESS reaches the maximum discharge limit). This power equation is described in (33).
Power grid export and import constraints: The power grid export constraints are explained in (34) and (35). The total exported power of each seller x in the LEM is bounded by minimum and maximum limits P ep x,f ,t (min) and P ep x,f ,t (max) respectively. The total exported power of all sellers in the LEM is less than that of BAU, i.e., P X f ,t < k∈X ⊂K P ep k,f ,t . (36) and (37) demonstrate the power grid import constraints. The power grid imported power of each buyer y in the LEM is bounded by minimum and maximum limits P ip y,f ,t (min) and P ip y,f ,t (max) respectively. The total imported power of all buyers in the LEM is less than that of BAU, i.e., P Y f ,t < k∈Y ⊂K P ip k,f ,t . In the following sections (Section IV and Section V), the proposed LEM framework is split into three different models and rigorous case studies are presented for the performance analysis.

IV. CONSIDERED NETWORK MODELS
The proposed LEM architecture consists of 100 residential energy users including 60 consumers, 20 prosumers with solar PVs, and 20 prosumers with solar PVs and RBESSs in a single substation and distributed through two feeders. The capacity of the solar PV system is 6 kW per user and the installed size of RBESS is 12 kWh with a charger of 3.3 kW. A CBESS is considered at the substation level and has a capacity of 100 kWh with a charger of 50 kW. The case study used real world (randomly selected from AusGrid) 24 hours average load consumption and solar PV radiation data of 100 households from New South Wales (NSW) over one example summer day. The annual averaged profiles in Fig. 10 illustrate that load consumption is maximum during evening times and solar PVs generate maximum power during afternoon times.
In the LEM trading platform, the status of generation and load consumption are monitored and forecasted regularly. The energy users in the automated platform are capable to place their buy and sell orders within set limits to perform the merit order mechanism, and their results are processed through the RBESS control system to successfully complete the P2P trading. The main objectives of the P2P-assisted LEM platform are to minimise the electricity bills of energy users and maintain the margins for energy retailers and distribution utilities. In addition, it ensures the LEM development and applicability in the real world.

A. MODEL-A WITH A SINGLE ENERGY RETAILER
In the LEM model A, one single retailer (z = 1) is responsible for energy trading between seller and buyer and confirms that set margins are distributed among the distribution utility, trading platforms, upstream energy retailers (generators) and government bodies. The energy retailer ensures that all the energy users fulfil their energy requirement and get full benefit by either P2P trading (first preference) or BAU (once P2P trading is terminated) at different ToU intervals. Fig. 11 illustrates that one energy retailer manages the selling and buying requirements amongst 100 energy users connected in one LV distribution substation, where the first feeder has 80 energy users including consumers and prosumers with solar PVs, and the second feeder has 20 prosumers with solar PVs and RBESSs. Note that no CBESS is considered in model-A, i.e., P cr x,f ,t (cs) , P dc y,f ,t (cs) = 0.

B. MODEL-B WITH CROSS ENERGY RETAILER
In the LEM model-B, two energy retailers (z = 2) enable, the P2P energy trading between the sellers and the buyers and ensure that set margins are distributed among the distribution  utility, trading platforms, upstream energy retailers (generators) and government bodies. The energy retailer ensures that all the energy users fulfil their energy requirement and get full benefit by either P2P trading (first preference) or BAU (once P2P trading is terminated) at different ToU intervals. Fig. 12 illustrates that two energy retailers ensure the selling and buying requirements amongst 100 energy users connected in one LV distribution substation, where the first feeder has 80 energy users including consumers and prosumers with solar PVs and the second feeder has 20 prosumers with solar PVs and RBESSs. It is also evident that energy retailer-1 has all three types of energy users including consumers, prosumers with solar PVs, and prosumers with solar PVs and RBESSs, however, energy retailer-2 only has consumers. Note that no CBESS is considered in model-B, i.e., P cr x,f ,t (cs) , P dc y,f ,t (cs) = 0.

C. MODEL-C WITH CROSS ENERGY RETAILERS AND A CBESS
In the LEM model-C, two energy retailers (z = 2) facilitate the P2P energy trading between the sellers and the buyers. The distribution utility is assumed to own the CBESS, that is operational within a distribution substation through a separate feeder as seen in Fig. 13. The LEM platform and CBESS are administered by the distribution utility that allows energy users to perform P2P trading and excess energy is first utilised by the CBESS and then the residual is traded with the power grid. The LEM model has 100 energy users connected in one LV distribution substation, where the first feeder has 80 energy users including consumers and prosumers with solar PVs, the second feeder has 20 energy users with solar PVs and RBESSs. Besides, the CBESS is managed by a third feeder connected to the distribution substation. Note that CBESS is considered in model-C, i.e., P cr x,f ,t (cs) , P dc y,f ,t (cs) = 0

V. RESULTS AND ANALYSIS
In this section, the studied LEM models are simulated, where all the functional constraints; described in Section III; are solved through adopted market rules to obtain the main objectives which are to reduce the energy cost of the energy users, improve or maintain the margins for the distribution utility and energy retailers, and minimise the power grid congestion issues with the integration of RBESSs and the CBESS. In the case studies, blockchain technology is used for price flow within energy users. LEM platform stores securely bidding information and executes smart contracts for each energy user. Further, the results of LEM model-A, model-B and model-C are analysed in comparison with the existing BAU model [2] and also a brief comparative analysis among the studied models are carried out to rate the most suitable one in today's energy market.

A. LEM FRAMEWORK MODEL-A CASE STUDY
The average electricity cost reduction for consumers, prosumers with solar PVs, and prosumers with solar PVs and RBESSs are compared among an existing BAU model [71] and the proposed LEM model-A in Fig. 14. On average, P2P trading reduces the electricity costs of consumers; prosumers with solar PVs; and prosumers with solar PVs and RBESSs by 5.24 %; 13.58 %; and 21.04 %, respectively, compared to the BAU model. The rapid decrease in prosumer electricity cost can definitely encourage the energy users to invest in DERs and participate in the LEM platform as prosumers to earn maximum benefit. Fig. 15 (a) shows the BAU average daily load profile in kWh, where most of the load requirements are met by the power grid; and solar PVs and RBESSs contributions are  noticeable during afternoon and evening times, respectively. Fig. 15 (b) depicts that the amounts of energy bought from the power grid are decreased in the afternoon and evening due to P2P trading in the proposed LEM model-A. Particularly, more solar PVs perform P2P trading in the afternoon and RBESS-based trading (through discharging) are executed during the evening time.
A typical day export/import from/to the power grid is represented in Fig. 16 for the existing BAU and proposed LEM model-A. As is shown in Fig. 16, the proposed LEM model decreases the power grid export by 17.2 % due to RBESS charging and P2P trading during off-peak and shoulder times. Further, the power import from the power grid is reduced by 13.7 % because of RBESS discharging and P2P trading during peak demand times. That clearly justifies that solar  PVs'-and RBESSs'-empowered P2P trading can minimise the power grid congestion issue and improve the network selfsufficiency with local DERs. Fig. 17 portrays the energy retailer's margin for an existing BAU model and the proposed LEM model-A. The results highlight an increase in daily margin owing to the fact of an additional fee per P2P traded kWh as well as an increased P2P trading volume due to RBESSs' charging from other prosumers equipped with excessive solar PVs. On the other hand, the income of the distribution utility is displayed in Fig. 18, which clarifies that the distribution utility is not benefitted like the energy users in terms of daily income. However, importantly, P2P trading can significantly lead to the reduction of the capital expenditures and operational expenditures of the distribution utility.

B. LEM MODEL-B CASE STUDY
In LEM model-B, two energy retailers are integrated to manage the energy trading among energy users, and provide maximum opportunity to all of them to minimise their electricity expenditures. Fig. 19 shows that the reduction of electricity costs for consumers, prosumers with solar PVs, and prosumers with solar PVs and RBESSs are 8.54 %, 23.77 % and 51.46 %, respectively on average. The main reason for  the slight reduction in consumers' average electricity bill is due to the fact that most consumers (50 out of 60) are with energy retailer 2, who has higher prices during the shoulder period. Therefore, these consumers can offer higher buying prices compared to their peers under energy retailer-1 and are prioritised in merit order. Additionally, priority for P2P trading is given to the energy users who have largest investments on DERs in the LEM like prosumers with solar PVs and RBESSs. Therefore, the largest electricity cost cutback of prosumers can motivate other energy users to invest more in DERs. Huge reduction in electricity cost compared to LEM model-A is a result of high selling prices to consumers of energy retailer-2, who can offer up to 19 c/kWh for solar PV excess.
The average daily load consumption in the existing BAU model is shown in Fig. 20(a) and it is compared with LEM model-B (with proposed P2P trading) in Fig. 20(b). In the BAU model, most of the energy actually comes from the power grid during evening and night times, and excess solar PV generation is sold to the power grid at the FiT rate. In contrast, if P2P trading is performed in LEM model-B; the amounts of excess solar PV generation are traded with neighbouring energy users during afternoon and morning times that clearly cut down power imported/exported from/to the power grid.  Overall, as shown in Fig. 21, compared to the existing BAU model, the proposed LEM model-B reduces the energy export to the power grid by 16.7 % and energy import from the power grid by 12.9 % due to the RBESSs' charging during off-peak and shoulder periods, and their discharging during peak demand periods.
The margins for both energy retailers (energy retailer-1 and energy retailer-2) are captured in Fig. 22, where the margins are kept at or above BAU level. Energy retailer-1 has a set of consumers, prosumers with solar PVs, and prosumers with solar PVs and RBESSs. The daily margin increases by 4.1% due to an additional fee per kWh of P2P traded amount and an increased volume of RBESSs' charging via P2P at various ToU intervals. On the other hand, energy retailer-2  contains only consumers and retains its BAU margin in the proposed LEM model-B. This advocates that energy retailers serving more prosumers with solar PVs and RBESSs can achieve higher margins due to receiving an additional fee per kWh amount of P2P transaction sold from within their portfolio. Fig. 23 exhibits the distribution utility income for the proposed model-B that is increased marginally compared to the existing BAU model because of the enhanced P2P trading volume for RBESSs' charging during afternoon times. The income margin of the distribution utility due to P2P trading is impacted to a little extent. However, the LEM can reduce the problems that the distribution utility is experiencing due to higher DERs' penetration into the power grid. Further, the proposed LEM can bring down the network operational and capital expenditures. Eventually, it can encourage the distribution utility to permit more prosumers with solar PVs and RBESSs to participate in the LEM and get the opportunity to make more profits.

C. LEM MODEL-C CASE STUDY
In LEM model-C, two energy retailers are considered with a CBESS managed by the distribution utility and connected at a third feeder. When the energy users participate in the LEM and perform P2P trading, their electricity expenses compared to the existing BAU model are provided in Fig. 24. The average electricity bill reduction percentages for consumers, prosumers with solar PVs, and prosumers with solar PVs and RBESSs with two energy retailers given in Table 4, which suggests they lower their expenses by 9.68 %, 29.87 %, and 53.81 %, respectively. Similar to LEM model-A and LEM model-B, prosumers with solar PVs and RBESSs are the winners in the LEM model-C with proposed P2P trading when it comes to diminishing energy expenditures. An average daily load profile in BAU is shown in Fig. 25(a), where energy bought from the energy network fulfils most portions of the load requirement, that includes the discharge from the CBESS in the evenings. Rest of the portions are fulfilled by solar PVs' supply and RBESSs' discharged during afternoon and evening periods. Fig. 25(b), on the contrary, depicts the daily load profile in the LEM model-C with proposed P2P trading, where energy bought from the power grid (apart from the CBESS) is reduced substantially and most of the load requirements are met by internal solar PVs and RBESSs by means of P2P. It is also manifest that a bulk part of P2P trading is conducted by prosumers with solar PVs, while some portion is executed by prosumers with solar PVs and RBESSs. Fig. 26 displays power import and export caused by the LEM model-C with proposed P2P trading and compares these with the BAU (with CBESS) results. It is presented that the proposed LEM model-C lessens the power grid export by 55.2 % due to charging of RBESSs controlled by the P2P trading during off-peak and shoulder times. The import from the power grid also declines by 20.6 % owing to discharging of RBESSs with the help of P2P trading during peak times. These results emphasise that integration of CBESS with the LEM framework significantly drives away the power grid congestion, e.g., 220.93 % and 230.53 % more reduction in  export compared to LEM model-A and LEM model-B respectively; and 50.36 % and 56.20 % more reduction in import compared to LEM model-A and LEM model-B respectively, and effectively controls the power grid problem of import and export.
The energy retailers' margins are laid out in Fig. 27 for the BAU (with CBESS) and LEM model-C with proposed P2P trading. Energy retailer-1 income margin from the trading group grows by 5% as a function of P2P traded volume due to the fact of RBESSs' and CBESSs' charging/discharging from/to neighbouring energy users. However, energy retailer-2 consists of a set of sole consumers that causes it to retain the income margin for every kWh traded within the LEM (instead of buying the same amount from the power grid). The results  point out the uniform fact, as seen in LEM model-A and LEM model-B, that an energy retailer with more prosumers and enlarged P2P trading volume is awarded with greater income margins.
The daily income margin of the distribution utility is found to be marginal in the proposed LEM model-C in contrast with the BAU model as shown in Fig. 28, and it does not receive larger income margins compared to energy users like LEM model-A and LEM model-B. However, LEM model-C with proposed P2P trading helps the distribution utility curtail the detrimental repercussions of unregulated local DERs' penetrations through P2P trading and scales down the power grid's operational and capital expenditures.

VI. CONCLUSION
In this paper, a hoarded case study on multifarious entities in Australia; that include residential energy users, energy retailers, and the distribution utility, has been demonstrated to validate the proposed P2P trading-enabled LEM framework assumed to be operated by the blockchain technology. This article has started with a brief explanation on contemporary literature focusing on the advent of P2P trading in the LEM followed by its architecture, retailers' model for trading, and blockchain structure. The proposed P2P trading settlement in the LEM has then been described in detail that guarantees all energy users' notable cost reduction in contrast with the existing BAU model while ascertaining the appropriate adoptions of RBESSs' and the CBESS to balance local supply and demand, and cutback power grid's export and import remarkably. Further, the income margins of both energy retailers and the distribution utility have been kept the same or above as the BAU model to include them in the proposed LEM mechanism. Lastly, assorted case studies, through desktop simulation, have been presented to authenticate the performance of the proposed P2P trading-based LEM framework under three different models labelled as LEM model-A, LEM model-B, and LEM model-C respectively. The simulation results have stressed the following key findings compared to the existing BAU model: • All three types of energy users, including consumers (without solar PVs and RBESSs); prosumers with solar PVs and prosumers with solar PVs and RBESS, have been able to minimise their energy costs in comparison with their existing billing system. This verifies the energy users-centric feature of the proposed P2P trading-facilitated LEM strategy.
• Although consumers have received some monetary gains without investing anything on local DERs, it is the prosumers with solar PVs and RBESSs who have been incentivised the most due to the negotiable usage of their RBESSs whenever required, leading to a fact of investing more on local DERs.
• The export/import to/from the power grid has been found to be reduced substantially because of the effective operation of multiple RBESS (via P2P) and the CBESS, resulting in improving network self-sufficiency with local DERs and trimming away the congestion issue.
• The margins of energy retailers have been retained the same, but it has been observed that they can escalate their margins by allowing their customers -who have solar PVs and RBESSs -to participate more in the proposed P2P trading framework, and contributing towards lowering the dropout of installing the local DERs rate.
• The margins of the distribution utility have been retained or raised slightly by the proposed P2P-enabled LEM mechanism, confirming their portions to spur their vigorous participation. On top of it, they can avoid outstanding expenditures on capital and operation required to maintain the network assets.
Future work will focus on extending the proposed LEM model by incorporating real-time operations of P2P trading using state-of-the-art techniques like blockchain based tokenomics and synthetic intelligence. Further, accurate forecasting and dynamic physical network constraints can be incorporated in the LEM platform to extend the proposed P2P trading model. He 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 Sales at Perth Energy and Senior Advisor 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, in 2002, the two post-graduate diplomas in sustainability with a Master's degree at the University of Cambridge, and the Ph.D. degree from Curtin University, Perth, in 2017. She returned to Australia in 2013. Her research looked at environmental risks in corporate ratings for the mining and oil and gas sectors globally. Her research interests include disruptive innovation, stranded assets, renewable energy and energy storage for housing, and prefabricated modular building systems. She is a Chairman and co-founder of Power ledger, a technology company that uses block chain to facilitate energy tracking, 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, London. She set up the first fossil fuel-free pension fund and has sat on numerous boards championing sustainable business such as Carbon Tracker and Climate-KIC Australia. In 2016, Power ledger won Sir Richard Branson's Extreme Tech Challenge. In 2018, she was made EY Fintech Entrepreneur of the Year.
S. M. MUYEEN (Senior Member, IEEE) received the B.Sc. degree in electrical and electronic engineering from the Rajshahi University of Engineering and Technology (RUET), formerly known as the Rajshahi Institute of Technology, Bangladesh, in 2000, and the M.Eng. and Ph.D. degrees in electrical and electronic engineering from the Kitami Institute of Technology, Japan, in 2005 and 2008, respectively. He is currently working as a Full Professor with the Department of Electrical Engineering, Qatar University. He has published more than 250 articles in different journals and international conferences, and seven books as the author or an 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 is serving as an Editor/Associate Editor for many prestigious journals from IEEE, IET, and other publishers, including IEEE IEEE TRANSACTIONS ON ENERGY CONVERSION, IEEE POWER ENGINEERING LETTERS, IET Renewable Power Generation, and IET Generation, Transmission & Distribution. He has been a keynote speaker and an invited speaker at many international conferences, workshops, and universities. VOLUME 10, 2022