A growing number of prosumers have entered the local power market in response to an increase in the number of residential users who can afford to install distributed energy resources. The traditional microgrid trading platform has many problems, such as low transaction efficiency, the high cost of market maintenance, opaque transactions, and the difficulty of ensuring user privacy, which are not conducive to encouraging users to participate in local electricity trading. A blockchain-based mechanism of microgrid transactions can solve these problems, but the common single-blockchain framework cannot manage user identity. This study thus proposes a mechanism for secure microgrid transactions based on the hybrid blockchain. A hybrid framework consisting of private blockchain and consortium blockchain is first proposed to complete market transactions. The private blockchain stores the identifying information of users and a review of their transactions, while the consortium blockchain is responsible for storing transaction information. The block digest of the private blockchain is stored in the consortium blockchain to prevent information on the private blockchain from being tampered with by the central node. A reputation evaluation algorithm based on user behavior is then developed to evaluate user reputation, which affects the results of the access audit on the private blockchain. The higher a user’s reputation score is, the more benefits he/she can obtain in the transaction process. Finally, an identity-based proxy signcryption algorithm is proposed to help the intelligent management device with limited computing power obtain signcryption information in the transaction process to protect the transaction information. A system analysis showed that the secure transaction mechanism of the microgrid based on the hybrid blockchain boasts many security features, such as privacy, transparency, and imtamperability. The proposed reputation evaluation algorithm can objectively reflect all users’ behaviors through their reputation scores, and the identity-based proxy signcryption algorithm is practical.
The Energy Internet (EI), a distributed sharing network that combines the Internet and distributed energy resources (DER), can connect many kinds of distributed energy nodes to achieve the two-way flow of energy. Energy is used to provide light, heat, power, and other necessities to human beings. With continual scientific and technological progress, a variety of devices are now available to easily convert electric energy into various kinds of energy needed for human production and living. Therefore, the two-way flow of electric energy will form the core of future research on EI.
Currently used forms of primary energy include fossil energy, light energy, wind energy, and water energy , whereas electric energy needs to be obtained through conversion from primary energy. The traditional method of conversion is thermal power generation, that is, generating electricity through the combustion of fossil fuels. However, this method is inefficient and causes serious environmental pollution. In 2010, carbon dioxide emissions from energy production, such as the production of electricity, accounted for 76% of global emissions . Considering the importance of environmental protection, research on new methods of conversion has gained momentum. Renewable energy sources (RES) such as light, wind, and water are widely used in the world through primary energy conversion devices. By the end of 2018, the installed capacity of hydropower in China was 352 GW, that of wind power was 184 GW, and that of solar power was 174 GW . In addition, as the number of residential and industrial users who can afford DER deployment, in the form of solar photovoltaic panels, biomass generators, microwind turbines, and diesel engines, grows each year, a growing number of DER are being deployed at the industrial and residential scales . Although DER has the characteristics of low loss, little pollution, and good system economy, it still has problems that need to be solved. First, the distributed generator (DG) that uses the RES for power generation has a small capacity and is limited by external conditions, because of which the electricity generated by it is intermittent and random. This significantly reduces the reliability of the power supply . Moreover, when a large number of invisible and uncontrollable power generated by DER directly flow into the power grid, the overall power supply line is prone to overshooting the power flow, which jeopardizes the safety and reliability of the power system . Finally, the relationship between supply and demand in the power market is a major obstacle to the development of the DER, and consumers’ acceptance of DER power generation needs to be considered.
To solve the above problems of DER, two technologies have been proposed: the virtual power plant (VPP) and the microgrid (MG) . The VPP leverages advanced coordinated control technologies, smart metering technologies, and information and communication technologies to interact with participants in EI, thus making full use of the large-scale and multiregional DER. Due to the limitation of the available power transmission technology, long-distance power transmission causes partial power loss. For industrial and residential users who have DG installed, close-range MG technology is a better choice. MG focuses on regional balance of distributed load and power supply to achieve energy autonomy. VPP focuses on realizing the maximum benefit of the main body and has the derivative function of participating in the power market and auxiliary service market . Liu et al.  have provided a distributed robust energy management scheme for a system composed of multiple MGs. Uncertain factors in the operation of the MG have been dealt with by tunable robust optimization technology to optimize the total operating cost of the MG, and studies have verified the effectiveness of the method in a four-MG system. Zhang et al.  proposed a networked physical–social system for DER management in the MG that has the capability of parallel learning and can promote the emergence of high-quality DER optimization strategies through human–computer interactive learning. A case study was used to show that this technique can yield a DER optimization strategy more quickly than other heuristic algorithms. Ranjbar et al.  proposed an MG protection method in which the short-time Fourier transform (STFT) is used to pretreat the voltage waveform within a period, and the features of disturbance are extracted accordingly. These features are fed to a decision tree algorithm to identify fault events in the MG. The results of simulations showed that depending on the type of event, only two or six features were needed to detect any fault.
The above literature has mainly focused on solving the technical and economic problems of the MG, but it needs to be further developed to solve issues with its management. The prevalent mode of energy operation mostly uses centralized third-party management organization to manage transactions. This mode of management has the following problems: First, with an increase in the number of DER transactions within its jurisdiction, the operating cost of the trading center increases, transaction efficiency is significantly reduced, and it is difficult to ensure the effective operation of the microgrid in real time. Second, in the energy trading process, the trading center and the trading side cannot achieve complete trust, which imposes a significant annual cost on the trading centers to maintain trust. Moreover, there is no open and transparent trading and information platform in the MG, because of which the security and effectiveness of the transaction cannot be guaranteed, and its cost is high. Finally, the centralized trading center is prone to a single point of failure; that is, the trading center causes the entire system to collapse once it is attacked, and the disclosure or tempering of trading information damages the property and violates the privacy of both parties to the transaction.
Since 2016, Bitcoin, a decentralized digital currency, has gained considerable attention from the financial community due to an increase in its economic value. Academics have found that in addition to the economic value of Bitcoin itself, its core supporting technology, namely, the blockchain, has significant research value. The blockchain has the characteristics of decentralization, trustlessness, openness, and transparency. With progress in research, the scope of applications of the blockchain is no longer limited to the financial field. Adding blockchain technology to the transaction process of the MG may provide a new solution to the abovementioned management problems. Research on combining the microgrid energy market with blockchain technology is still in its preliminary stage. To prove the feasibility of this combination, many scholars have carried out a series of studies, and the results show that the blockchain has the ability to support energy transactions within a certain range [12–14]. Based on this assessment of theoretical feasibility, a growing number of papers have been published in the area. Di Silvestre et al.  discussed the loss in the distribution of energy transactions of blockchains when applied to the MG and proposed two indicators of loss distribution to solve this problem. The feasibility of these indicators was verified in two operating scenarios of a medium-voltage microgrid. Di Silvestre et al.  considered the provision of voltage regulation technology based on the blockchain for the MG, mainly by solving for reactive power optimization power flow and reactive power compensation. The former was intended to ensure optimal economic planning in reactive power production and the latter to evaluate the contribution of voltage regulation. Hassan et al.  proposed an energy transaction auction mechanism called differential privacy auction to provide moderately costly but secure and private energy auctions for the MG based on consortium blockchain. Experimental comparisons showed that this mechanism was superior to the VCG mechanism. van Leeuwen et al.  designed an integrated energy management platform based on the blockchain that is composed of three parts: a physical layer, economic layer, and information layer. It can facilitate the trade of energy in the microgrid community through a bilateral transaction mechanism and optimize energy flow by solving optimal power flow problems. Meeuw et al.  studied the impact of limitations of hardware and the communication infrastructure of applications on the blockchain system. Based on the conditions of the Swiss blockchain-based Walenstadt microgrid, the researchers artificially adjusted the bandwidth between nodes to simulate the bandwidth of the communication infrastructure. They found that a communication network with a bandwidth of less than 1000 kbit/s leads to insufficient system throughput. To solve the problems of default risk and demand uncertainty in designing a renewable energy microgrid based on the blockchain, a method based on robust two-type fuzzy programming was proposed by Tsao et al. , and its effectiveness was proved by a case study. The above literature has examined the blockchain-based microgrid system from different technical aspects, but a safe method to protect energy transactions in the MG remains elusive.
In this paper, a secure microgrid transaction mechanism based on the blockchain is proposed. The main contributions are as follows: (1)Blockchain-based microgrid trading platforms can solve the problems of trust and transparency in microgrid energy trading, but most schemes proposed in the literature are based on a single blockchain. In application, a single blockchain struggles to provide effective user identity management, and this makes it easier for malicious actors to infiltrate the system. This paper proposes a microgrid energy transaction framework based on the hybrid blockchain containing a trading consortium blockchain and private blockchains for identity management, where is the number of microgrids in the network. Only users verified by the private blockchain can conduct transactions on the consortium blockchain(2)To ensure good market trading behavior, a reputation evaluation algorithm based on user behavior is proposed. Because there are two kinds of identities, buyer and seller, in energy trading, this algorithm contains separate algorithms to assess buyer and seller behaviors. Whether a user can be authenticated by the private blockchain depends on their own reputation: when the reputation has a score of zero, the user cannot use the energy transaction function. In addition, the energy in the consortium blockchain is mainly auctioned by using the continuous double auction algorithm based on reputation. The higher the reputation score of a user is, the more benefit from the transaction they can draw(3)When users participate in energy transactions, they need to communicate with the microgrid continuously. To ensure the security of the information shared during transaction-related communication, an identity-based proxy signcryption algorithm is proposed that is suitable for users with smart home manager. Proxy signcryption allows the smart home manager with a limited amount of computing power and storage to delegate its data processing rights to the powerful energy manager to participate in energy trading. The identity-based proxy signcryption algorithm solves the defect whereby the typical proxy signcryption algorithm needs to store a large number of certificates
The remainder of this paper is arranged as follows: Section 2 introduces some preliminary information, and the system as a whole and its detailed framework are introduced in Section 3. In Section 4, we describe the steps of implementation of the proposed scheme, such as details of the buyer and seller reputation evaluation algorithms, the identity-based proxy signcryption process, and the process of generation of new blocks. Section 5 is devoted to a performance analysis and evaluation of the proposed scheme, and we summarize our findings in Section 6.
In this section, we review some preliminary knowledge, such as the structure of the microgrid, the nature of the bilinear pairing involved, and the principle of proxy signcrytion.
The earliest concept of the microgrid was proposed by the United States Consortium for Electric Reliability Technology Solutions (CERTS)  and remains the most authoritative one. The CERTS microgrid assumes that the set of loads and DER operate as a single system. A critical feature is that it can autonomously exist in the distribution system as a self-controlling entity. In other words, it is impossible to distinguish the MG from legitimate customer sites in the grid. The initial work by the CERTS was based on small-scale micropower sources with a capacity lower than 500 kW, and the basic structure of the MG developed by the CERTS is shown in Figure 1.