1. Overview and General Information about P2P-ET
The existing literature on P2P-ET is extensive and it has enabled the conception of innovative solutions combining key aspects, technologies, and different interaction layers present in P2P-ET. Information about the energy evolution and explanation of P2P-ET models from a theoretical point of view is analysed by Giotitsas et al. 
, providing three different types of P2P-ET networks. Moreover, a design of an ideal P2P-ET model within a social context is developed backed up on the principle of commons-based peer production. Abdella et al. 
presented a comprehensive survey of existing demand response optimization models, power routing devices, and power routing algorithms from the perspective of MGs. It provides furthermore a listing of challenges and enabling technologies for future P2P-ET. A clear definition of P2P-ET with its potential impacts on the actual power system, key factors for deployment, and a worldwide list of project trials is presented in 
, contributing also a checklist that resumes the most important requirements for implementation of P2P-ET, namely: technical requirements, policies needed, regulatory requirements and stakeholder roles and responsibilities. A complete overview of P2P-ET can be found in the literature review paper 
, displaying a summary and classification of journal papers, research projects, industrial projects, and a thorough review of key aspects concerning P2P-ET. The authors provided also a scheme with the possible market structures in which P2P-ET can be installed. Tushar et al. in 
provided an overview of the use of game-theory approaches for different P2P-ET structures as a feasible and effective means of energy management, providing a classification of literature that applies game-theoretic approaches.
resumes a grouping of the literature researched with a focus on the theoretical aspects and test case studies of P2P-ET. The aspects considered for the classification of literature are based on sources 
and are the following: P2P-ET market design, P2P/P2G (Peer-to-grid) market design, P2P-ET sector coupling design, Physical and Virtual Layer, social, policy, and legal perspectives. Specifically, the P2P/P2G market design and P2P-ET on sector coupling categories have not been considered as classification categories in the researched literature, to the best of researchers' knowledge. P2G is defined in this context as the ability to exchange electricity between interconnected MGs and, additionally, with an upper grid if the interconnection exists. Additionally, research papers on political and legal aspects are considered, although it is not deeply discussed in this research, as it widely differs for each country. Note that several studies may cover more than one aspect.
Table 1. Cluster of papers with a focus on theoretical perspectives.
Besides providing an overview of P2P-ET market designs, several papers provide test case studies to evaluate results more accurately. Indeed, Ref. 
proposed a reference test case on an Institute of Electrical and Electronics Engineers (IEEE) 14 bus-network to present realistic results of three P2P-ET market designs (Full, Community and Hybrid). In 
the authors presented a theoretical review of two centralised P2P-ET designs: bilateral contract-based and auction-based trading mechanisms. It also provided an evaluation of direct trading market designs and possible new actors. In 
a novel concept bringing together P2P-ET transactions and VPPs is presented. This new system is called Federated Power Plants and aims to encourage prosumers to participate in the upstream electricity market. Ref. 
proposes a scalable option for a P2P-ET market applying bilateral contracts between prosumers, suppliers (intermediary), and generators (fuel-based), introducing forward and real-time markets. Ref. 
proposes a multi-class energy management P2P-ET platform, which considered three energy classes (green, subsidized, and grid) along with three different types of prosumers (green, philanthropic, and low-income household), that can trade energy with each other and with the wholesale electricity market. Ref. 
presents a distributed system operator (DSO) pricing strategy based on locational marginal pricing for a distribution network of 57 prosumers divided consequently into two P2P-ET platforms. Finally and in line with previous papers, Ref. 
showed an overview of different business models that P2P-ET can support and reviews the mathematical frameworks that have been proposed for designing P2P-ET and other prosumer-centric energy markets. Ref. 
, the authors considered a distribution network with a central generator and prosumers employing a canonical coalition game to study the prosumers’ behaviour. Ref. 
, they extended their previous work by applying a cooperative Stackelberg game to the same network scheme doubling the number of players and implementing an auction-based price mechanism.
A series of innovative market designs and optimization mathematical frameworks have been proposed. The authors from 
proposed an algorithm to cluster prosumers that can balance their energy needs into the new concept of virtual MGs. A localized event-driven market, i.e., due to seasonality and hours with maximum solar energy generation, with a not-so-common reinforcement learning technique is presented in 
. As an extension of previous work, a deep reinforcement learning technique denominating deep Q-networks is used to model automatic P2P energy trading using an adapted algorithm from the stock exchange and a Long Short-Term Delayed Reward system 
. Under the topic of DLTs applied to the energy field, a novel proposal of Blockchain ET under demurrage and “Enertoks” as a cryptocurrency utilizing Mixed Complementary Problems and game theory for the simulation is presented in 
. Additionally, in line with past work, an incentive mechanism based on the usage of a virtual currency “NRG-X-Change”, a game-theory model under a Nash Equilibrium is presented in 
. A two-layer multi-agent system-based model with Blockchain for test case study modelling 50 to 300 participants is modelled with the Matlab optimization tool in 
. A Stackelberg game and power flow analysis in a community-based case study, furthermore, with the estimation of a distribution system usage fee charged for P2P-ET transactions is presented in 
. In the network of California, USA, an algorithm for clustering prosumers and consumers based on the flocking behaviour of birds, so they trade electricity in a direct trading market design, as proposed in 
On the other hand, there are proposals with an emphasis on how the flexibility of BSSs can improve a P2P-ET market design. Lüth et al. assess two different market designs to encourage P2P-ET and BSS as flexibilities, either owned privately or by a community. Moreover evaluates the possible market outcome in two different cases 
. Nguyen et al. demonstrate, through a mixed integer linear programming method, how peers can gain higher economic savings by optimizing photovoltaic (PV) generation with BSS 
. Guerrero et al. present two P2P trading scenarios for an SG system applied to a low-voltage radial distribution network that considers prosumers with private BSS as well as a bigger community BSS. It demonstrates that, in general, there is an overall market benefit for both scenarios 
. Bjarghov et al., propose a market design for trading capacity in a P2P-ET way for a small test case sample for Norway, composed of four prosumers with two of them owning a BSS 
. Zepter et al., introduce and modelled a proposed trading platform, namely, “Smart elecTricity Exchange Platform (STEP)”, that integrates a group of residential buildings equipped with BSSs, i.e., sonnenBatterie, into the wholesale market 
In line with the MG concept, P2P-ET enables peer-to-grid energy trading models, in which a prosumer’s MG can trade electricity with an upstream main grid or another MG 
. Paper 
proposed a clarifying four-system layer design for P2P-ET within a grid-connected low voltage MG using the virtual platform “Elecbay”. An energy-sharing market proposal for an interconnected MG of PV prosumers through an intermediary can be found in 
. Another P2P—P2G market structure is presented by Paudel A. et al. 
in a prosumer MG interconnected with bidirectional communication and power lines between its participants. Papers 
present a game theoretic constrained non-linear programming approach respectively analyzing and comparing several price mechanisms and size of community for an interconnected MG performing P2P and P2G transactions. A Korean test case study for three different MGs performing P2P—P2G transactions using the market clearing price signal is analyzed in 
. Dudkina E. et al. in 
presented a pure P2G power flow optimization problem for two remote villages physically interconnected between each other.
A few papers that addressed P2P-ET market designs on sector coupling were also clustered within this research. The cooperation between residential and commercial peers in Germany, with more than 18,000 participants, is analysed by Wanapinit and Thomsen in 
, employing cooperative games theory in a mixed integer linear programming model, they evaluated the effects of total reduced costs, electricity imports, and total emissions. Similar to the previous paper, 
studied a P2P-ET network composed of 2000 residential prosumers and a commercial prosumer business area in Shangai, who can trade electrical energy as well as heating energy. The network is modelled under a Nash non-cooperative game and mixed integer linear programming method model. In 
, the impact of P2P-ET in the transport sector and the electrical grid is evaluated in Belgium using a predictive model and quadratic problem formulation, classifying drivers based on their daily driving activity. P2P-ET between charging and discharging plug-in hybrid EVs in the USA is studied in 
, proposing a consortium blockchain based on aggregators, that allow electricity trading, and an iterative double auction price mechanism.
More papers focusing on the physical and virtual layer of P2P-ET can be found in the literature since these are key aspects of its implementation. A classification of the current literature that assesses the different challenges encountered in the virtual and physical layer of P2P-ET structures with its respective discussion is conveyed in 
. Ref. 
overviews the blockchain applicability in the energy sector looking at its opportunities and risks of it and assessing socio-technical aspects. Ref. 
develops a home energy management systems communication scheme to exchange information and trace possible energy mismatch information. Ref. 
focuses on the physical layer and summarized studies that assess probable avoidable grid costs in different voltage levels through local electricity markets (LEMs). A proposed energy blockchain trading framework with a payment scheme and optimal pricing strategy utilizing game theory is found in 
. An integration and prototype implementation of blockchain technology for a decentralised P2P-ET system that enables anonymity in price negotiation and security in transactions is proposed in 
. A detailed discussion and performance analysis of the structured and unstructured P2P-ET architectural models for energy trading is carried out in 
. A proposal of a secure and private energy trading based on blockchain and IIoT system considered for nodes with the ability of energy storage is made in 
. Power flow modelling is employed for different nodes in a distribution network in 
, consequently, a framework for allocating losses is proposed to balance physical energy trades and financial transactions. Based on the Smart Grid Architecture Model (SGAM) 
, a proposed blockchain-based mathematical model for the P2P-ET considering physical network constraints in SG is presented in 
. The creation of a business model consisting of a P2P electricity trading platform, a marketplace for PV equipment and related services, and a platform for funding solar energy investments are done by 
A series of papers overviewing and evaluating social aspects such as the general willingness to pay and to participate in P2P-ET were also clustered. Reuter and Look 
conveyed a survey in four different European countries with a total sample of 830, in which 78% of participants are in favour of participating in P2P-ET concepts. Participants also stated that, overall, the environment and economic aspects are the main motivations for jumping into P2P-ET. In papers 
, survey-based studies are employed in a total sample of 400 participants. The studies depicted several autarkies and P2P-ET scenarios for household, neighbourhood, and small-town situations. A positive indication of the participation rate in P2P-ET is concluded from the results, as selling and buying prices for P2P-ET electricity indicated by surveyees are below the average market price of 28 ct€/kWh (Stand 2017). Mengelkamp, E. presented a series of papers that evaluate several social aspects regarding LEM. Ref. 
an agent-based model is employed in which a cluster of prosumers and consumers are modelled and evaluated on how much electricity is traded from the grid and the LEM. Ref. 
develops a structural equation model tested via the partial least squares method for analyzing a survey and determined the most important factors that participants consider for going into P2P-ET. Finally, in 
, an adaptative choice-based conjoint analysis is used for a regional (Allgäu, Germany) and a country-wide (whole Germany) survey to quantify the willingness to participate in LEMs. Hackbarth and Loebbe in their study 
evaluated consumer and prosumer preferences related to P2P-ET through hierarchical multiple regression analysis of a survey from 4148 participants. Ref. 
employs a multilevel model for clustering different types of prosumers who own a PV-system combined with BSS and determined the probability of entering into P2P-ET as a function of the BSS’s state of charge and possible LEM prices. Ref. 
evaluates the behaviour of participants in the “Quartierstrom” pilot project collecting quantitative and qualitative data and analyzing them via third-party tools, such as Google analytics and Inspectlet. Singh et al. in 
presented a multi-method ethnographic study to analyze energy exchanges within remote rural villages located in India, where all the data was collected via participant observation, interviews, and field notes by an ethnographer.
As mentioned before, although the political and legal aspects related to P2P-ET are out of the scope of this research, a cluster of papers for both categories is carried out. Several of the addressed studies for social aspects (e.g., 
) give insights into political strategies for implementing and disseminating P2P-ET. Concerning legal aspects, the studies 
address the current legal framework and how it may affect P2P-ET implementation and market penetration.
Table 2 resumes the researched literature that focuses on demonstrators, actual companies, research, and pilot projects worldwide that work already (or enable) P2P-ET in every aspect. As in Table 1, it is noted that a study can board more than one type of P2P-ET demonstrator.
Table 2. Cluster of literature focused on P2P-ET demonstrators.
An extended collection of research projects is presented in 
. The study 
compares some of the major P2P-ET cases being promoted worldwide, reviewing, and analysing the potential development, future challenges, and the profit structure of each company. In source 
, a more extended list of P2P-ET projects with their respective comparison is presented as well, providing a possible future scenario of P2P-ET. A complete detailed list of P2P-ET platforms enabling local trades and specified for the following regions: Germany, Europe, and the rest of the world are presented and discussed in 
. Source 
provides an overview of P2P-ET-related research and development projects worldwide, as well as, a list of start-ups that emerged from research projects and that cover the physical and virtual layer of P2P-ET. The design of a seven-component MG market is presented in 
and applied to evaluate the famous Brooklyn MG project 
. Applying the SGAM 
, the case study Landau Microgrid Project (LAMP) 
is designed and evaluated in 
. Defined in the framework of the NEMoGrid 
project, different types of P2P-ET business models and other important factors such as new actors in the market and the formulation of the objective function in a proposed business model are described by Barbara Antonioli in 
A group of literature proposing evaluation methods for P2P-ET aspects, structures, price mechanisms, and pilot projects has been also summarized as part of researchers' research. Abdela, Tari et al. In 
, authors evaluate the effectiveness of blockchain in P2P energy trading systems by defining some performance metrics. They integrated three different types of energy markets in one unified energy trading model and one single payment model. Zhou, Wu, et al. in 
present an evaluation method employing agent-based simulation to compare the performance of different P2P-ET models under different pricing mechanisms. The evaluation indexes are divided into economic and technical.
2. Market Design
Several authors 
have defined three different types of markets in the P2P-ET, the main difference between them being the degree of decentralization. A more detailed description of each type of market will be discussed in the following sections.
2.1. Centralised Energy Market
An energy market can be composed of consumers, producers or prosumers, and a third entity. In the so-called centralised energy market, there is a third entity which has an active role. It coordinates and controls the energy trading and fixes the price. In this market, the architecture relies on the presence of a central entity that acts as a supervisor, coordinating electricity trading between agents involved in the negotiations 
. There is no direct connection between the production and the consumption block, meaning that buyers and sellers remain anonymous. Literature review shows that in most cases consumers do not have the option to choose the technology, the price, or the producer by themselves, but is the third entity that makes these decisions. The main advantage of this market type is that the overall economy can be maximised due to centralised control 
. The coordinator distributes the revenues depending on predefined contracts 
Several studies are reported in the literature to address this type of market. In 
, authors proposed a fully centralized P2P-ET market under a supply-demand ratio pricing mechanism, where an energy-sharing coordinator controls the participants’ DER and performs contracts with each participant. Ref. 
presents a centralised energy market where prosumers are clustered into virtual microgrids (VMGs) to participate in the market as a single entity and optimize the benefits of all participants. With the idea that VMGs participate in an organized manner with the upper electricity market, the introduction of the virtual MG aggregator role is proposed. The results of the case study show a cost reduction. Denysiuk, et al. In 
, authors developed a market mechanism designed to incentivize the production and self-consumption of renewable energies produced locally. The main characteristic of this project is the assumption that the agents act in their self-interest when optimizing energy usage.
Another research project is LAMP 
, which currently runs on a centralized basis operated by the local energy utility company. Here a merit order market mechanism is employed to allocate PV and CHP generation within a small neighbourhood. In this case, consumers and prosumers can use an app that allows them to set their price expectations. Energy trading on the local trading platform is made through automatic agents. Furthermore, the project assesses the suitability of a blockchain-based local energy market 
Other significant projects from companies are Sonnen 
, Badische-Energie-Servicegesellschaft 
, and LichtBlick Swarm Energy 
. Sonnen provides the SonnenFlat electricity tariff, which is only for customers who own the sonnenBaterie, which is digitally networked in the sonnenCommunity to form a VPP. Thus, it helps in a completely new way to keep the power grid stable. It is considered a closed community since only prosumers with batteries from Sonnen can participate in it. Furthermore, the company has full control of the energy devices and is then responsible for setting the price.
In this market configuration, third entities are not directly involved in the control or management of the energy flow, meaning that they cannot control DER. A third entity could be optional for peers, would that be the case, then it has a passive role as a service provider, for example, for billing or invoicing. Peers interact directly between them performing an optimal multi-bilateral transaction to sell or purchase electricity without centralised supervision 
. The main advantage of this market structure is that prosumers can fully control their devices and privacy is not an issue because the participants decide which information to share. However, the efficiency is lower due to the lack of centralised coordination and the overall economy is not maximised. Most case studies use blockchain-based smart contracts for tracing the quantity of electricity traded and the financial transactions. A token-based transaction mechanism could be further established for realizing financial transactions.
There is a wide choice of direct trading study cases available in the literature. Ref. 
formulatesa P2P-ET electricity market based on Multi-Bilateral trading and product differentiation, for example, based on consumer preferences. This model structure does not need a central agent and there is only a limited exchange of information. Ref. 
employs a decentralized approach based on the alternating direction method of multipliers to attribute the costs through exogenous network charges in different ways: uniformly, based on the electrical grid distances, and by zones. In this variety of ways, the main grid physical and regulatory configurations are covered. Ref. 
develops a decentralised energy trading platform that consists of two layers, namely market, and blockchain. The market layer provides privacy and a near-optimally efficient market solution for the participants. On the other hand, blockchain guarantees a high level of automation, security, and smart contracts. Ref. 
develops a decentralised P2P-ET model using blockchain. This model allows the market members to interact with each other and trade energy without involving any third party and proposed three different smart contracts: the main smart contract, the P2P-ET smart contract, and the P2G smart contract. The first one proves the participant’s status, stores the important data, and allows him to take part in the LEM. The second one is responsible for the local trading of the market and the last contract is responsible for the electricity exchange between the prosumers and the grid in the case of electricity shortage in LEM. Ref. 
presents a model for a decentralised P2P-ET marketplace for energy trading between autonomous agents using DLT. The model combines different emerging technologies, which allow for the provision of a dynamic, scalable, and sustainable Multi-Agent System. This protects the security of peers during data collection, trading, and billing.
The Brooklyn MG 
is a successful pilot project that follows the decentralised market approach. As mentioned before, Ref. 
established seven components for the efficient design and operation of blockchain-based MG energy markets to locally trade distributed generation. Thus, a construct to evaluate the case study of Brooklyn MG is developed, concluding that this project fulfils three components (MG Setup, grid connection, and the information system), partially fulfils three components (energy management trading system, market, and pricing mechanism) and does not yet fulfil the legal environment component 
There are already some companies that try to follow the approach of the direct trading P2P-ET market. Enyway, which, at the beginning of the year 2022 ceased operations 
and Lition, which ceased operations in 2021 
in Germany were two examples. Enyway offered a platform that prosumers could use for posting their ads to sell their self-produced energy. Hence, producers could freely set the price for their energy. At the same time, consumers had the opportunity to choose the producer. However, as a consumer, a monthly fee had to be paid. In the case that the producer chosen could not supply the required energy, the producer bought certified electricity. The platform also took responsibility for the electricity invoice and customer service. Lition runs on the open-source Ethereum blockchain via smart contracts. This company gives the option of choosing the producer and the price is set by the producer itself too. Nevertheless, Lition earns half of the price that the producers offer. One special condition of this company is that all producers must sell in direct marketing and have at least an output of 100kWp.
The distributed energy market is the combination of the two energy market concepts explained above. In this energy market model, the third entity influences peers indirectly by sending pricing signals 
. However, unlike the centralized market, the third entity is not able to control the energy systems. In other words, the platform or third entity cannot directly control the export and import of energy from the different prosumers within the market 
. Thus, in a distributed energy market model, the information is normally shared with the third entity and only a limited amount of information is needed. Subsequently, privacy is not a big issue in this model.
As well as the other described market structures, it can be found several proposals of theoretical case studies. Ref. 
proposesa market mechanism that provides additional options for peers who have the willingness to occasionally participate in the retail electricity market. This trading mechanism will introduce the figure of an energy broker, whose goal is to facilitate the market operation. Ref. 
introduces an intermediary agent that allows electricity trading between the prosumers and the wholesale market. It is considered that the intermediary agent adapts the price considering the prosumer electricity demand and the wholesale market price, seeking social welfare and satisfying network constraints and privacy constraints of LEM participants.
Currently, some companies offer this service. PowerPeers 
, Talmarkt 
, and RegionalStrom Soest 
are examples in Europe. Powerpeers promises the highest remuneration for PV electricity in the Netherlands, including electricity from wind farms in their energy mix. Consumers can select different sources to create their energy mix in this case. PowerPeers offers two options: a platform service for consumers and one for businesses. The electricity from prosumers is rather bought by the platform than the consumer directly. Talmarkt 
offers a platform where you can create your energy mix and every 15 minutes you are allowed to change it. The mix is based on solar, wind, and hydropower energy and the consumer can choose which producer or producers will deliver to them the energy, as well as, the price. In a similar way to previous options, the municipal utility company RegionalStrom Soest 
offers an online marketplace in which the end customer can choose its energy mix. Energy carriers offered in the platform are based on solar PV, wind farms, biogas facilities, and CHP, and residual electricity needs are covered by hydro-power plants.
3. Distributed Ledger Technology
Keeping transaction records is an integral part of electricity trading, as with any kind of trading. Distributed ledger technologies (DLT), which include Blockchain, resonate well with peer-to-peer trading due to their distributed and bilateral natures. In general, DLT refers to shared and distributed databases that digitally store transactions without a central authority 
. Given that records are kept by multiple nodes, e.g., participants, DLT can be more secure than the conventional central ledger system 
. Via the integration of smart contracts, DLT can evolve into a comprehensive interface between metering systems, appliances, and transactions 
. Many research projects and start-ups in the energy sector place their focus on combining the DLT with the P2P-ET concepts 
. Furthermore, several authors propose different architectures of DLT that can be implemented successfully in energy trading 
By providing decentralised interfaces and systems, blockchains can play an important role in this transition, offering an alternative to the current form of energy market organisation 
It should be noted that the application of distributed ledgers in energy trading is unproven. That is, while applications in localized parts may exist, the scalability and viability of system-wide applications are subject to further investigations. Existing regulations may also hinder the adoption of DLT, which needs to be revised 
. Concretely, it is to be investigated if a distributed ledger in energy trading applications would be superior to a conventional centralized ledger in terms of transaction efficiency, transparency, and security. To most (grid-connected) customers, production and consumption are monitored by other market actors, e.g., grid operators or balancing responsible parties. This also raises the question of it additionally distributed record-keeping is necessary.
4. Pricing Mechanisms
P2P-ET has encouraged research on novel price mechanisms since feed-in tariffs (FiTs) schemes are already expiring in several countries 
In the context of local energy trading, pricing mechanisms refer to means of allocating costs and benefits among the participants. Under this definition, payments may be based on pre-determined per kWh prices, a share of the total costs at the end of payment periods, or a fixed payment regardless of the volume of consumption, i.e., the energy as a service tariff model. Depending on the market setup, the allocation of costs may be determined before or after the delivery.
In the literature, existing pricing mechanisms designed for cooperative energy sharing include bill sharing, mid-market-rate (MMR) 
, and supply-demand-ratio (SDR) 
. These mechanisms are originally proposed for the cost allocation in microgrids with variable renewable electricity generation. The principle of bill sharing is that all participants are on equal terms, and therefore should bear the same costs or prices for their consumption or generation. Figure 1
depicts the MMR and SDR prices. Under MMR, the common price is the average of the feed-in price and the electricity retail price, i.e., the minimum revenues of selling to the utility and the maximum purchasing price of buying from the utility, respectively. However, this mechanism does not consider the scarcity of supply within the local systems; therefore, they fail to signal if additional investments are needed (For example, one of the functions of the wholesale electricity prices is to incentive new investments. This is achieved as high market prices also signify the supply scarcity 
). The SDR is set to resolve this by dynamically adjusting the prices between these two price points. That is, during periods of high local generation, the prices are closer to the feed-in price. Both mechanisms are relatively simple to comprehend and implement; however, they have some notable drawbacks, namely, they assume that participants are similar in terms of technical potentials and behaviours, and they do not consider the flexibility, nor individual preferences of participants.
Figure 1. Electricity buying and selling prices within a microgrid according to the MMR and SDR pricing mechanisms.
In market-based mechanisms, in which transactions are regulated by a market, prices may be determined directly by the participants, e.g., pay-as-bid, or indirectly via a common price set by an agreed-upon algorithm, e.g., merit order. These market-based mechanisms imply that participants compete with each other to increase their benefits. Theoretically, this competitive behaviour should maximize the total welfare. In reality, certain participants may exercise their market power to manipulate the prices, which results in sub-optimal outcomes. Ultimately, the choice of price mechanisms must balance various aspects, e.g., economic efficiency, transparency, and social acceptance including the principle of the local energy community.