State-of-the-art analysis and perspectives for peer-to-peer energy trading

As a promising solution to address the “energy trilemma” confronting human society, peer-to-peer (P2P) energy trading has emerged and rapidly developed in recent years. When carrying out P2P energy trading, customers with distributed energy resources (DERs) are able to directly trade and share energy with each other. This paper summarizes and analyzes the global development of P2P energy trading based on a comprehensive review of related academic papers, research projects, and industrial practice. Key aspects in P2P energy trading are identified and discussed, including market design, trading platforms, physical infrastructure and information and communication technology (ICT) infrastructure, social science perspectives, and policy. For each key aspect, existing research and practice are critically reviewed and insights for future development are presented. Comprehensive concluding remarks are provided at the end, summarizing the major findings and perspectives of this paper. P2P energy trading is a growing field with great potential and opportunities for both academia and industry across the world.


Introduction
The "energy trilemma" is one of the core issues confronting modern human society. It includes three vital yet sometimes conflicting objectives: environmental sustainability, energy equity, and energy security [1]. All three objectives must be achieved during the development of the economy and society. As a result, an unprecedented energy revolution is ongoing globally, and around 2 trillion USD are estimated to be invested globally in energy infrastructure every year [2]. Potential solutions to the energy trilemma can be categorized as aiming in two directions. One direction involves creating even larger interconnected energy systems to dispatch resources on a regional, national, or even global level. For example, numerous efforts in this direction have been conducted by the Global Energy Interconnection Development and Cooperation Organization (GEIDCO) [3]. The other direction is to develop localized solutions, such as smart local energy systems, to create self-managed and robust cells for larger energy systems [4]. Experts believe that no single solution will be the "silver bullet" to solve the energy trilemma [5]; rather, a whole-system approach is More than 30 journal papers were reviewed in order to depict the global picture of academic research on P2P energy trading. "Peer-to-peer," "energy trading," "energy sharing," and their combinations were used as keywords to search in the IEEE Xplore, ScienceDirect, MDPI, and Springer databases. The papers were then manually checked and filtered by the authors, by reading the title, keywords, and abstracts, in order to select those directly related to P2P energy trading. Only journal papers were selected to be reviewed in this paper, considering the enormous quantity of conference papers and the fact that many conference papers have been or will be further developed as journal papers. The statistics by year, by country, and by research focus are illustrated in Figs. 1-3. For detailed information on the surveyed papers, refer to Table S1.     11, which is more than half the total number in 2018. Therefore, it is estimated that the number of papers will continue to increase in 2019. This data shows that P2P energy trading has attracted increasing attention and interest from academia. Please note that these papers were found and selected using limited keywords and following the specific procedure described at the beginning of this subsection. Therefore, the actual number of papers regarding P2P energy trading is higher than that shown here. Also, this figure does NOT imply that the earliest paper on P2P energy trading appeared in 2015. There may be earlier papers regarding P2P energy trading that are not included in this paper due to the searching and selection criteria used. This figure simply shows the increasing trend in the number of papers on P2P energy trading. Similar rules applies to Figs. 2 and 3 as well. In addition, note that the number for 2019 covers January to March 2019 only. Fig. 2 shows the number of papers by country. The United Kingdom produced the greatest number of papers on P2P energy trading, while European countries contributed more than 55% of the total number of papers, significantly preceding other countries and regions in the world. Many papers were also produced in Australia, which ranked second in the world. Besides Europe and Australia, a number of papers were produced in Asia (including China, Singapore, and Japan) and North America (the United States and Canada) as well, with the total number of papers being nine and five, respectively.
Regarding the research focus, as demonstrated in Fig. 3, a great majority of the papers focused on the market design of P2P energy trading, followed by trading platforms, social science perspectives, physical and ICT infrastructure, and policy. This may be because P2P energy trading is still at an early stage of development, so most studies are focusing on how to make P2P energy trading occur in practice. Policy issues are one of the main obstacles to deploying P2P energy trading on a large scale, and are thus worth further study.

Research projects
Some governments or funding bodies support research projects to facilitate the development of P2P energy trading. In this paper, "peer-to-peer," "energy trading," "energy sharing," and their combinations were used with "project" as the keywords to search in Google. The results were then manually checked and filtered by the authors to select those that were directly relevant.
One significant project is the P2P-SmarTest (Peer-to-Peer Smart Energy Distribution Networks) project under the Horizon 2020 program of the European Commission [22]. This project started in 2015 and ended in 2018, covering four major aspects of P2P energy trading: market design, trading platforms, physical and ICT infrastructure, and policy. Another big project is the P2P-3M (Peer-to-Peer Energy Trading and Sharing-Multi-times, Multi-scales, Multi-qualities) project funded by EPSRC of the United Kingdom, which started in 2016 and will continue until the end of 2020 [23]. The P2P-3M project tries to align the technical and market arrangements with the diverse social requirements of P2P energy trading.
From the detailed list shown in Table S2, it is seen that the majority of research projects (7 out of 8) are conducted in European countries. In terms of research scope, each project focuses on multiple topics, and most projects focus on market design and trading platforms. A moderate proportion of projects focus on physical and ICT infrastructure and policy issues, while very few (1 out of 8) involve social science perspectives.

Industrial projects
A rapidly increasing number of trials and commercial projects on P2P energy trading are emerging across the world, conducted by both high-tech start-ups and large players in the energy and information industries. In this paper, "peer-to-peer," "energy trading," "energy sharing," and their combinations were used with "project" as the keywords to search in Google. The results were then manually checked and filtered by the authors to select those that were directly relevant. It is worth noting that, in principle, only ongoing projects, rather than those at the planning stage, were selected.
The statistics of the survey are illustrated in Figs. 4 and 5. For detailed information, refer to Table S3.   Fig. 4 shows that industrial practice is most active in the United States and in European countries, with the United States and Germany having the largest number of industrial projects. Fig. 5 shows that 70% of the projects focused on P2P energy trading at the local level, including that in buildings, communities, microgrids, and distribution networks. The other 30% of the projects were at the national level, focusing on how to conduct P2P energy trading between generators and consumers in different regions or in the wholesale market.
It is also worth noting that almost all the projects surveyed in this paper (see Table S3) involve utilizing blockchain technology to support and facilitate P2P energy trading at different levels. This shows that blockchain may be the most promising solution to enable P2P energy trading, due to its various advantageous features, which will be detailed in Section 3.2.

Remarks on the limitations of the landscape depicted in this paper
Aside from the papers and projects reviewed in this paper, many other papers and projects may exist that are related to P2P energy trading but are not included in this paper due to the search methodology and selection criteria used. As described in Sections 2.1-2.3, "peer-to-peer," "energy trading," "energy sharing," and their combinations were used as the keywords for searching. However, other papers and projects relevant to P2P energy trading might be found if different keywords were used, such as "energy exchange" [30], "local electricity market" [31], "prosumer business" [11], and so forth. Those keywords were not used for searching in this paper because their "efficiency" is somewhat low, as most of the results would be very loosely about P2P energy trading or even be irrelevant.
Furthermore, as described in Sections 2.1-2.3, the searching results were manually checked and filtered, thus relying on the knowledge and subjective judgement of the authors. Moreover, for the papers selected in Section 2.1, only the title, keywords, and abstract were examined for each paper for selection. Therefore, it is possible that a paper might actually be about P2P energy trading, yet be missed because it was difficult to determine the relevancy from just the title, keywords, and abstract (e.g., Ref. [32]).
Finally, for the papers reviewed in Section 2.1, only journal papers were selected. It is worth pointing out that there are an enormous number of conference papers and self-archived articles regarding P2P energy trading, such as Refs. [33][34][35][36][37], which are not reviewed in this paper. Also, only the IEEE Xplore, ScienceDirect, MDPI, and Springer databases were searched, and relevant studies may exist in other databases and sources.
Despite the above limitations, we believe that this paper still covers a significant portion of state-of-theart studies and projects directly related to P2P energy trading, based on which the classification, analysis, and perspectives were made.

Key aspects of P2P energy trading: Review and future research
Based on the existing development in both academia and industry, key aspects in P2P energy trading are identified and analyzed in this section, including market design, trading platforms, physical and ICT infrastructure, social science perspectives, and policy. These aspects were identified by the authors by reading and summarizing the materials introduced in Section 2 and listed in Appendices A-C. Each key aspect is first described, followed by a review of the existing studies and practice, and perspectives for the future. An overview of key aspects in P2P energy trading is illustrated in Fig. 6.

Market design
P2P energy trading involves innovative market arrangements for modern power systems with increasing penetration of DERs. The market designs for P2P energy trading are discussed from the following perspectives: market categorization based on the centralization level, differentiation of electricity products, market stability, relationship with external markets, and game theoretic perspective.

Centralized, decentralized, or distributed markets?
Based on the level of centralization, market designs for P2P energy trading can be divided into three categories: centralized, distributed, and decentralized, as illustrated in Fig. 7.

Centralized markets
In a centralized market, there is a coordinator who communicates with each peer, that is, the entity participating in P2P energy trading. Based on the information collected from the peers, the coordinator directly decides the energy import/export of the peers or the operational status of the devices among the peers. The coordinator distributes the revenue of the whole P2P community following some predefined principles, such as by deciding prices for calculating the revenues of each peer [39].
One major advantage of centralized markets is that they could maximize the social welfare of the whole P2P community. The coordinator could set the maximization of social welfare as the objective function (as in Ref. [40]) when making control decisions for the peers. Another advantage is that the outcome of centralized markets, that is, the power generation and consumption patterns of the peers, has less uncertainty. This is because the operational status of peers is under the direct control of the coordinator [40][41][42][43][44], in contrast to distributed or decentralized markets [17].
The major disadvantage of centralized markets is that they place an exponential computational and communication burden on centralized management systems with the increasing scale of DERs involved [19].
Other disadvantages include privacy and autonomy concerns. In terms of privacy, the information required by the coordinator may expose the privacy of peers. In terms of autonomy, the direct control over the peers' devices undermines the peers' autonomy, which may be undesirable to some customers [38]. Finally, centralized markets are vulnerable to single-point failures at the coordinators.
Several studies have proposed or discussed centralized P2P energy trading markets. Nguyen et al. [40] proposed an optimization model to maximize the economic benefits of a group of households with photovoltaic (PV) cells and batteries. In that model, trading prices are decided among the households. Lüth et al. [41] examined the role and values of centralized and decentralized batteries in P2P energy trading and proposed two market designs, the "Flexi User" and "Pool Hub," which are both centralized markets. Hou et al. [42] proposed equipping and using local electricity storage for blockchain-based P2P energy trading in the Industrial Internet of Things (IIoT), with a focus on minimizing the chain length and energy transportation cost. Zepter et al. [43] proposed a P2P energy trading mechanism named "Smart elecTricity Exchange Platform" (STEP) in which the P2P energy trade was taken as a constraint with an assumed price. Long et al. [39] proposed a two-stage control scheme for batteries in a P2P energy sharing community microgrid. The key selling points of the scheme are that only the measurement at the point of common coupling (PCC) and one-way communication to the batteries are required. One of the contributions of Alam et al. [44] to centralized P2P energy trading markets is the near-optimal algorithm named "Energy Cost Optimization via Trade (ECO-Trade)." Using this algorithm, 99% of optimal solutions could be derived in a more efficient way.
From the above review, it can be seen that centralized P2P energy trading markets can be used to achieve a number of benefits, such as overall economic benefits maximization, due to the fact that global optimization can be conducted in such markets. Future research on centralized P2P energy trading markets can proceed in two directions: One direction is to enable other good features, such as ancillary service provision, network constraint management, and fair revenue allocation, while the other direction is to try to address the intrinsic drawbacks of centralized markets in terms of scalability, reliability, privacy, and autonomy.

Decentralized markets
Unlike centralized markets, decentralized P2P energy trading markets have no centralized coordinators and the peers directly contract and trade with each other. In decentralized markets, the privacy of peers is well protected, and peers are able to fully control their own devices [45][46][47][48]. Moreover, the scalability of decentralized markets is better, and the peers can "plug-in and -out" easily [45][46][47][48]. These are the advantages of decentralized markets over centralized markets.
Decentralized markets are subject to disadvantages as well. Because there are no centralized coordinators, the "efficiency" of decentralized markets may not be high; that is, the social welfare of the whole P2P community may not be maximized [49]. Moreover, the overall outcome of P2P energy trading is not very visible or predictable for network operators, such as distribution network operators (DNOs) and transmission system operators (TSOs); an example is the bilateral contract networks in Ref. [45]. This makes it more complex to manage network constraints and more difficult to improve the operational efficiency of the power systems. Last but not least, peers are subject to severe uncertainties in fully decentralized markets; thus, vulnerable customers' interests may be easily compromised. An example is the generation/load curtailment that may happen under the continuous double-auction mechanism described in Ref. [50].
Compared with studies on centralized markets, fewer studies have been published on decentralized P2P energy trading markets. Morstyn et al. [45] proposed fully decentralized bilateral contract networks as both forward and real-time market designs for P2P energy trading. It was noted that the satisfaction of "full substitutability conditions" for the preferences of peers is essential for the existence of a stable outcome. Sorin et al. [46] proposed a "multi-bilateral economic dispatch (MBED)" formulation and a relaxed consensus + innovation (RCI) approach as the solution for constructing a fully decentralized P2P market. The authors claimed that differentiated preferences of customers can be respected while social welfare is maximized. Devine et al. [47] designed an innovative and interesting demurrage mechanism for a blockchain-based energy trading marketplace. In this mechanism, the redemptive value of the energy-backed tokens is designed to decline with time, so that power consumption can be allocated to the periods with surplus local generation. Luo et al. [48] developed an agent coalition mechanism for peers to form coalitions and negotiate electricity trading. Furthermore, in an earlier work dating back to 2014, Velik et al. [32] proposed a very simple mechanism in which the trading price between microgrids was set at constant and time-independent values. The microgrids determined which neighbor to trade with, following a fixed order in a predefined table.
From the above review, it can be seen that, compared with centralized markets in which global optimization is widely used, a diversity of methods have been proposed for decentralized markets, including bilateral contract networks, a consensus approach, a demurrage mechanism for blockchain tokens, and a multiagent method. From another point of view, this indicates that no global optimum can be easily achieved in a fully decentralized environment, so there is a great deal of space for proposing different types of methods that have good features in different aspects. Furthermore, the implications of existing decentralized market designs are usually based on certain assumptions on how peers will make decisions. However, in reality, peers' decision-making process may be highly complex and uncertain, as well as different between one peer and another. How the designed markets will perform in practice needs careful consideration and assessment. In addition, compared with centralized markets, the question of how to design relevant mechanisms in decentralized markets in order to motivate peers to provide other functions, such as ancillary services, while simultaneously conducting bilateral energy trading, is another challenge to be addressed in the future.

Distributed markets
Distributed markets are a type of design that lies between centralized and decentralized markets. In distributed markets, the coordinator usually influences peers indirectly by sending pricing signals, rather than directly instructing the peers' energy import/export or the operational status of the peers' devices [17]. Compared with fully decentralized markets (e.g., comparing Refs. [17] and [45]), distributed markets still involve a coordinator, so the behaviors of peers can be better coordinated. Compared with centralized markets (e.g., comparing Refs. [17] and [44]), distributed markets usually require limited information from the peers, and do not directly control the peers' devices; thus, they provide a higher level of privacy and autonomy for customers. In sum, distributed markets combine the features of centralized and decentralized markets and provide a compromised solution between centralized and decentralized markets.
A number of studies have proposed distributed markets for P2P energy trading. Kang et al. [51] used an iterative double-auction mechanism to maximize social welfare in P2P energy trading among plug-in electric vehicles (PHEVs). Li et al. [52] used a Stackelberg game-based pricing strategy for credit-based loans in a designed energy blockchain for P2P energy trading in the IIoT. Long et al. [53] proposed three pricing mechanisms-bill sharing, mid-market rate, and an auction-based pricing strategy-for P2P energy trading in a community microgrid. Alvaro-Hermana et al. [54] used a quadratic programming formulation for deciding the prices for P2P energy trading based on a linear offer price function assumed for each electric vehicle. Morstyn et al. [55] proposed a distributed price-directed optimization mechanism for P2P energy trading with multiple classes of energy products. Paudel et al. [56] proposed an iterative pricing mechanism based on the non-cooperative game, evolutionary game, and Stackelberg game theories for P2P energy trading in a community microgrid. Baroche et al. [57] used the consensus alternating direction method of multipliers (ADMM) to solve the endogenous P2P economic dispatch to create a distributed P2P market. Chen et al. [58] proposed a localized event-driven market in which the retail energy broker determines the occasional market open rate when there are any events or requests based on a double-auction model. Liu et al. [59] proposed a P2P energy sharing model with a price-based demand response for microgrids, in which a dynamic internal pricing model based on the supply-and-demand ratio was developed.
From the above review, it can be seen that one of the core issues of distributed markets is how to design a proper pricing mechanism for P2P energy trading. It is also important to figure out proper methods for modeling the decision-making process of the peers and for implementing the designed pricing mechanism (e.g., one-shot or iteratively, synchronously or asynchronously). The hierarchy of distributed P2P energy trading markets is summarized in Ref. [17], in which a multiagent framework and a systematic index system are developed for simulating and assessing different distributed market designs.
Future directions in distributed P2P energy trading markets will involve how to design proper pricing mechanisms to facilitate P2P energy trading while simultaneously providing other functions such as ancillary services. The pricing mechanisms must consider practical decision-making and behavior models of the peers and applicable implementation manners. The convergence under the pricing mechanisms requires special care in order to avoid unstable and undesired outcomes in practice.

Differentiation of electricity products
In the existing bulk of electricity markets, electricity products are mainly differentiated by the fact that the electricity sold at different times has different values and prices. In the wholesale market, electricity over different time periods-for example, short-term, mid-term, and long-term contracts-usually has different prices. In the retail market, time-of-use (ToU) tariffs, or other pricing mechanisms such as real-time pricing (RTP) and critical peak pricing (CPP), are used in many places around the world [60]. Electricity is sometimes differentiated based on the accumulated energy consumption as well. For example, for incline block tariffs (IBT) adopted in some countries such as China [61], Canada [62], and South Africa [63], electricity prices are divided into several levels based on the accumulated electricity consumption of a month.
P2P energy trading markets offer even greater opportunities for the differentiation of electricity products. This is because P2P energy trading markets serve localized energy systems with specific local characteristics and are relatively small; thus, they are more flexible for trialing different settings. Some preliminary studies have been conducted to explore the possibilities of trading differentiated electricity products in P2P energy trading marketplaces. Morstyn et al. [55] proposed a multi-class energy management for P2P energy trading, in which the electricity is divided into "green energy," "subsidized energy," and "grid energy," which are preferred by different types of prosumers. The consensus-based approach proposed in Ref. [46] is open to enable the differentiation of electricity products. An example was given in which different additional costs were imposed on trades with a different Euclidean distance between the peers.
In the future, different market designs for incorporating the differentiation of electricity products will be proposed for P2P energy trading, and different ways of differentiating electricity products can be explored, such as differentiating electricity based on the power quality or supply reliability.
The differentiation of electricity products is summarized and illustrated in Fig. 8.

Stability and competition in forming P2P energy trading coalitions
Almost all of the existing studies on P2P energy trading, such as Refs. [40][41][42][43][45][46][47][48][51][52][53][54][55][56][57][58][59], have assumed that there was only one uniform P2P energy trading market for the area considered. However, in practice, it is highly possible for there to be several "P2P market service providers" in an area, which compete with each other to recruit peers for the markets they have established. In such cases, the stability-that is, the ability to keep peers within the market-would become an important dimension for evaluating a P2P energy trading market design.
A few studies have worked on this topic. The P2P energy trading market proposed in Ref. [44] guaranteed that no single peer would be worse off when participating in the market, but did not examine whether the interests of a sub-group of peers would not be worse off. As a result, a sub-group of peers might quit and form a new coalition to get higher benefits. Tushar et al. [64] verified the core of the designed canonical coalition game-based framework for P2P energy trading and proved the stability of the proposed market. However, it remains to be examined whether the pricing mechanism used for revenue distribution-that is, the mid-market rate-could indeed guarantee that a sub-group of peers would not leave the grand coalition to form a new one for higher benefits.
Future studies may focus on creating P2P energy trading markets that are stable, at least given certain conditions. For centralized markets, stability highly depends on how the revenue of the coalition is allocated to each peer. For decentralized and distributed markets, the stability issue needs to be considered when designing the market rules or pricing mechanisms. It is also interesting to analyze how the peers will be grouped for a certain area when they are free to form P2P energy trading coalitions. With this information, the impact of P2P energy trading-on both individual peers and wider society-can be evaluated more precisely.

Relationship between P2P energy trading and existing wholesale/retail markets
What the overall market paradigm of power systems will be like in the future remains an open question, although a number of experts have presented views on this issue [65][66][67]. Nevertheless, it can be foreseen that, in the near future, the conventional wholesale-retail market system and P2P energy trading will co-exist for a considerable period of time. Therefore, exploring the relationship between emerging P2P energy trading and existing wholesale and retail markets is an important topic in P2P energy trading studies.
In most existing studies, peers are assumed to first trade with each other, and then trade with the wholesale or retail market individually or in aggregate (depending on the scale of the peers and the design of the market for P2P energy trading) in order to deal with the energy imbalance. In other words, the conventional wholesale or retail market acts as the "residual balancer" for the peers in P2P energy trading. The "community-based market" presented in Ref. [68] is an example of this type of relationship. Other examples are provided in Refs. [39,40,44,48,53,54,56] (interaction with the retail market) and Refs. [41,43,55] (interaction with the wholesale market).
There are also some more general market designs for P2P energy trading, which can not only include demand-side customers with DERs, but also involve large generators and/or retailers. The "full P2P market" presented in Ref. [68] is one example of this type of market design. Furthermore, it was explicitly demonstrated in Ref. [45] that the proposed bilateral contract networks could be applied to enable direct energy trading among prosumers, retailers, and large generators. The market proposed in Ref. [46] can be applied to direct energy trading between large generators and customers as well. Although it is not stated explicitly, the market designed in Ref. [47] is quite general, and has the potential to be applied beyond demand-side customers.
In the existing studies that take the wholesale or retail market as the residual balancer, it is commonly assumed that the scale and impact of P2P energy trading are still very limited in the whole power system. As a result, the peers are assumed to act as "price takers" in the wholesale and retail markets. However, given the increasing number of customers with DERs participating in P2P energy trading, their impacts can no longer be ignored, and it will be important to consider them as "price makers" in the wholesale and retail markets. For those market designs that can include large generators and even retailers in P2P energy trading, the relationship between the new markets for P2P energy trading and the existing wholesale or retail market needs further clarification.

Game-theoretic perspectives on P2P energy trading
Game-theoretic approaches are capable of modeling the decision-making processes of entities with conflicting interests and motivating entities to compete or cooperate to achieve certain goals; thus, they hold great potential for application in P2P energy trading [69]. Some studies have used different game-theoretic approaches in multiple aspects of P2P energy trading.
Non-cooperative game-based approaches have been used for simulating the overall outcome of P2P energy trading to assess the performance of proposed market designs. In Ref. [20], the Nash equilibrium of a microgrid, in which prosumers with onsite PV systems and flexible demand trade with each other, was calculated in order to assess the outcome of P2P energy trading. Non-cooperative game-based approaches were also used in Ref. [56] to model the behaviors of peers. Furthermore, non-cooperative auction-based approaches have been used as the core mechanisms of distributed P2P energy trading markets in some existing studies, such as Ref. [50].
Stackelberg game-based approaches have been used in some existing studies for establishing pricing mechanisms in distributed P2P energy trading markets. Examples include Ref. [52], where the coordinator acted as the "leader" and the peers acted as the "followers," or Ref. [56], where the sellers acted as the "leaders" and the buyers acted as the "followers." As mentioned in Section 3.1.3, cooperative game-based approaches can act as a foundation for analyzing the stability and competition issues of P2P energy trading. In Ref. [64], a canonical coalition game was used as the basis to construct the P2P energy trading market, and the "core" concept of the game was used to analyze the stability of the designed market.
A variety of game-theoretic approaches have been proposed, as summarized in Ref. [69], although only a few have been used for P2P energy trading in existing studies. Game-theoretic approaches are valuable resources that could be utilized in the future for modeling the trading behaviors of peers and for designing and assessing P2P energy trading markets.

Trading platforms
With the design of P2P energy trading markets in place, a trading platform is essential to enable peers to trade with each other (and with bulk retail and wholesale markets), following the market rules. Extensive research and trials have been carried out regarding trading platforms for P2P energy trading.
Based on the underlying technology, platforms can also be divided into centralized and decentralized. For centralized planforms, Zhang et al. [20] developed the conceptual design of a centralized software platform, named Elecbay, for P2P energy trading in a grid-connected microgrid. Similar to the e-commerce platform "eBay," electricity producers can list electricity and consumers can place orders on Elecbay. Each order includes when and how much electricity needs to be supplied between the producers and consumers. The supplier (electricity retailers in the UK) and distribution system operator communicate with Elecbay as well, in order to balance the power surplus/deficit beyond the P2P trades and examine whether the P2P trades will cause network constraints violation.
Considerably more attention has been paid to using blockchain technology to create decentralized platforms for P2P energy trading. A comprehensive review is provided in Ref. [70], which establishes an analytical framework for blockchain-based microgrids and identifies the potential challenges and future directions in both practical and academic contexts. Blockchain technology is an innovative distributed ledger technology, which is able to create a trustable environment for trading between various entities in a decentralized manner. Enabling P2P energy trading in microgrids in the long term is considered to be one of the most significant aspects of blockchain technology [71].
The decentralization feature of blockchain is considered to be well matched with the decentralization characteristic of P2P energy trading, where electricity supply is no longer provided by centralized large generators, but rather by small customers with DERs. To summarize, several benefits could be obtained by using blockchain technology to support P2P energy trading, including the following: • The need for a third party for coordinating trading in the market is avoided. As a result, the relevant overhead cost can be saved, and the risks caused by misbehavior of the intermediary are reduced.
• The transaction records are stored in multiple points in the network in the form of a chain of blocks, which are made by some "consensus mechanism" and protected by cryptography. Consequently, the transaction records are transparent, tamper-proof, and robust to single-point failure.
• Blockchain platforms can support smart contracts, which can be easily made and automatically executed, so that the contracting, enforcement, and compliance costs can be lowered [72]. This feature is especially desirable for P2P energy trading, which involves numerous low-value transactions between small-scale customers with DERs.
Considering the above features, many industrial trials and projects are ongoing all over the world, in which blockchain-based platforms are used to enable P2P energy trading. One distinguishing project is the Brooklyn Microgrid project in New York, which is run by Transactive Grid. An Ethereum-based blockchain platform is used to support P2P energy trading, with smart contracts for conducting the trading and tokens for energy transactions [73]. The project is composed of two phases, with the first phase involving 10 customers and the second phase extended to a much larger scale that will include 300 houses and small businesses. There are also many other projects with different scales and focuses around the world, as listed in Table S3. Andoni et al. [74] gave a comprehensive review of the global industrial projects in this area as examples of the application of blockchain technology in the energy sector.
In addition to industrial practice, there are a number of academic studies on how to better use blockchain technology as trading platforms for P2P energy trading. In Refs. [52] and [54], blockchain technology was used to establish platforms for P2P energy trading on the IIoT. In Ref. [52], a consortium blockchain was proposed for supporting P2P energy trading in microgrids, energy harvesting networks, and vehicle-to-grid networks. A credit-based payment scheme was proposed for overcoming the weakness of blockchain technology in transaction confirmation delays. In Ref. [54], a local electricity storage solution was proposed to address the issue of a long chain maintaining many blocks possibly being created during P2P energy trading, and thus reducing the operational overhead. Kang et al. [51] designed a consortium blockchain for P2P energy trading between plug-in hybrid electric vehicles, which could improve transaction security and privacy protection level. Aitzhan et al. [75] combined blockchain technology with multi-signatures and anonymous messaging streams to create a platform for P2P energy trading with a higher level of security and privacy.
Despite a considerable amount of effort in utilizing blockchain technology to establish decentralized platforms for P2P energy trading, there is still no clear evidence that blockchain-based decentralized platforms are preferable to centralized solutions such as Elecbay. Although the advantages of blockchain technology in terms of trustworthiness, transparency, redundancy, tamper-proof ability, and intermediary avoidance are real, it is still an open question whether all these features are really necessary in P2P energy trading and how much cost people would to pay for the system to be equipped with all these features. Moreover, although the benefits of smart contracts are usually mentioned together with blockchain, in fact, smart contracts could be based on centralized platforms as well, even though decentralized platforms can provide a higher level of trustworthiness for smart contracts. In addition, blockchain technology itself has many drawbacks, such as the time and energy cost for reaching consensus in public blockchain and the compromise of trustworthiness in consortium or private blockchains. Therefore, it is important to conduct a detailed cost-benefit analysis when deciding what type of platform to use to enable P2P energy trading, based on the specific environment and the requirements of the application.

Physical and ICT infrastructure
After trading agreements are reached on P2P energy trading platforms, the agreed-upon amount of electricity needs to be delivered from one peer to another at an agreed period of time through electric power networks (either transmission or distribution network, or both). In this process, a number of metering and communication devices need to function accordingly to make the energy delivery happen. Therefore, physical and ICT infrastructure is essential for P2P energy trading.

Electric power networks and associated technical arrangements
Physical electric power networks need to be ready between peers so that the agreed-upon electricity can be delivered. Two types of solutions can be used for this purpose, as summarized in Fig. 9.   Fig. 9. Existing studies on physical infrastructure for enabling P2P energy trading.

Private electric power networks and associated control strategies
One solution is to construct private wires or networks between peers, so that the electricity delivery is conducted physically in a peer-to-peer way. Although the increasing penetration and decreasing costs of DERs have re-opened the discussion on constructing private networks in some countries, electric power networks are still subject to distinct characteristics, including economies of scale, economies of scope, and economies of density, because of the high sunken costs and low marginal network operating costs [76]. Moreover, long-term concerns and uncertainties regarding future investment, supply security, climate change, and regulations make private networks riskier [77]. As a result, constructing private networks for P2P energy trading on a large scale is still not an economic solution, and a vast majority of power networks in the world are still operating in a monopolistic way under governmental regulation. There is still no sign that this situation will change, even with the development of P2P energy trading.
Several academic studies have been conducted to verify the technical feasibility and proposed control strategies for private networks that connect residential houses or islanded microgrids. Werth et al. [78] proposed a direct current (DC)-based open energy system, in which each house with PV panels and batteries is further equipped with a bidirectional DC-DC converter and a network. With this design, electricity can be exchanged between houses through an external DC power bus in a P2P manner. A software layer with associated control functions was further designed for the system. Furthermore, Kumar et al. [79] developed a control strategy for the interconnection of DC microgrids operating at various voltages. Hossain et al. [80] designed a robust distributed control scheme to regulate the power flows among multiple islanded microgrids. Konar et al. [81] also proposed the interconnection of islanded DC microgrids to increase supply reliability. Refs. [79][80][81] are not targeted at P2P energy trading, but the interconnection they studied might act as the physical infrastructure for enabling P2P energy trading between islanded microgrids.
In sum, private networks are feasible technical solutions to enable P2P energy trading, but are not expected to thrive in due course. Nevertheless, some academic studies have explored hardware configuration and control strategies in this area.

Public electric power networks and associated technical arrangements
The other solution is to utilize the public power networks between peers to deliver the agreed-upon electricity in P2P energy trading, which is the current practice in most places around the world. In this solution, a power network acts like a big pool. Electricity producers inject power into the pool, and electricity consumers abstract power from the pool. However, the electricity in the pool basically has a uniform property and the consumers cannot and need not determine where the electricity physically comes from. In the future, the differentiation of electricity products (as presented in Section 3.1.2) and the development of power routing devices [82,83] and algorithms [84,85] (see Refs. [13] and [86] for more details) may change this situation, but they are still at a very early stage. Therefore, some people argue that P2P energy trading based on public electric networks is virtual energy trading rather than a physical energy exchange, and thus more about market and commercial arrangements than technical arrangements. However, different rulesets of P2P energy trading will motivate peers to adopt different electricity production or consumption patterns, ultimately affecting the power flow in power networks. Even if we do not consider the flexibility in electricity production or consumption patterns, the peers in P2P energy trading use the power networks to different extents and in different ways, which need to be considered in the ruleset making of P2P energy trading.
As a result, technical arrangements need to be embedded into the rulesets of P2P energy trading. Guerrero et al. [50] developed a mechanism that examines whether a trade between peers would violate network constraints based on a sensitivity analysis, in order to decide whether the trade should be approved or not. Efforts have also been made to better reflect the use of power networks in P2P energy trading in order to fairly allocate network charges among the peers, and to motivate peers to act in a way that is beneficial to power networks. Nikolaidis et al. [87] represented distribution networks as multi-layered radial graphs, and proposed a transparent loss allocation framework to fit with the underlying financial transaction features of P2P energy trading. Three-phase unbalanced power flow was considered in the proposed framework. Baroche et al. [57] proposed multiple network charging solutions for P2P energy trading based on different principles, including uniform charging, charging based on electrical distance, and charging by zones. One outstanding feature of the proposed charging methods is that they are all exogenous, so that they fit well with the physical and regulatory configurations of the main grid. In the consensus-based P2P energy trading market proposed by Sorin et al. [46], product differentiation could be imposed, and the network usage could be used as the basis for differentiation.
Although the above studies have made a very good start on involving power network consideration, it is still important for new P2P energy trading markets developed in the future to consider how to deal with the network constraints. Current network charge allocation methods in the above studies are still quite simple, such as being loss-based or distance-based. Nevertheless, network charges involve complex factors such as sunk cost recovery, reinforcement avoidance, locational and ToU costs, and so forth, which require further research. Moreover, research and discussion should continue to explore what physical infrastructure-either private or public networks, or both-is suitable for supporting P2P energy trading in different scenarios. Interconnection of microgrids and novel power routing devices and algorithms for P2P energy trading are emerging topics to be thoroughly studied in the future.

ICT infrastructure and associated technical arrangements
Large amounts of communication and information are needed across the negotiation, delivery, and settlement stages of P2P energy trading. For centralized and distributed P2P energy trading markets, there is massive bilateral communication between the coordinator and the peers, while for decentralized P2P energy trading markets, there is plenty of bilateral communication among peers. Therefore, ICT infrastructure and its impact on P2P energy trading are considered to be an important issue to be studied [20].
Only a few studies have been published in this area so far. Jogunola et al. [88] conducted a comparative analysis of P2P communication architectures for P2P energy trading and sharing of prosumers in microgrids. Both structured and unstructured P2P protocols were evaluated under the requirements specified in IEEE 1547.3-2007, and it was concluded that both protocols showed good performance and were promising for supporting prosumer communication. Zhang et al. [89] investigated the requirements of ICT infrastructures for bidding and control systems for P2P energy trading. Existing and private communication networks with different features, such as medium and bandwidth, were modeled and simulated in OPNET. It was verified that existing ICT infrastructure, such as wired broadband networks and GPRS Smart Metering networks, are sufficient and no additional large investment is needed to facilitate P2P energy trading.
In the future, the communication burden and investment required may be important dimensions to evaluate a market design or platform for P2P energy trading. The impact of non-ideal communication conditions, such as communication delay, distortion, and failure, on P2P energy trading should be assessed. Moreover, the optimal configuration and operation of communication networks for P2P energy trading is worth studying.

Social science perspectives
The integration of energy and social science research has increasingly been considered to be important in the past few years. As an innovative market paradigm in modern power systems, P2P energy trading involves large numbers of small customers, and creates a new playground for social science energy research and practice. A few studies have looked into P2P energy trading from sociological perspectives.
One major direction is to use anthropological methods to model the people participating in P2P energy trading in a way that is closer to reality, rather than assuming that people are completely rational. Five pieces of work have been conducted in this direction. Singh et al. [90] conducted an ethnographic "research intervention" study in two off-grid villages in rural India for 11 months, and revealed that the return in P2P energy trading is not just an economic act but actually a complicated sociocultural process. Besides the monetary return, which is termed the "in-cash" return in the study, two other types of returns, "in-kind" and "intangible" returns, were assessed. The study finally suggested enabling diverse types of returns and acknowledging the dynamics of social relations in P2P energy trading. That study demonstrates the importance of applying anthropological approaches when designing and evaluating P2P energy trading markets.
Singh et al. [30] also studied household energy exchange from an economic anthropological perspective, and identified another type of energy exchange besides the market energy exchange: mutual energy trading. P2P energy trading in the market realm involves rational participants and is regulated and structured by utilities. In contrast, mutual energy trading is "a social and personal transaction of energy between an energygiver and energy receiver, which is mutually structured and negotiated (P104)." Mutual energy trading involves social relations and diverse cultural values. These findings were based on an "ethnographic intervention" study conducted in an off-grid village in rural India.
Ecker et al. [38] conducted an online survey in which as many as 248 German homeowners participated. The survey was about the aspirations of people to adopt private ESSs. It also drew interesting implications for the development of P2P energy trading. The results showed that both "autarky" (i.e., independence of supply) and "autonomy" (i.e., the ability to self-determine the energy provision) were important factors, but only the concerns regarding autarky significantly affected people's investment decision on the adoption of a private energy storage system. Based on this result, the authors concluded that people's preference on autarky might decrease the likelihood of P2P energy trading, because people tend to offer the electricity they produce at higher prices than its actual value. From our point of view, one more inference may be made based on the results: Namely, people seem to be less sensitive than expected to the undermining of autonomy. That is, autonomy concerns for centralized P2P energy trading markets, as discussed in Section 3.1.1.1, may not be a very severe issue.
Moreover, Tushar et al. [64] assessed P2P energy trading from the motivational psychology perspective, and found that P2P energy trading satisfies both rational-economic and positive reinforcement properties. Based on these results, it was further concluded that the P2P energy trading proposed in the paper was a consumer-centric scheme.
The other direction in which P2P energy trading and social science can be combined is in studying the impact of P2P energy trading on the development of society from a macro perspective. Giotitsas et al. [91] discussed the energy evolution process and its impact on the global socioeconomic structure. It was concluded that a "P2P energy grid" based on a "P2P microgrid" is a promising architecture for future energy production, and could facilitate the transition of society from commodity/service-based centralized energy production to commons-based energy production and management.

Policy
Current regulatory schemes in the electricity sector are mostly made based on the conventional power system paradigm, which is vertical and unidirectional, and are thus increasingly not fit for the purpose in modern and future power systems with high DER penetration at the demand side. There are an increasing number of discussions on how to reform regulatory schemes to adapt to the rapid changes in the sector [21,69,70,92], but no radical change has been witnessed on a large scale in the world. This is because ① regulatory changes involve a great number of interests of a large number of stakeholders across the whole electricity supply chain, so they are sensitive and must be very cautious when rolling out any radical regulatory change; and ② new technologies (e.g., blockchain technology, as presented in Section 3.2) and the associated commercial models (i.e., the various types of P2P energy trading mechanisms, as presented in Section 3.1) are developing fast and have not yet settled down, so it is still not very clear how regulatory schemes should be depicted to satisfy the needs of technological and commercial changes.
Efforts are being made to consider how regulatory schemes should facilitate the development of P2P energy trading and to deal with the associated challenges [21,69,70,92].
Morstyn et al. [21] emphasized that P2P energy trading markets may be a potential solution for distribution system operators (DSOs) to facilitate prosumer DER coordination. It was suggested that changes to DSO regulations may be needed to link the DSO rate of return to network capacity investments to provide incentives for DSOs. Also, it was pointed out that "further investigation is required to understand how regulations can best align DSO, prosumer, social and power system objectives." Tushar et al. [69] stated that it is vital to fit P2P energy trading into current energy policy, so that it will be clear what market designs are allowed, how the taxes and fees are distributed, and what the relationship is between the P2P energy trading markets and conventional electricity markets. They also pointed out that governments can either promote the development of P2P energy trading for the efficient utilization of renewable energy resources and environmental conservation, or discourage it if it brings a negative impact on existing power markets and systems.
Ahl et al. [70] took policies as a subset of "institutions," which include formal policies, standards, and regulations, as well as informal norms and customs. They pointed out that "policy is lagging behind technological development" and "there is a need of new laws for the buying and selling of P2P power." It was suggested that possible directions for policy development for P2P energy trading are to develop clearer ownership and partnership models, prosumer licensing, and associated requirements and market roles.
Finally, Diestelmeier [92] identified the major policy implications for the electricity law of the European Union, considering the shift in the role of electricity consumers with blockchain technology, which is closely related and widely applicable to P2P energy trading. Diestelmeier concluded that no "one-size-fits-all solutions" can be established within the EU legal framework regarding the electricity sector. She summarized three key questions to be answered in this area: ① how to define and allocate decentralized responsibility of electricity supply and transmission, ② how to provide incentives for customers to invest and provide flexibility, and ③ how to balance self-responsibility and protection of customers. These three questions were raised for blockchain-based power systems, but we found that the same questions exist for P2P energy trading as well, and require further research in the future.
In sum, although some studies have discussed the policy issues regarding P2P energy trading from different perspectives, as described above, there is still a lack of concrete details regarding what the new policies are like and how policy reform should be conducted. Furthermore, no radical change in policy regarding P2P energy trading has been witnessed on a large scale in the world.

Concluding remarks
As a promising solution to address the energy trilemma confronting human society, P2P energy trading has emerged and developed rapidly in recent years. This paper has summarized and analyzed the global development of P2P energy trading by reviewing academic papers, research projects, and industrial practices. It is seen that P2P energy trading has attracted increasing attention from both academia and industry across the world, with a rapidly growing number of papers and projects in this field.
Key aspects of P2P energy trading have been identified and discussed, including market design, trading platforms, physical infrastructure, ICT infrastructure, social science perspectives, and policy. For each key aspect, existing research and practice have been critically reviewed and perspectives for future development have been suggested. It is seen that although a number of efforts have been made in different aspects of P2P energy trading, a significant number of problems remain to be addressed in the future. This shows that P2P energy trading is a growing field with great potential and opportunities for both academia and industry. Detailed concluding remarks for the global development and key aspects of P2P energy trading are presented below.

Global development of P2P energy trading
More than 30 journal papers, eight research projects, and 20 industrial projects were surveyed to depict a global picture of the development of P2P energy trading all over the world. It was found that there was a sharp increase in the number of academic papers in 2018, and this trend continued in 2019, showing that P2P energy trading has become a hot research topic in the global research society. Australia, China, the United States, Singapore, the United Kingdom, and other European countries contributed most of the journal papers published in this area. Most of these papers focused on market design.
Research projects, such as the European H2020 P2P-SmarTest project and the UK EPSRC P2P-3M project have been conducted in different countries, covering a wide range of aspects involved in P2P energy trading.
Many industrial trials are being conducted across the world, with numerous projects in Europe and the United States. Of these projects, 70% focus on P2P energy trading at the local level, while 30% examine the national or regional level. Almost all the surveyed industrial projects involve utilizing blockchain technology to support and facilitate P2P energy trading, indicating the great potential of blockchain technology.

Market design
Market designs for P2P energy trading are categorized as centralized, decentralized, and distributed markets. Centralized markets are good for global social welfare optimization and higher certainty on the market outcome, but weak in terms of heavy computational and communication burdens, lower scalability and reliability, and increased privacy and autonomy concerns. Decentralized markets have the opposite advantages and disadvantages in comparison with centralized markets. Distributed markets act as a tradeoff solution between centralized and decentralized markets, combining their strengths and weaknesses. Future directions for market design lie in addressing the intrinsic drawbacks of the respective market types, and in enabling markets to have other functions such as providing ancillary services (e.g., peak shaving, frequency response, voltage support, etc.) for power systems.
Differentiation of electricity products is a promising direction in P2P energy trading; existing studies have made a preliminary attempt to differentiate electricity by time, distance, and type (e.g. green, subsidized, and grid energy). Further studies can investigate the differentiation of electricity products, such as those based on power quality and reliability.
Market stability is another important direction for applying P2P energy trading in practice. Revenue distribution and pricing mechanisms need to be further studied for centralized and distributed/decentralized markets, respectively, in order to enhance market stability. How peers will be grouped when they are free to form coalitions (i.e., free to choose P2P energy trading service providers) is another interesting topic.
The relationship between P2P energy trading markets and wholesale/retail markets has been extensively studied by researchers. However, with the wide deployment of P2P energy trading markets, P2P energy trading markets can no longer be taken as "price takers," as assumed in existing studies. Therefore, in the future, P2P energy trading markets may need to be considered as "price makers," and their relationship with wholesale and retail markets will need to be reconsidered.
Non-cooperative game theory, Stackelberg game theory, and cooperative game theory have been used in some P2P energy trading studies. Game-theory approaches include a wide variety of methods, and can be used in various aspects of P2P energy trading that involve the decision-making process of entities with conflicting interests.

Trading platforms
Trading platforms that allow peers to conduct P2P energy trading are categorized as centralized or decentralized. Centralized platforms work like eBay; one example is Elecbay, designed by Zhang et al. [20]. Academic and industrial efforts have been made to develop blockchain-based decentralized platforms. Academic researchers have proposed blockchain-based platform designs for various application scenarios, such as the IIoT, and have also proposed related techniques for shortening the chain length or obtaining a higher level of security and privacy. Industrial companies have conducted real-life projects to trial blockchain-based trading platforms.
Although an overwhelming amount of research and practice has been conducted on blockchain-based decentralized platforms, a detailed cost-benefit analysis needs to be carried out to decide which type of platform should be adopted on a case-by-case basis. The costs and drawbacks (e.g., time and energy costs) of blockchain technology need to be considered, despite its many good features (e.g., trustworthiness, transparency, redundancy, tamper-proof ability, and intermediary avoidance). It is also worth noting that the advantages of smart contracts should not be mixed with those of blockchain technology, considering that centralized platforms can support smart contracts as well.
Therefore, the following recommendations are provided for future studies: ① Identify specific designs for blockchain-based decentralized platforms for specific applications, with the cost-effectiveness evaluated; ② identify and propose solutions to the potential drawbacks of blockchain-based decentralized platforms, such as potential high time/energy costs, limited scalability for public blockchains, and cyber vulnerability for private blockchains; and ③ distinguish smart contracts from blockchain technology and, for specific applications, always examine whether blockchain technology is the best basis for deploying smart contracts or whether centralized platforms will be more suitable.

Physical and ICT infrastructure
Physical electric power networks for supporting P2P energy trading can be private networks or public networks. Private network solutions with associated control strategies in households and between islanded microgrids have been proposed in some academic studies, but are still not practical on a large scale in the short term. Public power networks provide the practical solution at the moment. At present, power networks act like a pool, and peers do not exchange electricity physically in a P2P way. Technical arrangements, such as network constraint violation checks, network losses, and charges allocation algorithms, have been proposed to better reflect the use of power networks, and to motivate peers to act in a way that is beneficial to power networks. Further studies can be undertaken to consider more practical elements in network charges, such as sunk cost recovery, reinforcement avoidance, locational and ToU costs, and so forth. The debate between using private or public networks can continue. Power routing devices and algorithms may allow electricity to be physically exchanged in a P2P way in the future.
Existing studies on ICT infrastructure basically verify that the existing ICT infrastructure and protocols are able to satisfy the needs of P2P energy trading. Future research directions include evaluating the communication burden and investment of designed P2P energy trading markets, dealing with non-ideal communication conditions (e.g., considering communication delay, distortion, and failure), and determining the optimal configuration and operation of ICT infrastructure for P2P energy trading.

Social science perspectives
P2P energy trading involves large numbers of small customers, and creates a new playground for social science energy research and practice. Existing sociological, anthropological, and psychological studies have suggested enabling diverse returns ("in-cash," "in-kind," and "intangible" returns), and acknowledge the dynamics of social relations in P2P energy trading. It was also found that, in addition to P2P energy trading in the market realm, "mutual energy trading" exists, which is mutually structured energy trading that involves social relations and diverse cultural values. Existing studies have also examined the impact of people's attitudes toward "autarky" and "autonomy" on the success of P2P energy trading markets. It was further verified that P2P energy trading is a consumer-centric scheme from a motivational psychology perspective. Moreover, P2P energy trading is considered to be a promising architecture that could facilitate the transition of society from commodity-based energy production to commons-based energy production.
Existing sociological, anthropological, and psychological studies were conducted for limited cultural backgrounds (e.g. rural India and Germany) and limited forms and mechanisms of P2P energy trading. Future studies can be made for a wider range of cultural backgrounds and considering wider forms and mechanisms of P2P energy trading, such as P2P energy trading between electric vehicles, P2P energy trading with auction mechanisms, etc.

Policy
Current regulatory schemes in the electricity sector are mostly based on the conventional power system paradigm, and must be changed to fit a future with P2P energy trading. Due to the great impact of regulatory changes and the immaturity of P2P energy trading, no radical change has been witnessed on a large scale across the world. Existing studies suggest that no "one-size-fits-all" solutions can be established.
Directions for future policy development regarding P2P energy trading include: ① defining the role and responsibility of prosumers and P2P energy trading markets; ② exploring the relationship between P2P energy trading markets, existing electricity markets, and other evolving entities such as DSO; ③ proposing appropriate schemes for the distribution of taxes and fees for P2P energy trading; ④ incorporating and providing incentives for flexibility; and ⑤ protecting vulnerable customers in the context of P2P energy trading.