Research on Multimicrogrid Transaction Model and Cross-Chain Transaction Mechanism Based on Blockchain

*e traditional microgrid electricity transactions face a low security, poor economic benefits, and weak stability. To solve these problems, this paper proposes a multimicrogrid cross-chain transaction model based on quantum blockchain. Specifically, a bidding strategy was developed for the noncooperative dynamic game of aggregator-multimicrogrid alliance, aiming to balance and optimize the benefits of all parties and effectively enhance the consumption rate of electric energy. To improve the transaction efficiency between aggregators, a consensus mechanism was designed for multimicrogrid cross-chain communication, realizing consistent self-adaptation to cross-chain information. In addition, the quantum threshold signature technology was adopted to ensure the reliability of transaction data and create an unconditional secure communication environment. Case analysis shows that our model proposed in this paper not only ensures the security and stability of transactions but also enhances the economic benefits, providing theoretical support and decision support for the optimization of multimicronetwork cross-chain transaction model.


Introduction
e continuous development of energy information technology brings more and more challenges to data communication and isolated value island in multiple energy transaction market. e emerging technology of quantum blockchain injects new vitality to the multiple energy transaction market and significantly vitalizes the peer-topeer cross-chain transactions between multiple microgrids [1]. Based on quantum blockchain, the multimicrogrid cross-chain transactions can overcome the problems of traditional electricity transactions within microgrids, such as poor stability, low efficiency, and incredible data. erefore, it is of great significance to deeply integrate multimicrogrid cross-chain communication with quantum blockchain technology.
So far, domestic and foreign scholars have coupled microgrid electricity transactions with key blockchain techniques from various aspects. Zhang et al. [2] designed an electricity transaction settlement model based on smart contract and verified the feasibility and effectiveness of the proposed model. Chang et al. [3] established a hybrid game model, which includes the Stackelberg game between grid sources and the cooperative game between wind power and thermal power and designed an income distribution method based on both economic and environmental factors. After analyzing the demand of each node in microgrids, Ma et al. [4] improved the ant colony algorithm to build a blockchainbased competitive game model for multiple grids. She et al. [5] presented a secure transaction model based on heterogenous energy blockchain, aiming to realize the complementation between multiple energies in the electricity transaction system. e above studies have applied blockchain technology in electricity transactions. However, the existing models fail to offer a secure and efficient method for multimicrogrid cross-chain transactions.
For multimicrogrid joint operation, the cross-chain technology of quantum blockchain can break through the trust barriers of each microgrid and realize energy transactions between multiple systems without sacrificing privacy. Quantum communication is a new communication pattern that transmits information, using the superposition of states, quantum entanglement, and quantum teleportation [6]. Quantum blockchain is developing rapidly, and the relevant theories are increasingly perfect, providing reference and research direction for optimizing the electricity transactions of multimicrogrids.
Considering the above factors, this paper proposes a multimicrogrid cross-chain transaction model based on quantum blockchain. Firstly, a bidding mechanism was developed for the noncooperative dynamic game between aggregators and microgrids + grid and between aggregators, and the optimal selling model was derived for the multimicrogrids to obtain the unique Nash equilibrium solution, thereby maximizing the consumption of distributed energy. After that, a consensus mechanism was designed for multimicrogrid cross-chain communication.
e mechanism disperses the values across blockchain nodes in the private chain and effectively optimizes the efficiency of multimicrogrid cross-chain transactions. Finally, a quantum threshold signature scheme was formed under the quantum key distribution protocol. e scheme manages to regulate the transaction behaviors between multiple microgrids and improve the security of the transaction data.

Quantum Blockchain
Blockchain is a new application mode of computer technology, such as distributed data storage, peer-to-peer transmission, consensus mechanism, and encryption algorithm [7]. Blockchain is different from general distributed storage. Each node in the blockchain stores a copy of the blockchain database [8]. Blockchain is formed by linking blocks with hash values. e defining features of blockchain are decentralization, openness, and tamper-proof information [9]. e blockchain system consists of multiple data blocks, each of which is generated chronologically after the previous block. Figure 1 shows the structure of the blockchain.
Quantum computing uses the laws of quantum mechanics to process information and perform calculation. e basic principle of quantum mechanics is quantum superposition [10]. e superposition of states α|0 + β|1 is the most general state of physical systems [11]. e coefficients α and β are complex numbers about the number of configurations. e configuration probabilities can be described as g 0 � |α| 2 and g 1 � |β| 2 , with g 0 + g 1 � 1. Similar to those in the classic blockchain, the nodes in the quantum blockchain network each stores a copy of the blockchain, aiming to increase effective blocks in a decentralized manner.

Multimicrogrid Joint Operation Architecture.
Microgrid is a small power distribution system composed of distributed power sources, storage devices, electrical loads, and monitoring and protection devices [12]. With the largescale construction of microgrids, multiple adjacent microgrids in a certain area can form a multimicrogrid joint operation system through the connected transmission and distribution network. Figure 2 presents two independent microgrids i and j. e transmission and distribution network in the area serves as the physical channel for electricity interaction. Each of the two microgrids has established a blockchain-based internal peer-to-peer electricity transaction network, i.e., blockchain x and blockchain y. When the electricity supply and demand are out of balance, each microgrid purchases electricity at a high price from or sells electricity at a low price to the external distribution network. But this strategy is not conducive to the economic operation of each microgrid, because energy may get lost during the long-distance transmission in the distribution network [13]. To solve the problem, this paper designs a dynamic adaptive cross-chain network, which enables each party in blockchains x and y to handle cross-system transactions independently. e dynamic adaptive network was established on quantum blockchain, such that the cross-chain transactions inherit the advantages of distributed data storage and mutual trust.

Multimicrogrid Cross-Chain Communication.
In each blockchain network, a verification node subset (VNS) is chosen based on credibility and used to verify the effectiveness of cross-chain communication information, namely, V x and V y . By threshold signature, the VNS extends the internal consensus within each blockchain to interchain consensus. e nodes of VNS are independent of each other. e cross-chain consensus of multimicrogrid joint operation can be described by V k ∈ V x ∪ V y . Figure 3 shows the cross-chain communication process of blockchains x and y.
Blockchain node x i of microgrid i first makes a request for cross-chain transaction. en, blockchain node y j of microgrid j receives the request and signs the transaction agreement. is process can be divided into six phases: (1) x i prepares a graphical identification certificate and a data transmission key x is and describes the crosschain transaction demand mx i . e details and deadline of the electricity transaction are written in a smart contract ET resquest x i , which is deployed.
(2) V x verifies the transaction demand by testing the consistency of cross-chain consensus. If the transaction demand is verified, the key will be updated, and a new smart contract will be constructed. en, the cross-chain transaction will be sent to V y . Otherwise, the transaction demand will be neglected. (3) V y verifies the transaction demand. If the transaction demand is verified, the key will be updated, and a new smart contract will be constructed. en, the smart contract information will be broadcasted to all the nodes in blockchain y. Otherwise, the transaction demand will be neglected. (4) Node y j in blockchain y concludes a transaction with x i according to the transaction demand. If formulas (1)-(3) hold, y j will update the key and write the blind response to mx i . en, the corresponding transaction demand will be redeployed into y j . Otherwise, the transaction demand will be neglected. (1) where t current is the current date; t contract deadline is the deadline of the contract; Δt is the upper limit of the time for deploying or executing the smart contract; Traceability(mx i , Key, sig) is the proof of the traceability and credibility of the information sensor; Key and sig are the key and the corresponding digital signature from x i to y j .   Mathematical Problems in Engineering (5) x i verifies the smart contract from y j . If the smart contract is verified, x i will write the hash function of the electricity transaction into the smart contract and extract the response mx i . During the execution of the smart contract, x i returns the key of the electricity transaction to y j . e other cross-chain transactions are executed in a similar manner. (6) After executing the electricity transaction contract, x i and y j will separately broadcast the cross-chain certificate to the multimicrogrid system.

Electricity Transaction Model Based on Multiple
Aggregators. As the initiator of multimicrogrid game, aggregators are critical liaisons in the energy transaction between microgrids and between microgrid and the big grid. To maximize its own utility, an aggregator sells or buys electricity at a reasonable price to or from the big grid or the multiple microgrids. With the highest selling price in the electricity market, the multiple microgrids expect the maximal bidding income [14]. During the dynamic transaction, the unique Nash equilibrium solution is needed to lower the electrical energy flow cost within the multiple microgrids [15]. Taking the multiple microgrids as an example, this paper constructs the optimal selling model for aggregators ( Figure 4) by simplex method and dynamic game, with the goal of optimizing electricity consumption and balancing supply and sales: where E M−A and E P−A are the income of aggregators by selling electricity to microgrids and the big grid, respectively; δ is the coefficient of the electricity service fee charged by aggregators; P PG(sell) and P PG(buy) are the real-time purchase and selling prices of electricity of the big grid, respectively; P M i −p and P M i −M j are the electricity volumes purchased by MGA − i from the big grid and MGA − j via aggregators, respectively; P sell is the selling price of microgrids; Q sell is the electricity volume sold by microgrids; E A−M and E A−P are the expenditures of aggregators purchasing electricity from microgrids and the big grid, respectively.

Objective Function.
max , E A , E A is the utility function of aggregators; W t is the bidding income expected by the microgrids in the electricity market; q t is is the bidding electricity volume of microgrid i for the quoted price b t is ; ρ is the clearing price at the equilibrium.
① P sell < Q sell : P sell is the electricity selling price of microgrids; P PG(sell) is the real-time electricity selling price of the big grid. ② 0.85 < σ < 1.2: δ is the electricity service coefficient charged by aggregates.
is is the quoted price. ⑤ ρ ≤ ρ * : ρ is the clearing price at equilibrium; ρ * is the optimal clearing price at the optimal Nash equilibrium. ⑥ 0 ≤ q t is ≤ q t iM−EM , ∀s � 1, 2, . . . , n: q t is is the bidding electricity volume of microgrid i at the quoted price b t is ; q t iM−EM is the total bidding electricity volume of microgrid i at time t. e game bidding model of the supply-side microgrids is a noncooperative game model. According to the bidding strategy development method, the upper and lower limits of the quoted price were determined by setting the marginal cost of the bidding electricity volume [16]. Once the quoted price interval n is determined, the bidding strategy belongs to a discrete limited pure strategy set and has a Nash equilibrium solution. In the electricity market, there are two discrete strategy sets of bidding, which, respectively, belong to microgrid i and microgrid j. e Nash equilibrium of the bidding game can be established as where subscript c is the bidding strategy S t i or the fulfilment of Nash equilibrium; W t is the bidding income of the multiple microgrids in the electricity market. e improved iterative search was performed to obtain the Nash equilibrium solution to the above bidding game [17]. In each iteration, if the calculated clearing price is below the preset minimum, the clearing price will be corrected into the preset minimum; otherwise, the clearing price will be corrected into the preset maximum.
Let S t,k i , S t,k j be the bidding strategy of the multiple microgrids.
en, the bidding strategy of the multiple microgrids is S t,k+1 Formula (8) is the optimal bidding income of the multiple microgrids at the fixed bidding strategy S t,k+1 . e Nash equilibrium solution of the game, i.e., the optimal bidding strategy, can be obtained, after the iteration ends when the bidding strategy of all microgrids changes no more: e game might not reach Nash equilibrium, when the maximum number of iterations is too small or the interval of the clearing price is unreasonable (the interval could be affected by weather or relevant policies). erefore, the iteration should end, when Nash equilibrium is not fulfilled after the iteration reaches the preset maximum number. In this case, the current round of bidding for the electricity market fails. Figure 5 shows the flow of the abovementioned bidding game model of the multiple microgrids.

Quantum reshold Signature.
e cross-chain communication between multiple microgrids can disperse the value dynamically and adaptively across blockchain nodes [18]. For multimicrogrid cross-chain communication, the data transmission will become more secure and trustworthy if the distributed key management is realized by quantum threshold signature technology. e multiple microgrids will operate more efficiently, for the cross-chain communication is verified by a few privileged nodes.
It is assumed that, in the quantum block chain, each pair of nodes are connected by a classic channel, and a private key sequence is established using the quantum key distribution (QKD) network. In other words, these nodes connected by the quantum channel form a QKD network. Quantum threshold signature is a scheme that couples distributed keys with multithreshold signature. is technology has been extensively applied to the smart contract of blockchains, owing to its low cost, high security, and data credibility. Assuming that the QKD network exists, this paper realizes the unconditionally secure communication based on quantum threshold signature. (1) P � P 0 , P 1 , . . . , P n is the set of communication participants, including the signer P 0 and n potential receivers P 1 ⟶ P n . It is assumed that some of the σ participants are honest, with σ > 34.

Distribution Phase
① e sender randomly generates a string r 1,1 , . . . , r n,n , each of which is of the length l h . e hash function determined by r 1,1 , . . . , r n,n is represented by f 1,1 , . . . , f n,n . ② e sender safety sends r i,1 , . . . , r i,n to all receivers P i . ③ Receiver P i will send r i,j to another receiver P i ′ .

Signature Phase.
Message m is given a signature Sign(m) � (f 1,1 (m), . . . , f n,n (m)). Proof M × P × Σ ⟶ True, False { } is a function that receives message m, signature σ, and participant P i and returns the Boolean value based on the validity of the signature. e verification is performed by P i .
After receiving a pair of signatures (m, σ), with σ being a signature of forms (t 1,1 , . . . , t n,n ), the receiver P i will carry out the following test: If (m, σ, P i ) is true, when P i accepts the signature, more than (1/2 + 2(1 − σ)) × n pass the test, with σ being the proportion of honest participants: Theorem 1. e quantum threshold signature scheme meets the following security requirements.
(1) Unforgeability: e attacker cannot create a valid signature with a probability s higher than a negligible level.
(2) Transferability: If an honest P i accepts a signature, the other honest P i will also accept the signature. (3) Undeniability: e signer cannot reject the legal signature he/she created with a probability higher than a negligible level.
In the blockchain smart contract, some nodes should be authorized to form a V k in cross-chain communication, which facilitates multimicrogrid joint operation. e full node server in the system is responsible for maintaining V k and providing all valid operation information, until the protocol is reached. When the node of V k reaches a consistent result, the new data block is generated. e number of nodes in V k is selected according to the actual situation of the multimicrogrid system. en, the publicprivate key pair (K Public V , K private V ) of V k is generated by the quantum threshold signature scheme. e cross-chain consensus rules are as follows: CK private V ET, t 1 , n 1 ; · · · ; t m , n m ; t, n False, otherwise, where n k is all the nodes in V k ; formula (12) is the cooperation relationship between independent blockchains; formulas (13) and (14) describe the scale of cross-chain consensus nodes, with the former being the threshold for energy blockchain to verify cross-chain information and the latter being the condition for the verification; formulas (15) and (16) are the consensus threshold for the public-private key pair; t k is the minimum number of n k needed to pass a verification; t k ′ is the actual number of n k needed to pass a verification. For the n nodes in V k , at least t nodes should pass the verification. e proposed quantum threshold consensus mechanism for multiple microgrids can ensure the consistency of crosschain information, without changing the structure of the current blockchain system in each system.

Flow of Cross-Chain Transaction.
During the cross-chain transaction between multiple microgrids and aggregators, the big grid and microgrids perform real-name registration in the virtual power plant, aiming to ensure that the account information is true and effective. At this time, aggregates, as intermediaries that are critical to the big grid and microgrids, initiate the transaction game. In the virtual power plant, the multiple microgrids kick off the cross-chain communication based on blockchain, while ensuring the consistency of the transaction information and improving the transaction efficiency. In the private chain, aggregators AG1 and AG2 carry out a noncooperative dynamic game bidding across the chain with the big grid and the multiple microgrids. Taking the multiple microgrids for example, the simplex method is adopted to compute the utility of aggregators, as well as the bidding income and clearing price of themselves. en, the optimal selling model is solved to maximize the utility and bidding income and to reach the unique Nash equilibrium solution. In this way, the utilities of different parties are balanced, the electricity consumption is optimized, and the economic benefits are increased ( Figure 6).
On this basis, it is necessary to check if the bidding strategy of the k-th round is equal to that of the k+1-th round, i.e., if the Nash equilibrium is reached, aiming to ensure that the cross-chain transaction has a unique clearing price. If not, the transaction fails; if yes, quantum threshold signature is implemented in the multiple microgrids, and quantum keys are used to prevent the signature set and message set from being attacked or tampered with. Whether the multimicrogrid cross-chain transaction has reached a consensus is tested in the private chain. If yes, a transaction order is generated in the virtual power plant; otherwise, the cross-chain transaction fails. After the multiple microgrids, the big grid, and aggregators reach a consensus, all transaction data will be uploaded to the quantum blockchain and broadcasted across the private chain. en, these participants will exchange energy as per the smart contract, putting an end to the cross-chain transaction.

Analysis on the Optimal Selling Model.
It is assumed that the virtual power plant has 4 microgrids. In each phase of bidding, the electricity volume was derived by fitting the unified clearing price in the previous round. e optimal bidding results were simulated for the multiple microgrids at 220 kW, 550 kW, and 1,000 kW. e parameter of the bidding strategy was set to 3; i.e., the multiple microgrids have three electricity prices: high, medium, and low. In addition, the authors set iM−EM being the marginal cost of the maximum power generation and C AC−t i being the mean cost of the maximum power generation.
As shown in Table 1, microgrid 1, with a high power generation cost, does not have an advantage in the bidding process. e winning bid was merely 12.3827 kW, with the electricity demand of 220 kW. e income falls, as the grid offers a low electricity price. But the bid-winning electricity amount and income increase obviously with the growing market demand. erefore, power generation should be reduced when market demand is low.
(1) Microgrid 2 has a low power generation cost and outputs lots of power. erefore, it always has an advantage in the market. e microgrid enjoys a high bid-winning electricity volume and a higher income than its competitors. e same occurred to microgrid 4. (2) Limited by its output, microgrid 3 does not have an outstanding income. Despite having a low bidwinning electricity volume, the microgrid achieves a considerable income. us, power generation can be increased to boost the income.
To verify the bidding strategy, three traditional quoted prices, n � 3 (high, medium, and low), were selected, with Δu t � 0.2C MC−t iM−EM , and microgrid 1 was taken as the object. Figure 7 presents the results of our bidding strategy (improved strategy) and traditional strategy under different demands.
As shown in Figure 7, when the market demand was 220 kW, the bid-winning volume of our strategy was 12.3827 kW, while that of the traditional strategy was 0 kW. Under different demands, our strategy always surpassed the traditional one in income and bid-winning volume. erefore, the noncooperative game bidding strategy adapts better to the electricity market. It can increase the bidwinning volume of multiple microgrids, while increasing their income.
As shown in Figure 8, through the 24 iterations, the oscillating unified clearing prices of improved and traditional strategies tended to be stable after the 15th and 21st iterations, respectively. erefore, the improved clearing price model helps to improve the transaction efficiency. Being lower than the traditional clearing price, the improved clearing price benefits the consumption of electricity in the multiple microgrids. When the market demand was 220 kW, the competition between the microgrids intensified with the growing number of iterations, due to the relatively small electricity demand. To increase the bid-winning volume, the microgrids continued to suppress the offered prices. Hence, more bid-winning volume clustered to the low price interval, dragging down the unified clearing price. With the rise of market demand, the unified clearing price increased with the number of iterations. In other words, the microgrids gradually lifted the price to obtain more selling income. As a Mathematical Problems in Engineering 7 result, more bid-winning volume clustered to the high price interval.
In this case, the microgrid nodes have reached a consensus of noncooperative game, during the blockchainbased alliance between aggregators and multiple microgrids. en, two microgrids were selected for simulation: MGA − i, which is operated by an energy conservation service provider, and MGA − j, a microgrid node. e former is a large solar and wind power generator mainly serving residents; the latter is a small solar power generator mainly serving businesses. Figure 9 predicts the load and day-ahead outputs of the two microgrids.

Effectiveness of Multimicrogrid Cross-Chain Consensus.
Suppose x and y are connected to different microgrids and wish to communicate across the chain. ey know each other's public information parameters parm A and parm B . Each parameter has its own private key. Based on the basic principle that quantum blockchain has function, x and y can obtain the following communication keys: Key y � Hash K private y · parm x . (17) Due to the commutative property of multiplication, we have x � y. erefore, the cross-chain consensus transaction of the multiple microgrids is effective. of lawful participants P � P 0 , P 1 , . . . , P n . Since the QKD distributes K private V in a unified manner, it is impossible for Eve to steal the transaction information. Even if he/she tries to forge a quantum threshold signature |σ, Eve cannot pass the verification of quantum threshold signature:

Analysis on
e quantum channel between the sender and the receiver is constructed based on superposition of states. e message set M � 0, 1 { } l m is transmitted securely and reliably in quantum state via the QKD. e receiver will notice the test T m j,i on honest nodes. Hence, the signature set and message set cannot be foraged or tampered with.

Transferability.
In electricity transactions, quantum threshold signature is transferable. e transferability optimizes the efficiency of energy transmission. As a result, this technology is widely applied in electronic trading systems. When participant P i confirms that a signature Σ � 0, 1 { } n 2 l h and a message M � 0, 1 { } l m are true, the node will be recognized as an honest node. is node will be uploaded to the quantum blockchain and broadcasted. It can be queried in the block forever. At this time, other legal participants will accept the signature and message of that participant, with the assistance of the trusted communication channel. erefore, the quantum threshold signature technology is transferable.

Undeniability.
e quantum threshold signature |σ of P 0 is broadcasted via the quantum channel, making it impossible to be denied by the participant. If the signer P 0 denies his/her quantum threshold signature out of any reason, P i can refuse by presenting the signature and serial number provided by the quantum channel.
If P 0 denies K private V , P i can verify if P 0 is making a false claim by a random string r 1,1 , . . . , r n,n and T m j,i in formula (11). If P 0 denies |M and |Σ, P i can restore |M and |Σ with a probability of where n is the length of message. e longer the length is, the closer the success rate of the denial by P 0 is to zero. erefore, the quantum threshold signature technology is undeniable.

Conclusions
is paper proposes a multimicrogrid cross-chain transaction model based on quantum blockchain, aiming to better solve the energy transaction between multiple microgrids, ensure safe and reliable cross-chain transactions, and increase the consumption rate of distributed energy. Starting from the architecture of quantum blockchain-based aggregator-multimicrogrid alliance, the authors constructed the optimal selling model of multiple microgrids, in the light of noncooperative dynamic game. e model enables the multiple microgrids to win sufficient electricity volume and set precise and efficient prices, guarantees the unique Nash equilibrium solution for the bidding strategies of aggregators, the big grid, and the microgrids, and greatly improves the economic benefits of private chains. In addition, the consensus mechanism of multimicrogrid cross-chain communication was taken as the embedding algorithm of smart contract, such that the value is dispersed across blockchain nodes, the information and attributes of transaction subjects are consistent among the multiple microgrids, and the multiple microgrids can operate efficiently and collaborate in cross-chain communication. Furthermore, quantum blockchain was deeply integrated with multimicrogrid cross-chain communication, barring attackers from knowing quantum keys. erefore, the attackers cannot pass the verification on quantum threshold signature, not to mention accessing the ciphertext of the signature set and message set. In this way, the transaction data become much safer, creating a trustworthy environment for multimicrogrid cross-chain transactions. e experimental results show the following: (1) e optimal bidding results can be achieved by the multiple microgrids through noncooperative dynamic game and simplex method. Our bidding strategy can boost the bid-winning volume of the multiple microgrids, while enhancing the income of aggregators and the multiple microgrids and adapting well to the market of multimicrogrid crosschain transactions. (2) By the basic principle of quantum blockchain hash function, the consensus mechanism of multimicrogrid communication was verified with the communication keys. (3) Using quantum blockchain technology, the quantum threshold signature scheme was proved to be unforgeable, transferable, and undeniable.
In the future, cross-chain trading of multimicronetworks can be further combined with China's dual carbon policy to establish a fair and reasonable initial allocation mechanism of carbon emission rights, achieve efficient and stable operation of carbon emission rights allocation, and build a zero-carbon trading platform of "green mountains are gold mountains."

Data Availability
e data used to support the findings of this study are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that they have no conflicts of interest.