A Survey on Energy Trading in the Smart Grid: Taxonomy, Research Challenges and Solutions

The smart grid is generally studied as an efficient and powerful electric grid. With the assistance of information and communication technology (ICT), the electric grid can increase the performance of the power grid system with smart energy management. On the other hand, with the usage of renewable energy resources (RERs), smart energy storage, and new transmission technologies in the power grid system, various new features such as real-time monitoring, fast restoration, battery displays, automated outage management, etc. have been assimilated into the smart grid. These new features generate more complexity in energy transmission and constitute important challenges like low energy consumption, high energy cost, social welfare, etc. while designing energy trading mechanisms in the smart grid. In the Internet-of-Things (IoT) era, several scenarios such as micro-grids, energy harvesting networks, and vehicle-to-grid (V2G) networks are present where energy trading plays an important role. However, in these scenarios, there are energy transmission and distribution, security and privacy, energy consumption, system reliability, the criticality of data delivery, and a few more challenges caused by distrust, non-transparent, and uncertain energy markets. Motivated from these challenges, we present a four-layered architecture of energy trading used in the smart grid. We propose a comprehensive background regarding the main concepts of energy trading and the implication of enabling technologies that manage the energy imbalances in the smart grid. Then, we present a problem taxonomy based on incentive, mathematical, and simulation model-driven approaches, which are widely used to control and maintain the energy trading mechanisms. Based on the findings from the literature, we also present a solution taxonomy with enabling technologies such as Energy Internet, Software-defined networking (SDN), and blockchain. In the end, a summary of future research directions based on the energy trading mechanisms is explored to provide deep insights to the readers.

energy trading, demand response (DR), and dynamic pricing. Among all of these mechanisms, energy trading is one of the most effective mechanisms, which accounts for the concern of both the supply and the demand sides. In this mechanism, the prosumers aim to provide electricity to consumers and adhere to the physical constraints of an electric grid [4]. They can schedule with the generators for generating energy as per the demand of energy by the end-users [5], [6]. On the other side, consumers reshape their demands according to the supply conditions. The energy demand from the consumers is the function of unit price that influences the supply strategies of the prosumers. The participation of prosumers and consumers in the wholesale market is accepted as the inevitable solution to enhance the economic efficiency of energy markets, reduce peak demand and price volatility, and improve the reliability of electric power systems. From the past few years, various DR programs have been promoted by power system operators to encourage the active involvement of end-users. Moreover, these programs can provide system services to the end-users at wholesale electricity markets. The DR requirements in wholesale markets, such as the minimum curtailment level, could curtail eligible customers or leave off potential small customers from participating in DR programs. The DR aggregation is acknowledged as an efficient solution to increasing the exposure of large volumes of consumers to wholesale energy markets. In this way, DR aggregators work with the customers to offer appropriate DR programs that would allow customers to participate in the wholesale energy market. The aggregators work with load-serving entities to provide customers with advanced metering data to monitor and control of real-time energy consumption in the energy market [7]. For this, simulation, incentive, and mathematical models used in energy trading provide great potential to the participants by optimizing the energy cost and energy consumption in the smart grid. Among all the models, incentive models such as price, bargain, game, auction, and contract theory are most commonly used for energy trading in the smart grid. But, to frame the energy trading mechanisms, game theory is one of the most popular and economic tools to analyze and maintain the rational interaction between two or more individuals. With these mechanisms, optimization, linear programming, Markov decision process (MDP), reinforcement learning, etc. are also used, which improve the energy consumption and find the right behavior of energy trading participants. Figure 1 shows the architecture of a smart grid that includes renewable energy resources (RERs), smart transportation, power technologies (investigate all aspects of electric power generation and distribution with significance on sustainable technology and environmentally sensitive issues), and widespread electric vehicles (EVs). With this, many new technologies have been introduced into smart grid such as micro-grids (smart building with wind generators, solar panels etc. and trade energy in a Peer-to-Peer (P2P) manner, V2G networks (EVs acted as energy storage devices [8]. They can sell their energy to the power grid as well as other vehicles in a P2P manner using local aggregator and reduce peak loads [9]), and energy harvesting networks (with this ability, the nodes can charge their battery from renewable energy/ mobile charger in a P2P way [10]). Moreover, the smart grid develops an efficient and green P2P energy trading [11]. Taking all the characteristics and features of energy management in the smart grid, the energy trading mechanisms become more complicated. So, there is a big challenge in the smart grid to improve the social welfare of energy transactions or exchanges between prosumers and consumers and make the energy trading system more reliable.
A. ANALYTICAL REVIEWS TO THE EXISTING LITERATURE Many research articles have been published on energy trading that manages the smart grid's energy demand and supply. For example, Bayram et al. [12] provided an overview of distributed energy trading concepts in the smart grid. They have presented the enabling technologies, which are required to communicate with trading companies. Similarly, Zhang et al. [13] discussed the incentive-based approaches adopted in energy trading control mechanisms. In the same way, Zhou et al. [14] discussed the existing agent-based simulation models used for electricity markets. Siano [15] proposed DR potentials and benefits in the smart grid, facilitating the coordination of efficiency in the smart grid. Wang et al. [16] provided a comprehensive survey on communication architectures used in the power grid system, which are responsible for delivering electricity and energy-related information to the end-users. Pagani and Aiello [17] presented a survey on different power grid infrastructure using complex network analysis technologies and methodologies. Abdella and Shuaib [18] presented a literature review of on-demand response optimization models, power routing devices, and power routing algorithms used in P2P energy trading. Similarly, Tushar et al. [19] provided a comprehensive review on P2P energy trading using blockchain. They have identified various challenges that address the virtual and physical layers of energy trading with the existing research. In the same way, Zhou et al. [20] proposed a comprehensive survey on P2P energy trading based on an academic paper, research papers, and industrial projects.
From the analytical reviews of the literature, we observed that no research article had been published that describes all the energy trading approaches and optimization models used for energy trading mechanisms. So, there is a need to investigate the various approaches and methods used for energy trading mechanisms in the smart grid. In this paper, we present the energy requirements and challenges of this mechanism, review existing approaches used for energy trading in the smart grid, and provide a relative comparison of the state-of-the-art approaches. Table 2 shows the comparative analysis of the proposed survey with the existing surveys.

B. CONTRIBUTION
The main contributions of this paper are described as under.
1) We propose a comprehensive background regarding the main concepts of energy trading and the implication of enabling technologies used to manage energy exchanges in the smart grid. 2) Then, a problem taxonomy is presented based on existing models like mathematical, simulation, and incentive, which are used for energy trading in the smart grid. 3) This paper also describes a solution taxonomy based on enabling technologies like Software-defined networking (SDN), Energy Internet, and blockchain to improve the energy cost and energy consumption in the smart grid effectively and efficiently. 4) Then, we provide future research directions, which can be beneficial for energy trading mechanisms in the smart grid.

C. ORGANISATION OF THE PAPER
The rest of the paper is organized as follows. The four-layered architecture of energy trading is described in Section II. Section III discusses the problem taxonomy based on various VOLUME 9, 2021 models used in energy trading. Section IV provides the solution taxonomy based on enabling technologies. Section V describes the open issues of energy trading in the smart grid, and finally, Section VI concludes the paper. The pictorial representation of the organization of the paper is shown in Figure 2.

II. ARCHITECTURE OF ENERGY TRADING IN THE SMART GRID
A smart grid is considered a typical cyber-physical system in which all the operations and mechanisms are controlled and managed by computer-based algorithms. To manage the energy trading in the smart grid (micro-grids and V2G) and minimize and optimize the impact of charging/discharging facilities, secure data exchange among EVs, charging stations, and distribution power systems, reliable communication are needed [21]. Based on the architecture of the smart grid [22], and the framework for the cyber-physical system [23], we present a four-layered architecture for energy trading mechanism in the smart grid is as shown in Figure 3. The energy trading architecture consists of an energy trading layer, a data acquisition layer, a communication network layer, and a market layer described as follows.

A. ENERGY TRADING LAYER
The energy trading layer includes energy aggregators (advanced metering infrastructure (AMI), local aggregators), energy nodes (smart buildings, EVs, and charging stations), and smart meters. The energy aggregators work as energy brokers to manage an exchange of energy and provide communication services to the network. The energy nodes are referred to as machines in which energy can be stored or generated. Then, this energy is transported via transmission lines, substations, and transformers to the end-users and customers. According to the architecture, they play different roles such as energy buyers and energy sellers in energy trading of the smart grid. Every node on this layer selects its role as per the current state of energy and future work plans. The consumed or used energy can be controlled and maintained by the smart meter used in the smart grid. It is an electronic device used for calculating and collecting the records of consuming and distributed energy in real time. Then, the consumers pay energy coins or money to the prosumers as per the energy records recorded on the smart meter.

B. DATA ACQUISITION LAYER
This layer is used to collect important information on energy consumption and energy distribution from different energy nodes through sensors, intelligent electronic devices, and monitoring devices. As per the requirements of an application, we can use the data acquisition modules. For example, in micro-grids, sensors and electronic devices collect data on energy consumption, such as power density and equipment power. But in the case of V2G, sensors are used to monitor the battery status of EVs, such as load, charging/ discharging status, temperature, current, etc.

C. COMMUNICATION NETWORK LAYER
Information and communication technology (ICT) aims to support, control, coordinate, and manage an exchange of energy among EVs, charging stations, and the power grid. This layer facilitates real-time exchange of energy between different energy nodes in the smart grid [24]. The communication infrastructure mainly includes connection devices, wired/wireless connections used for communicate information, servers, routers, circuits, switches, etc. It reduces the distance and makes the flow of information faster. It also saves time, budget, Information, ideas, and opinions, which can be shared among different energy nodes at any given time.

D. MARKET LAYER
This layer presents the business view of energy trading in the smart grid. It includes two parts, i.e., (i) the wholesale market and (ii) the retail market. The major role in the market domain are energy sellers, energy buyers, and the distribution system operator (DSO) worked as participants.
The important processes consist of bidding, decision-making, exchange of energy, and energy settlement of the market layer. It comprises all the financial and business-related aspects of energy trading in the smart grid. Energy market structures, the micro-economics of energy technologies, and energy billing belong to this layer. It also considered the various factors, such as investments, net present value (NPV), Levelized costs of electricity (LCoE), electricity tariffs, and pricing mechanisms of energy trading in the smart grid.

E. INTERACTION AMONG ALL LAYERS
This subsection defines the interaction among all the four layers used for energy in the smart grid. From the users' layer, i.e., the energy trading layer to the market layer, there is a need for the virtual energy market and physical energy network to enable energy trading in the smart grid. The physical energy network is used to exchange energy among various entities such as EVs, smart homes, charging stations, etc., while the virtual energy market platform is required for selling and buying the energy in a local energy market. The main aim of this architecture is to emphasize the importance of each layer and the current knowledge of each layer. The interaction among four layers show the number of research activities in the different disciplines and attempt to define the key elements of smart grids for sustainable energy and flexibility. It has been used to provide a market platform to consumers and prosumers that enable energy trading reliability and scalability. The architecture's main advantages having enhancement of system efficiency, reduced costs of energy, and deferral of systems upgrade because the data acquisition layer has various sensors and electronic devices to keep track of energy data efficiently and securely. Thus, passing the information to the market layer for consumers through switches and routers. In this way, the communication and interaction among these layers will support the real-time energy exchange among various entities in the smart grid.

F. CYBER SECURITY CHALLENGES AND SOLUTIONS
With ICT rising, which is the backbone of development, organizations and industries observe the growing cyber security threats in the smart grid [25]. The primary cyber security challenges in the smart grid are as follows.
• Hacking: One of the most common cyber security threats is hacking. It is exploiting a private network or digital system to gain unauthorized information. The severity of its impact on the smart grid is also increasing as hacking exposes sensitive data, leakage of private information of end-users, and causes major legal trouble.
• Phishing: This cyber security threat is sending out malicious files and deceitful communication that seems to be from an authentic source, but in reality, is meant to enter the system and harm the smart grid data.
• Man-in-the-Middle (mitm) attack: This cyber security attack mostly happens when an attacker includes themselves in a two-party transaction as an authenticator. When the attacker successfully enters the traffic, he can interrupt communication channels and steal the smart grid's information.
• Structured Query Language (SQL) Injection: A SQL Injection is a cyber security threat that occurs when the attacker injects harmful code into the system, causing it to divulge information, which under normal circumstances it is not authorized to do.
The key to effectively tackling cyber security challenges are described as follows.
• Raise Awareness: Cyber security challenges are not stagnant. Every day, there is a new threat, and everyone must be sensitized to the issues. The end-users must follow safety protocols while dealing with the digital data in the smart grid.
• Prevent Database Exposure: Some standard methods to prevent smart meter database exposure are keeping physical hardware safe, having a web application VOLUME 9, 2021 firewall, encrypting server data, taking regular backups, and limited access to servers.
• Implement Strong Authentication: Not having enough authentication processes is a common source of cyber security threats. At least a 2-step verification process must be implemented to protect all devices from cyber security threats in the smart grid.

III. ENERGY TRADING IN SMART GRID: A PROBLEM TAXONOMY
In this section, we discuss and review existing approaches used for energy trading in the smart grid based on incentive models [26], [27], simulation models, and mathematical models. The detailed view of these models is described in the following subsections. Figure 4 shows the representation of problem taxonomy.

A. INCENTIVE MODELS
In this subsection, we presented some theoretical issues based on incentive economic approaches, focusing on dynamic pricing, game theory, bargain theory, auction theory, and contract theory.

1) AUCTION THEORY
Auction is a mechanism used in the energy market to trade energy between sellers and buyers, which improves their utilities by purchasing the goods. The first-price sealedbid auction, descending-bid auction, ascending-bid auction, and the second-price sealed-bid auction are the four types of auction mechanisms [28]. The result of an auction is the amount of the final price of the goods used for trading. In an auction theory, several auctioneers value the goods by evaluation criteria for sale. This evaluation information is secret and private from one another. But there is unsymmetrical or unbalanced energy information in the auction process in which selfish auctioneers may change their true valuations by bidding the good untruthfully. This may harm the efficiency and truthfulness of the trade. In this context, Zhong et al. [29] proposed a Vickrey-Clarke-Grove auction mechanism to solve energy trading in a multi-energy system. This mechanism ensures three economic properties like truthfulness, economic efficiency, and individual rationality. Similarly, in [30], the authors proposed two auction mechanisms for two-layered V2G architecture that also ensures economic properties. In the same way, the authors in [31] proposed a V2G auction mechanism and analytic target cascading framework for the multiple micro-grids and distribution network to provide economic properties with social cost minimization. For instance, to buy the same amount of electricity, the grid or power utility can earn a high price during peak timings when the energy demand is more as compared to the offpeak timings. So, to improve the efficiency of electricity distribution, there is a need for autonomous and distributed energy management. In this context, the distributed auction scheme based on blockchain is suitable between local users and small-scale energy givers for autonomous management.
With the help of this scheme, the private information of the participants is shared only among local nodes to improve privacy and security, energy-efficiency and cost-efficiency of V2G network in the smart grid [32]. On the other hand, to consider the integrity and privacy of the smart grid, adaptive hierarchical auction-based energy trading schemes are important and play a major role for energy management. Due to increasing demands and limited capacity of the energy generation resources, one consumer may purchase or sell energy from the number of energy providers, where a multiitem energy auction scheme is required. Thus, using auction schemes in energy trading, the risk of lack of RERs and the fluctuations produced in generation of energy from RERs should be taken into consideration.

2) PRICE THEORY
It is a powerful approach for customers to act in an economically optimal manner. According to the demand for electricity, the smart grid load varies with time, which is analogous to electricity prices at different times. In this order, the pricing schemes can be categorized into three types [33], which are described as follows.
• Real-Time Pricing (RTP): It is generally the hourly rate that applies to customers on the usage of electricity on an hourly basis. This pricing is time-varying as per the current conditions of energy demand and must be informed to customers accurately and timely. So, it is the most useful type to improve the efficiency and efficacy of the energy markets [34].
• Time of Use (ToU) Pricing: This pricing is released in advance and unlike RTP, it is constant for a long period of time. It does not change with day-to-day changes in the energy market. It can reduce the overall costs for both the utility and customers.
• Inclining Block Rate (IBR) Pricing: It is designed for customers where prices are recognized based on electricity consumption levels. It charges a high rate per kWh at higher energy usage levels and a lower rate at lower usage levels. The average electricity consumption determines these levels in a period with the fixed thresholds. In this context, some researchers have used pricing theory to the manage energy trading efficiently. For example, Wu et al. [35] proposed a smart micro-grid model based on pricing theory by local energy traders. This model has benefits for customers as well as for producers from energy trading. They have used the two-layered optimization algorithms in which a bottom-layer optimization describes the energy trading decisions by customers and producers according to the price announced. In contrast, a top-layer optimization describes the gain of local energy traders with the benefits of energy consumers and providers. Similarly, Morstyn et al. [36] developed a strategy based on marginal pricing that manages and controls the uncertainty with energy prices and local energy trading between the producers and the customers. In the same way, the authors in [37] used the RTP scheme to satisfy the consumers and optimize the energy benefits of producers. The relationship between the demanded loads and the pricing scheme is defined as follows.
whereas, L represents the demanded loads, el is the price elasticity, P is the electricity price, and β is a constant. In this order, the pricing theory also has been used to balance the load via two-way energy flow between EVs and the smart grid. This theory solves the amount and time of the exchange of energy between them in the V2G system [38].

3) BARGAIN THEORY
It can be defined as a negotiation process during meetings between the workers and the employees to reach an agreement or to improve pay and conditions in the power electricity markets [39]. In the bargaining theory, the consumers can tackle energy consumption for their preferred payment in the smart grid. Unlike auction theory, which focuses on maximizing the utility function of bidders and auctioneers, bargain theory concentrates to achieve a fair and selfexecuting agreement. For a specific bargaining solution, it is usual to follow Nash's proposal. The solution should satisfy frequent axioms like efficiency, symmetry, scalar invariance, monotonicity, etc. So, the Nash bargaining solution is the unique solution of a classical bargaining problem, which satisfies the theory of scale invariance, symmetry, Pareto optimality, and independence of irrelevant alternatives. It maximizes the product of an agent's utilities on the bargaining set and many researchers follow the Nash equilibrium to solve the bargaining problem [40]. For example, Kim et al. [41] proposed a two-phase approach for addressing the nonconvexity of generalized Nash Bargaining among multiple micro-grids for direct energy trading. The first phase solves the optimal power flow problem, and the second phase determines the market price clearance. Their evaluation results show that they have reduced the network cost. For bargaining among the N number of players, the Nash bargaining problem can be defined as follows.
where U c i and U d i are the utilities of player i gained with and without collaboration respectively, and B * n is the Nash equilibrium solution with constraint of utility of the player gained with collaboration is greater than the utility of the player gained without collaboration.
The energy trading process in the smart grid includes several participants such as EVs, producers, consumers, and a different types of electric devices. Taking all these participants into a centralized bargaining process will increase the complexity of distributing bidding goods and bidding costs among collaborators. So, distributed bargaining process can be scalable and efficient solution with limited information exchange. In this context, Wang and Huang [42] proposed a Nash bargaining theory to strengthen and fair benefit in energy trading. They developed a decentralized solution with minimum information exchange overhead in energy trading. Their numerical results show the reduction of total cost of the interconnected micro-grids operation and an individual participating micro-grid achieved by 29.4% reduction in its cost through energy trading [43].

4) CONTRACT THEORY
According to the features and characteristics such as energy generation and energy consumption in energy trading, there are various types of participants. Commonly, each participant delivers the best trading scheme to earn more profit or reward. Moreover, due to asymmetric information (where one side participants are not aware of the other side) in energy trading, the problem may be intensified. So, to address this problem in energy trading, contract theory can be a viable solution that incentivizes the participants under asymmetric information [44].
Considering N number of participants in energy trading having each participant has its type (a i , b i ) where i ∈ N , N = 1, 2, 3, . . . , N . Here a i is the reward for i th participant to trade b i amount of electricity. VOLUME 9, 2021 For designing feasible contracts, it should satisfy the individual rationality and incentive compatibility constraints that are defined as under.
• Individual Rationality: A contract satisfies this constraint when the utility (U i ) of each type of participants must be non-negative, which is as follows.
This constraint motivates the trading where profit can be gained by self-interested participants.
• Incentive Compatibility: A contract satisfies this constraint when the contract of i th participant attain the highest utility U i they could obtain as follows.
So, a well-planned contract mechanism is utilized to maximize the benefit in energy trading. For example, Amin et al. [45] proposed a scheme to categorize energy suppliers for energy trading between electricity suppliers and an aggregator. They developed an optimal contractbased scheme that allows energy suppliers to sell their energy at different prices. Their energy prices are based on the cost of the production of unit that maximize the benefits of total cost to the aggregator. Their numerical results show the effectiveness of contract theory in energy trading. Similarly, Zhang et al. [46] proposed a contract-based direct energy trading model for energy buyers and sellers having uncertainty in the generation of renewable energy resources. In the same way, the authors in [47] proposed a cloudletbased vehicle-to-vehicle energy trading system. This system has been modeled by contract theory. The energy switch center purchases electricity from discharging vehicles and then resells it to the charging vehicles without transmission of energy on the grid. Their simulation results show that the proposed model increases the profit of energy switch centers compared to the other mechanisms.

5) GAME THEORY
This theory can be defined as where producers (suppliers) and consumers (demanding users) are participating in the local energy market of the smart grid. The change in one party can affect the strategies of other party. So, to balance and analyze the energy trading strategies, game theory can be a viable solution.
In a game theory, the main three components are set of players as N , its action as A i , and its corresponding utility function U i , where i represents the number of players N . In this theory, each player chooses its A i to maximize the U i . The utility function of one player does not depend only on its action but also depends on the other player's actions other than i. In a normal-form game (N, A, U), the expected utility U i for player i of the mixed-strategy profile s j = (s 1 , . . . , s n ) is defined as follows.
The main aim of the game players is to minimize and optimize the utility function by controlling the strategies like mid value, nash equilibrium, mid value+1, etc. From all the strategies, the most important one for game theory is known as the Nash equilibrium. In this strategy, a player cannot retrieve additional profits from changing actions or we can say that the other players remain consistent in the game strategies. According to the players, the game theory is classified into two types such as cooperative game and non-cooperative game. In non-cooperative games, individual players can compete with each other, whereas in cooperative games, the player can play only for self-enforcing.
In this order, non-cooperative games are suitable for P2P energy trading between the prosumers and the consumers. Instead, cooperative games are suitable for improving social welfare in energy trading with the help of a communication network. Several research articles have been published on energy trading in the smart grid using game theory. For example, El Rahi et al. [48] proposed a game to maintain price uncertainty in prosumer-centric energy trading. They formulated a single-leader, multiple-follower Stackelberg game where the power company acts as a leader that declares its price strategy for maximum profits. Prosumers act as followers who choose the optimal energy bid. Latifi et al. [49] proposed a solution for energy management and energy trading in the smart grid. They described the solution in three phases, i.e., (i) a game-theory based energy management model with reinforcement learning to schedule the power consumptions in micro/nano-grids, (ii) an incentive-based double auction mechanism for directly trading in micro/nanogrids, and (iii) an optimal power allocation program that reduces transmission loss and destructive effects of power in energy trading. Park et al. [50] designed an energy trading mechanism based on a contribution energy allocation scheme in the smart grid. A distributor distributes its energy to customers based on their contribution level, whereas customers receive this energy to maximize their utility. They have formulated the problem using non-cooperative game theory with the existence and uniqueness of the Nash equilibrium. Tushar et al. [51] proposed a cake cutting game that discriminates price technique and ensures envy-free energy trading. In this game, energy users set the price per unit of energy to sell surplus energy and study fairness criteria to attain maximum benefits. Their results show that the game possesses a socially optimal called Pareto optimal solution. The authors proposed a Stackelberg game model in eventdriven energy trading in micro-grids. This model provides an optimal bidding algorithm for retailers. Their simulation results show that this model has linearithmic complexity with acceptable expandability and applicable in time-varying cases [52]. Similarly, the authors in [53] proposed a gametheoretic approach for solving energy trading, which allows consumers to minimize the energy bill and producers to make a profit from their excess of energy. In the same way, Alsalloum et al. [54] proposed a game theory that frames the different interactions (different prices for the buyers) between the prosumers and the smart grid.
EVs are one of the prominent solutions for the sustainability issues needing critical attention like global warming, depleting fossil fuel reserves, and greenhouse gas emissions. They can also act as a storage system, to mitigate the challenges associated with renewable energy sources and to provide the grid with ancillary services, such as voltage regulation, frequency regulation, spinning reserve, etc. For extracting maximum benefits from EVs and minimizing the associated impact on the distribution network, optimal integration of EVs has been done. Mohammad et al. [55] proposed a literature on the modelling of grid-connected EV-PV (photovoltaic) systems. They presented a comprehensive review of modelling a grid-connected EV-PV system via, control architectures, charging algorithms, and uncertainty analysis. With this, EVs are various advantages like environmentally friendly, low noise production etc. to use EVs in the smart grid. But, some problems, such as energy consumption by EVs, are unstable and unpredictable [56]. However, EVs are sensitive to the decisions taken by their owners, which specifies their charging/discharging rates and the payments. For example, the authors in [57] proposed a both models, such as DR management and energy trading for EVs in an off-grid system. The hierarchical decision-making scheme of this model has been analyzed as a single-leader-heterogeneous multi-follower Stackelberg game. Their simulation results show that the transaction price decreases in the proposed market model as compared to an existing energy market models. Similarly, the authors in [58] discussed the network topology of energy trading for EVs in the smart grid, which has been considered as a multi-leader multi-follower Stackelberg game. Hence, by designing optimal game theories, EVs are accelerated to provide additional assistance to the V2G network and help to meet the service demand of the smart grid.
From the above-mentioned incentive-based approaches, we observed that game theory is one of the most popular and widely used techniques for energy trading in the smart grid. It optimizes the utility function that captures the tradeoff between economic benefits and related costs, such as reducing battery life, storage efficiency, etc. in energy trading.

B. SIMULATION MODELS
The simulation model-based study is used to exemplary the management and performance of multiple type of models at different scale of decision-making processes in the smart grid. These multiple models are the use of statistical learning algorithms such as reinforcement learning [59], Q-learning [60], so that energy traders can acquire longterm policies based on profit standards in an autonomous way [61], [62].

1) REINFORCEMENT LEARNING
It is an area of machine learning in which the products depend on the present input state and the next computation of product depends on the previous product output. In this learning, the output decision is dependent on the parameters that has been decided for the production [63]. Initially, reinforcement learning has been used for video and strategy board games but recently used for optimizing the storage of energy and generation of energy from RERs in the smart grid [64]- [66]. The optimal energy trading approach depends on the dynamic demand-supply and time-varying energy prices in the grid. Hence, it is very difficult for the grid to acquire such information in time [67], [68]. So, many researchers have used reinforcement learning that impacts the grid's future battery level and trading policies. For example, Chen and Su [69] described the learning module based on deep reinforcement learning in a holistic market model design as shown in Figure 5. The local energy market in the smart grid facilitates short-term and prompt energy exchanges [52]. The DSO or distribution network operator (DNO) is used for the regulation of energy markets in the smart grid having reinforcement learning. The utility providers provide energy not only to customers but also attempt several retail plans for long-term policies. Meantime, energy producers also develop their energy exchange approaches having several energy devices such as batteries and distributed energy resources. A local energy exchange can be satisfied by the advantage of the present distribution line and smart meters for billing and payment [70]. The authors in [71] developed a model for energy trading in the smart grid having reinforcement learning. This model optimizes the micro-grid battery level, estimation of energy generation from renewable energy resources, and the current demand of electricity in the smart grid. However, its performance degenerates at the large-scale of the smart grid with strict energy demand estimation error and latency [72]. To enhance the energy trading in the micro-grids, the authors have compared the deep reinforcement learning-based algorithms such as Proximal policies optimal (PPO) and Deep deterministic policy gradients (DDPG) [73]. Zhang and Yang [74] proposed a deep reinforcement learning-based double auction energy trading scheme to maximize the benefits of all agents, i.e., buyers and sellers. Their simulation results show that profits has increased for sellers and cost has decreased for buyers. Similarly, Lu et al. [75] proposed a deep reinforcement learning model for energy trading to solve the demand-supply mismatch problem and to optimize the battery level of the grid. Their simulation results based on the smart grid with three micro-grids each equipped with wind turbines show that this scheme increases the micro-grid utility compared to the existing schemes. Shateri et al. [76] proposed a deep reinforcement learning algorithm named deep double Q-learning to manage the privacy cost in smart meters during energy trading in the smart grid. Wang et al. [77] proposed an energy trading model based on the repeated game in which each micro-grid chooses its approach individually and randomly for trading and maximize its revenue. They have used two learning automation algorithms based on reinforcement learning that protects the grid's private strategy. Similarly, Peters et al. [78] used autonomous broker agents with reinforcement learning between sellers and buyers, which can operate in smart electricity markets and ensure profit-maximization and long-term energy trading policies. In the same way, the authors in [79] used broker agents modeled with MDP and Q-learning techniques.
Q-Learning is a classic form of reinforcement learning that uses Q-values (also known as action values). These action values improve the performance and efficiency of learning agent iteratively. This learning algorithm helps to make long-term trading policies for traders independently. For example, the authors in [70] proposed an indirect userto-user energy trading model in a localized event-driven market. They utilized reinforcement learning techniques built on MDP with a modified Q-learning to benefit all market participants. Furthermore, the work discussed by the authors in [80] proposed simulation-based modelling for local energy trading.
As per the discussion and existing proposals on simulation models, we observed that there is a need for more research on simulation models so that energy trading mechanisms utilize the deep reinforcement learning adequately and efficiently in the smart grid.

C. MATHEMATICAL MODELS
As time passes, there is an exponential increase in energy demand [81]. If this energy demand is not controlled and coordinated by equivalent energy response then there is a cause of peak hour load that leads to frequency deviation from normal values. This whole deviation destroys the energy trading system. So, various techniques must be executed by utility companies to assuage energy demand and control this balance. The strategy can either be used RERs for trading during off-peak timings to control and assuage the high energy demands or to handle the power grid units to generate high amount of energy that completes the demand of trading. However, this may result in high maintenance and operational costs and reduce performance because of underutilization. In this case, mathematical models are capable to find an optimal energy load to be traded. By the mathematical models like mixed-integer linear programming (MILP) [82], convex optimization [83], particle swarm optimization (PSO) [84], Lyapunov optimization [85], many researchers described the energy trading in the smart grid. These optimization techniques help study the effects of different components in energy trading and make predictions about behavior [86]. For example, Alam et al. [87] proposed an energy cost optimization algorithm to minimize the total cost of energy trading. Their simulation results show that 99% of solutions provided by this optimization algorithm are optimal ones. Lin et al. [88] established a model based on MILP to optimize the decision of a single end-user, which further decides the charge/discharge of the energy storage and the EVs on the Internet of Energy. Similarly, Zhong et al. [89] used the MILP for non-convex-based social welfare maximization and energy trading problems between the buyers and the sellers in a cooperative energy market. Alam et al. [90] addressed the residential energy cost optimization problem in the smart grid. The authors break down the mixed-integer non-linear programming (MINLP) problem having NP-hard complexity into multiple MILP modules and solve these modules iteratively. They have maintained the Pareto optimality so that no households are worse-off to improve the cost of others. In this paper [91], authors presented a distributed convex optimization technique for energy trading among various micro-grids. Their main aim is to minimize the total operational cost of the system by optimal exchange of energy by the micro-grids. Their simulation results show that the cost minimization algorithm proved convergence over non-connected microgrids. Similarly, the authors in [92] proposed a centralized and distributed solution for energy trading between two micro-grids. The central controller has accessed all the information, whereas a distributed approach solved a local optimization problem iteratively. They have used a convex optimization technique, which minimizes the transportation cost of energy exchange and total cost of the energy generation. Ramachandran et al. [93] employed a PSO scheme to minimize the cost of energy generation for realistic energy market prices, distributed generator bids chasing operational costs, and load bids as per consumers' priorities. They have used an auction process for the trading strategy. Their simulation results indicate that the viability and efficiency of the proposed system reduce the cost of energy by 37% as compared to the conventional method reduces only up to 35%.
In an another case, the energy generation from RERs and stochastic optimization methods used that addresses the ambiguity, mistrust, and uncertainty in energy generation. In this context, the authors presented a model in [94] where they proposed a profit maximization problem from consumers standpoint using stochastic programming. Similarly, Do Prado and Qiao [95] proposed a decisionmaking energy trading scheme between the customers and energy retailers. The authors have considered the stochastic native of DR participation of customers, which is solved by MILP. Hu et al. [96] proposed an energy management scheme in a micro-grid with multiple conventional generators, renewable generators, and energy storage systems. They have presented a robust two-stage optimization approach using Lyapunov optimization, which meets quality-of-service (QoS) to handle large difficulties in the load demands and renewable energy generation, and provides an efficient solution under limited computational resources.
From the facts discussed in mathematical models, we found that optimization techniques used in energy trading mechanisms are highly useful. Further, these techniques optimizing energy consumption and energy transmission cost. Table 3 shows the detailed summary of the existing proposals mentioned in the problem taxonomy of energy trading in the smart grid.

IV. SOLUTION TAXONOMY FOR ENERGY TRADING: ENABLING TECHNOLOGIES
This subsection discusses three enabling technologies for future energy trading in the smart grid, such as SDN, Energy Internet, and blockchain. These technologies are used in the energy trading mechanism because the traditional power system is highly dependent on a central authority that leads to a single point of failure. Also, there is a chance of destruction of private information of the participants, which causes security and privacy issues in the energy trading. So, to resolve and address these issues, we explore the energy trading mechanisms in terms of enabling technologies. The detailed view of these technologies is described as follows. Figure 6 shows the representation of solution taxonomy.

A. SOFTWARE-DEFINED NETWORKING-BASED ENERGY TRADING
Power routers play an important role in energy trading, which provides various key functionalities such as bi-directional energy flow, energy conversion i.e. kinetic energy to electrical energy and vice-versa, routing, and transmission scheduling. It is one of the core elements of the Energy Internet that provides bidirectional communication and two-way energy flow. For adequate, efficient, and effective management of power routers, there is a need for an influential routing, coordination, and powerful communication that are essential between routers to achieve global stability. In this context, many researchers have proposed a SDN architecture as a possible solution for managing the network infrastructure in smart grid [98]- [102]. Unlike traditional networking systems, SDN allows the rules of centralized control system and follows the dynamic configuration of network devices. We observed from the literature survey that SDN-based networking had been used in the existing smart grid systems for better efficiency and achieves better QoS. For example, the authors in [103] suggested an SDN-based networking architecture for digital grids routers in which control, data, and energy planes are separated. The control plane is referred to as a part of a centralized software controller. There are software-defined data and energy controllers used for data and energy flow control in this plane, respectively. In the data plane, various data types have been generated and transmitted. In contrast, in the energy plane, distributed renewable resources and energy storage are deployed at the user side and P2P energy trading can also done.
From the aforementioned facts, we believed that a SDNbased communication network could provide improved energy scheduling and energy optimization. Moreover, novel and efficient routing algorithms should developed to improve energy trading performance and quality in the smart grid system. Figure 7 shows the proposed SDN-based architecture used for energy trading in the smart grid. This architecture has three planes include control plane, data and energy plane, and infrastructure plane. It provides a better solution to energy trading to control and manage the data and energy in the smart grid. Thus, an essential feature of this architecture is the separation of the control, data, and energy planes. The technologies in the three planes, such as controllers, network devices, and grid devices, can be developed independently. These devices can communicate with each other by open interfaces and makes the infrastructure more flexible and energy-efficient. The control plane is used to manage the data dynamically and energy plane with their respective controllers. This plane achieves programmability and flexible cooperation between data and energy plane. The data plane is responsible for providing energy-related data services, while the energy plane is responsible for physical energy flow control. The infrastructure plane is referred to as a layer of users. The bottom layer of Figure 7 shows the three scenarios, such as micro-grid, V2G, and energy harvesting networks, which are used for energy trading in the smart grid.

B. INTERNET OF ENERGY-BASED ENERGY TRADING
Today's energy trading of the smart grid accommodates only power energy. However, energy can be generated from renewable and non-renewable energy resources such as chemical, thermal, and electromagnetic. From the study, we observed that the next generation will not only limited to electrical energy for energy exchanges but will incorporate all energy resources. The new and latest power systems are being created from this interconnection, which is known as Energy Internet [104]. It is anticipated as the Internet of energy networks, which aggregates all energy resources in an open inter-connection similar to the Internet. It is the combination of information technology (IT), power and electronics technology (PET), and smart management technology, and a large number of power networks, which are composed of distributed energy storage devices and various types of loads. Moreover, it provides flexible energy scheduling, bidirectional energy flow, and power conversions from one energy to other in the smart grid [105]. So, it is one of the promising technologies for P2P energy trading, and its consequences have been discussed in [106], [107]. According to the [108], Energy Internet solves a peak load shifting method in energy trading. The authors provided a P2P energy trading framework to end-users to trade the stored energy in their respective distributed energy storage facilities. Similarly, Lin et al. [109] proposed a energy sharing between the houses of the smart grid via Energy Internet. Their simulation results show that after sharing the energy, each house make a high profit in one day as compared to the existing energy sharing methods.
However, Energy Internet is developing technology that has not been consistent and standardized in the real world. Its concepts and methods have not yet been fixed, which makes it an interesting area for future investigation. But, energy trading based on the Internet-of-Energy (IoE) can encourage end-users to develop and store renewable energies to address energy issues (electricity demand) in the smart grid.

C. BLOCKCHAIN-BASED ENERGY TRADING
A big limitation in an existing V2G network is the lack of privacy and security of the energy transactions between consumers and prosumers [110]. The conventional energy trading architecture in the smart grid leads to high operating costs, high maintenance cost with low performance and productivity [18]. In an another way, a P2P energy trading architecture having blockchain offers a distributed platform that provides secure energy exchanges [111], [112]. In the traditional energy sector, due to high amounts of carbon emissions produced by the high carbon intensity of combustion of fossil fuels, which leads to air pollution and irreversible effects of climate change. Facing these environmental issues, on one hand, facilitate distributed RERs to be integrated into distribution systems for carbon mitigation and transmission efficiency. On the other hand, the authors have formulated a carbon pricing scheme using blockchain to charge carbon producers for allowances to phase out the power plants with extremely high carbon intensities. [113]. Blockchain is an emerging technology, which ensures immutability, security, privacy, tamper-proof payment transactions in an energy trading of the smart grid [114]- [116]. It allows verification, exchange, and the public storage of information in a distributed manner. It prevents the information from being changed or manipulated and provides verifiable of historical events and user anonymity without the involvement of central authority [117], [118]. The identity privacy and authentication of energy transactions are higher in a distributed platform instead of traditional platform [119], [120]. Also, this technology promotes electronic contracts named smart contracts between the energy prosumers and the energy consumers [121]- [124]. Moreover, it also supports the energy trading between the EVs that dynamically enter and leave the network in the smart grid system. These characteristics make the blockchain a viable solution to serve the distributed energy exchange market. In this context, Saxena et al. [125] proposed a blockchain-based P2P energy VOLUME 9, 2021 trading scheme that reduces peak demand and smart home electricity bills. Their simulation results show that peak demand reduces with weekly savings in a Canadian microgrid using the Hyperledger platform. Having the same platform, the authors in [126] demonstrated a P2P energy trading and energy sharing model having blockchain that reduces energy consumption at peak hours [127]. In a same way, Jamil et al. [128] proposed an energy model based on blockchain having Hyperledger Fabric network between the prosumers and the consumers to aggregate the information for monitoring real-time load. They have also used the data analytics technique for extracting hidden patterns and information for right decision-making and managing energy distribution. Abdella et al. [129] proposed Istanbul Byzantine fault tolerance (BFT) consensus having permissioned blockchain for energy trading in the smart grid. They have compared the proposed consensus with the existing ones such as ethereum clique, Hyperledger Fabric, and proof-of-work (PoW) and show the results that the proposed consensus has 15 times low latency and double the throughput. Khorasany et al. [130] proposed a proof of location consensus that provides location awareness in P2P energy trading of the smart grid. Petri et al. [131] implemented a P2P energy trading framework to support energy clusters and study the interactions between producers and consumers in the power grid. Their simulation results show that this implementation reduces the fluctuation in energy exchanges and costs. Similarly, Khalid et al. [132] implemented a hybrid P2P energy trading model using blockchain that reduces cost and peak to the average rate of electricity in the smart grid. In the same way, Aggarwal et al. [133] proposed a blockchain model for storing and accessing the data generated by smart homes in a secure manner. The model has 3 phases: 1) selecting smart home as miner node based on power capacity, 2) a block creation and validation, and 3) transaction handling for secure energy trading. Their evaluation results show that EnergyChain model performs better in terms of communication cost and computation time than the existing models. Wang et al. [134] proposed a minimum cut maximum flow theory to schedule distributed energy sources. They have used blockchain to record the information and management of power energy trading. Their simulation results show that the proposed system is cost-efficient for power energy consumption than the existing ones.
With this, game theory has been widely used for designing and analyzing energy systems. In this context, many researchers have used dynamic programming to maximize the benefits for trading participants [135] while others have used the incentive models and game theory for the purpose and framework of P2P energy trading in the smart grid [136]. These P2P energy trading models reduce the burden of electricity on a centralized power system to balance the load on the peak demand period [137], [138] and increases the profit of energy market participants [139], [140]. In addition, Esmat et al. [141] used the ant colony optimization with auction in a blockchain-based energy trading to provide fast trading settlements, security, and high level of automation. The main aim of blockchain-based energy trading is to inspire and strengthen the energy trading users to trade energy with one another so that the charging rates of central power stations may not affect the productivity and efficiency of the P2P energy trading [19], [142]. For example, Hassija et al. [143] proposed a blockchain-based protocol, i.e., directed acyclic graph for energy trading in V2G networks. They have used the game theory for the negotiation between the vehicles and the grid at an optimized cost [144]. Similarly, Liu et al. [145] proposed a non-cooperative Stackelberg game model to discuss the relationship between the sellers and the buyers in P2P energy trading. In the same way, Anoh et al. [146] proposed a Stackelberg game-theoretical model to secure the interactions between producers and the consumers in a virtual micro-grid. Their simulation results show that their trading model gives higher benefits to the trading participants than the other existing game models. Ullah and Park [147] proposed a two-tier clearing market model in a distributed P2P energy trading of smart grid that improves the economic benefits than conventional singletier market model. Similarly, Elkazaz et al. [148] proposed a decentralized-based and hierarchal P2P energy trading model for the management of energy of smart homes. They have used the MILP and shows the cost reduction in annual household energy management system. Chen and Zhang [149] proposed an incentive-based game theory model to secure energy trading between the EVs. To provide consistency in the data blocks, they have used a practical byzantine fault-tolerant (PBFT) mechanism that increases transaction throughput and reduces transmission delay. Their simulation results show that this model saves 64.55% communication overhead as compared to the existing models. In addition, Zhou et al. [150] proposed a blockchain-based secure energy trading for information asymmetry. They have used the contract theory and solves the optimization problem by the convex-concave algorithm. Their evaluation results show that the proposed model has achieved a high successful probability in block creation for energy trading transactions. Morstyn et al. [151] developed a bilateral contract networks between energy generators and consumers. Their network ensures scalability and price adjustment among traders.
Some researchers have used the P2P energy trading model to solve security and privacy problems in energy trading. In this context, the authors in [152] used the state channel-based energy trading that increases the throughput of blockchain and solves security and privacy problems in the smart grid. Similarly, Lu et al. [153] proposed a blockchainbased renewable energy trading model to provide security and privacy in the smart grid. Their evaluation results proved that the model gives high operational efficiency and low computational overhead. In a same way, Guan et al. [154] proposed an efficient secure and privacy-based energy trading scheme. They have used the attribute-based encryption with blockchain technology having credibility-based equity proof mechanism. Mezquita et al. [155] developed a smart contract on the Ethereum platform for blockchain-based energy trading in a micro-grid. This model provides security to the traders and ensures minimal energy cost and profitable energy production. In the same way, Gai et al. [156] solved the problem of privacy leakage in P2P energy trading using blockchain. Yi et al. [157] proposed a homomorphic encryption scheme for blockchain-based energy trading that provides privacy-preservation to the electric vehicles in the smart grid. Kang et al. [158] proposed a localized P2P electricity trading system with consortium blockchain method to achieve trust and secure electricity trading. They have used the auction mechanism to optimize electricity pricing and traded electricity among Plug-in hybrid electric vehicles (PHEVs). Similarly, Muzumdar et al. [159] proposed a Vickrey auction for blockchain-based P2P energy trading that ensures trustworthy, average throughput, and average cost-efficient. They have used the proof-of-stake (PoS) consensus having ethereum platform to aggregate the information of energy trading in the smart grid. In an another work, Hassan et al. [160] developed a differentially private energy auction for the blockchain-based micro-grid system, which modifies the Vickrey-Clarke-Groves auction mechanism. Their auction mechanism performs better in terms of cost, security, and privacy. It outperforms the traditional mechanisms to maintain the profit of overall network and social welfare and also maximizing the sellers' fund. Doan et al. [161] proposed a double auction mechanism for energy trading scheme in the smart grid. They have used the blockchain technology and maximizes the profit of all participants who are participated in the network and to achieve social welfare. Similarly, Guerrero et al. [162] proposed a P2P energy trading model based on continuous double auction and stable matching algorithm to find the shortest path between the agents. Their evaluation results show that the proposed system reduces the losses and line congestion in the energy markets. In the same way, Bandara et al. [163] proposed a flocking-based double auction in a decentralized P2P energy trading. Their trading model shows that they have 80% successful trading simulation results within neighbourhoods. In addition, Gomes et al. [164] proved by a case study that auction-based P2P energy trading decreases the energy costs without the need for load shifting consumption optimization or the acquisition of new equipment.
There exists a finite number of articles based on distributed P2P energy trading having blockchain [165]. However, it is a new technology and their integration with smart grid is not yet examined and analyzed to its full potential. Moreover, in many countries, blockchain-based standards and regulations do not recognize for P2P energy markets in the smart grid [166]. Hence, proper energy rules and standard need to be modified and explored before the implementation of P2P energy markets. In this context, Lu et al. [167] have discussed the blockchain technology in SDN-based distributed energy trading scheme in the Energy Internet. First, in a distributed Energy Internet architecture, the sheer volume of data makes it difficult for centralized systems to meet demand. Second, the security and privacy-preserving of distributed systems are difficult to solve. So, the authors have used RERs for energy generation, blockchain technology for protecting the privacy of energy transactions, and SDN has been applied to operate, control, and manage all parts of the system model as shown in Figure 8. Similarly, Chaudhary et al. [168] proposed an SDN in secure energy trading using blockchain in the smart transportation system. The distributed secure system used to authenticate, audit, verify, and validate the EVs participating in the network. Qian et al. [169] proposed a secure and efficient scheme for data aggregation in the smart grid. The authors have used homomorphic encryption that reduces the computation cost and resist quantum attacks on the data. It also provides security, data privacy and data integrity on the aggregated data in the smart grid. Similarly, Chen et al. [170] discussed the security, privacy, and anonymity in exchanges of energy flows and financial activity in the smart grid using blockchain implementation. Liu et al. [171] proposed a blockchain-based renewable energy incentive-based power trading mechanism in the smart grid. This framework provides security to the participants and improves the efficiency of power trading and renewable energy consumption. With security and privacy of the agents, the privacy-preservation of smart meter data in the smart grid is also a major concern [172]. For example, Shen et al. [173] presented a privacy-preserving twolevel random permutation method adequately and securely between massive meter data and their sources in the smart grid. Similarly, Mohammadali and Haghighi [174] presented a privacy-preserving homomorphic scheme with multiple dimensions and fault tolerance for metering data aggregation in the smart grid. In the same way, Sanduleac et al. [175] Proposed a framework for knowledge extraction from high reporting rate smart meters data to enhance the grid monitoring services with privacypreservation of the user.
By gaining the knowledge from literature review, we designed a P2P energy trading architecture using blockchain technology as shown in Figure 9. In this architecture, the energy coins are transferred from an energy buyer's wallet address to the energy seller's wallet address after the energy exchanges between them. The memory pool of energy aggregators (EAG) has latest energy blockchain data for verifying the payment transaction. The new transaction records generated by the energy buyers are uploaded to EAGs for auditing, which are further verified and digitally identified by the energy sellers. Therefore to obtain the proper balance between demand and supply on a blockchain energy, we implement incentives that reassure energy nodes to fulfill the energy demands out of self-interest. As per the duration of an energy trading, the energy seller is rewarded with energy coins with the contribution of energy exchanges between the energy sellers and the buyers. The PoW consensus mechanism is used on a blockchain to verify and validate the energy transactions between the energy sellers and buyers. Table 4 shows the detailed summary of existing proposals mentioned in the solution taxonomy of energy trading in the smart grid. It includes various parameters such as technology, type and No. of traders supported by the model, privacy and security, consideration of EVs, consideration of RERs, and cost-efficient energy production and transportation cost, which describes the difference among various existing proposals having enabling technologies.

V. FUTURE RESEARCH DIRECTIONS
To manage the demand and supply of electricity during energy trading is an interesting field of research. In this direction, a very less efforts have been done by the researchers and much more can be done. Here, we discussed some research directions based on P2P energy trading, which are described as follows.
1) Inter and Intra-community trading: In an energy trading, a energy producer should itself chose and have rights to choose whether it prefers to exchange energy with the consumers of intra-community or intercommunity. Similarly, there is a need for policies and methodologies ready in the energy market to solve this confusion, accommodating such flexibility to prosumers. 2) Privacy Consideration: The power system in the smart grid continuously collects data from micro-grids, V2G networks, which may cause some violation of the privacy of the participants. Data privacy in the smart grid is a major concern because this data may be used in various applications for analyzing and predicting data accuracy. So, blockchain-based P2P energy trading is a viable solution to ensure security, privacy, and tamper-proof data sharing among the prosumers and the consumers.

7)
Additional services to the grid: P2P trading has the potential to attain a private, reliable, secure, and costeffective energy trading among participants and make new alliances. So, there is a need for an extension that finds how such smart appliances and new services can help to provide better future in the smart grid to the endusers, such as smart appliances operated with virtual power plants. 8) Energy-efficiency: Energy consumption is the bottleneck of the EVs in smart grid communication. The charging/discharging capacity of the EVs depends on the energy present at their end. To enhance the energy-efficiency of the EVs in the smart grid, green energy resources, such as solar energy, wind energy are required to charge the battery of the EVs. 9) Cost-efficiency: The prosumers can collect high rates for trading electricity from the consumers to earn more profit. So, there is a need for P2P energy trading that provides a distributed platform between the producers and the consumers to earn equally profit. Also, there are several mechanisms used such as game theory, price theory, etc. to ensure optimized energy cost, energy distribution, energy transmission, and energy consumption at the time of P2P energy trading. 10) Smart contracts: A smart contract is a self-executing contract with the rules and regulations of the agreement that is directly written into programming lines of code. These are used for distributed applications to build trust between untrusted parties by making trust between them without any interference of a central authority, which may lead to various attacks (like mitm). Hence, for secure smart grid system, a need of smart contract solutions are required [176], [177]. 11) Lacks of standards and organizations: Many industries and organizations like VISA, Walmart, IBM, IEEE, and ITU are working on blockchain in various sectors like healthcare, financial services, supply chain, etc. to release new standards or upgrade versions in the existing ones. With this, the integration of blockchain with the other technologies is also explored. Still, there is a requirement of laws and proofs to implement the integration of blockchain with others in a real-time world. So, proper technical standards are needed to be developed to make efficient use of blockchain in P2P energy trading.

VI. CONCLUSION
In this paper, we reviewed and examined the energy trading mechanisms used in the smart grid. A discussion on the fourlayered architecture and requirements of the energy trading mechanism is carried out. Then, we reviewed a problem taxonomy on several typical models, such as incentive, mathematical, and simulation-based energy trading schemes. Especially, we mainly targeted on the approved schemes in which energy trading mechanisms constitute various design challenges. Further, a solution taxonomy based on energy trading having enabling technologies is discussed. From the literature review, several unsolved issues were extracted in energy trading between prosumers and consumers. Then, we provide a viable solution on a large view on SDN, Energy Internet, and blockchain, which provide efficient and effective energy trading in the smart grid. MAMOUN ALAZAB (Senior Member, IEEE) received the Ph.D. degree in computer science from the School of Science, Information Technology and Engineering, Federation University of Australia. He is currently an Associate Professor with the College of Engineering, IT and Environment, Charles Darwin University, Australia. He is also a cyber security researcher and a practitioner with industry and academic experience. He works closely with government and industry on many projects, including the Northern Territory (NT) Department of Information and Corporate Services, IBM, Trend Micro, the Australian Federal Police (AFP), Westpac, and the Attorney Generals Department. He has more than 150 research papers in many international journals and conferences, such as IEEE TRANSACTIONS ON INDUSTRIAL INFORMATICS, IEEE TRANSACTIONS ON  INDUSTRY APPLICATIONS, IEEE TRANSACTIONS ON BIG DATA, IEEE TRANSACTIONS  ON VEHICULAR TECHNOLOGY, Computers & Security, and Future Generation Computer Systems. His research is multidisciplinary that focuses on cyber security and digital forensics of computer systems with a focus on cybercrime detection and prevention. He is the Founding Chair of the IEEE Northern Territory (NT) Subsection. He delivered many invited and keynote speeches, and 24 events, in 2019. He convened and chaired more than 50 conferences and workshops. VOLUME 9, 2021