Toward Blockchain Technology in the Energy Environment

Energy management and exchange have increasingly shifted from concentrated to hierarchical modes. Numerous issues have arisen in the decentralized energy sector, including the storage of customer data and the need to ensure data integrity, fairness, and accountability in the transaction phase. The problem is that in the field of the innovative technology of blockchain and its applications, with the energy sector still in the developmental stages, there is still a need for more research to understand the full capacity of the technology in the field. The main aim of this work was to investigate the state of the current research of blockchain technologies as well as their application within the field of energy. This work also set out to identify certain research gaps and provide a set of recommendations for future directions. Among these research gaps is the application of blockchain in decentralized storage, the integration of blockchain with artificial intelligence, and security and privacy concerns, which have not received much attention despite their importance. An analysis of fifty-seven carefully reviewed studies revealed that the emerging blockchain which provides privacy-protection technologies in cryptography and other areas that can be integrated to address users’ privacy concerns is another aspect that needs further investigation. Grid operations, economies, and customers will all learn from blockchain technology as it provides disintermediation, confidentiality, and tamper-proof transfers. Moreover, it provides innovative ways for customers and small solar generators to participate more actively in the electricity sector and to benefit from their properties. Blockchains are a rapidly evolving field of research and growth. A study of this emerging technology is necessary to increase comprehension, to educate the body of expertise on blockchains, and to realize its potential. This study recommends that future work investigates the potential application of blockchain in the energy sector as well as the challenges that face its implementation from the perspective of policy makers. This future approach will enable researchers to direct their focus to the case studies approach, which will facilitate and ease the application of blockchain technology.


Introduction
In recent years, blockchain (Table S1) has attracted the interest of both academics and business. It has been branded the "next great technical innovation" since the Internet of Things (IoTs), as it is supposed to revolutionize not just our connectivity and information technology framework, but also the very fabric of our communities [1]. Intermediaries would no longer be needed outside the technological network provision since blockchain offers cryptographic confidence by technology architecture, allowing anonymous parties to transact without the risk of fraud. In conjunction with smart contracts, blockchain offers transaction record transparency and imposes contract-defined rules on all transactions, and Sustainability 2021, 13, 9008 2 of 20 regulatory and legal enforcement checks will become a requirement for the completion of any transaction [2].
In the energy sector, energy management and exchange have increasingly shifted from concentrated to hierarchical modes. Numerous issues have arisen in the decentralized energy sector, including the storage of customer data and the need to ensure data integrity, fairness, and accountability in the transaction phase [3]. Many recent studies have investigated how blockchain technology could be used in distributed administration, peer-to-peer (P2P) sharing, electric vehicles (EVs), and green certificate trading [4][5][6][7][8]. New innovative technology in the form of blockchain technology is mostly used in distributed management to handle the collection of users' files, as well as to enhance data access and privacy, but it is often used to manage the grid's decentralization. In P2P sharing, blockchain supports price control and supply and demand, maintains accountability, and protects customer privacy. With regard to EVs, blockchain is mostly used for charging collection and pricing. The price is often determined through bidding and at other times through smart contracts that automatically respond to market conditions. Blockchain technology is mostly used in carbon emission and green certificate trading to provide traceability, privacy, and security throughout the trading period [4,7]. Since it satisfies the criteria of distributed generation systems that include certain features, blockchain has a broad range of applications in the energy sector. These include the following features. Decentralization: one of the first features of blockchain technologies that complies with the specifications of a distributed generation infrastructure in terms of user decentralization control and the nature of the data in the form of distributed storage, reducing management costs, and enhancing user data protection. Anonymity: as users engage in distributed energy trading this function will help preserve their privacy. Accuracy: The blockchain's data are synchronized across the network nodes, allowing every single node to retain all information associated with any transaction occurring within the network, guaranteeing transaction transparency. The use of this feature in the energy sector will in turn reduce collusion in distributed energy markets and increase energy-trading accountability. Since blockchain uses a shared storage structure, each node will have a full copy of the whole ledger; thus, a single point of failure is unlikely. As a result, an intruder cannot take ownership of the network by targeting and manipulating a single node. Consequently, the security of the network is improved. When extended to decentralized energy networks, it also improves the protection of customer data [2,9,10].
As many features of blockchain match the generation of distributed energy, its applications in the energy sector could be widespread, and relevant innovations could be developed. However, there are several issues and challenges that we could address while applying them to the energy sector. The problem is that in the field of innovative technology of blockchain and its applications, with the energy sector is still in the developmental stages, there is still a need for more research to understand the full capacity of the technology and its applications. Hence, this work aims to review and survey the recent literature on the use of blockchain technologies in the energy sector to obtain a clear understanding of the current situation, identify research gaps, and suggest future directions.
The remainder of this paper is organized as follows: Section 2 discusses the related works, identifies the research gaps and presents the contribution of the study. Section 3 introduces the research methodology and highlights the research questions. Section 4 presents the results, whereas Section 5 discusses the findings. Finally, the conclusion and future work recommendations are presented in Section 6.

Related Works and Contributions of Study
The topic of blockchain and its use in the energy sector is popular among scholars, and because blockchain is still in the developmental phase and is still emerging, numerous studies have reviewed it and its application in the energy sector. The work of the authors of [2] investigated the classification of the blockchain applications in smart grids and renewable energy resources, and discussed how the communication with blockchain was Sustainability 2021, 13, 9008 3 of 20 established. This work also discussed the advantages and disadvantages of the use of blockchain technology in power system applications and identified the most suitable blockchain technology for each application. Other scholars, such as the authors of [1], studied blockchain technology applications for power systems. Majeed et al. [3] conducted a chronological review of blockchain genesis, initiation, and growth, which detailed an overview of a wide number of blockchain applications in a smart city environment.
The multidisciplinary existence of blockchain research regarding consumer confidence was elucidated by the authors of [11]. The traceability and privacy offered by blockchain have been examined by scholars who have discussed blockchain transactions in the transportation and energy sectors. Marketing science should be employed as part of an effort to assess the impact of blockchain on consumer confidence. Additionally, Ahl et al. [10] clarified that blockchain had significant potential for energy development by conducting a comprehensive analysis of the multidimensional analytical structure of the factors of P2P microgrids centered in the blockchain. In the work by the author of [12], 468 smart contract-related studies were examined in a systematic summary of the research on smart contracts. Six mainstreams of intelligent contractual research were analyzed, and more research paths on smart contracts were established.
To identify the research gaps, a total of six review articles between 2018 and 2020 were carefully analyzed. Table 1 summarizes the survey works on energy-blockchain technology applications through various key topics such as energy internet, smart city, P2P energy-trading, electric vehicles (EVs), decentralized storage, blockchain with artificial intelligence (AI) and blockchain privacy/security. As shown in Table 1, the majority of the studies examined the application of blockchain in P2P and EVs (e.g., [13,14,[16][17][18]). Other fields such as energy internet and smart city were also discussed by the authors of [13][14][15]18], while the area of decentralized storage was only investigated by the authors of [17,18]. However, none of the reviewed articles fully examined the artificial intelligence (AI), security, and privacy in blockchain. Filling this gap facilitates a significant contribution due to the importance of AI and cybersecurity-related topics which have attracted the attention of various scholars in recent years. Therefore, the current study contributes to the body of knowledge regarding the energy blockchain in many ways: First, we conducted a comprehensive review analyzing 57 articles between 2014 and 2021. Second, we followed a systematic method and strategy to collect the articles and extracted the right information. Third, our work gives more attention to the topics that have not been discussed in prior works (e.g., artificial intelligence, security, and privacy), and topics that were less frequently examined (e.g., decentralized storage), while providing an update on the most discussed areas (e.g., P2P and EVs) as the majority of our included studies were published between 2020 and 2021. To our knowledge, the current study is among one of the primary academic works to offer a systematic and comprehensive review of energy-blockchain applications regarding AI, security, and privacy.

Methodological Selection and Research Questions
To conduct a systematic analysis of the existing literature on the subject of the research, a concrete strategy needed to be developed to ensure a comprehensive review of the literature on the use of blockchain technology in the energy sector. These strategies included defining problems, establishing the research aims and objectives, setting up the inclusion and exclusion criteria, scanning the literature using databases, manual searching, as well as selecting articles based on the eligibility criteria [19][20][21][22][23].
Google Scholar was used as the primary search database. It is superior to other search engines as it allows the researcher to find papers in a wide range of scholarly publications based on the keywords used. Other indexes, such as IEEE and ScienceDirect, were also scanned and used to achieve a detailed literature quest.
Keyword terms such as "blockchain," OR "blockchain technology," OR "blockchain application," AND "energy," OR "renewable energy" were used following certain criteria and parameters. The online literature search was performed between December 2020 and May 2021.
The inclusion criteria were as follows: (a) studies written in English, (b) studies published between 2014 and 2021, (c) studies from both peer-reviewed journals and conference proceedings, and (d) studies directly discussing blockchain technologies and applications in the energy sector. We excluded any study that was (a) not written in English, (b) focused on different energy aspects and (c) published in the form of dissertations or editorials.
Studies were selected based on two screening phases, these included "title/abstract" and "full text" screenings. Mendeley desktop was used to store and manage all recorded studies and citations, as well as to remove duplicates. Figure 1 illustrates the screening and selection process. The final number of studies included in the review was (n = 57).
knowledge, the current study is among one of the primary academic works to offer a systematic and comprehensive review of energy-blockchain applications regarding AI, security, and privacy.

Methodological Selection and Research Questions
To conduct a systematic analysis of the existing literature on the subject of the research, a concrete strategy needed to be developed to ensure a comprehensive review of the literature on the use of blockchain technology in the energy sector. These strategies included defining problems, establishing the research aims and objectives, setting up the inclusion and exclusion criteria, scanning the literature using databases, manual searching, as well as selecting articles based on the eligibility criteria [19][20][21][22][23].
Google Scholar was used as the primary search database. It is superior to other search engines as it allows the researcher to find papers in a wide range of scholarly publications based on the keywords used. Other indexes, such as IEEE and ScienceDirect, were also scanned and used to achieve a detailed literature quest.
Keyword terms such as "blockchain," OR "blockchain technology," OR "blockchain application," AND "energy," OR "renewable energy" were used following certain criteria and parameters. The online literature search was performed between December 2020 and May 2021.
The inclusion criteria were as follows: (a) studies written in English, (b) studies published between 2014 and 2021, (c) studies from both peer-reviewed journals and conference proceedings, and (d) studies directly discussing blockchain technologies and applications in the energy sector. We excluded any study that was (a) not written in English, (b) focused on different energy aspects and (c) published in the form of dissertations or editorials.
Studies were selected based on two screening phases, these included "title/abstract" and "full text" screenings. Mendeley desktop was used to store and manage all recorded studies and citations, as well as to remove duplicates. Figure 1 illustrates the screening and selection process. The final number of studies included in the review was (n = 57).  Hence, this work examines the current research of blockchain technology in the energy sector. We aimed to answer and address the following research questions:

Results
As blockchain technology is still in the phase of development and realization rather than in the phase of actual application and implementation, many of the reviewed articles were reviewing the current literature on the topic given. In [24], the study examined the more recent literature on the use of blockchain in the energy sector, as well as the shortcomings of the established research on the subject. Future problems in the implementation of blockchain in the electricity sector were identified in the report. It was indicated in the work of the authors of [25] that the notion of the smart grid has been described as a futuristic vision of the conventional power structure by establishing the successful convergence of green infrastructure and renewable energy technologies. The IoT and wireless sensor networks (WSNs) have been combined. However, due to the traditional centralized grid layout, integrating and syncing a comparatively significant amount of increasing interconnection can become a problem. Similarly, issues with security in the use and trading of energy statistics can pose major obstacles to smart grid deployment. The study provided a systematic analysis of blockchain-based smart grid applications; examined several recent blockchain-centered research works available in various literature; summarized recent related practical projects, experiments, and solutions; and examined a number of recent blockchain-centered research works accessible in the literature dealing with safety problems associated with smart grid ideas to be addressed by blockchain.
Few of the reviewed studies provided proof of work (PoW) and proof of concept (PoC). As in the work of the authors of [26], the need for PoW to be maximized to enhance the security of network resource and to allow users to defend themselves against cybercriminals was emphasized. Blockchain is a P2P process that ensures that there are no intermediaries involved in the exchange and that energy loss is minimized. One of the recent studies by the authors of [27] designed a blockchain-based, P2P, quasi-real-time electricity market. Energy Web Chain, for example, is a blockchain network based on Ethereum with a full proof-of-concept installation, including the smart meter and loads. The reviewed articles were examined based on the criteria mentioned in Section 3, and the result of the summaries of the articles is presented in Table 2 which includes the objectives of the studies and the field of use of blockchain technology in the energy sector, the methodology applied, and the findings or remarks of the study. Table 2. Selected articles based on objectives, methodology/ application, and findings/remarks.

Methodology and Blockchain Applications
Findings/Remarks [28] To address the initial blockchain's low-efficiency problem by using the private chain's high efficiency.
Built a private chain that links to an existing public chain to create an experimental area.
Tried to solve the storage problem with a hybrid architecture blockchain and a new storage mode which combines the public and private chain to enhance efficiency. [29] Incentivize the Distributed Energy Resources (DER) to run at a lower capacity.
Used a custom-designed blockchain protocol that manages a public network trusted by all DERs.
A DERs scheduling mechanism is being developed. It provides a reliable platform for trusting and securing all DERs. [9] Present the early ideas for a research project called Crypto-Trading, which incorporates a small Fintech firm.
The crypto-Trading project, Agile methods.
Implemented a scalable blockchain-based computing framework for expanding cryptocurrency trading functionality, including a robo-advisor that will recommend the most common strategy to prosumers.

Methodology and Blockchain Applications
Findings/Remarks [30] Propose a tamper-proof system for securing customer data that are recorded and passed into the smart grid system using a sovereign blockchain-based approach.
The user can observe how electricity is used without fear of manipulation from either party. [31] Investigate the use of decentralized blockchain mechanisms for providing open, safe, efficient, and timely energy flexibility.
On an Ethereum platform, the solution provides timely balances of real-time energy demand supply with high flexibility. [32] Examine how blockchain technologies could be used in the energy sector in emerging countries such as Sub-Saharan Africa. Blockchain.
Microgrid adoption in developed countries can be supported by digital infrastructure solutions such as blockchains. [33] Identify a solution to the issue of transaction protection in decentralized smart grid energy trading that does not rely on trustworthy third parties.
Proof-of-concept for a decentralized energy exchange mechanism built on blockchain technologies, multi-signatures, and anonymous encrypted message streams. [34] Demonstrate the idea of a blockchain-based microgrid energy market that eliminates the need for middlemen.
This concept cuts the price of electricity and makes energy transactions transparent. [35] The use of blockchain and smart contracts to boost smart grid cyber resiliency and safe transactive energy applications is explored.
Smart grid, smart contracts.
Evaluating energy trading challenges in smart grids such as fraud, false data injections, high price points, and unreliable transactions. [36] Analyze the security of a local trading market and raised security and privacy concerns.
Smart Grid, Electricity Trading.
A local electricity exchange market was proposed, where RES owners could sell surplus electricity to neighbors or vendors via a bidding system. [37] Demonstrate the success of our multi-agent-based framework for exchanging 'green' resources with an immersive demo.
Incorporating renewable energy systems into low-voltage networks using the NRGcoin concept.
Participants experimented with energy use and output while also evaluating the actions of the energy market and, as a result, the price of NRGcoins in real-time. [38] Apply a blockchain structure for the decentralized management of a Predix industrial system considering energy storage and renewable energy.
More laboratory environments are needed to completely comprehend how real-time measurement data from "Internet of Things (IoT)" sensors can be used directly. [24] Analyze blockchain studies in the electricity sector for flaws and, using a case study, suggest a method for using blockchain in centralized electricity markets.

Review.
Blockchain technology protects energy buy and sell transactions through a peer-to-peer network, encouraging the creation of a decentralized energy sharing mechanism. [25] Comprehensive analysis of blockchain-based smart grid applications, summarized a number of related practical prototypes, experiments, and solutions. Review.
Confirmed that the blockchain lacks a consistent framework that will allow it to reach its full potential.

Methodology and Blockchain Applications
Findings/Remarks [26] Focus on the various methods used to reduce losses during the blockchain operation.
Stated that blockchain processes consume a lot of energy for computation, network power, and cooling. [27] Propose an ad-hoc Ethereum-based consortium blockchain.
A proof-of-concept implementation.
With the growing knowledge of IoT devices, the blockchain must be applied effectively and safely. The concept provides blockchain-based energy applications that are compliant. [39] Evaluate the factors that may influence the behavioral intention of energy experts to implement the distributed ledger technology.
Survey energy sector experts about blockchain adoption.
The perceived ease of use, perceived usefulness, attitude, and cost savings had a positive and significant impact on blockchain adoption. Innovativeness, on the other hand, had a positive impact on perceived ease of use but had no effect on perceived usefulness. [40] Develop a transactive energy framework for prosumers based on blockchains.
Bitcoin and Ethereum, develop a protocol.
According to the findings, a decentralized trading algorithm reduces the user's individual cost by up to 77 percent and the overall cost by 24 percent. [41] Analyze topics such as block-chain architectures' energy usage, as well as the risks and opportunities of developing business models.
Exploratory literature review and use cases analysis for blockchain systems.
Blockchain technology cannot transform the energy sector radically and this is related to various constraints. [42] Review blockchain theory systematically and investigate the current status of research and applications.
Systematic review about energy blockchain.
The review highlighted that energy blockchain use cases are more prevalent in developed countries. [43] Use blockchain technologies to optimize the financial and operational efficiency of power distribution systems.
A set of interoperable blockchains embedded with self-enforcing smart contracts.
Transactive energy and blockchain technologies will be essential in shifting power distribution systems to active networks. [44] Use the blockchain approach to design a distributed energy trading scheme based on software-defined networking (SDN).
The SDN-based and blockchain framework takes security into account, and its effectiveness is demonstrated. [31] Examine the use of decentralized blockchain frameworks for providing reliable and timely energy flexibility through the implementation of distributed energy prosumers' energy demand profiles.
A prototype implemented in an Ethereum-based platform.
On an Ethereum platform, the proposed system provides timely balances of real-time energy demand supply with considerable flexibility.

The Use of Blockchain in Decentralized Storage
The review of the literature demonstrated that the energy market is gradually transforming into a distributed market, as indicated by the growing coverage of the solar photovoltaic industry. However, the emergence of many prosumers has become a problem that needs to be dealt with. For example, it is difficult to store a massive amount of data of a large number of participants. The storage of large amounts of data in a central management organization causes several issues. As the number of participants increase, the data volume and the corresponding storage costs also increase. In the current condition in which all Sustainability 2021, 13, 9008 8 of 20 the data is stored by one organization, other participants are expected to face difficulty in accessing the previous data and ensuring transparency. Furthermore, in the case of a breach in this organization, all data are likely to be leaked or lost. In the decentralized power grid, it is difficult for the traditional centralized management approach to tackle these issues.
Based on the review of the included literature, blockchain is used within the decentralized energy system to improve the management of large amounts of data through the protection of such data and the ability to make better decisions using a smart contract. Blockchain technology simplifies and fairly reduces the management of the decentralized energy system as it promises better management of the data even with an increased number of participating consumers in the network. However, some privacy-related issues have arisen with the use of certain blockchain networks, such as Ethereum.
In the first example, the authors of [28] designed an Internet data storage system based on a hybrid blockchain application, which was a combination of public and private blockchains. By using this hybrid block chain application, the efficiency and security of energy management using the Internet can be guaranteed. This satisfies the requirement of safe and efficient data storage as well as data integrity and prevents the malicious handling of data. The system was designed to ensure the integrity, confidentiality, and security of the electricity data of consumers. The application of blockchain to collect consumer data from the system ensures that such data are not manipulated without permission by external attackers, hence improving security. Additionally, consumers are fully encouraged to monitor their own data. Intelligent meters inform users in detail about the amount of electricity they use and what equipment they use the most.
Energy systems are undergoing a transformation resulting from the development of distributed energy resources (DERs) and information and communication technologies (ICT). One of the most important challenges is the new decentralization of the energy system, which requires that new paradigms and distributed technologies be taken into account, explored, and adopted. Because of their nature, blockchains show promise in controlling and managing complex energy and microgrid systems, which have become increasingly decentralized [35,45,46]. Facilitating these automated trading platforms could be an efficient way for consumer price signals and energy cost information to be delivered [46], which simultaneously provides consumers with demand response incentives and smart energy consumption management. Blockchains are capable of supporting local power generation and local consumption-oriented markets, or microgrids [47]. One of the major advantages of this approach is its ability to reduce transmission losses and postpone costly network improvements. However, energy still needs to be carefully controlled and managed through the physical grid to fulfill actual technological constraints and power system stability.
The maintenance of security of supply and proven network resilience is a key challenge as volumes of RES continue to improve. Blockchains could improve network resilience and the security of supply by facilitating and accelerating IoT applications and making it possible for flexible markets to be more efficient [35]. The technical characteristics of the blockchains for DER and an enhanced resilience (safety, scalability, and speed), allows blockchain solutions to be utilized not only for smart charging and resource-sharing arrangements, e.g., community rage or microgrids, but also for smart grid and cyber safety storage applications [36,48]. Green certificate trading has been discussed by the authors of [38].
Decentralized grid control is another feature of blockchain in decentralized management. If the residential low-voltage grid exceeds the electricity limitation, it must upload the excess electricity to the main grid. When improperly controlled, the voltage on the grid will become unstable, causing, for example, a sharp rise in electrical voltage. This common issue requires an efficient solution in the form of a proper output power control. In the work by the authors of [24], a proportional and equitable blockchain and smart contract control scheme was proposed. The scheme involves the installation and assignment of the Sustainability 2021, 13, 9008 9 of 20 smart contracts to some voltage controllers. This process is different from the conventional architectures that involve all participants controlling the voltage in comparison with these control schemes; moreover, they always restrict their output power. Clearly, they are neither fair nor effective. The implementation of blockchain technology with the increase in the number of participants has led to a corresponding increase in complexity and cost.
The crypto trading project was proposed by Mannaro et al. [9]. The main objective of this project was to build a smart grid using blockchain. The purpose of using the smart grid in this project was to match the relationship between supply and demand, which would help the distributed energy market. By using these applications, end users can monitor and create their own supply of energy and sell surplus energy on the distributed energy market. Blockchain has two key functions in this project: to be used in energy trading as a distributed directory and to be used as a control system for driving smart meters.
Gao et al. [30] have developed a smart grid system based on the sovereign blockchain. The main objective of the system was to protect consumer data and at the same time to ensure transparency and to identify possible uncontrolled power utilization, which would lead to the manipulation of electricity.
Liang et al. [49] proposed a distributed blockchain-based data protection framework. The main feature of the system was its ability to improve security as it can resist potential attacks on the networks. This ensures that the data is not being misused or manipulated by unauthorized parties. The framework uses certain features of blockchain technology by distributing safety measures that ensure the recording and storing of consumer data with the distributed ledger in the smart meters as nodes; hence, ensuring the integrity and consistency of the data. Smart contracts are also utilized to monitor user power consumption. An imbalance between power and demand can threaten power supply security and can result in the overloading of power supplies and eventually power failure or service interruption.
Hahn et al [50] introduced the smart contract that incorporates a transactive electricity auction that does not require the supervision of a trustworthy agency. They used a 72 kW Photovoltaic (PV) array to conduct an Ethereum-based transactive auction on the WSU campus to prove the concept. However, the power flow model was ignored in the optimization process. To accomplish P2P transfers in the power grids, Cheng et al. [51] applied blockchain technology to the distributed energy industry using Nbitcoin currency. They provided perspectives on the technological, economic, social, environmental, and institutional dimensions: A critical identified issue was the matching of technological advancements with regulatory change facilitated by multi-stakeholder engagement and regulatory sandboxes.
Zhu et al. [52] examined how blockchain technologies can be used to overhaul China's electricity market. They looked at how blockchain technology is advancing in the energy industry and looked at some of the more famous instances of energy blockchains around the globe. This work suggested that China should ease its regulatory framework, reform the applicable rules, and resolve the management-innovation dispute. On the other hand, Ahl et al. [53] investigated the use of blockchain in the energy sector through structured interviews with energy and blockchain experts. They provided perspectives on the technological, economic, social, environmental, and institutional dimensions.

The Use of Blockchain in P2P Energy-Trading Platforms
Due to the need for the decentralized systems to cope with the increasing demand for power and electricity, the application of blockchain in P2P markets is necessary. Mengelkamp et al. [34] proposed a decentralized consumer and prosumer market platform based on a private blockchain for local energy markets. No local energy transactions are required for a centralized intermediary. This article focused on the local photovoltaic energy generation transaction system and implemented an Ethereum proof-of-concept model for 100 users. This system uses the supply-and-demand auction mechanism. Such a mechanism is implemented using smart contracts in the blockchain on their proposed market platform. The platform enables users to make payments within the blockchain. The supply and demand for each consumer will be automatically measured and predicted using smart meters and then transmitted to nodes. The platform enables this information to be handled locally without being transmitted to the blockchain to ensure the privacy of the users or consumers. The authors addressed the privacy concerns of participants during the designing phase of this decentralized platform. It would measure and broadcast only the demand and production capacity of the participants to other users. Although the platform is based on Ethereum, these data can also lead to privacy disclosure. As an example, unauthorized individuals may deduce electricity consumption habits based on this information.
Hahn et al. [50] suggested a decentralized blockchain-based energy auction system. Buyers and sellers are able to perform reliable, safe, and transparent power exchanges based on this distributed auction system. In the system, both the buyers and sellers use two types of technologies, namely, smart contracts and smart meters. In case the sellers pose excess generated power for the solar cells and aim to sell such an excess, the process is simplified by starting a new auction in which the excess electricity is advertised in the blockchain where bidders can participate in the auction. Smart contracts automate both the auction and payment processes. The smart meters used in the network detect and report the transaction electricity, verifying the completion of the transaction. The blockchain stores all the data mentioned, which are generated by the suppliers, bidders, and smart meters. In this article, the privacy issues were not discussed. However, if the data stored on the blockchain is not coded for auction, the data will likely be compromised due to the involvement of different parties, namely, the bidders, sellers, and smart meters.
The work of the authors of [33] mainly addressed the problems in the security of disbursed energy transactions using certain privacy technologies in the smart grid. This work used a token-based private distributed energy-trading system as it attempted to find a solution for the previous situation where the auction may compromise the privacy of information. The article by the authors [33] used this feature rather than the auction mechanism. The proposed system allows consumers to anonymously exchange the price of electricity without disclosing any identity; hence, the information during the transaction is secured. To protect consumer privacy, certain features of the blockchain technology are implemented, including anonymous encrypted information flow and multiple signatures. In this trading system, there is no trustworthy third party, so prices can be negotiated. However, they are always anonymous, and data protection is encrypted. This article examined the corresponding countermeasures for a number of privacy and security features by proposing a system that can be used to design energy-trading based on blockchain.
Park et al. [54] developed a blockchain-based P2P energy-trading platform that effectively trades energy between users. This article suggested that energy labels should be stored and verified using blockchain. Energy labels identify the source and consumption of energy. The following steps form part of the trade process. First, it is automatically determined by IoT devices based on the consumer activity to buy or sell energy; then, the network generates a label. Such a label is then sent to all trading platform participants. In case any of the participants wish to deal with the buyer or seller who has issued the label, the label will be confirmed. At the end of the process, a record of the transaction between the two parties is obtained and added to a blockchain and then transmitted to all participants. This protects the privacy of all the participants, which was previously discussed in other studies.
Esmat et al. [55] developed a platform with blockchain technology integration and used actual data to simulate the platform operations. The proposed platform achieved the required objectives and offered several advantages over the CDA design, but no "one-size-fits-all" structure is available for P2P markets, which promises high efficiencies while meeting the requirements of all prosumers. However, since pool-based markets require a community manager to coordinate trading and so are not entirely decentralized, the proposed approaches cannot reach the privacy protection and scalability desired in P2P marketplaces.
The work of the authors of [16] reviewed P2P energy trading applications related to blockchain technology and proposed a multilayer energy model architecture using blockchain technology. On the other hand, the authors of [56] reviewed the emergence of blockchain technology in the energy industry considering the ongoing transformation of the energy market. The findings emphasized the significance of distributed energy transactions and stated that rigid regulatory frameworks pose the most difficult challenge. In the short term, blockchain will enable peer-to-peer microgrids, and over the long term, it will impact electric vehicle integration as well.
The blockchain can encourage consumer participation in local energy markets [46]. Consequently, consumers will be exposed to the real energy cost, which may lead to rational energy consumption or to adequate price signals to certain demands [57]. The local energy markets can include consumer self-generating investments in photovoltaics (PVs) and small-scale wind energy. However, consumers have not had actual access to the energy market until now, which for institutionalized energy suppliers remains the priority [58] due to the high cost of its assets. Furthermore, several renewable energy source (RES) investment incentives to export charges are often adequate or eliminated for the sale of energy surplus back to the grid [59]. Such surpluses are acquired at low prices by utilities companies and returned to consumers at standard prices. If prosumers can directly sell their excess electricity to the non-intermediary consumers, saving energy costs for all stakeholders will be possible. Prosumers can benefit more from their investments since both the profits and value remain in the microgrid and local communities. P2P trading can act as socioeconomic incentives for locally re-generated energy markets and thus can provide alternatives for prospective prosumers [46].
A demanding task is the integration in the energy market of small-scale renewables, distributed production, flexibility services, and consumer participation. Some authors such as the authors of [35] have argued that blockchain can provide innovative trade platforms for prosumers and consumers, where their energy surplus P2P demand can be interchangeably traded. The active participation of the consumer can be secured and recorded in smart contracts, which are immutable, transparent, and manipulatable. The trading platform can compare and adjust electricity prices according to the trading situation on the current market. The algorithm will help consumers/prosumers determine which energy is the most affordable and is of high quality, thus making it more efficient. The authors' ultimate objective was to propose a platform that enables high-quality, low-cost energy trade at all times and wherever between consumers and prosumers [35].
A distributed trading platform was constructed, and distributed pricing was carried out by the authors of [51] based on blockchain technology and P2P trading. The work proposed a decentralized framework for blockchain-based power market trading, which developed a mechanism to encourage a balance between supplementary supply and demand between consumers. This work also compared conventional methods of power trading with power trading methods based on blockchain. Security and transparency of trading information are the significant advantages of blockchain-based power trading. All transaction information is recorded and maintained by all the participating nodes in the blockchain-based power trading method, and each node can see all transaction records, making the transaction information transparent and traceable. This mechanism allows the data to be saved in a blockchain where all participating nodes are synchronized. However, once the central administration is maliciously attacked, consumers' information can be leaked and misused.
Cheng et al. [51] primarily emphasized the security of the transaction information. Every node records all transaction details and can view them. This can ensure that the transaction is traceable and can also prevent a single point of failure; the main drawback of the system is that it may reveal consumers' transaction information.
In the field of renewable energy, solar PV shows promise in reducing cost, especially with the development of battery storage technology. Such an advancement increases the willingness of the public to install solar PV and become prosumers. The advantages of solar power in terms of environmental protection and costs have become increasingly popular in recent years. The new challenges for the emerging energy-trading market are the rapid growth of the distributed generations. Therefore, research on the appropriate management systems and market mechanisms is needed, and new trading schemes have been proposed for the distributed energy market, which are based on blockchain advantages. However, one of the major concerns of the implementation of blockchain technology is the protection of the participants' privacy in the blockchain-based decentralized energy-trading systems, as most studies have focused primarily on transaction transparency.

The Use of Blockchain in Electric Vehicles (EVs)
EVs, for example, direct battery exchanges with charging stations, can be refilled in a variety of forms without having to stop for a long time to charge. However, this approach may cause the transaction to be fair. The fairness of the transaction will be affected by the different battery brands and wear levels. The data are stored on the central server using a traditional centralized management system, making fair trading difficult to achieve. Kim et al. [60] therefore suggested a decentralized blockchain system-based battery exchange method. In this mechanism, the battery information is stored in the blockchain, and intelligent contracts automate the payment process, including the compensation for price differences. This can solve the fairness issues in the transaction process.
An objective process based on a shared blockchain framework was suggested by Hua et al. [6] to control battery switching and to address the confidence gap between electric car owners and swapping stations. The proposed network with all the operational data of the battery will solve problems that are not present and take account of battery status, degradation of performance, and depreciation. In the work of the authors of [4], an EV charging platform based on blockchain technology was proposed. This platform is reliable, automated, and secured. EVs apply demand charges and then issue their quotes for charging stations. EVs can select appropriate charging stations based on the price and the location. The use of blockchain technology in this process can help improve the transparency and reliability of the trading process. In the meantime, information on the geographical location of EVs is not leaked; hence, it can be deduced that privacy is protected. The transaction process consists of four phases: exploration, bidding, evaluation, and charging. EVs can complete the selection and the charging process of the most suitable recharging stations, and this will not leak any information for the following reasons: First, no information is revealed since every user is anonymous in the blockchain. Second, regional range is the geographical position of the user's message on demand. This process not only prevents the disclosure of data and location but also makes the arrival of electricity supply to the destination areas easier. In addition, most transaction processes do not have to be carried out in blockchain, and other users will not know which transaction was made as well as the price.

The Integration of Blockchain with Artificial Intelligence (AI)
Artificial intelligence (AI) is quickly evolving, and its powers in prediction, control, and optimization have been demonstrated in various applications. There have been few attempts to integrate the blockchain with AI in the energy domain. For example, in [61], an artificial intelligence-enabled blockchain system was proposed for the electric vehicle to predict EV charge. The authors approved the conventional training scenario. The proposed solution exhibited a high predicted power consumption with an R2 score of 0.938. The accuracy dropped by only 1.7 per cent when using a federated learning strategy.
Thus, the proposed system provides dependable and timely service to deliver extra electricity from the vehicular network and lowers power fluctuation. Although the amount of energy is predicted and charging and discharging EVs are separated, there is no method for dynamic cost allocation for energy. Another use of federated learning was found in [62]. The researchers analyzed the dynamics of vehicle machine learning to quantify the end-to-end delay with blockchain-based federated learning. The channel dynamics can be used to reduce the system delay. The proposed method for tweaking the block arrival rate is demonstrable online and is capable of driving system dynamics to the desired operating point.
The researchers in [63] used blockchain to reduce the risk when banks lend money to power companies. The proposed model identifies the number and location of renewable generation units, time-of-use energy pricing, and manufacturers. A type-2 fuzzy programming solution method was proposed. The findings showed that uncertain demand and default risk have a substantial effect on the solution, and that profitability was increased by 1.73% by using the proposed model.
In another study by the authors of [64], a sustainable network microgrid incorporated economic, environmental, and social constraints to search for maximum customer demand satisfaction. The fuzzy multi-objective programming models were proposed to handle the variability in distributed generation capacity and demand load. The sustainable microgrid P2P market paradigm boosts profitability while lowering CO2 emissions by 9.35 per cent and 25.20 per cent, respectively.

Blockchain Privacy and Security Issues
Blockchain is a new technology. Its implementation in the smart power grid poses a major challenge. This section discusses some major privacy and security issues that were not discussed in the previous sections. In addition, the latest developments in the blockchain technology are discussed here.
The capacity of the power distribution system is sufficient for consumers for a stable period of time and requires minimal monitoring and control. However, the conventional load and power flow patterns have significantly changed with the integration of distributed microgrids into bidirectional power flow. To solve this issue, the power distribution system is being redesigned to incorporate a large number of IoT-based devices to improve system controllability and observability. The redesigned power distribution system is known as the active cyber-physical distribution system (A-CPDS) [65]. Blockchain technology's enhanced security and efficiency features have made it a good candidate for improving A-CPDS cybersecurity and efficiency [66]. In the setting of A-CPDS, smart homes outfitted with a variety of IoT-based devices, such as smart meters, have created a high level of interconnectivity between the consumers and the grid. Concerns regarding privacy leakage and smart grid data integrity attacks induced from various data incursions from the customer's side have hindered the development of smart homes [67]. Blockchain has been proposed as a technique for supporting the development of smart homes by ensuring confidentiality and integrity as well as improving the authentication levels of customer's devices [68].
By integrating the smart meter into blockchain, the electricity bill will be autogenerated and updated to the server in a tamper-proof manner. The customers can access their bill information and make payments remotely using the accurate private key.
In the work of the authors of [69,70], the remote electricity bill payment feature was implemented based on the blockchain and smart home technologies, with a high level of protection against electricity theft. Blockchain technology can ensure that customers' demand response power is provided through smart contracts that prevent fraudulent activities. Additionally, by utilizing the smart contract and decentralized applications for a smart meter, a distributed demand response can be implemented. Blockchain can ensure the availability of critical data for distributed demand responses (such as ancillary service signals, regional system states, and electricity pricing signals). Furthermore, the blockchain's auditability ensures that abnormal demand response actions can be regulated or punished in a fair manner [33]. Blockchain with smart contract functionality can also be used in an active cyber-physical distribution system for a secured and trusted demand response of smart homes [66].
Conversely, the IoT and blockchain-enabled automated transactions can be applied to the smart charging of EVs [71]. The blockchain-based billing system for EV charging was evaluated in [72], in which the mode for the charging transaction was from grid to vehicle (G2V). EV drivers will be able to know the charging amount in real time and instantly pay using a blockchain-based billing system. Furthermore, the blockchain's mutual authentication for payment settlement can ensure that the payment is only cleared when the user and charging station supplier agree on the actual charging amount [72].
An even greater number of blockchain-based processes were introduced in [73]. The systems must be highly secure and only operated by a trusted system, which is the primary advantage of blockchain. The same method for automatic maintenance can be employed on the smart grid. Such smart grid additions will increase customer satisfaction as well as security. Wang et al. [74] discussed anonymous power exchange between EVs, as well as performance analysis and proof of blockchain feasibility for cybersecure V2G/V2V applications. Siano et al. [75] introduced smart contract capability supported by the proof of power method, which was used to reduce consensus delay. This technique performs better in P2P power transactions and could be useful in G2V and V2G transactions. Moreover, the proof of probability algorithm performs well and can be extended to the grid space to reduce transaction latency. Table 3 introduces the recent developments in the blockchain technology for the privacy and security challenges. Table 3. Selected articles based on advancement in the blockchain privacy and security.

Article
Privacy/Security Issue Developments in the Blockchain Technology [76] Participants in peer-to-peer energy trading may have their data and transactions visible to all blockchain nodes.
Encrypted all bids through a smart contract based on functional encryption. [77] Maximize the protection of information and improve the security and reliability of the transaction model.
Ciphertext-Policy Attribute-Based Encryption (CP-ABE) is used to recreate the transaction model. It can accomplish fine-grained access control using ciphertext transaction arbitration. [78] Security and privacy threats to electric vehicle charging.
Proposes a framework using blockchain-based privacy-preserving smart charging station selection for EVs. [79] Distributed denial-of-service (DDoS) attacks. Proposes a distributed fog computing-based platform for detecting DDoS attacks in smart contracts. [80] Enhance the reliability and efficiency of data-sharing security and allow data providers to engage in the data sharing process.
To ease transmission load and address data suppliers' privacy concerns, the author proposes a federated learning architecture.
To enhance efficiency, the author develops an asynchronous federated learning strategy that uses deep reinforcement learning (DRL) for node selection. [81] With an untrustworthy or corrupted IoT platform provider, security and privacy risks are unavoidable In a hybrid approach, the author proposes a bridge connecting position to isolate IoT users' peer-to-peer transactions and link the main blockchain to its subnetwork blockchain(s).
[82] Data mining algorithms can be used to obtain the privacy of user groups living close. Proposes a consortium blockchain-based approach.
Aside from the hidden EV users' location, partially homomorphic encryption based on reputation computation via local communication was employed.
[84] Mutual authentication and anonymity, generation of huge overhead.
Proposes a hierarchical blockchain-based authentication approach for awarding EVs. The distributed ledger of the blockchain is used for transaction execution in distributed V2G environments, whereas hierarchical authentication is handled via elliptic curve cryptography (ECC).

Discussions
The review of the literature that has examined the use of blockchain technology in the energy sector reveals that the technology is new and is advancing at a fast pace in various areas and fields of application including decentralized storage, P2P energy-trading platforms, EVs, AI, security, and privacy.
However, certain concerns and issues have arisen with the experimental projects that use blockchain technologies. These issues need to be clearly understood and addressed in order to improve blockchain adoption and to enable it to reach its full potential. One of the important issues that was raised in the literature is that blockchain technologies must be able to provide the requisite scalability, pace, and protection for the proposed use cases. Distributed consensus algorithms, which are critical to achieving these goals, are already being investigated, but a solution that incorporates the desirable features without major trade-offs is still in the early phases of development and requires more investigation.
Blockchain technologies should demonstrate the capability to be scaled to match the requirement of both security and privacy with each application. However, there is promising work in the direction of the distributed consensus algorithms, which are believed to be essential for the implementation of blockchain technology.
Another issue that was raised by many researchers was the possibility of security threats resulting from inadvertently poor device architecture. This feature needs to be presented in the technology which will lead to more resilience against the security threats. To demonstrate the concept of security, Bitcoin is considered to be the first cryptocurrency implemented. It has shown to be highly resistant to cyberattacks.
Other networks, such as Ethereum, have previously been victims of significant attacks. Importantly, cybersecurity flaws are often caused by peripheral implementations, such as digital wallets or smart contracts. The ability to withstand such attacks is important, particularly for applications in critical infrastructure, including energy systems. Due to a lack of familiarity with large-scale implementations, blockchains pose potential threats such as malfunctions in the early stages of its development. Blockchain applications and platforms heavily depend on the coding of new algorithms, which can be a time-consuming and error-prone process. Before the system matures, there is also a high risk of security vulnerabilities, which may result in negative exposure and delay in market adoption.
Another significant problem is the high implementation costs associated with blockchain networks [17][18][19]. To achieve data integrity and enhanced protection as well as to remove the need for a trustworthy intermediary, new expensive hardware is needed, such as custom information and communications technology equipment and applications. The costs for this hardware must be outweighed by the advantages of data integrity, enhanced security, and the absence of financial authority.
Smart meters are currently being used in the energy market without significant computing capacities but combining existing smart metering and grid infrastructure with distributed ledgers may be expensive. Both the administrative and legal realms pose challenges to the acceptance and adoption of the technology. Public interest in energy markets is encouraged by regulatory authorities [19,21,29,36]. Blockchain systems have started to show promise in decentralized microgrids, but they face difficulties in aligning with central commands and grid coordination. Energy trading must be incorporated with grid operator experience. A continued decentralization may result in a more complicated energy system management in general. To maintain consistency with the law and customer rights, smart contracts must be built into legal code. It is not obvious who bears the legal and technological liabilities for the unintended effects of the conduct of multiple parties in a distributed framework architecture.
For instance, if a massive breach is effectively carried out as a result of a software or hardware flaw in the scheme, there is no single body to whom customers can direct their concerns, which is the case now. Instead of trusting a known authority, blockchain schemes trust the technology itself. The lack of standardization and versatility is another important aspect that may hinder blockchain applications. To enable interoperability across technology solutions, standards for blockchain architectures must be established.
Regardless of the major concerns that have arisen as a result of the introduction of blockchain systems, there are certain benefits that should not be ignored, such as real-time updates dependent on blockchain technology. This mechanism allows for information exchange between the two modes to be realized, reducing the waste of energy of the supply device. There are several positions involved in the method of energy transport infrastructures. Blockchain technology will help the various positions achieve confidence and transaction integrity, encourage healthy competition, as well as increasing transportation quality.
Based on the review of the existing literature, it was noticed that when developing a management or trading network based on blockchain, adequate attention should be paid to the privacy and security question. Most networks utilize blockchain to store critical data to maintain accountability and tamper-proofing; however, users' privacy is often overlooked. Users' electricity usage data are stored on the blockchain in certain grid management platforms, which may contribute to the occurrence of leakage of the everyday electricity consumption habits. Users' explicit demands and quotations are broadcast to the network in the distributed point-to-point trading site, exposing their personal information. The exact path and driving route of the EVs, as well as other classified materials, can be used for harmful purposes in the EV charging management network. The designer's ignorance of the user's critical data security triggers these issues. Any data security technology in cryptography and other fields may be merged to address user privacy protection issues while solving problems with blockchain. Furthermore, selecting and improving the required consensus mechanisms is important to prevent incurring undue costs in the implementation phase. Further consideration should be given to how suitable smart contracts are that are developed for use in the trading process in order to enhance the pricing mechanism of the distributed market, allowing them to perform the functions of the conventional market.

Conclusions
In this work, we conducted a systematic and comprehensive survey of fifty-seven energy-blockchain studies from 2014 to May 2021. We explored the blockchain applications in various fields including P2P energy-trading, electric vehicles, decentralized storage, artificial intelligence, security, and privacy. Our analysis revealed that blockchain provides disintermediation, confidentiality, and tamper-proof transfers; it also provides innovative ways for customers and small solar generators to participate more actively in the electricity sector and to benefit from their properties. In the energy market, blockchains have allowed sharing-economy applications such as SolarCoins, M-PAYG, and KWHCoin to be used [83]. In the electricity market, several academic and industrial entities are actively seeking blockchain innovation. Since blockchain is a rapidly evolving field of research and growth, a study of this emerging technology is necessary to increase the understanding of it, to educate the body of expertise on it, and to allow its full potential to be realized. The implications and potential uses of blockchain in the energy sector seem to be limitless, but this field is still new and evolving.
Based on the survey of the current literature, in the energy sector, the majority of countries are utilizing the centralized system, which is often governed by the country's policies and regulations. Hence, the potential application of blockchain in the energy sector and the challenges that face its implementation should be viewed from a country or region perspective in future research. Furthermore, blockchain should be examined within the context of that country or region and its current challenges. This future approach will enable researchers to direct their focus to the case studies approach, which will facilitate and ease the application of blockchain technology.