Applications of blockchain and artificial intelligence technologies for enabling prosumers in smart grids: A review

Governments' net zero emission target aims at increasing the share of renewable energy sources as well as influencing the behaviours of consumers to support the cost-effective balancing of energy supply and demand. These will be achieved by the advanced information and control infrastructures of smart grids which allow the interoperability among various stakeholders. Under this circumstance, increasing number of consumers produce, store, and consume energy, giving them a new role of prosumers. The integration of prosumers and accommodation of incurred bidirectional flows of energy and information rely on two key factors: flexible structures of energy markets and intelligent operations of power systems. The blockchain and artificial intelligence (AI) are innovative technologies to fulfil these two factors, by which the blockchain provides decentralised trading platforms for energy markets and the AI supports the optimal operational control of power systems. This paper attempts to address how to incorporate the blockchain and AI in the smart grids for facilitating prosumers to participate in energy markets. To achieve this objective, first, this paper reviews how policy designs price carbon emissions caused by the fossil-fuel based generation so as to facilitate the integration of prosumers with renewable energy sources. Second, the potential structures of energy markets with the support of the blockchain technologies are discussed. Last, how to apply the AI for enhancing the state monitoring and decision making during the operations of power systems is introduced.


Introduction
The power systems represent around 40 % of global carbon emissions from the combustion of fossil fuels [1].In efforts to meet the targets of net zero power systems, policy makers formulate measures for facilitating the integration of renewable energy sources (RESs) and encouraging changes in energy consumption behaviours.The smart grids refer to an intelligent power network which cost-effectively integrates information and control infrastructures to allow more reliable and efficient operations of power systems [2].From the perspective of information system infrastructure, the smart grids enable bidirectional communications between stakeholders in power systems such as the system operator, generators, and consumers, which facilitates the optimal operation of generators and the active engagement of consumers [3].From the control perspective, the interoperability of the smart grids enables the optimal coordination of various entities such as generation units or loads, to cooperatively achieve the overall benefits of power systems [4].
The regulatory supports and advances of smart grids enable consumers to actively produce, consume, and store energy through using distributed RESs, storage devices, and advanced metering infrastructures.The energy markets are transitioning to recognise and promote the emerging role of prosumers [5].The prosumers are small or medium sized energy users [6], e.g., residents, businesses, and industries, who also generate energy on-site, and strategically exchange energy with the utility grid or other prosumers to meet their own demand or make profits from the energy arbitrage.The emerging role of prosumers is expected to promote the demand side management (DSM) and therefore reduce the dependency on the fossil-fuel based generation with the long-distance transmission.Nevertheless, the involvement of prosumers also brings the following challenges from the perspectives of energy markets and power systems: • The structures of current energy markets are not suitable to accommodate the role of prosumers, since energy pricing schemes and balancing mechanisms are independent of the behaviours of energy exchange among prosumers [7,8].
• The information infrastructures of the current power systems cannot handle the increasing information flows caused by the decision making and transactions of large amounts of distributed prosumers [9].
• Given limited budgets for small or medium sized prosumers' control systems, it is hard for them to exploit historical data for optimally scheduling the generation and consumption according to their specific energy patterns [10].
• It is challenging to accurately predict prosumption behaviours given uncertainties caused by the intermittency of distributed RESs and flexible demand [11].Flexible structures of energy markets and intelligent operations of power systems are two crucial factors for addressing these challenges.These two factors can be fulfilled by recent scientific innovations on the blockchain and artificial intelligence (AI).From the perspective of the energy market, the blockchain provides the trading platform and technical supports for decentralised energy markets which are open and accessible to individual prosumers with the enhanced automation, security, and privacy [12].From the operational perspective, the AI supports control systems to strategically make decisions for optimising system operations and achieving certain goals [13], such as saving electricity bills, improving generating profits, mitigating carbon emissions, and predicting system uncertainties.The decisions are yielded by intelligent controlling approaches, such as the optimisation, game theory, and machine learn-ing, which can take advantage of historical data from power systems.The conceptual graph of incorporating the blockchain and AI in smart grids with the prosumers' integration is presented in Fig. 1.
The review presented in this paper is inspired by the issue of how the applications of blockchain and AI in smart grids could enable the integration of prosumers to decarbonise power systems.The rest of this paper is organised as follows: From the regulatory aspect, Section 2 introduces how to trace carbon emissions and then impose the carbon cost on fossil-fuel based generation while promote the engagement of prosumers with the distributed RESs.From the aspect of market structures, Section 3 identifies the potential structures of energy markets when integrating the role of prosumers, and reviews the research on blockchain implemented in decentralised energy trading.From the operational aspect, Section 4 reviews the research on how the AI supports the control and decision making of stakeholders in power systems.Section 5 draws the conclusion of this paper.

Carbon emissions tracing and pricing
This section reviews approaches for carbon emissions tracing in power systems as a foundation to inform the policy design, and then discusses how international regulations and existing research price carbon emissions from the fossil-fuel based energy generation.

Carbon emissions tracing in power systems
In the context of this review paper, the term of carbon emissions refers to the carbon dioxide equivalent which is a metric to measure the emissions from various greenhouse sources by converting the amounts of these sources to the equivalent amount of the carbon dioxide according to their global warming potentials [14].The carbon emissions from power systems can be accounted by the carbon intensities or carbon emission flows (CEFs).The carbon intensities quantify the amount of carbon emissions per unit of energy generation by evaluating the carbon content of fossil fuels and generating efficiency [15].The CEFs trace carbon emissions from generation when the power is transmitted and consumed [16], which is crucial for fairly allocating the responsibilities of carbon reduction and encouraging the demand side engagement.

Carbon intensities
Evaluation of carbon intensities has been focused by a majority of research [17,18,19,20].The research in [18] investigated the relationship between the dynamic carbon intensities and the levels of the part-load operation of fossil-fuel based power stations using historical data from power systems.The marginal generators, e.g., coal and gas, are generators which respond to the changes of RESs outputs by operating at the part-load state [18].The part-load operation of the marginal generators would reduce efficiencies, which consumes more fossil fuels and raises the carbon intensities.To further investigate the impacts of this part-load operation on the carbon emissions, researchers analysed the historical data of all generation sources [17], marginal generators [19], and demand [21], through which three corresponding types of emission factors were defined: the average emission factor, marginal displacement factor, and marginal emission factor.The average emission factor quantifies the part-load impacts on the annual average carbon emissions from all power generation sources; The marginal displacement factor quantifies the part-load impacts on the carbon emissions from generators operating at the margin; The marginal emission factor quantifies the part-load impacts on the carbon emissions from the marginal changes of the power demand.Moreover, to audit the carbon emissions caused by the RESs, the long-term average carbon intensities evaluated by the life-cycle carbon analysis [22] are used.

Carbon emission flows
To facilitate the demand side engagement for decarbonising power systems, the responsibilities of carbon emissions from generators can be shared by consumers and prosumers, since the consumption and power import from the utility grid are the primary driver to the fossil-fuel based generation.Sharing the responsibilities of carbon emissions requires the information of how much carbon emissions are produced by generators when transmitting and consuming per unit of energy.This information can be obtained by analysing the topological structures and power flows of power networks using the CEFs.The CEFs are virtual network flows concurrent with the power flows to analyse the responsibilities of carbon emissions for every component of power networks including transmission lines and loads [16].
The approach of CEFs has been focused in the literature.The concept of CEFs was initially created from international trades to audit carbon responsibilities among countries.Ståhls et al. [23] analysed the international carbon flows from a consumption-based perspective and identified the portion of carbon emissions from industrial exports.Further research implemented this concept into power systems to identify the carbon emissions incurred by consumption behaviours.In [24], an approach was developed for analysing the CEFs to determine the indirect carbon emissions caused by consumption behaviours, by which the regional variation of carbon emissions was identified.Kang et al. [25] quantified the carbon emissions from the power delivery process by analysing the operational characteristics and topological structures of power networks.

Policy design for pricing carbon emissions
The carbon pricing is a market based policy to address carbon emissions caused by the combustion of fossil fuels [26].This policy enforces the pollutant emitters to compensate the environmental damage in a monetary manner, which increases the costs of using fossil fuels and subsequently encourages the engagement of prosumers with their distributed RESs.Two primary forms of carbon pricing are the carbon tax and emissions trading scheme.By the end of 2019, the policy of carbon pricing has been implemented in 46 countries, of which 25 countries adopt the carbon tax and 21 countries adopt the emissions trading scheme [27].

Carbon tax
The carbon tax levies a fixed rate on carbon content of fossil fuels [28].This fixed rate is determined by the social cost of carbon which quantifies the marginal damage costs of carbon emissions to the society [29].

Emissions trading scheme
The emissions trading scheme, also known as the cap-and-trade scheme, is an alternative form to the carbon tax.Under the emissions trading scheme, the policy makers allocate a certain amount of carbon allowances for a given time period [30].Carbon producers are obliged to have an enough amount of carbon allowances covering the amount of their carbon emissions.The surplus or deficiency of carbon allowances can be traded among these carbon producers [31].
Nonetheless, an inappropriate carbon price determined by the emissions trading scheme would inefficiently deliver the targets of carbon reduction.If the carbon price lies below the social cost of carbon or the rate at which the targets of carbon reduction can be achieved, it would insufficiently stimulate the mitigation of carbon emissions; If the carbon price in one region is higher than the carbon price in another region, the market competitiveness of carbon producers in the high-price region would be harmed.The carbon producers are prone to discharging carbon emissions in the low-price region, while the total amount of carbon emissions remains unchanged, which is defined as the carbon leakage issue [32].
To overcome the issue of an inappropriate carbon price, the carbon price floor and ceiling are implemented in current international carbon markets by setting additional limits to carbon prices [33].For the case of the U.K. carbon market, since the carbon price of the E.U. emissions trading scheme is lower than the social cost of carbon in the U.K., the carbon price had failed to incentivise the U.K. coal-to-gas transition before 2013 [34].Afterwards, the U.K. has formulated the carbon price floor as the lower bound of the carbon prices from the E.U. emissions trading scheme.The U.S. has set a similar price floor and facilitated the carbon auctions since 2009 [35].In New Zealand, a carbon price ceiling has been enacted by a fixed price option to prevent high carbon prices and protect the market competitiveness of domestic carbon producers [36].
The relationship between the emissions trading scheme and energy markets is presented in Fig. 2. The emissions trading scheme is linked to the energy markets through the carbon emissions and incurred carbon cost of generation companies.As a key stakeholder in energy markets, generation companies need to register an operator holding account in order to participate in the carbon markets [37].With this operator holding account, generation companies can 1) receive free carbon allowances from regulators if they are eligible, 2) bid carbon allowances from the auction market held by regulators, 3) buy/sell carbon allowances from/to other pollutant emitters with surplus/deficiency of carbon allowances at the secondary market, and 4) prove to regulators that their carbon allowances cover their reportable emissions.Purchasing carbon allowances, i.e., carbon cost, is a part of operational costs of generation companies, and the carbon cost varies depending on the carbon intensities of different generation technologies as where c carbon n is the carbon cost of the generation company n, π carbon is the carbon price determined at the auction or secondary markets with the unit of GBP/ton, i g,n is the carbon intensity of the power plant g belonging to the generation company n with the unit of ton/MWh, G is the index set of all power plants belonging to the generation company n, p g,n,t is the power output of the power plant g belonging to the generation company n at the time step t with the unit of MW, T is the index set of time steps, and ∆t is the time interval.
The life-cycle carbon intensities of different generation technologies are compared in Table 1.It can be seen from the table that the carbon intensities of fossil-fuel based generation technologies are higher than those of RESs, and therefore the generation companies with fossil-fuel based generation need to afford more carbon cost according to Eq. (1).In the energy market, the carbon cost is further passed from generation companies to consumers through wholesale energy markets and retail energy markets (see Fig. 2), in the form of increased electricity bills.The projection of the future UK carbon cost under the UK emissions trading scheme is presented in Fig. 3, which includes four scenarios of societal changes in achieving the 2050 net zero target identified by the nationalgridESO future energy scenarios 2020 [40].The scenario of the steady progression indicates the slowest path to the decarbonisation compared to other scenarios, under which the energy supply would heavily rely on the natural gas and domestic heating, while there will be slight increase of the home insulation and uptake of electric vehicles.Due to the relatively low carbon cost, this scenario would fail to achieve the net zero target by 2050.The scenario of the system transformation indicates a significant transformation on the supply side while slight changes on the consumers, whereas the scenario of the consumer transformation indicates a significant level of consumers' engagement through the high penetration of low carbon heating sources, electric vehicles, smart energy managements, and storage devices.Both scenarios of the system transformation and consumer transformation have the same trend of the carbon cost and will achieve the net zero target by 2050.The scenario of the leading the way indicates the most progressive path to the net zero target, by which different areas will achieve decarbonisation in their earliest dates with the highest consumers' engagement, improvement of energy efficiency, and investment in low carbon technologies, and therefore this scenario yields the highest carbon cost.Given the link between the emissions trading scheme and energy markets, separately designing the carbon and energy markets would be inefficient.Recent research has highlighted the importance for coupling the energy and carbon markets.Zhang et al. [41] integrated the emissions trading scheme into the unit commitment problem of electricity generators, enabling generation companies to trade energy and carbon allowances simultaneously.Huang et al. [42] analysed how the emission price, emission quality, and time related factors drive energy generation companies to participate in the emissions trading scheme.Researchers in [43] implemented the EU emissions trading scheme to control the emissions from a group of micro-generators.
Since increasing numbers of prosumers participate in the peer-to-peer energy trading and take the responsibilities of carbon reduction, designing decentralised emissions trading scheme has drawn attentions from recent research.Fawcett [44] reviewed the personal carbon trading undertaken by the UK government in 2008 which assigns individuals a tradable carbon allowance to cover emissions from personal energy consumption, and highlighted its importance for the individual and social change in terms of carbon reduction.A peer-to-peer trading framework was developed in [45] enabling prosumers to trade energy and carbon allowances together, in which a decentralised carbon incentive was formulated targeting on specific energy behaviours of prosumers to achieve the local energy balance and carbon reduction.Yan et al. [46] proposed a blockchain based transacting energy and carbon allowance between microgrids and the distribution system operator.

Comparison remark
As two well-established policy instruments, the carbon tax and emissions trading scheme have following aspects in common: • Both the carbon tax and emissions trading scheme impose a price on carbon emissions for facilitating carbon producers to internalise the cost of environmental damages.
• Instead of the command-and-control based policy that sets out and enforces specific actions for carbon reduction, the market based policy can flexibly incentivise carbon producers for strategically responding to the carbon prices.
• Market based policy can generate public revenue through charging the carbon tax or selling the carbon allowances.This revenue can be further redistributed for investing in low carbon technologies such as RESs and the carbon capture and storage, so as to achieve the carbon revenue neutrality [47].
The differences between the carbon tax and emissions trading scheme are as follows: • The carbon tax gives a certainty to the price of carbon emissions through a fixed tax rate, whereas the emissions trading scheme gives a certainty to the quantity of carbon emissions through the fixed total carbon allowances [48].
• The carbon tax is easier to be implemented since it is based on the established tax systems.By contrast, the emissions trading scheme is more flexible since it can embed financial innovations, e.g., peer-to-peer trading and options.

Remark of research challenges
Although the carbon pricing has been implemented as practical regulations and investigated in the literature, there are still opportunities to incorporate dynamic and decentralised policy measures targeting on high-carbon generators and consumers.This is because the long-term policy for overall power systems cannot specifically target on real-time power profiles and incurred carbon emissions.
Furthermore, with the increasing engagement of prosumers into local energy markets, tracing carbon emissions caused by individual energy patterns presents a challenge.These energy patterns are reflected by how a prosumer responds to pricing incentives through determining its on-site generation, consumption, and energy exchange.Tracing prosumer-centric carbon emissions is particularly important when assigning personal carbon allowances to individual prosumers.

Energy markets transition with prosumers' integration
This section identifies the potential structures of decentralised energy markets with the integration of the role of prosumers, and then reviews the research and innovations on how to exploit the blockchain technologies including smart contracts for facilitating the decentralised energy trading.A transition of energy markets towards decentralised generation and consumption is crucial for the integration of the emerging role of prosumers.The potential structures of such markets have been well investigated [5] and three primary structures are identified: 1) peer-to-peer trading markets, 2) intermediary-based trading markets, and 3) microgrid-based trading markets.These three structures of energy markets are based on the information and control infrastructures of smart grids, and categorised by the functions of control units and associated manners of the information exchange.A schematic illustration of these three structures is presented in Fig. 4, where each dot represents a control unit and each interconnected line represents an information flow.The comparison of these three structures is presented in Table 2 with details introduced as follows.

Peer-to-peer trading markets
The peer-to-peer trading markets are structured as a completely decentralised framework [55], under which the energy and services, e.g., DSM, storage capacities, and carbon credits, can be directly traded among prosumers.In comparison to the other two market structures, the peer-to-peer trading markets are the least structured framework.Instead of using central authorities, e.g., aggregator, as a control unit, each individual prosumer becomes an independent unit to perform control functions and exchange information with each other [56].The behaviours of prosumers are directly incentivised by their individual bidding/selling prices.The role of the distribution system operator remains as managing the trading platform and providing the power distribution function [57].Hence, this framework allows individual prosumers to directly participate in energy markets while increases the burdens of control and information flows.As practical cases, the RWE [49] has developed the peer-to-peer trading platforms integrating the functions of the decentralised generation control, grid management, communication, automation, and security.The Power Ledger [50] provides a software based peer-to-peer energy trading for 11,000 participants from residential and commercial consumers in Australia.

Intermediary-based trading markets
The intermediary-based trading markets are more structured than the peer-to-peer trading markets, under which an ensemble of prosumers is organised as a community such as smart buildings and virtual power plants.Each community is managed by an intermediary, e.g., aggregators or retailers, as a control unit to perform control functions and exchange information with each other.All generation sources, loads, and storage capacities within a community are pooled to collectively coordinate resources for local benefits.The intermediary can earn bonus from regulators or utilities by providing prosumers with services, e.g., the improvement of residential energy efficiency, DSM, and setup of RESs.
An example of the intermediary is the Stem [51] which has designed a platform to provide the storage service and DSM for consumers in California through the real-time optimisation and automated control.The company of Energy and Meteo Systems [52] in Germany has established a virtual power plant via a digital control centre with the services of the real-time data management, remote control of wind and solar generation, energy scheduling, DSM, and balancing management.

Microgrid-based trading markets
The microgrid-based trading markets are the most structured framework, under which prosumers connect to microgrids and microgrids can either connect to utility grids or operate in an islanded mode [58].Analogous to the peer-to-peer trading markets, each individual prosumer is an independent control unit connecting to the microgrid without the intermediary.When a microgrid connects to the utility grid, prosumers can sell surplus generation to the utilities [5].In this case, prosumers would be incentivised to generate more energy for earning profits.When a microgrid operates in an islanded mode, the surplus generation can be stored within the microgrid or used for load shifting services [59].In this case, prosumers would be incentivised to strategically schedule their generation and consumption for the local energy balance.
As practical cases, the Asea Brown Boveri Ltd [53] provides microgrid solutions for customers to ensure the reliable, stable, and affordable power supply.The LO3 Energy [54] has developed the Brooklyn microgrid integrating 130 buildings to facilitate the DSM and improve communication infrastructures.

Blockchain supporting decentralised energy trading
This subsection introduces the concepts, advantages and limitations of blockchain technologies.The smart contracts which are the second generation of the blockchain technologies and the most potential application in the decentralised energy trading [60] are specifically focused.The research and implementations on applying the blockchain technologies in the decentralised energy trading are reviewed and subsequently compared to the conventional centralised trading.

Blockchain Technologies
Blockchain technologies [61], as one of the distributed ledger technologies, have the potential to establish a platform for the decentralised energy trading.The blockchain can prevent the replay attack and double spending attack [62] in energy markets, i.e., the same energy is sold twice or the same digital currency is spent twice, through accounting the ownership of these assets.The decentralised feature of the blockchain enables a ledger to be held and verified by all energy market participants [62].Hence, the trading platform is open and accessible for all prosumers, system operators, and market operators.The disintermediating feature of the blockchain transits the role of energy suppliers or aggregators to a neutral facilitator for encouraging prosumers' participation [63].The encryption of the blockchain protects prosumers' private information such as addresses, transactions, and power profiles.The computational difficulty of block mining and collective validation for reaching a consensus guarantee the security of trading networks [64].
Nonetheless, due to the technical limitations of current blockchain technologies and the conflicts with physical assets of power systems, the application of blockchain technologies also brings challenges.First, theoretically the blockchain networks allow the prosumers at anywhere to trade energy with each other.However, this would violate the physical restriction of power systems and cause higher power losses over the long-distance transmission.How to ensure prosumers to trade energy within their distribution networks presents a challenge.Second, the throughput, i.e., transactions per second, of the blockchain is lower than the existing trading technologies, whereas the latency, i.e., time per verified transaction, of the blockchain is higher than the existing trading technologies.For instance, the throughputs of the Ethereum, Bitcoin, and Visa are 15 [65],7 [66], and 2000 [67] transactions per second, respectively, whereas the latencies of them are 3 [68], 10 [69], and 0.05 [70] minutes, respectively.

Smart Contracts
Blockchain technologies have evolved from the first generation of the Bitcoin and cryptocurrency to the second generation of the Ethereum and smart contracts.In the field of the decentralised energy trading, the most potential application of the blockchain technologies is the smart contracts.The smart contracts, coined by Szabo in 1994 [71], enable executable programs to be performed in a manner of the self-enforcing settlement and setting out negotiation [72].This supports the automatic control and interoperability of the smart grids, so as to reduce the burdens of handling information exchanges among prosumers.A general form of the smart contracts is 'If an event A happens, the smart contracts pay the currency B, deposited by the buyer C, to the seller D' [73].The replicable feature of this general form of the smart contracts ensures standardised trading procedures with reduced transactional costs, and also prevents unforeseen trading behaviours.On the context of the energy trading, the event could be the supply of energy or other services, e.g., the DSM, which is monitored by smart meters of prosumers.The pay function is executed in a self-enforcing manner.Hence, the trustworthiness of the energy trading is dependent on the trustworthiness of smart meters and programs to be executed on the smart contracts.Nevertheless, the interactions between the smart contracts and smart meters or controllers require the design of new communication protocols and interfacing domains.

Research and implementations
The blockchain and smart contracts applied in the power systems control and decentralised energy trading are the subject of active research and practical implementations.Thomas et al. [12] proposed a general form of smart contracts for negotiation and controlling energy transfer process between separated distribution networks.In [74], the real-time power losses caused by energy trading in microgrids were accounted by the blockchain, by which the prosumers were considered as negotiators of energy trading and distributors were responsible for computing losses.Li et al. [75] applied smart contracts into distributed hybrid energy systems to facilitate the energy exchange among the end-user.The DSM and uncertainties caused by the renewable generation were considered into the designed framework of the peer-to-peer energy trading.Mihaylov et al. [76] designed a paradigm for the energy trading with a virtual currency generated from the energy supply.Case studies of this research testified that the designed currency incentivised prosumers to achieve the demand response and energy balance.Saxena et al. [77] proposed a blockchain based transactive energy system to address the incentivising, contract auditability and enforcement of the voltage regulation service.The smart contracts were used by this research to enforce the validity of each transaction and automate the negotiation and bidding processes.In [78], a transparent and safe energy trading algorithm executed on the Ethereum blockchain platform was presented.
To enhance the carbon pricing scheme, blockchain technologies have also been developed to trade the carbon allowances or allocate the incentives for decarbonisation.Khaqqi et al. [79] customised the trading of carbon allowances to industries using a reputation based blockchain network by which the reputation signified participants' performances and commitments for the carbon reduction.Pan et al. [80] implemented the blockchain into the trading of carbon credits to reduce the entry threshold of carbon markets and improve the reliability of information exchange.Analogously, Richardson and Xu [81] proposed a blockchain based emissions trading scheme to ensure the transparency, tamper-resistance, and high liquidity.With respect to the application of smart contracts, a distributed carbon ledger system fitted with existing emissions trading schemes was designed in [82] to strengthen the corporate carbon accounting systems.

Comparison between the centralised trading and blockchain based decentralised trading
The difference between the conventional centralised trading and blockchain based decentralised trading in energy markets is summarised in Table 3, with detailed explanations as follows: Idiosyncratic contracts [83] Standardised smart contracts Settlement enforcement [72] Legal restriction Self-enforcement Trustee [72] Third First, the primary generators in the conventional centralised trading are large-scale fossil-fuel based power plants connecting to transmission networks, whereas the primary generators in the decentralised trading are prosumers with distributed RESs connecting to distribution networks.
Second, the pricing scheme in the conventional energy trading reflects the supply-demand balance of overall energy markets.For instance, the wholesale electricity prices are determined by the uniform market clearing pricing or pay-as-bid pricing [84].By contrast, the prosumer-centric pricing scheme in the decentralised energy trading can reflect individual supply-demand balance.
Third, the contracts for the conventional energy trading are idiosyncratic [83], which means that the contents of contracts are negotiated between generators, suppliers, system operators, market operators, and policy makers.By contrast, the smart contracts formulate standardised auction procedures for the decentralised energy trading, which is replicable for all prosumers, which can prevent unforeseen trading behaviours of prosumers Fourth, the settlement of the centralised energy trading is enforced by legal restrictions, which means that if the energy or other services are not delivered, generators or suppliers would receive penalty afterwards.By contrast, the self-enforcing settlement of smart contracts enables the violation of contracts to be prevented beforehand by querying smart meters to ensure that the prosumers have enough capacities to supply.
Fifth, the trustworthiness of the conventional energy trading relies on a third party, e.g., the auditing institutions or market operators, whereas in the blockchain based decentralised energy trading, the trustworthiness of prosumers relies on the consensus of blockchain networks and the interface between smart contracts and smart meters.

Remark of research challenges
Although these innovative structures of energy markets and the blockchain based decentralised energy trading can support the integration of prosumers, the transition of energy markets also raises a series of challenges as follows: First, when prosumers feed their distributed generation into the utility grid, the issues on market operations, e.g., negative energy prices [85], and grid operations, e.g., the voltage spike [86], power imbalance [87], and harmonic distortion [88], would challenge the control infrastructures and protocols of current power systems.
Second, for these decentralised energy markets without central authorities, how to maintain the overall benefits of power systems, e.g., the resilience and carbon mitigation, presents a challenge.This requires sophisticated rulesets, incentive measures, and pricing schemes to align individual prosumers' behaviours with systems' benefits.
Third, the transaction costs of the current blockchain platforms are high compared to the conventional IT based trading systems.Fig. 5 shows the average transaction fee for two of the most prominent blockchain platforms, i.e., Bitcoin and Ethereum.The high transaction cost would pose a barrier for prosumers to participate in the peer-to-peer energy trading.

Artificial intelligence supporting operations of power systems
The advanced metering infrastructures of smart grids produce a substantial volume of useful data.This data could be exploited by the AI to improve the situational awareness and operability of power systems.This is particularly useful when small or medium sized prosumers participate in the operations of power systems and make decisions independently, given limited budgets of their control systems.According to the research [10], the cost of control solution at the household level is on the order of 57 USD per year.In this section, the state-of-the-art approaches of the AI applied in the operations of power systems are reviewed.

Analysing and optimising operations of power systems
This subsection introduces the approaches implemented to analyse and optimise the operations of power systems.The game theory is a collection of analytical tools for modelling the strategic decision making and interactions among stakeholders in power systems.The optimisation provides a solution to find optimal decisions for delivering certain objectives.Additionally, uncertainties caused by the intermittency of RESs and flexible demand would affect the accuracy of the power systems modelling.This review also discusses the statistical approaches for predicting these uncertainties.

Game theory
The Cournot and Stackelberg are two classic models for analysing decision making of stakeholders.The Cournot model describes that market players supply homogeneous products, and compete on the amount of supplied products by making decisions independently and simultaneously [90].The Stackelberg model features a hierarchical two-level or multi-level sequential decision making process [91].For the two-level decision making, the players are categorised into a leader-level which makes decisions first and a follower-level which makes subsequent decisions responding to the leader's strategies.For the multi-level decision making, after the first level of followers makes responding decisions, they become a leader-level to make decisions prioritising the decisions of the next level of followers.This process continues until the last level of followers makes their responding decisions.

Optimisation approaches
The optimisation approaches can be categorised as programming techniques and heuristic algorithms.The programming techniques include the linear programming, integer linear programming, mixed integer linear programming, and non-linear programming.The linear programming refers to an optimisation problem in which all objective functions and constraints are the linear functions of decision variables [92].In the integer linear programming, only binary values and integers can be used as decision variables [93].In the mixed integer linear programming, both integers and non-integers can be used as decision variables [94].The non-linear programming refers to an optimisation problem in which at least one objective function or constraint is the non-linear function of decision variables [95].
Although the non-linear programming problems can accurately model the practical operations of power systems, it is difficult to be solved by analytical approaches and ensure the global optimality.To overcome this issue, further research has focused on the heuristic algorithms.The heuristic algorithms can iteratively search over the entire feasible space to guarantee the global optimal solutions, including the particle swarm algorithm, genetic algorithm, artificial immune algorithm, and other heuristic algorithms.The particle swarm algorithm [96] optimises a problem by searching from solution set consisting of particles, and moving particles within the searching space according to predefined functions of particles' position and velocity.The movements of particles are determined by both the local best known position and global best known position of the searching space.A swarm of particles would ultimately move towards the best solution.The genetic algorithm [97] is based on the Darwin's theory of evolution, by which a population of candidate solutions to an optimisation problem is randomly generated and defined as a generation.The values of objective functions for every individual in the population are evaluated and defined as the fitness.The highly fitted individuals are selected and mutated to form a new generation.The population is iteratively evolved towards the best solution.Analogous to the genetic algorithm, for the artificial immune algorithm [98], a population of candidate solutions to an optimisation problem is randomly generated and defined as antigens.The values of objective functions for every antigen in the population are evaluated and defined as the antibodies.The antigens are iteratively cloned towards the best solution.

Research and implementations
The game theory and optimisation have been well documented by research on the power systems scheduling.The game-theoretic models, players, solving approaches, advantages, challenges, differences, and commons from the current research are summarised in Table 4. Belgana et al. [99] developed a multi-leader and multi-follower Stackelberg game-theoretic problem to find optimal strategies that could maximise profits of utilities and minimise carbon emissions.The problem was solved by a hybrid multiobjective evolutionary algorithm.The results demonstrated a trade-off between emissions, profits, and bills, while there was an opportunity to improve the searching mechanism of the algorithm and consider power losses.Meng and Zeng [100] proposed a 1-leader, n-follower Stackelberg game to maximise the profits of retailers at the leader-level and minimise the electricity bills of consumers at the follower-level considering the real-time pricing scheme.The genetic algorithm was used to solve the leader's optimisation problem and the linear programming was used to solve the follower's optimisation problem.This Stackelberg game yielded an efficient retail pricing to incentivise the demand response of consumers, whereas the competitive retail markets and imperfect information from consumers could be extended by this model.Analogously, a Stackelberg game-theoretic problem was proposed in [101] to model the interactions between the policy maker and generators/consumers for decarbonising power systems, which was solved by the designed bi-level multiobjective immune algorithm.This model could reduce carbon emissions and improve social welfare for the GB energy system.However, how to reallocate carbon revenue received from energy sector remained as a challenge.Ghosh et al. [102] formulated a coupled constrained potential game to set the energy exchange prices for maximising the amount of the energy exchange among prosumers and reducing the consumption from the utility grid.A distributed algorithm was proposed enabling individual prosumers to optimise their own payoffs.This work could be further extended to consider the non-linear price of prosumers and uncertainties caused by RESs.The Cournot game was implemented in [103] to model the competition between customers and utilities in distribution networks for satisfying the system reliability.How to facilitate the ergy patterns of electric vehicles could be further investigated.To select the high-probable scenarios, Xiao et al. [111] proposed an statistical approach to merge scenarios with a minimum probability distance.The proposed approach selected typical scenarios for accurate prediction of uncertainties, while the scalability to other power networks remained a challenge.

Data-driven machine learning
The machine learning is capable of exploiting historical data to capture typical features of actors in the operation of power systems, and improving the scalability and computational efficiency from using optimisation approaches.

Learning approaches
The learning approaches can be categorised as the supervised learning, unsupervised learning, and reinforcement learning.For the supervised learning, the input is provided as a labelled dataset, such that the model can learn from the labels to improve the learning accuracy [114].By contrast, for the unsupervised learning, there is no labelled dataset, such that the model explores the hidden features and predicts the output in a self-organising manner [115].For the reinforcement learning, the model learns to react to the environment by self-adjusting through travelling from one state to another [116].

Research and implementations
Applying learning approaches in solving decision making problems during the operations of power systems has been well studied in literatures.The typical literatures, targeted issues, advantages, challenges, differences, and commons are summarised in Table 6.Zhang et al. [117] developed an online learning approach to replace heuristic algorithms for solving a cost minimisation problem under the uncertain RESs and loads.The results demonstrated the improved solution optimality and computational efficiency compared to heuristic algorithms, while the location planning of RESs could be considered into this problem.Mbuwir et al. [118] compared two approaches of the reinforcement learning, i.e., the policy iteration and fitted Q-iteration, in terms of scheduling the operation of the battery and heat pump in a residential microgrid.The simulation results demonstrated that the policy iteration outperformed the fitted Q-iteration, and both approaches outperformed the optimisation approach in terms of improving the computational efficiency, whereas the future work could be extended to consider the grid congestions and energy sharing.In [119], a Q-learning algorithm was used as a reinforcement learning approach to minimise the costs and protect the privacy when the EV owners exchange energy, while the physical constraints for the vehicle-to-grid (V2G) could be further considered.Analogously, Shafie-Khah et al. [120] designed a Q-learning algorithm to optimally submit the bids of demand response for the end-user.The numerical results proved that the proposed model could reduce the costs of using electricity and improve the load balance.However, how to facilitate the participation of consumers to the scheme of demand response could be considered.An energy management system was designed in [121] to provide demand response services, by which the predefined model of consumers' dissatisfaction was replaced by the feature representations extracted through using the reinforcement learning.The designed energy management system enabled flexible requests from different users.However, how to avoid a new peak caused by the synchronised demand response of a large number of consumers remained a challenge.Ruelens et al. [122] combined the heuristic algorithm with reinforcement learning to control a cluster of loads and storage devices.The simulation demonstrated the effectiveness on the cost reduction through using the proposed algorithm, while the exploration strategies could be included to improve the learning efficiency.Gasse et al. [123] proposed a learning model for extracting the branchand-bound variable selection policies to solve the combinatorial optimisation problem, and testified that a series of computational complex problems could be efficiently solved.How to apply the proposed learning model for assisting other heuristic algorithms could be further explored.Zhang et al. [124] integrated the learning mechanism with optimisation techniques to obtain optimal demand response policies.The designed controller could help consumers reduce electricity bills with improved computational efficiency.However, how to capture the load change between two set-points remained a challenge.

Remark of practicalities, benefits, and challenges
This section remarks the extents for implementing the AI into operations of power systems, and outlines the benefits and potential challenges of such implementations.

Practical implementations
The extents of implementing the AI into operations of power systems can be categorised into four levels as shown in Fig. 6.The first level, i.e., responsive level, features the conventional operations of power systems, in which the analytical AI assists the situational awareness, fault detection, and restoration of power systems after receiving a call of outages.The development of the deep AI and digitalisation of power systems enable the transition towards the second level, i.e., predictive level, where more AI based analytics and decision supporting tools are included to predict the real-time generation, demand, and uncertainties, so as to maintain system performances, e.g., stability, capacity margin, and resilience.At the third level, i.e., prescriptive level, a number of functions in the first two levels can be performed automatically with the support of AI based software, so as to minimise the disturbances and outages from the systematic perspective.At the fourth level, i.e., autonomous level, full automation of system operations would be achieved in the future, where the wide area controlling decisions and network optimisations could be delivered by an AI based digital layer without the intervention of system operators, so that the system can maintain the self-healing.

Benefits
The benefits of implementing the AI into the operations of power systems are summarised as follows: • Automation: The AI can automatically make optimal decisions for generators (e.g., generation dispatch), power system operators (e.g., state estimation, real-time control, energy balancing, and contingency screening), consumers (e.g., smart load control).
• Computational efficiency: The AI can improve the computational efficiency for the management of power systems, so as to achieve the real-time reactive operations.
• Interoperability: The AI can assist the strategic coordination of actors in power systems, in achieving the overall system benefits.
• Scalability: The developed AI based models and software are scalable for different scales of power systems from households, industries, businesses, to an entire region, since they only require the historical data to extract typical characteristics of these systems.
• Adaptability: The AI based management tools can dynamically adapt the situations of power systems, which ensures the system resilience under both the high-probable but low-impact issues, e.g., power imbalance, and lowprobable but high-impact issues, e.g., extreme weather conditions.

Challenges
There are two primary issues when implementing the AI to the operations of power systems: First, when the historical data is too less to train an accurate AI model, how to guarantee the model accuracy and avoid the issues of over/under fitting presents a challenge.
Second, how to ensure that controlling decisions yielded by the AI models align with the physical constraints of power systems presents another challenge.

Conclusion
To investigate how to exploit the blockchain and AI for facilitating the emerging role of prosumers to be integrated into smart grids and decarbonising the power systems, a comprehensive review from the aspects of the regulations, energy markets, and operations of power systems is provided by this paper.This review particularly focuses on the state-of-the-art research and applications of the blockchain and AI in terms of supporting the decentralised energy trading and decision making during the operations.From the regulatory perspective, the vital barrier for facilitating the engagement of prosumers is the lack of dynamic and decentralised policy measures.Overcoming this barrier requires future research and practical regulatory design to identify key responsibilities, assets, roles, and models for prosumers.From the market perspective, the vital issue for accommodating the new role of prosumers is to design appropriate local market structures so as to align individual profits with system benefits, which requires the focus on the rulesets, pricing, transactions, trading platforms, and auction mechanisms.From the operational perspective, the vital issue is to fit novel AI models into the physical operations and constraints of power systems.This requires the transition towards a digitalised and interoperable power systems with intensive interactions between the digital layer and physical layer.Therefore, this review concludes that by incorporating the blockchain and AI, the smart grids can support the integration of prosumers with the functions of trading, control, and policy.Nonetheless, this is achievable only if the vital issues and barriers on the regulation, market, and operation are overcome.

Fig. 1 .
Fig. 1.Conceptual graph of incorporating the blockchain and artificial intelligence in smart grids.

Fig. 2 .
Fig. 2. Relationship between the emissions trading scheme and energy markets.

Fig. 3 .
Fig. 3.The projection of the future UK carbon cost under the UK emissions trading scheme, which includes four scenarios of societal changes in achieving the 2050 net zero target identified by the nationalgridESO future energy scenarios 2020 [40].

Fig. 4 .
Fig. 4. Schematic illustration for structures of decentralised energy markets with the integration of the role of prosumers.Dots indicate the control units.Lines indicate the information flows exchanged among these units.Under the peer-to-peer trading markets, prosumers interconnect with each other to trade energy and other services; Under the intermediary-based trading markets, an ensemble of prosumers is organised by an intermediary to pool generation sources, flexible demand, and storage capacities for collective control; Under the microgrid-based trading markets, prosumers connect to microgrids and microgrids either connect to the utility grid or operate in an islanded mode as indicated by dashed lines.

Fig. 6 .
Fig. 6.Four extents of implementing the artificial intelligence into the operations of power systems.

Table 1
Comparison of life-cycle carbon intensities of different generation technologies.

Table 2
Comparison for structures of decentralised energy markets with the integration of the role of prosumers.

Table 3
Comparison between the conventional centralised trading and blockchain based decentralised trading in energy markets.

Table 5
Comparison of literatures on scenarios approaches in the field of power systems operation.

Table 6
Comparison of literatures on learning approaches in the field of power systems operation.