Blockchain-Enabled Smart Grid Applications: Architecture, Challenges, and Solutions

: The conventional electrical grid is undergoing substantial growth for reliable grid operation and for more efﬁcient and sustainable energy use. The traditional grid is now metamorphosing into a smart grid (SG) that incorporates a diverse, heterogeneous blend of operating measures such as smart appliances, meters, and renewable energy resources. With better efﬁcient results and dependability, the SG can be described as a modern electric power grid architecture. The SG is one of the greatest potential advances as a promising solution for the energy crisis. However, it is complex and its decentralization could be of tremendous beneﬁt. Moreover, digitalization and integration of a large number of growing connections make it a target of cyber-attacks. In this sense, blockchain is a promising SG paradigm solution that offers several excellent features. There has been considerable effort put into using blockchains in the smart grid for its decentralization and enhanced cybersecurity; however, it has not been thoroughly studied in both application and architectural perspectives. An in-depth study was conducted on blockchain-enabled SG applications. Blockchain architectures for various applications, such as the synchrophasor applications, electric vehicles, energy management systems, etc., were proposed. The purpose of this article is to provide directions for future research efforts aimed at secure and decentralized SG applications using blockchain.


Introduction
The power grid is a complex engineering marvel, which is undergoing rapid changes due to the proliferation of renewable energy resources, high-speed signal processors, and intelligent sensors, etc. The present requirement involves bi-directional flow energy and information between the power generators and the power consumers. So, the traditional power grid is evolving into a smart grid (SG), a grid that is capable of dynamically monitoring and controlling the flow of power, providing reliable power to the consumers [1].
The SG connects heterogeneous components that vary in their functionality and requirements. These components include renewable and non-renewable energy sources, intelligent sensors, controllers, etc. The statistics on research publications related to the SG are shown in Figure 1. These statistics were obtained from the Scopus database. The various applications that the SG caters to are shown in Figure 2. In Figure 2, the share of research publications from the application's perspective is shown. From this figure, it can be observed that the main applications in an SG are the energy management systems (EMS), electric vehicles (EVs), microgrids (MGs), smart cities (SCs), home automation (HA), advanced metering infrastructure (AMI), and synchrophasor applications (SPAs) [2]. Sustainability 2022, 14, x FOR PEER REVIEW 2 of 35 power grid is evolving into a smart grid (SG), a grid that is capable of dynamically monitoring and controlling the flow of power, providing reliable power to the consumers [1]. The SG connects heterogeneous components that vary in their functionality and requirements. These components include renewable and non-renewable energy sources, intelligent sensors, controllers, etc. The statistics on research publications related to the SG are shown in Figure 1. These statistics were obtained from the Scopus database. The various applications that the SG caters to are shown in Figure 2. In Figure 2, the share of research publications from the application's perspective is shown. From this figure, it can be observed that the main applications in an SG are the energy management systems (EMS), electric vehicles (EVs), microgrids (MGs), smart cities (SCs), home automation (HA), advanced metering infrastructure (AMI), and synchrophasor applications (SPAs) [2].    Table 1. Existing reviews on blockchain for SG. " " and "" indicates "included" and "excluded" respectively in literature.

Reference Blockchain from an SG Application
The paper is organized in the following sections, as represented in Figure 4. Section 2 discusses the basic concepts of a blockchain. It presents the terminology related to the blockchain and its general architecture. Section 3 presents a review of the blockchain-enabled SG applications. Different applications are discussed, and their architectures are presented. The security concerns pertaining to these applications are discussed in Section 4, and Section 5 is the conclusion of this review.

Overview of Blockchain
In the past few years, blockchain technology has received tremendous attention worldwide. At the beginning of the technology's inception for application in digital currency, or cryptocurrency, blockchain was considered a cryptocurrency [23]. Bitcoin, the most popular cryptocurrency, was considered to be the blockchain. However, blockchain is the backbone of these cryptocurrencies. It is a distributed ledger for transactions in a decentralized network. Initially, the researchers were skeptical about this technology, but the popularity of Bitcoin changed their perception. This can be corroborated in the sudden growth in the number of published articles on the blockchain after 2016 as shown in Figure  3. Blockchain is being considered in various other domains such as banking, healthcare, healthcare, industries, etc. These various applications are depicted in Figure 5.

Overview of Blockchain
In the past few years, blockchain technology has received tremendous attention worldwide. At the beginning of the technology's inception for application in digital currency, or cryptocurrency, blockchain was considered a cryptocurrency [23]. Bitcoin, the most popular cryptocurrency, was considered to be the blockchain. However, blockchain is the backbone of these cryptocurrencies. It is a distributed ledger for transactions in a decentralized network. Initially, the researchers were skeptical about this technology, but the popularity of Bitcoin changed their perception. This can be corroborated in the sudden growth in the number of published articles on the blockchain after 2016 as shown in Figure 3. Blockchain

Structure of Blockchain
The blockchain comprises a series of blocks of transactions linked together in as shown in Figure 6. Client/server architecture is used in traditional client/server and various administrators are in charge of them. On the other hand, blockchain tributed, decentralized peer-to-peer (P2P) network [24]. Each and every network pant can control the network. The network is made up of many connected comp nodes, and the blocks in the chain cannot be changed without the network's a Each node in the network has its copy of the digital ledger.  The main constituents of a blockchain and the associated terminology are d as follows: 1. Block: In a blockchain, pointers and linked list data structures are utilized sent blocks. Using a linked list, the blocks are sorted in a logical order and

Structure of Blockchain
The blockchain comprises a series of blocks of transactions linked together in a chain, as shown in Figure 6. Client/server architecture is used in traditional client/server systems, and various administrators are in charge of them. On the other hand, blockchain is a distributed, decentralized peer-to-peer (P2P) network [24]. Each and every network participant can control the network. The network is made up of many connected computers or nodes, and the blocks in the chain cannot be changed without the network's approval. Each node in the network has its copy of the digital ledger.  Figure 5. Applications of blockchain.

Structure of Blockchain
The blockchain comprises a series of blocks of transactions linked together in a chain, as shown in Figure 6. Client/server architecture is used in traditional client/server systems, and various administrators are in charge of them. On the other hand, blockchain is a distributed, decentralized peer-to-peer (P2P) network [24]. Each and every network participant can control the network. The network is made up of many connected computers or nodes, and the blocks in the chain cannot be changed without the network's approval. Each node in the network has its copy of the digital ledger.  The main constituents of a blockchain and the associated terminology are described as follows: 1. Block: In a blockchain, pointers and linked list data structures are utilized to represent blocks. Using a linked list, the blocks are sorted in a logical order and aligned up with one another. A block is a data set containing transaction information like timestamps and links to previous blocks and is produced using a secure hash technique. The location of the next block is indicated via pointers. Every block is divided into two sections: the block header and the block body.
The block header has the following fields: (i.) Block version: specifies which set of block validation criteria should be used. The main constituents of a blockchain and the associated terminology are described as follows:

1.
Block: In a blockchain, pointers and linked list data structures are utilized to represent blocks. Using a linked list, the blocks are sorted in a logical order and aligned up with one another. A block is a data set containing transaction information like timestamps and links to previous blocks and is produced using a secure hash technique. A transaction counter and transactions make up the block body. The maximum number of transactions stored in a block is determined by the block size and the transaction size.

2.
Public and Private keys: Blockchain is a constantly increasing network of interconnected and secured blocks using cryptographic processes [25]. To validate transactional authentication, blockchain employs an asymmetric key technique. The transactions in the block are encrypted using a private key. Every other node in the network can access these transactions. These nodes can decrypt the data using a public key available to all the nodes in the network.

3.
Hash function: Every block has a cryptographic hash related to the previous block.
Hashing creates a unique fixed-length string to identify a piece of data. The length of the string is independent of the size of the data. 4.
Consensus process: A set of protocols and consensus from all network participants are used to validate new blocks. Consensus is needed to decide on the validity of the block. Several approaches are available for the consensus process, such as proof of work, proof of stake, practical byzantine fault tolerance, etc.

5.
Smart Contracts: Smart contracts are programs that execute automatically and control the transactions between the distributed nodes in the blockchain network.

Types of Blockchain
The type of a blockchain depends on the nature of the application. There are three types of blockchains: public, private, and consortium [26]. These three types of blockchains are represented along with their properties in Figure 7. A transaction counter and transactions make up the block body. The maximum num ber of transactions stored in a block is determined by the block size and the transaction size. 2 Public and Private keys: Blockchain is a constantly increasing network of intercon nected and secured blocks using cryptographic processes [25]. To validate transac tional authentication, blockchain employs an asymmetric key technique. The trans actions in the block are encrypted using a private key. Every other node in the net work can access these transactions. These nodes can decrypt the data using a publi key available to all the nodes in the network. 3 Hash function: Every block has a cryptographic hash related to the previous block Hashing creates a unique fixed-length string to identify a piece of data. The length o the string is independent of the size of the data. 4 Consensus process: A set of protocols and consensus from all network participant are used to validate new blocks. Consensus is needed to decide on the validity of th block. Several approaches are available for the consensus process, such as proof o work, proof of stake, practical byzantine fault tolerance, etc. 5 Smart Contracts: Smart contracts are programs that execute automatically and con trol the transactions between the distributed nodes in the blockchain network.

Types of Blockchain
The type of a blockchain depends on the nature of the application. There are thre types of blockchains: public, private, and consortium [26]. These three types of block chains are represented along with their properties in Figure 7.
A blockchain is a decentralized network, and unlike a centralized system, the transactions are validated by the nodes in the network [27]. The identity of the nodes in the network remains unanimous, and once a transaction is validated by the nodes and added to the blockchain, it is impossible to reverse the transaction. Thus, the blockchain is immutable. The various other characteristics of a blockchain are depicted in Figure 8.

Decentralization
The nodes in the blockchain network have access to the transactions of other nodes

Immutable
The validated transactions cannot be reversed  Although blockchain technology has gained traction in future Internet systems, several difficulties must be properly addressed. Expertise in blockchain technology is critical, as the technology is still in the nascent stages. Adoption of BCT provides promised benefits in various fields, but the high initial infrastructure costs are a big worry for businesses. The deployment of blockchain technology is also influenced by privacy and security concerns. Scalability and legal requirements are also significant obstacles to its implementation.

Blockchain for Smart Grid
Blockchain technology has much potential to transform applications by creating more trust and increasing decentralization. Despite its rapid growth, its advantages are not being aggressively exploited by the SG applications. The number of articles published on blockchain from the perspective of the various SG applications is shown in Figure 9. Although blockchain technology has gained traction in future Internet systems, several difficulties must be properly addressed. Expertise in blockchain technology is critical, as the technology is still in the nascent stages. Adoption of BCT provides promised benefits in various fields, but the high initial infrastructure costs are a big worry for businesses. The deployment of blockchain technology is also influenced by privacy and security concerns. Scalability and legal requirements are also significant obstacles to its implementation.

Blockchain for Smart Grid
Blockchain technology has much potential to transform applications by creating more trust and increasing decentralization. Despite its rapid growth, its advantages are not being aggressively exploited by the SG applications. The number of articles published on blockchain from the perspective of the various SG applications is shown in Figure 9. These Blockchain is widely adopted for energy management applications in an SG. Blockchain is also widely used for SCs, EVs, and MGs. SPAs, responsible for the wide area monitoring and control of the grid, are not employing blockchain technology for decentralizing the process. Only four conference articles reported the use of blockchain technology for SPA. In this section, blockchain technology will be explored from the perspective of these applications.

Blockchain for Synchrophasor Application
The major outages across the globe, such as those in Brazil in February 2011, the Pacific Southwest in September 2011, India in July 2012, Vietnam in May 2013, the Philippines in June 2013, Bangladesh in November 2014, etc., have necessitated the wide-area measurement system (WAMS) in the SG [28,29]. The WAMS is a comprehensive solution to monitor, control, and maintain the SG by incorporating the state-of-the-art infrastructure, emerging technology, and tools.
Recently, synchrophasor technology emerged as a viable solution for the WAMS. The synchrophasor technology enables WAMS to monitor, control, and coordinate the SG in real-time and precisely [30]. The fundamental architecture of the synchrophasor measurement system involves a phasor measurement unit (PMU), phasor data concentrator (PDC), and the communication network [31]. The PMUs are high-speed sensors that monitor the grid in real-time by measuring the grid voltages and currents. These measurements are time-synchronized using the global positioning system (GPS) and communicated to the PDC, which acts as an aggregator. The time-synchronized measurements of PMUs are referred to as synchrophasor data.
The communication network acts as a backbone since it provides the infrastructure for communicating synchrophasor data between PMUs and PDCs [32]. The more generic architecture of WAMS comprises decentralized architecture where the devices are hierar- Blockchain is widely adopted for energy management applications in an SG. Blockchain is also widely used for SCs, EVs, and MGs. SPAs, responsible for the wide area monitoring and control of the grid, are not employing blockchain technology for decentralizing the process. Only four conference articles reported the use of blockchain technology for SPA. In this section, blockchain technology will be explored from the perspective of these applications.

Blockchain for Synchrophasor Application
The major outages across the globe, such as those in Brazil in February 2011, the Pacific Southwest in September 2011, India in July 2012, Vietnam in May 2013, the Philippines in June 2013, Bangladesh in November 2014, etc., have necessitated the wide-area measurement system (WAMS) in the SG [28,29]. The WAMS is a comprehensive solution to monitor, control, and maintain the SG by incorporating the state-of-the-art infrastructure, emerging technology, and tools.
Recently, synchrophasor technology emerged as a viable solution for the WAMS. The synchrophasor technology enables WAMS to monitor, control, and coordinate the SG in real-time and precisely [30]. The fundamental architecture of the synchrophasor measurement system involves a phasor measurement unit (PMU), phasor data concentrator (PDC), and the communication network [31]. The PMUs are high-speed sensors that monitor the grid in real-time by measuring the grid voltages and currents. These measurements are time-synchronized using the global positioning system (GPS) and communicated to the PDC, which acts as an aggregator. The time-synchronized measurements of PMUs are referred to as synchrophasor data.
The communication network acts as a backbone since it provides the infrastructure for communicating synchrophasor data between PMUs and PDCs [32]. The more generic architecture of WAMS comprises decentralized architecture where the devices are hierarchically arranged. The decentralized hierarchical architecture of the WAMS with three levels of hierarchy is shown in Figure 10. A local PDC may be located close to the microgrids, aggregating synchrophasor data from several PMUs in a power grid. Further, there may be a master PDC that aggregates data from several local PDCs. Finally, the data from several master PDCs may be aggregated by a PDC known as a super PDC located at the regional level, which is the highest level in the proposed hierarchy. The data pertaining to the health of the grid can be used in WAMS for state e tion, stability analysis, situational awareness, etc., of the SG and its other operation lated functionalities. However, such data, typically referred to as synchrophasor da be exploited by cyber-attacks such as denial of service (DoS), distributed denial of s (DDoS), false data injection, spoofing, data tampering, etc. [33]. These attacks p WAMS at risk, and its efficacy becomes questionable. The risk identification and a ment of smart grids is thoroughly discussed by Jha et al. in [34], where the author sidered risk assessment analysis of smart grid communication networks. The block can be used with synchrophasor technology to mitigate the risk of cyber-attack WAMS. Additionally, blockchain technology can simultaneously enhance the robus reliability, and integrity of the synchrophasor data by incorporating a decentralized to-peer approach to communicate synchrophasor data in a WAMS.

Blockchain Architecture for SPA
The blockchain architecture for the SPA in an SG will consist of three fundam components: 1. The member nodes, which are the PMUs or the PDC. Each node generates it chrophasor data and shares it using the IEEE C37.118-2 [35]. 2. A shared ledger containing the synchrophasor data collected by all the m nodes. 3. A peer-to-peer distributed network between the member nodes.
The architecture of a blockchain for SPAs is shown in Figure 11. As shown figure, the PMUs are connected in a fashion to create a distributed peer-to-peer ne where all PMUs are enabled as member nodes. Each PMU is responsible for collec updating the shared ledger. The synchrophasor data from a PMU is referred to as The data pertaining to the health of the grid can be used in WAMS for state estimation, stability analysis, situational awareness, etc., of the SG and its other operational-related functionalities. However, such data, typically referred to as synchrophasor data, can be exploited by cyber-attacks such as denial of service (DoS), distributed denial of service (DDoS), false data injection, spoofing, data tampering, etc. [33]. These attacks put the WAMS at risk, and its efficacy becomes questionable. The risk identification and assessment of smart grids is thoroughly discussed by Jha et al. in [34], where the authors considered risk assessment analysis of smart grid communication networks. The blockchain can be used with synchrophasor technology to mitigate the risk of cyber-attacks in a WAMS. Additionally, blockchain technology can simultaneously enhance the robustness, reliability, and integrity of the synchrophasor data by incorporating a decentralized peer-to-peer approach to communicate synchrophasor data in a WAMS.

Blockchain Architecture for SPA
The blockchain architecture for the SPA in an SG will consist of three fundamental components: 1.
The member nodes, which are the PMUs or the PDC. Each node generates its synchrophasor data and shares it using the IEEE C37.118-2 [35].

2.
A shared ledger containing the synchrophasor data collected by all the member nodes.

3.
A peer-to-peer distributed network between the member nodes.
The architecture of a blockchain for SPAs is shown in Figure 11. As shown in the figure, the PMUs are connected in a fashion to create a distributed peer-to-peer network where all PMUs are enabled as member nodes. Each PMU is responsible for collectively updating the shared ledger. The synchrophasor data from a PMU is referred to as a synchrophasor transaction. The synchrophasor transactions are generated by PMUs which can be verified using authentication methods such as the elliptic curve digital signature algorithm. Despite this authentication, it is quite possible that the false identity of a PMU can be created to obtain access to the network causing danger to the resources. Such an attack can be mitigated using device identity validation methods such as the Bloom filter-based PMU identity validation approach.  The PMUs are connected in a fashion to create distributed peer-to-peer network. Each PMU in the distributed peer-to-peer networks acts as a member which mines the block, where the synchrophasor transactions are included in a block. The contents of the block are shown in Figure 12.   Each block is generated using the IEEE C37.118-2 standard. The block is encapsulated with other protocols for communication over the TCP/IP network. The PMUs are responsible for consensus execution and block validation. There are several approaches for consensus execution and validation in blockchain technology. For SPA, the Markel tree-based The PMUs are connected in a fashion to create distributed peer-to-peer network. Each PMU in the distributed peer-to-peer networks acts as a member which mines the block, where the synchrophasor transactions are included in a block. The contents of the block are shown in Figure 12.  The PMUs are connected in a fashion to create distributed peer-to-peer network. Ea PMU in the distributed peer-to-peer networks acts as a member which mines the bloc where the synchrophasor transactions are included in a block. The contents of the blo are shown in Figure 12.

TCP header
Hash of block 0  Each block is generated using the IEEE C37.118-2 standard. The block is encapsulat with other protocols for communication over the TCP/IP network. The PMUs are respo sible for consensus execution and block validation. There are several approaches for co sensus execution and validation in blockchain technology. For SPA, the Markel tree-bas Each block is generated using the IEEE C37.118-2 standard. The block is encapsulated with other protocols for communication over the TCP/IP network. The PMUs are responsible for consensus execution and block validation. There are several approaches for consensus execution and validation in blockchain technology. For SPA, the Markel tree-based approach can be used for consensus execution as it converges quickly without compromising the integrity of the synchrophasor transactions. Further, PMUs can follow consensus based on proof-of-work (PoW), where nonce is searched, which is a random number. When all the synchrophasor transactions grouped in a block are validated and PoW is completed, only a block is considered successfully mined by the PMU. On validating with PoW, the newly created block is appended to the existing chain to update the blockchain. The first block in the blockchain is a genesis block, which a PMU in the network can generate. It is imperative that any PMU can validate any number of blocks and receives the whole existing blockchain from executing the consensus and PoW. The decentralization can also help remove the PDC, and the PMUs themselves can take commensurate actions based on the measurements available from other PMUs.

Challenges and Solutions for the Implementation of Blockchain-Based SPA
PMUs operate at a very high rate, typically 30-60 samples per second in a timesynchronized manner. Hence, the additional functionalities of creating the blocks and validating burden the device and hampers the granularity of its measurements. An alternative solution to this problem is implementing the blockchain at a higher level in the hierarchy, i.e., at the local PDCs. The architecture for implementing the blockchain at the level of local PDCs is shown in Figure 13. When all the synchrophasor transactions grouped in a block are validated and PoW is completed, only a block is considered successfully mined by the PMU. On validating with PoW, the newly created block is appended to the existing chain to update the blockchain. The first block in the blockchain is a genesis block, which a PMU in the network can generate. It is imperative that any PMU can validate any number of blocks and receives the whole existing blockchain from executing the consensus and PoW. The decentralization can also help remove the PDC, and the PMUs themselves can take commensurate actions based on the measurements available from other PMUs.

Challenges and Solutions for the Implementation of Blockchain-Based SPA
PMUs operate at a very high rate, typically 30-60 samples per second in a time-synchronized manner. Hence, the additional functionalities of creating the blocks and validating burden the device and hampers the granularity of its measurements. An alternative solution to this problem is implementing the blockchain at a higher level in the hierarchy, i.e., at the local PDCs. The architecture for implementing the blockchain at the level of local PDCs is shown in Figure 13.   SPAs are mission-critical, so it becomes computationally intensive to validate all the transactions. A solution to this problem is to terminate the chain at periodic intervals and start a new chain. This reduces the secureness of the chain, so additional measures will be needed to maintain the security. Because of the problems of the mission-critical nature of the application and the high data rate of the PMU, not many works are available on this topic.

Blockchain for Home Automation
A smart house is an integrated Internet of Things (IoT) domicile that provides users security, health, comfort, and a higher standard of life, among other benefits. People's life and independent living are made easier with smart home solutions. They provide valuable capabilities such as behavior tracking and safety evaluations, which have drawn the SPAs are mission-critical, so it becomes computationally intensive to validate all the transactions. A solution to this problem is to terminate the chain at periodic intervals and start a new chain. This reduces the secureness of the chain, so additional measures will be needed to maintain the security. Because of the problems of the mission-critical nature of the application and the high data rate of the PMU, not many works are available on this topic.

Blockchain for Home Automation
A smart house is an integrated Internet of Things (IoT) domicile that provides users security, health, comfort, and a higher standard of life, among other benefits. People's life and independent living are made easier with smart home solutions. They provide valuable capabilities such as behavior tracking and safety evaluations, which have drawn the attention of consumers and device makers. Although intelligent homes provide significant benefits to homeowners and other interested parties, they are vulnerable to harmful cyberattacks that risk users' safety and privacy [36]. Traditional solutions to such dangers exist, but they are extremely centralized and prone to large-scale attacks. As a result, the adaptability and scalability needed for effective utilization in the cutting-edge field of autonomous smart home applications and facilities are absent. Several clever technologies make life easier for individuals. Such programs generate enormous volumes of data. The archiving of this ever-changing material into repositories raises security problems. In cybersecurity technologies with remote connectivity and data transmission, blockchain has performed well. Thus, it is being employed for home automation applications.

Blockchain Architecture for HA
Home automation involves several smart devices, such as smart TVs, lights, etc. These devices monitor and control the various parameters of the house, which operate independently or are coordinated by a user. The interconnectivity of these smart devices is required to achieve the objective of HA. The interoperability challenges between the smart devices are handled using an IoT gateway. Users from one home cannot control the devices of another home to avoid a security breach. The service provider is responsible for providing necessary recommendations to the user for controlling smart devices based on prediction algorithms. The service provider can use machine learning algorithms for better recommendations or predictions. The blockchain network is used to connect different users and service providers to enhance security in the HA [37]. The blockchain network may be built using Ethereum or Hyperledger. The general architecture of blockchain for HA is shown in Figure 14.
Sustainability 2022, 14, x FOR PEER REVIEW 12 cyber-attacks that risk users' safety and privacy [36]. Traditional solutions to such dan exist, but they are extremely centralized and prone to large-scale attacks. As a result adaptability and scalability needed for effective utilization in the cutting-edge field of tonomous smart home applications and facilities are absent. Several clever technolo make life easier for individuals. Such programs generate enormous volumes of data. archiving of this ever-changing material into repositories raises security problems. In bersecurity technologies with remote connectivity and data transmission, blockchain performed well. Thus, it is being employed for home automation applications.

Blockchain Architecture for HA
Home automation involves several smart devices, such as smart TVs, lights, These devices monitor and control the various parameters of the house, which ope independently or are coordinated by a user. The interconnectivity of these smart dev is required to achieve the objective of HA. The interoperability challenges between smart devices are handled using an IoT gateway. Users from one home cannot contro devices of another home to avoid a security breach. The service provider is respons for providing necessary recommendations to the user for controlling smart devices ba on prediction algorithms. The service provider can use machine learning algorithms better recommendations or predictions. The blockchain network is used to connect di ent users and service providers to enhance security in the HA [37]. The blockchain work may be built using Ethereum or Hyperledger. The general architecture of blockc for HA is shown in Figure 14. The user within the house can control the entities within his home; he cannot h access to the entities present in another smart home. The various devices in the home be directly connected to the blockchain network through the gateway. The data from devices can be placed into the blocks, which are then chained together using the hash mechanism of the blockchain. The service provider can analyze the data and send sug The user within the house can control the entities within his home; he cannot have access to the entities present in another smart home. The various devices in the home can be directly connected to the blockchain network through the gateway. The data from the devices can be placed into the blocks, which are then chained together using the hashing mechanism of the blockchain. The service provider can analyze the data and send suggestions to the users, but he cannot directly control the devices in the smart home. This architecture can be customized based on the user's specific requirements by the service provider. The various devices in the home can be directly connected to the blockchain network through the gateway. The data from the devices can be placed into the blocks, which are then chained together using the hashing mechanism of the blockchain.

State-of-the-Art on Blockchain for HA
The literature on blockchain for HA applications discusses access control mechanisms, homecare systems, utility payment services, etc. These works are summarized in Table 2. Table 2. Review of the works on blockchain for HA applications.

Reference
Domain Blockchain Mechanism Used Summary [38] Access control Private blockchain For access control in smart homes, which is computationally fast and economical but is susceptible to malicious attacks.
[39] Home care Ethereum blockchain Provides a secure means of sending healthcare data to the healthcare center, but has increased overhead.
[40] Home care Private blockchain Reduces communication overhead for sending patient data but has more overhead.
[41] EV charging bill payment Lightweight basic blockchain Reduces the size of block for payment of charging bill. This is also vulnerable to security attacks.
[42] Home care Consortium blockchain Data of the aged people is stored efficiently with enhanced quality but is susceptible to DoS attack.
[43] Authentication mechanism Ethereum blockchain A scalable but expensive mechanism for authentication of IoT devices.
[44] Automated payment Bitcoin blockchain A highly scalable automated payment system that also allows off-chain transactions. [45] Lightweight payment system NA A low-power and fast payment system. This may be susceptible to malicious attacks.

Challenges and Solutions for the Implementation of Blockchain-Based HA
Various blockchain systems are being used for HA applications [46]. These systems have their specific data format, and their interoperability is challenging. Additionally, the consensus algorithms used by these systems are different. For seamless interaction, standardization of blockchain systems is required. Another challenge to implementing blockchain for HA applications is the real-time analytics of streaming data. The data have to be processed and analyzed in real-time. For example, an intruder detection system requires real-time face detection. Processing blockchains for real-time applications is challenging. A possible solution is to use a lightweight framework for this application.

Blockchain for Advanced Metering Infrastructure
The heart of the AMI is a smart meter used to collect, monitor, and communicate the data related to energy consumption corresponding to every user. The meter data are used differently by different entities. For example, the grid operator can use this data for load forecasting and planning, and the market operator can use smart meter data for dynamic pricing and billing. On the other hand, the users can use such data to manage their electricity usage. Whereas AMI provides ample advantages, secure AMI data transaction is challenging. The blockchain-based AMI plays an important role in achieving this objective. A generic framework for implementing AMI using blockchain is shown in Figure 15. The smart meters can be directly connected to the blockchain network through the gateway [47]. The data from the meters contains meter IDs and other utility-related information as per the IEC 62056 protocol. These meters are connected to the servers or nodes inside the blockchain network that create the blocks using the data received from the AMIs. These blocks are then shared with all other nodes inside the blockchain-enabled network. This network can only be accessed by the nodes related to the utility center and so should be a private blockchain network. The private blockchain can be used for smart contracts and validations to provide energy utilization transparency without compromising security and privacy.
Challenges for the Implementation of Blockchain for AMI Blockchain has not been used widely for this SG application despite its utility. Researchers have used it to enhance the security of AMI applications. In ref. [48], a lightweight blockchain-based framework was proposed to enhance AMI's security. The framework was secure against attacks, and its energy consumption was low. In ref. [49], blockchain was used to preserve the integrity of the customers using AMI. As with the blockchain for HA applications, the blockchain for AMI is also plagued with interoperability and real-time constraints.

Blockchain for Electric Vehicles
The technological evolution of electric vehicles (EVs) and the rapid growth of the The smart meters can be directly connected to the blockchain network through the gateway [47]. The data from the meters contains meter IDs and other utility-related information as per the IEC 62056 protocol. These meters are connected to the servers or nodes inside the blockchain network that create the blocks using the data received from the AMIs. These blocks are then shared with all other nodes inside the blockchain-enabled network. This network can only be accessed by the nodes related to the utility center and so should be a private blockchain network. The private blockchain can be used for smart contracts and validations to provide energy utilization transparency without compromising security and privacy.
Challenges for the Implementation of Blockchain for AMI Blockchain has not been used widely for this SG application despite its utility. Researchers have used it to enhance the security of AMI applications. In ref. [48], a lightweight blockchain-based framework was proposed to enhance AMI's security. The framework was secure against attacks, and its energy consumption was low. In ref. [49], blockchain was used to preserve the integrity of the customers using AMI. As with the blockchain for HA applications, the blockchain for AMI is also plagued with interoperability and real-time constraints.

Blockchain for Electric Vehicles
The technological evolution of electric vehicles (EVs) and the rapid growth of the smart grid have led to the emergence of new connectivity structures-vehicle-to-grid (V2G) [50]. In the future, the importance of EVs using technologies such as the Internet of Vehicles (IoV) [51] or the Internet of Things (IoT) [52] will increase, as it offers innumerable advantages, for example logistics companies provide fixed charging stations (CSs) for their fleet of vehicles.
Interconnectivity requirements with all technology systems in the real world have led to the emergence of vehicle-to-everything (V2X) technology [53], using integrated vehicle sensor platforms that use the centralization of various functions through an integrated EV server, connected by a series of connectivity devices such as CAN, LIN, Wi-Fi, and Bluetooth technology [54]. The results of V2X performances are based on a series of information on the collection and dissemination of multi-networks and technological capabilities between electric vehicles.
The security factor, the speed of data transfer between interconnected vehicles, and the wide coverage of telecommunications systems led to the emergence of 5G networks and their distribution very quickly in the world [55]. The infrastructure of multi-networks communication systems through 5G technology has the power to process applications at a superior level. The 5G network drives the V2X protocol, generating many scenarios for data management by promoting the development and integration of blockchain applications [56]. The implementation of blockchain systems in the vehicle-to-everything protocol tends to reinvent intelligent transport systems, leading to high efficiency of transport and road safety services [57].

Architecture of Blockchain for EVs
The general blockchain architecture for the EV application is shown in Figure 16. The blockchain-based EVs infrastructure requires regular nodes to capture mobile cars' dynamics. These nodes are responsible for smart contracts and block validations, forming the basis of the blockchain. The mobile cars send their data to such regularly placed blockchain nodes or access points. The interconnectivity between mobile electric vehicles and nodes is through WiFi. An ID number uniquely identifies each EV. The data that an EV sends to the access point involve the battery status, vehicle status, bill payment for charging, etc. The data are placed into the blockchain network by the access points as blocks. The various nodes in the blockchain validate the transactions. The blockchain network is also accessible to the transport authority, who can continuously monitor the status of the EVs and send personalized recommendations or warnings to the EV user. However, the transportation authority cannot change the parameters of the EV. hicle sensor platforms that use the centralization of various functions through an integrated EV server, connected by a series of connectivity devices such as CAN, LIN, Wi-Fi, and Bluetooth technology [54]. The results of V2X performances are based on a series of information on the collection and dissemination of multi-networks and technological capabilities between electric vehicles. The security factor, the speed of data transfer between interconnected vehicles, and the wide coverage of telecommunications systems led to the emergence of 5G networks and their distribution very quickly in the world [55]. The infrastructure of multi-networks communication systems through 5G technology has the power to process applications at a superior level. The 5G network drives the V2X protocol, generating many scenarios for data management by promoting the development and integration of blockchain applications [56]. The implementation of blockchain systems in the vehicle-to-everything protocol tends to reinvent intelligent transport systems, leading to high efficiency of transport and road safety services [57].

Architecture of Blockchain for EVs
The general blockchain architecture for the EV application is shown in Figure 16. The blockchain-based EVs infrastructure requires regular nodes to capture mobile cars' dynamics. These nodes are responsible for smart contracts and block validations, forming the basis of the blockchain. The mobile cars send their data to such regularly placed blockchain nodes or access points. The interconnectivity between mobile electric vehicles and nodes is through WiFi. An ID number uniquely identifies each EV. The data that an EV sends to the access point involve the battery status, vehicle status, bill payment for charging, etc. The data are placed into the blockchain network by the access points as blocks. The various nodes in the blockchain validate the transactions. The blockchain network is also accessible to the transport authority, who can continuously monitor the status of the EVs and send personalized recommendations or warnings to the EV user. However, the transportation authority cannot change the parameters of the EV.

A panoramic Overview of Blockchain for EV
Despite abundant opportunities to incorporate blockchain in EV applications, some of the challenges are inherently present in the blockchain-enabled EV system, such as min-

A panoramic Overview of Blockchain for EV
Despite abundant opportunities to incorporate blockchain in EV applications, some of the challenges are inherently present in the blockchain-enabled EV system, such as mining of the data, cybersecurity, handling of voluminous data, etc. Furqan Jameel et al. [58] provided a solution for unloading mining tasks in vehicle-to-everything cellular networks. A short block length transmission architecture has been proposed to meet the low-latency requirements for cybersecurity applications of EVs. In practice, finite block length architecture is a fairer approach to modeling blockchain networks. The inspiration for the theoretical application of adopting games defines a type of challenge for solving mining tasks and efficiently unloading them to clusters. The advantage of using blockchain databases ensures good data transfer rates and maintains the vehicles' fairness in the unloading process.
However, a significant disadvantage is the scalability of the data chains within the blockchain, which can be a design problem. Because data security is the main issue in conventional blockchain networks, the impact it has on the process of downloading data into electric vehicles is a real challenge. However, in ref. [59], the authors proposed a new coding sequence-Secure V2X-that capitalizes on the characteristics of the blockchain and the data networks protecting the confidentiality and security of the V2X protocol.
In addition to the benefits that blockchain initiates in low-security areas, confidentiality is the main issue in trading energy in a collective network type peer-to-peer (P2P) (E-trading). In recent years, electric vehicles have received worldwide recognition due to their potential in the green transportation system. The rapid development of technologies in smart communication networks has allowed EVs to relate to the environment. The electricity production costs are constantly decreasing through the implementation of renewable energy sources and smart grids [60]. Thus, the major challenge of peer-to-peer technology, E-trading and D-trading [61], and integration for electric vehicles is the development of a secure communication architecture that maintains data confidentiality and information anonymity. In addition, the objective of the blockchain is to mask trading relationships without compromising data integrity [62].
Various review papers in the literature focus on blockchain technologies applied in the Future Smart Grid [63,64]. Although the technology is considered one with a wide range of advantages, security needs to be assessed systematically to enhance reliability of the SG [65].
Motivated by previous development, Marina Dorokhova et al. [66] proposed integrating electric vehicle charging systems based on blockchain technology. The study is based on a popular blockchain platform, Ethereum, for interconnecting EV infrastructure and real-world infrastructure [67]. The advantage it offers is the crediting in the safety zone of the energy flows between the owners of electric vehicles and the companies that own charging stations. The only barriers that could be removed in the future are the limitations of the blockchain-high transaction costs due to network loads, high power consumption, or transactions that do not change in case of errors.
A case study by Shivam Saxena et al. [68] further demonstrated the need for technoeconomic evaluation of residential energy trading systems. The EV is a part of such system, which can be enhanced through the blockchain. Using blockchain in EVs not only improves the household's participation in the electricity markets but also drastically reduces the negative impact on the energy distribution network [69]. These seminal works are comprehensively summarized in Table 3.

Challenges and Solutions for the Implementation of Blockchain for EVs
The scalability of blockchain data chains, data security in the download process, and confidentiality are challenges that are yet to be addressed. The major challenge of peer-to-peer technologies is the processing of energy transactions and the anonymity of information. The high resource requirement and transaction cost in terms of energy consumption plagued the use of blockchain technology for EV applications with WSN infrastructure. Overcoming these limitations would make blockchain technology the main key factor for EVs. The development of lightweight blockchain algorithms for reaching consensus in real-time can be a probable solution.

Blockchain for Renewable Microgrids
With every day passing, there is a continuous transition and evolution to a renewable grid that is based on various distributed energy resources such as photovoltaics, fuel cells, microturbines, batteries, etc. These transitions rely on the successful deployment of blockchain technology.

Architecture of Blockchain for MGs
The generalized blockchain architecture for the MG application is shown in Figure 17. In general, the power grid of a zone is sprawled over a large geographical area where different MGs are considered. The different MGs are interconnected using the blockchain network. The blockchain network aims to enhance security and privacy in the MG operation without hampering transparency and data integrity. The data block carries information regarding the energy generated, energy to be shared with other microgrids, etc. The data pertaining to the MG are grouped into the blocks where each newly generated block is validated using a consensus algorithm. The block is then placed onto the blockchain network and is added to the blockchain after being validated. The nodes in the blockchain need proper algorithms to reach a consensus on the energy being traded, the price at which the electricity is being traded, etc.

A Panoramic Overview of Blockchain for MG
Early inquiries about the energy sector with the accent on t crogrids are mainly found in refs. [70][71][72][73], where different requirem chitectures, trends, and cyber security issues are largely debated.
With rising social, economic, political, and environmental c such as increasing power consumption, dealing with the middlem tion, pollution, etc., blockchain is seen as a promising solution in for efficient operation such as complex point-to-point transaction traders, and users using elaborate algorithms in order to validate, s transactions.
The different authors reviewed blockchain in the context of m perspectives. In ref. [74], the need for blockchain, benefits, and cha In ref. [11], real solutions such as the Brooklyn Micro Grid based o ronment with the Proof of Work (PoW) mechanism were presented reviews can be found in ref. [75] that can serve as quality backgro who want to propose and implement feasible solutions and metho

A Panoramic Overview of Blockchain for MG
Early inquiries about the energy sector with the accent on the smart grid and microgrids are mainly found in refs. [70][71][72][73], where different requirements, technologies, architectures, trends, and cyber security issues are largely debated.
With rising social, economic, political, and environmental concerns and strategies such as increasing power consumption, dealing with the middleman, market liberalization, pollution, etc., blockchain is seen as a promising solution in renewable microgrids for efficient operation such as complex point-to-point transactions between producers, traders, and users using elaborate algorithms in order to validate, secure, and record these transactions.
The different authors reviewed blockchain in the context of microgrids from several perspectives. In ref. [74], the need for blockchain, benefits, and challenges was reviewed. In ref. [11], real solutions such as the Brooklyn Micro Grid based on the blockchain environment with the Proof of Work (PoW) mechanism were presented. Other comprehensive reviews can be found in ref. [75] that can serve as quality background research for those who want to propose and implement feasible solutions and methodologies for renewable microgrids based on blockchain technology.
On the other hand, many works propose different solutions and approaches that use blockchain technology to enhance and improve microgrids and their applications. To start, ref. [76] proposed an approach for using blockchain on the Dominican Republic's electricity market, referred to as the main step in empowering automatic management of economic transfers with funds authenticating and supplier's guarantee. The approach presents an economic and energy blockchain-based flow to decentralize the current flows that involve total control through banking operations. Of course, such an approach must face serious economic interests, political regulations, and technological limitations to achieve its goals, but it is seen as a first step in applying blockchain in the electricity sector.
In ref. [77], a local energy market model using private blockchain via home energy management and demurrage mechanisms was presented. In the proposed model, there are three major actors: a small community (several microgrids) that uses photovoltaic systems as renewable energy as the prosumers; the consumers; and the main grid. Using Critical Peak Price (CPP) and Real-Time Price (RTP) schemes, simulations showed that costs were significantly reduced. Moreover, ref. [78] proposed a blockchain-based decentralized market mechanism to establish the price using auction methods. However, this is plagued with two limitations: difficulty in selling the oversupply of energy through auction and big challenges in ensuring privacy and security. Another solution for P2P energy trading was presented in ref. [79] by implementing the blockchain-based decentralized energy flexibility market for P2P transactions among prosumers. Two additional frameworks, first as decentralized blockchain-based and second as semi-decentralized, can be found in ref. [80], where the P2P energy trading subject was analyzed.
A more applied approach is in ref. [81], which proposed a method for an effective P2P blockchain-based energy market between a microgrid and the smart grid (IEEE 24-bus test system) where the function of distributed consensus algorithm was evaluated in the presence of Fault Data Injection Attack (FDIA). The main findings of this paper showed that the consensus process keeps running even if the case of a cyber-attack and the output response of the P2P market is very close to the centralized energy market. Maintaining the idea of the applied solution, the authors in ref. [82] suggested a model for an integrated energy management platform based on blockchain technology and, at the same time, implement a bilateral trading mechanism with simulation results showing significant optimization of the energy flow in a microgrid. Another model for blockchain-based energy management was suggested in ref. [83], where a Pythagorean fuzzy method was used in choosing the best solution for energy production, distribution, and waste control.
Further, in ref. [84], another P2P energy trading mechanism between microgrids based on the same technology using a fuzzy meta-heuristic approach as a pricing solution was presented with results showing increased profitability and reduced CO 2 emissions. Additionally, the fusion of the electricity market and blockchain was studied in ref. [85], where transactions were highlighted using multi-agent cooperation and sharing platform based on the Ethereum private blockchain, with results revealing several benefits such as transparent transactions and intelligent mutual trust.
Going deeper and deeper into the heart of the topic of this section, we arrive at the point where blockchain applications variates in terms of the constructive technology that microgrids are built on, this referring to AC microgrids, DC microgrids, or hybrid AC-DC MGs [86][87][88][89][90]. First, blockchain was used in ref. [86] to increase the security for interconnected hybrid AC-DC microgrids using a modified sine cosine algorithm to achieve the optimal decision in the shortest time and with high accuracy. The approaches in refs. [87] and [88] are based on the blockchain technology for energy management concerning DC and hybrid AC-DC microgrids using different strategies such as fuzzy logic control or the whale optimization algorithm. These seminal works are comprehensively summarized in Table 4.

Challenges for Implementation of Blockchain for Microgrids
Like the numerous advantages, many challenges must be overcome in the blockchainbased renewable microgrids [91,92]. These challenges refer to technological constraints, economic aspects, social uncertainties, environmental concerns, political and institutional limitations, and law, regulations, norms, or end-to-end privacy and security.
A feasible and efficient balance between key features such as security, energy management, constraints, and costs is still challenging. Different consortiums operate different microgrids, so it is important to analyze and decide on the correct algorithm or methods to use, the best technology, the most suitable investor, and a very well-trained team.

Blockchain for Smart City
With the development and use of blockchain technology, the Internet of Things (IoT), and Cloud Computing, rapid evolution can be observed in the smart city paradigm.

A panoramic Overview on Blockchain for SC
In refs. [93,94], some of the problems related to smart city transportation were debated. These works demonstrated that there are concerns in rethinking the transformations of localities in terms of improvement of public transport and logistics [95,96], water supply [97], green energy [98], environment [99], health [100,101], education [102][103][104][105], and economics [106][107][108][109] by using the blockchain, which offers the possibility to use distributed stored data, and performs transactions without intermediaries between producers and beneficiaries [106,109] without data security problems [107]. The blockchain architecture [93,94] is the one that will strengthen the importance of using smart contracts in the development of transactions between the parties. These contracts are triggered by operations (agreements) between the parties or are determined by sensors, actuators, or IoT tags [97]. So, the blockchain and smart contracts are the ones that contribute to the transformation of localities into smart cities, finding the optimal adequacy in the development of logistics, energy, environment, water quality, health, etc. Some seminal results of the prospective of blockchain on health care are summarized in Table 5, whereas its applications in other smart city domains are summarized in Table 6. Enhanced privacy and security using a combined approach based on off-chain storage and on-chain verification Applications and research opportunities in the paradigm of a smart city using BC [104] Supply chain data management Implementation of salient features of BC, viz., immutability, transparency, decentralization, etc., to improve the efficacy of supply chain management in the industry BC chain-based food traceability system as a case study with the deployment of BC in order to enhance the efficacy of supply chain management in the industry The prospects of the IoT determine the smart city architecture, the multitude of sensors and smart objects that help collect data collected from public infrastructure, public access to data, increasing the quality of services and costs of environmental protection, and economic development. The general architecture of blockchain for SCs is shown in Figure 18. Using the same blockchain network for all the services in the smart city is not feasible. Therefore, multiple blockchain networks have to be used depending on the size of the city and the nature of smart services provided. Each blockchain network may cater to the requirements of a single service. Smart devices, i.e., smart transport vehicles, smart sensors Using the same blockchain network for all the services in the smart city is not feasible. Therefore, multiple blockchain networks have to be used depending on the size of the city and the nature of smart services provided. Each blockchain network may cater to the requirements of a single service. Smart devices, i.e., smart transport vehicles, smart sensors in homes, smart monitoring devices in hospitals, etc., generate data that is put into a blockchain related to its service. Proper protocols and blockchain frameworks will be needed to ensure the smooth operation of the services.

Challenges for Blockchain for SCs
SC has many different entities. The blockchain network used by the SCs' various entities varies with the application type. These applications have diverse requirements. For example, in the case of smart transportation, the devices are changing their locations, and in the case of smart lighting, the devices are static. The blockchain architecture must be planned according to the nature of the application. Additionally, the entities are spread over a large geographical area, and to meet the criterion for real-time analysis, the blockchain must be fast and secure. Additionally, interoperability between different blockchain networks in the SC is a challenge.

Blockchain for Energy Management System
Developing and implementing the distributed system, both in production and consumption and energy marketing, brought new benefits to producers and consumers. Moreover, the increasing energy use from wind turbines and photovoltaic panels necessitated changing the energy market's architecture and secure energy transactions. Blockchain technology can be used for this purpose.

Architecture of Blockchain for Energy Management System
The blockchain has enormous potential in the transaction related to energy marketing. EMS aims to ensure reliable energy trading in real-time, including all energy market entities such as generation systems (both renewable energy sources and non-renewable energy sources), customer systems, grid operators, etc. The blockchain architecture for EMS is shown in Figure 19. entities such as generation systems (both renewable energy sources and non-renewable energy sources), customer systems, grid operators, etc. The blockchain architecture for EMS is shown in Figure 19. The SG envisioned integrating renewable energy sources with conventional energy sources as generation sources. On the consumer side, there are individual homes, residential buildings, offices, market complexes, etc. In addition to these, the EV charging stations  The SG envisioned integrating renewable energy sources with conventional energy sources as generation sources. On the consumer side, there are individual homes, residential buildings, offices, market complexes, etc. In addition to these, the EV charging stations also fall in the consumer domain of the SG. However, the consumer domain entities act not only as the electricity consumer but also as the electricity producer. Such consumers can be referred to as prosumers. When surplus electricity is available at prosumers, it is contributed to reducing the burden on the generation system.
On the one hand, it reduces the burden of the generation system, but on the other hand, it becomes vital to monitor the energy trading between users. Additionally, security and privacy in the energy trading market are equally important. To achieve this objective, blockchain can be integrated into the EMS.
The blockchain aims to integrate all domains of the SG, such as the generation system, operation system, the consumer system, regulator, and control center, using the blockchain network as shown in Figure 19. The blockchain-based EMS ensures the security and privacy of energy transactions through its distributed approach, interoperability, and smart contracts. The private blockchain can implement data permissions and selective consortium access to ensure security and privacy in energy trading. Due to distributed approach, blockchain-based EMS augments the transparency without compromising privacy in peerto-peer energy trading.

A Panoramic Overview of Blockchain for EMS
The research on blockchain for EMS is gaining momentum and has been discussed in many recent works. As the amount of energy increases in trading, the greater the difficulties. So, this trading system needs to be controlled very carefully. An online energy transaction management model was proposed in ref. [111] where users can obtain information on their own trading and consumption through energetic transaction. For the transaction to be secure and fast, a payment plan was proposed based on the loan's value. Jiawei Yang et al., in ref. [112], propose a public pricing scheme based on the blockchain. The price is influenced by the share borne by the miners who are taxed with a part of the income for the power losses. The smart contract was created, although the testing was conducted with only 27 prosumers. The biggest problem when we talk about the price of energy in the trading process by using the blockchain is the high energy consumption used by this technology, which was resolved in ref. [113].
The security challenge was dealt with by Yi Zhang et al. in ref. [114] for users and energy flow. In ref. [115], S.N.G. Gourisetti et al. proposed an energy market framework using the online double auction. The authors explain the benefits and usefulness of blockchain technology and its use for transactional energy. The prognosis is that this technology and the implementation of smart contracts in stages can minimize and eliminate the challenge elements in key and certificate management. The authors stated that they expect that lower energy consumption will be achieved if users are more receptive.
Blockchain technology has allowed smart meters with enhanced security and privacy features. Further, a platform to monitor the energy generated from renewable sources by storing and trading energy between residents and network services of users was proposed in ref. [116]. The possibility of trading renewable energy generated by private producers using blockchain technology was shown in ref. [117]. The authors offer a high scalability solution based on smart contracts, which will not harm the decentralized system and data security. The costs of transactions made in this way will be lower compared with current blockchain costs. A cloud services platform for energy trading was proposed in ref. [118] by Lei Wang et al. Both users and suppliers participated in the platform, and the intelligent contract for trading between the parties was created. Antchain is used to make smart contracts, trade, and use the services offered by the cloud. The evolution over time of blockchain technology in the energy trading sector and the issues that stop the application of this technology were presented in ref. [119]. In ref. [120], the authors present the blockchain used by customers to pay for energy consumption. Some seminal work in this direction is comprehensively analyzed in Table 7. High flexibility and security of the power system and subsequent exploration to be done together.

Blockchain for Cybersecurity in SG
The immediate need to incorporate renewable energy sources has necessitated considering a more diversified and distributed structure for the SG. This objective was achieved through distributed generation system and DER [123]. However, this has increased the complexity of the SG. Further, the SG's complex infrastructure comprises several devices such as the PMUs, smart meters, home automation sensors, remote terminal unit, spanning generation, transmission, distribution, customer, operation, marketing, and utility domains, etc. [124]. Situational awareness is vital to ensure the resiliency of such a marvelous SG infrastructure. The communication infrastructure and the communication protocols needed to support these applications vary. The core of the communication network is a wide area network (WAN). In addition to this, there exist other types of communication networks such as local area networks (LAN), home area networks (HAN), wireless sensor networks (WSN), neighborhood area networks (NAN), etc. These communication networks mostly use TCP/IP protocol suite for data communication. TCP/IP is not a secure protocol. Hence, the communication network of the SG applications can be easily attacked by exploiting its vulnerability. Despite the basic security measures such as firewall, intrusion detection, encryption, authentication, etc., which are already implemented in the SG, though it is still vulnerable to several cyber-attacks. An excellent survey on various detection algorithms was provided on false data injection in ref. [125].
The SG is a typical cyber-physical system [126]. As a cyber-physical system, cybersecurity is a vital parameter with three features: availability, confidentiality, and integrity. Availability is characterized as the property in which all data are available promptly. The cyberattack can compromise availability by blocking, delaying, and corrupting the data or even losing the data. The impact of cyber-attack on the availability of SG applications is huge. Confidentiality is characterized as the property of the system to protect the privacy and proprietary information from unauthorized access. The cyberattack on confidentiality can compromise the privacy and proprietary information of the SG application. Such incidents can grant illegal access to the application by stealing password-related information, causing enormous loss to the operation of the application. Integrity is characterized as the application's property to protect the system from unauthorized access to avoid any modification, alternation, and destruction of the data. The cyberattacks on integrity can modify the data to configure the application, resulting in an enormous loss. For example, the modification data can lead to misconfiguration of the sensors leading to failure of the SG application.
Blockchain is a distributed ledger that is immutable and does not depend upon any third party for its execution. This makes blockchain a secure method for data transactions and thus plays a vital role in SG applications. The blockchain can explicitly be used to mitigate the cyberattacks to strengthen the SG application's security. Among the different blockchains, the public blockchain is highly secure compared with the consortium and private blockchain due to the nature of the members and the consensus mechanism. The members of the public blockchain can be anonymous, whereas only the trusted nodes can be members of the consortium and private blockchains. The consensus mechanism followed in the public blockchain is proof-of-work, whereas multi-party voting in the consortium blockchain and strictly pre-approved nodes in the private blockchain are followed as a consensus mechanism. However, computational complexity is very high in the public blockchain. Thus, when security threats are fewer, and computation complexity is low, consortium and private blockchains are preferable to the public blockchain. The architecture of the blockchain for cybersecurity in SG applications is shown in Figure 20. The smart devices generate data communicated to the blockchain network server using the TCP/IP protocol. If the devices are computationally powerful, the hashing of the data and its encryption can be performed at the device itself, thereby creating the block, which is then placed into the blockchain network. This is the most secure architecture, as any data tampering after it leaves the device results in a change in the has function, leading to the invalidation of the block. However, this puts much computational pressure on the end devices, which are already over-burdened by other tasks. The other alternative is to send the data to the servers/nodes in the blockchain using TCP/IP and generate the blocks in the blockchain. This is less secure, but it is not a computationally powerful smart devices. In the latter case, using private and public keys for extra authentication can be beneficial. This architecture envisions maximizing the security since all participants in the consortium blockchain are trusted, and the consensus mechanism is based on multi-party voting with no scope for anonymity. The administrative and management authorities select the member nodes acting as miners for the consortium and private blockchain. Next, the works related to blockchain for SG cybersecurity are comprehensively summarized in Table 8. Table 8. Summary of works on blockchain for SG cybersecurity.

SG Application Summary
[127] AMI A quantum key distribution-based secure key transmission is proposed for increasing the security of smart meters against cyber-attacks [128] Applicable to all A multi-layer protocol is proposed to enhance the cyber-security of SG applications.
[81] EMS and MG A blockchain framework for P2P energy transactions is proposed, using a novel consensus algorithm for enhanced cyber security. The smart devices generate data communicated to the blockchain network server using the TCP/IP protocol. If the devices are computationally powerful, the hashing of the data and its encryption can be performed at the device itself, thereby creating the block, which is then placed into the blockchain network. This is the most secure architecture, as any data tampering after it leaves the device results in a change in the has function, leading to the invalidation of the block. However, this puts much computational pressure on the end devices, which are already over-burdened by other tasks. The other alternative is to send the data to the servers/nodes in the blockchain using TCP/IP and generate the blocks in the blockchain. This is less secure, but it is not a computationally powerful smart devices. In the latter case, using private and public keys for extra authentication can be beneficial. This architecture envisions maximizing the security since all participants in the consortium blockchain are trusted, and the consensus mechanism is based on multi-party voting with no scope for anonymity. The administrative and management authorities select the member nodes acting as miners for the consortium and private blockchain. Next, the works related to blockchain for SG cybersecurity are comprehensively summarized in Table 8. Table 8. Summary of works on blockchain for SG cybersecurity.

Reference SG Application Summary
[127] AMI A quantum key distribution-based secure key transmission is proposed for increasing the security of smart meters against cyber-attacks [128] Applicable to all A multi-layer protocol is proposed to enhance the cyber-security of SG applications.
[81] EMS and MG A blockchain framework for P2P energy transactions is proposed, using a novel consensus algorithm for enhanced cyber security.
[129] EMS and MG A novel blockchain hyperledger is proposed for secure transactions on energy distribution. [130] MGs A master-slave mechanism is proposed to protect the data against malicious attacks.
[131] EMS A novel rewarding scheme is presented for network security. Additionally, smart contracts are used for safe data storage.
Blockchain technology for SG applications is still in the research phase and is gradually finding practical utility. Secure mechanisms are needed that can be implemented at the device level before the data leave the device. These mechanisms should be light and can be implemented in real-time.

Conclusions
SG is evolving with the developments in storage and computational technologies. One such technology that can potentially transform the transactions amongst the various entities of the SG is the blockchain. The blockchain offers a decentralized and secure means of authorizing transactions, removing the need for a centralized authority. Despite its tremendous application in other domains, it has been underutilized for SG applications. This paper reviewed blockchain technology from a utility perspective for SG applications. General architectures were proposed for the important SG applications and identified challenges. The review is expected to enhance the research on developing novel technologies to meet the requirements of practical SG applications.
The blockchain-based applications are still in the nascent stage from various perspectives, which are seen as future research problems. Many SG applications operate in real-time, and the blockchain should not overburden the applications. The resource requirements for computation are a major challenge in blockchain-based systems. Blockchain must be developed to work on a lighter framework while retaining its security features. Additionally, regulatory bodies have to develop standardization procedures to make this technology interoperable and popular. Some of these research problems can be solved in the future, thoroughly revolutionizing blockchain-based applications.