Blockchain for secure decentralized energy management of multi-energy system using state machine replication

Decentralized energy management can preserve the privacy of individual energy systems while mitigating computational and communication burdens. However, most decentralized energy management methods are partially decentralized and cannot ensure information exchange security. Therefore, this paper provides a secure fully decentralized energy management by using blockchain. First


Introduction
As high-efficiency energy conversion and storage devices have become popular over the last decade, a new management paradigm is required for coordinating independent energy systems [1,2].The multienergy system could interconnect different types of energy systems to maximize total social welfare [3].By integrating independent energy systems, the multi-energy system improves system flexibility, economics [4], and sustainability [5] and can help the achievement of sustainable social development and net-zero carbon target [6].
As coordinated management flourishes the multi-energy system by improving operational efficiency and flexibility while ensuring the security of individual energy systems, a lot of studies have focused on centralized energy management for the multi-energy system [7].Reference [8] studied an energy management method that considers the interdependency of different energy systems.However, the energy network constraint of each energy system is ignored, which could result in an infeasible solution in practice.The energy networks were considered in reference [9].However, the proposed method is hard to be solved directly owing to the nonlinearity of the energy network.Reference [10] provided a linearized static energy network model.Furthermore, the energy network model considering the energy system's dynamic characteristics was studied in reference [11].Reference [12] studied the robust centralized energy management method for the multi-energy system penetrated with uncertain wind power.In practice, each energy sector is managed by an independent system operator.Centralized energy management requires all energy operators to submit their proprietary information (e.g., network information) to a third party (e.g., coordinated operator) in practice [13].Owing to privacy concerns or regulation issues, these operators could not reveal the proprietary information.Moreover, centralized energy management has other drawbacks, like the single point of failure, communication, and computation burdens.
Decentralized energy management provides a viable solution for addressing the above issues.Decentralized energy management can be categorized as partially decentralized or fully decentralized.The frameworks of centralized and decentralized energy management are compared in Fig. 1.Individual energy systems in decentralized energy management are managed by its onsite system operator.These onsite operators only share boundary information rather than all proprietary information in centralized energy management.In decentralized energy management, individual energy systems keep updating boundary information until convergence is achieved.In partially decentralized energy management, onsite operators need a coordinated operator to help with information exchange, while they can directly exchange information with their counterparts in fully decentralized energy management.By using decentralized energy management, the privacy of each energy system is preserved since it does not reveal any proprietary information.Moreover, computation and communication burdens are mitigated since individual energy system is managed and controlled locally.
Several studies have already focused on the decentralized energy management method.References [14,15] respectively studied the decentralized energy management method for the integrated gaselectricity system using the Lagrangian relaxation (LR) and alternating direction method of multipliers (ADMM).The decentralized framework was extended to the multi-energy system integrating more energy sectors in [16,17].Although decentralized energy management has been widely studied over the last decade, several issues should be discussed before implementing decentralized energy management.
The first issue is decentralization.Most decentralized energy management studies are based on mathematical methods like LR and ADMM.However, these methods are partially decentralized rather than fully decentralized, indicating that a centralized system operator is required to exchange information [18].Optimality condition decomposition (OCD) can address the drawback of LR and ADMM, and ensure that participants achieve a nearly global optimal solution in a fully decentralized manner.However, only a few references studied the implementation of OCD in the energy sector.References [19,20] utilized the OCD in dynamic economic dispatch for the power system.The references about OCD in the multi-energy system are still lacking.
The second issue is synchrony.The existing decentralized management methods (e.g., LR and ADMM) are synchronous optimization methods.In such methods, individual energy systems can only make decisions after they receive information from all adjacent areas.In other words, all energy systems must act simultaneously.As a result, decentralized management is vulnerable to communication interruption and latency.If energy systems fail to receive information owing to communication interruption/latency, they cannot make any decision, and the existing decentralized energy management could fail to work.Asynchronous optimization methods offer a reliable solution for addressing this issue [21].More specifically, participants in asynchronous optimization only use incomplete information from parts of adjacent areas to make the decision rather than full information from all adjacent areas.Therefore, the introduction of asynchronous optimization could enable decentralized management to work in the face of communication

Indices and sets i, j
Indices of gas nodes i and j b Indices of electric bus b t Index of time period k, n Indices of gas sources and power-to-gas (P2G) units f Index of malicious participants Carbon emission coefficients of coal-fired units and natural gas sources unit u at time period t P l,t , Q l,t Active and reactive power flow through electric line l at time period t interruption and latency.Additionally, the adoption of asynchronous optimization could enhance computational performance since the participants do not wait for all information to make a decision.Only a few references studied asynchronous optimization in the energy sector.References [21,22] introduced asynchronous optimization in the electricity market, in which market participants used asynchronous optimization for bargaining the electricity price in a decentralized manner.
Although asynchronous optimization has a lot of advantages, it is challenging to combine asynchronous optimization and the existing decentralized management.
The last issue is a secure interaction environment.In the existing decentralized management methods, all energy systems exchange information to make decisions.The hypothesis of decentralized management is that all energy systems trust each other.If there are dishonest energy systems or malicious attackers sending wrong information, the remaining energy systems could be misled to make wrong decisions and thus threaten the energy system's security.Therefore, the information exchange in decentralized energy management must be safeguarded against the aforementioned potential malicious behaviors.Blockchain can address the last issue by offering a secure interaction among participants.Blockchain essentially is a set of distributed digital ledgers [23].In a blockchain network, each participant holds an individual copy of the digital ledger and collaboratively maintains each ledger's state.The introduction of blockchain could enhance system operation efficiency, transparency, and security [24, [25].Several studies utilized blockchain in decentralized energy management to enhance security.Ref. [26] provided the blockchain with a consensus algorithm named "proof of solution" to ensure the security of exchanged information in decentralized energy management.Ref. [27] utilized blockchain in the partially decentralized energy management for the electricity system, and this work is further expanded to the multi-energy system in Ref. [28].However, different decentralized energy management requires specific blockchain methods, which lack an efficient blockchain method for fully decentralized energy management based on asynchronous optimization.
This paper proposes blockchain-based secure decentralized energy management for the multi-energy system based on the asynchronous OCD.The proposed framework safeguards information exchange among individual energy systems against malicious behaviors.The comparison of the proposed method and the existing studies are provided in Table 1.The contributions of this paper are summarized as follows: 1) A fully decentralized energy management framework for the multienergy system based on the OCD is provided, in which individual energy systems directly communicate with their peers to achieve a globally optimal solution while preserving privacy.2) An asynchronous optimization framework is provided for reliving computational and communication burdens.In the proposed framework, all energy systems can make individual decisions without the need to wait for the information from the other participants.3) Blockchain with state machine replication (SMR) consensus algorithm is applied to provide a secure information exchange environment for individual energy systems without the coordinated operator.4) The proposed blockchain-based secure decentralized energy management is applied to a real-world multi-energy system in North China, where the scalability and application value of the proposed method are demonstrated.
The rest of this paper is organized as follows: Section 2 introduces the mathematical formulation of the proposed fully decentralized energy management based on OCD and the asynchronous optimization framework.Section 3 develops the blockchain framework for information exchange.Case studies are conducted in Section 4 to show the validity of the proposed method.Section 5 draws the discussion on the proposed method.Conclusion and further work are provided in Section 6.

Mathematical formulation
The energy management coordinates different energy systems to minimize the overall operation cost while satisfying the security requirement (e.g., network security and load balance).In this section, the centralized energy management method is first introduced and fully decentralized management using the OCD is further illustrated.Finally, an asynchronous mechanism is proposed for updating information used in OCD.

Objective function
The objective of centralized energy management is to minimize the overall fuel cost as well as the carbon emission cost.

Table 1
Comparison of the proposed method and existing studies.
As shown in (1), the objective is composed of three items.The first item is the fuel cost of coal-fired units, which is a widely used quadratic function.The second item represents the carbon emission cost of coalfired units.The third item denotes the cost spent by the natural gas system.Both the natural gas purchase fee and the carbon tax will be charged for the consumed natural gas.

Electricity system constraints
The linearized AC optimal power flow model is applied to describe the electricity system with high accuracy.The operational constraints of the electricity system are stated as follows [29]: Eq. ( 2) represents the active electricity balance constraint, while eq.( 3) establishes the relationship of reactive electricity balance.Electricity flow through an electric line causes a voltage drop during the transmission and distribution of electricity.Eqs. ( 4)-( 5) describe how the active and reactive electricity flow affects voltages of the starting and ending buses of the electric line [30].Constraint (6) sets the upper limit of electricity that can be transmitted through the electric line.Constraints ( 7) and ( 8) set the upper and lower limits of nodal voltages and angles, respectively.Constraint (9) limits the outputs of generation units between their minimum and maximum values [31].Constraint (10) represents that the actual electricity output is no more than the available electricity generation of the wind farm [32].Constraint (11) represents the capacity limit of the power-to-gas (P2G) unit.Constraints ( 12)-( 13) set the ramp-up and ramp-down limits of generation units, respectively.

Natural gas system constraints
Here, the linear dynamic formulation is introduced to model the natural gas system.The model can also capture the dynamic characteristics of the natural gas system, and the effectiveness and modeling accuracy have been verified in references [11,33].
Constraints ( 14)-( 15) are the linearized constraints describing the relationship between the pipeline mass flow rate and the natural gas pressure at the starting and ending nodes of the pipeline.The natural gas balance constraint is represented as eq.( 16).Constraints ( 17) and ( 18) set the gas pressure limits for nodes with natural gas sources and normal nodes, respectively.Constraint (19) sets the upper and lower limits for natural gas sources, while the upper and lower limits of the pipeline's mass flow rate are set by constraint (20) [34].

Coupling constraints
The electricity and the natural gas systems are coupled via the P2G units and the natural gas-fired units.Therefore, the coupling constraints are presented in constraints ( 21)- (22), where the outputs of gas generators and P2G units are enforced, respectively [35].
Different electricity systems are connected by tie-lines, and the constraints related to tie-lines are stated as ( 23)- (25), whose physical meanings are the same as ( 4)- (6).
Various natural gas systems are connected by tie-pipelines, and the related constraints are presented as: ( The meanings of these tie-pipelines-related constraints are the same as the common pipelines, which has been clarified in the above subsection.

Decentralized energy management
The second-order constraint can be easily linearized [32], and the linear form further simplifies the complexity of the model.In this way, the above optimization model of the multi-energy system is linear programming.For ease of expression, the compact form of the above model is provided.
where s is the index of each subsystem, and S represents the total number of subsystems.y s represents the variables assigned to subsystem s. f s is the operational cost of subsystem s, which is subject to two sets of constraints (i.e., h s and g s ).Specifically, h s represents the set of coupling constraints.g s is the set of inner operational constraints of subsystem s.
Here the OCD [19,20] is applied to decentralized energy trading among different energy systems.With the utilization of the augmented Lagrange function, the primal objective can be revised as follow: The newly introduced variables π s and μ s are Lagrangian multipliers of constraints h s and g s , respectively.The problem ( 30) is an unconstrained optimization problem, and it is worth noting that f s , h s , and g s in (30) are not exactly the same as that in (29).Currently, the barrier terms associated with the upper and lower bounds of variables are added to the objective function f s .Constraints h s and g s are now equalities, which can be easily achieved via introducing slack variables to the original inequality constraints.To obtain the optimal solution of the Lagrangian function, both Karush-Kuhn-Tucker (KKT) conditions and the Newton-Raphson method are applied [36].Then, the optimization of ( 30) is exactly equivalent to solving a set of linear equations, presented as follows: Here, the representation of variables is further simplified and γ is used to denote all variables, composed of y s , π s and μ s .H and J are the Hessian matrix ∇ γ 2 L and Jacobian matrix ∇ γ L, respectively.Eq. ( 33) describes how the variable γ is updated, where the Newton-Raphson method is applied.When the elements in J are all equal to zero, the optimality is achieved, and the update can stop.
For the above optimization problem of the integrated energy system, our goal is to achieve decentralized energy management.Accordingly, the symmetric Hessian matrix can be rearranged according to the number of subsystems and H is rewritten as: The existence of coupling constraints makes the submatrix H rs not diagonal.In other words, there are non-zero elements in the submatrix when r and s denote different values.The non-diagonal submatrix restricts decentralized optimization for each subsystem.The OCD method is applied to solve and overcome the tricky problem and to achieve decomposition and decentralized optimization.Using the OCD method, the original non-diagonal submatrix H is replaced by an approximate diagonal matrix H, where non-diagonal elements are all set as zero.
In this way, eq. ( 33) can be decomposed into a set of equations for each subsystem, expressed as (36).Then, the variation of variable y s can be updated independently as (37).After the update of y s , the latest values of boundary variables (e.g., bus voltage and power injection from tie-lines) are exchanged among adjacent subsystems.The calculation of the elements H ss and J s requires boundary information from other subsystems.
The decentralized management framework can be widely used in multi-scenarios.This framework can also be used in peer-to-peer energy trading among different energy sectors.The physical meaning of multiplier π s is the price for purchasing/selling [37].These energy sectors keep updating their price and determining the energy surplus/ deficiency accordingly.Such energy information is further broadcasted in the form of boundary parameters.Each energy system can easily calculate energy information based on the provided parameters.

Asynchronous updating method
In practice, the communication network may be asynchronous or experience temporal and partial loss.Therefore, the asynchronous method is required to deal with such circumstances.Herein, unlike the traditional OCD method, an asynchronous OCD method is developed to accommodate heterogeneous communication circumstances, and the robustness of the proposed method is thus improved.
Herein, k is denoted as the index of iterations and denote ϕ(k) as the set of subsystems that can receive corresponding boundary information and Lagrangian multipliers as normal.The set of other subsystems which lose their communications at iteration k is denoted as ϕ(k).The update strategies for subsystems in ϕ(k) and ϕ(k) are different.For subsystems in ϕ(k), they will update their operational variables to move towards convergence.However, the subsystems in ϕ(k) keep their operational variables the same as the values in the previous iteration.Mathematically, the update strategy is expressed as: The newly developed asynchronous OCD method not only can solve the integrated energy system problem in a decentralized manner but also has great computational performance despite the asynchronous communication circumstance.

Solution procedures
Overall, the flowchart of the proposed decentralized energy M. Yan et al. management is shown as Fig. 2, and the detailed procedures are presented as follows: 1) Input relevant parameters (e.g., network and load parameters) and set the initial multipliers.2) Each energy system operator solves its energy system operation problem consisting of constraints ( 2)-( 13) or ( 14)-( 20) based on the current multipliers.3) Each energy system operator provides boundary information to the other energy systems using the proposed blockchain and SMR-based consensus algorithm.4) Each system operator updates its multipliers based on the updated boundary parameters.If parameters fail to be delivered within preset time, the multipliers are updated using the proposed asynchronous distributed mechanism.When the change of multipliers is negligible, the iterations converge and output the results.Otherwise, repeat steps 2) to 4).

Potential malicious behaviors
Fig. 3 (a) shows the framework of the aforementioned decentralized energy management framework.Each system exchanges boundary parameters (e.g., B 1 ) with its adjacent peers to achieve a globally optimal solution.The assumption in this decentralized management is that all participants honestly update their boundary parameters to their peers.However, if malicious participants do not provide authentic boundary parameters or the multipliers are tampered with by other malicious attackers, the proposed decentralized management could not converge to the optimal solution.Such malicious behaviors could occur especially when the proposed decentralized framework is used in peer-to-peer energy trading since malicious participants can benefit by providing fake boundary parameters.
Fig. 3 (b) provides an example of the potential malicious behavior in the conventional decentralized framework.Considering energy systems 1 and 3 are malicious participants, they have adequate energy production and expect to gain more revenues by selling more energy.One choice is that they can cheat system 4 to reduce its energy production by providing fake boundary parameters.More specifically, systems 1 and 3 tell lies to system 4 that they have adequate low-cost energy production or they have inner line congestion and further provide corresponding boundary information (i.e., F 1 and F 3 ) to system 4.If the first lie is chosen, system 4 has no motivation to produce energy owing to the lowcost energy generation of systems 1 and 3.If the latter one is chosen, the energy production of system 1 is limited since the inner networks of systems 1 and 3 prevent delivering system 4's energy production to the other energy systems.Meanwhile, systems 1 and 3 provide actual boundary parameters (i.e., B 1 and B 3 ) to the other systems so that they can sell energy successfully.In summary, the benefits of systems 1 and 3 are increased at the cost of prejudicing the benefits of system 1.

Blockchain-based decentralized management
Blockchain is used to safeguard the proposed decentralized energy management framework against the aforementioned malicious behaviors by providing a trustworthy communication environment.Each energy system holds a copy of the digital ledger in the blockchain [27].All ledgers are maintained and updated in the same state with the cooperation of all energy systems.
The communication topology of the multi-energy system after introducing blockchain is shown in Fig. 4, in which energy systems can communicate with each other.More specifically, a consensus must be reached before participants accept any boundary information from their counterparts.The SMR is one of the most popular and reliable consensus algorithms, which guarantees system security if the number of malicious participants meets the following criterion:   the second stage.The detailed procedures using the proposed consensus algorithm are listed as follows: 1) Initialization: Each energy system presets a pair of keys: one public key and one private key.The public key is served as a unique address, which makes system operators traceable.The private key, like a passcode, is served as a digital signature.The detailed initialization procedures are introduced in reference [23].2) Broadcast: The energy system broadcasts its boundary parameters with its digital signature.A simple example is shown in Fig. 6.Consider those boundary parameters are presented as B, which evolves into B 1 after attaching system 1's digital signature.Then, B e is broadcasted to systems 2, 3, and 4. 3) Verification: The energy system which receives boundary parameters further broadcasts boundary parameters to the other systems.As shown in Fig. 6, B 1 evolves into B 12 with system 2's digital signature, and system 2 delivers B 12 to the other energy systems.4) Decision: In this step, the energy system updates its multiplier based on received boundary parameters.The energy system could receive different boundary parameters from other energy systems since there are potential malicious behaviors.Therefore, the energy system is expected to choose the correct parameters.
As shown in Fig. 7, consider that system 1 sends actual parameters B 1 to systems 2 and 3 while sending false parameters F 1 to system 4. Additionally, system 4 also receives actual parameters B 12 and B 13 from systems 2 and 3, respectively.It should be noticed that B 12 and B 13 are the same (e.g., both B 1 ) just with different energy systems' digital signatures.System 4 chooses the parameters based on a simple criterion: choosing the one with the greatest number of verifications.As two systems provide B 1 while only one system provides F 1 , system 4 finally chooses the correct parameter B 1 .
Overall, it is proved in the above steps the proposed method can safeguard the proposed decentralized management against malicious behaviors.Moreover, each energy system only needs to receive validated parameters from 2f + 1 systems rather than from all systems for making the final decision.The final validated boundary parameters will be stored in the blockchain of each energy system, which is tamper-proof and traceable.Energy system operators can update their multipliers based on authentic information.Therefore, the proposed blockchainenabled framework ensures the security of decentralized energy management while preserving the privacy of each energy system.If the consensus process fails, the energy system operator will use the asynchronous distributed mechanism provided in Section 2.3 to update the multipliers.Therefore, the proposed decentralized energy management is compatible with the introduction of blockchain and the SMR-based consensus algorithm.

Case studies
The proposed decentralized energy management is tested and validated via a multi-energy system with seven subsystems and a real-world multi-energy system in North China.

Multi-energy system with seven subsystems
Fig. 8 presents the topology of the multi-energy system with seven subsystems.Specifically, the whole system is composed of 4 electricity subsystems (i.e., S1, S2, S3, and S4) and 3 natural gas subsystems (i.e., S5, S6, S7).Each electricity subsystem has the same topology and can be referred to in [38], while their generator parameters and load distribution are different.The topologies and parameters of natural gas subsystems can be referred to in [17].The prices of carbon emission and natural gas are set at 4 $/MMBtu and 20 $/ton, respectively.The total time periods of energy management are 24, while each time period represents one hour.The daily profiles of loads and wind generation can be referred to in [39].The modeling and experimental simulations are performed on a personal computer using the MATLAB 2019a platform, where the commercial solver Gurobi 9.5 is embedded.
All four electricity subsystems have generators.Specifically, subsystems 1, 2, and 3 have both coal-fired and natural gas-fired generators, and the required natural gases are supplied by natural gas subsystems 5, 6, and 7, respectively.Subsystem 4 is equipped with coal-fired   generators and wind farms.Since all electricity subsystems have generators, the four electricity subsystems compete to meet the overall electric loads.In general, the electrical outputs of each subsystem are determined based on the principle of global optimality.In other words, the subsystems with cheaper generators have a higher priority for electricity generation.In this way, each electricity subsystem can benefit if it gets more power generation rights, and possible cheating and manipulations are thus incurred.The natural gas subsystems have no such competition since the natural gas price of each subsystem is assumed to be the same.
In this paper, four cases are designed and compared to validate the effectiveness of the proposed decentralized energy management and the blockchain-based framework against malicious behaviors.
Case I.The energy management of the multi-energy system is solved in a centralized manner, which is taken as a base case.
Case II.The decentralized energy management of coordinated natural gas and electricity systems is applied, but the blockchain-based framework is not embedded.In this case, there is no cheating activity.
Case III.The decentralized energy management of the multi-energy system is applied, but the blockchain-based framework is not embedded.In this case, cheating activities occur.
Case IV.Both the decentralized energy management of the multienergy system and the blockchain-based framework are applied.In this case, cheating activities can be prevented.
The cost allocations in Case I and Case II are conducted and compared in Table 2.Among the four electricity subsystems, subsystem 2 has the highest cost due to its expensive coal-fired generators.Conversely, the cost in subsystem 3 is the lowest since the generation costs of its coal-fired generators are relatively cheaper compared to the other three electricity subsystems.Although the wind farm is equipped in subsystem 4, the cost in subsystem 4 is still higher than that in subsystem 3.This is because both the total loads and the economical parameters of coal-fired generators in subsystem 4 are relatively large.
When comparing the cost of Case I and Case II, Case II almost has the identical cost as that of Case I.The computation error of the whole system is 0.07%, which indicates that the result solved via the proposed decentralized method is very close to the optimal solution, and the computational error is negligible.In addition, the maximum cost deviation of all subsystems is no more than 0.12%, which reveals the cost allocated to each subsystem using the proposed decentralized method is also consistent with that using the centralized way.In sum, the proposed decentralized energy management neither affects the optimality of the whole system nor the cost allocated to each subsystem to a large extent.
The results in Case III and Case IV considering cheating activities are provided in Table 3. Driven by getting more benefits, there is cheating activity conducted by malicious peers.The malicious peers, subsystem 2 and subsystem 4 conspire to manipulate the Lagrangian multipliers, whose physical meaning is the local marginal prices (LMP) of boundary buses.By manipulation and cheating, the Lagrangian multipliers sent to subsystem 3 (i.e., 34.56$/MWh and 34.57$/MWh) are much lower than the normal values.In this way, subsystem 3 receives a wrong price signal and reduces its electricity generation.Subsequently, subsystem 2 and subsystem 4 can obtain the electricity generation capacity yielded by subsystem 3.
By manipulating the LMP of boundary buses (LMPBB) and getting extra electricity generation capacities, subsystem 2 and subsystem 4 both decrease their energy cost.And the cost deviations of subsystem 2 and subsystem 4 are − 2.50% and − 2.20%, respectively.The cost deviation is defined as the rate of the cost difference between Case III and Case IV to the cost of Case IV.However, the cost reduction of subsystem 2 and subsystem 4 sacrifice the operating economy of the entire system since the electricity generation rights of cheap generators in subsystem 3 is substituted by those in subsystems 2 and 4. The total cost of the entire system in Case III increases by 2.43% compared to that in Case IV.Especially, there is a sharp cost increment (i.e., 17.57%) in subsystem 3, which receives the tampered price signal.There is also a slight cost increment in subsystem 1, whose cost deviation in Case III is 0.23%.The costs of subsystems 5-7 remain unchanged due to the assumption that the natural gas cost is all the same in each subsystem, and the results of subsystems 5-7 are thus not presented in Table 3.
The blockchain-based framework is embedded in Case IV, and the same costs of Case IV and Case II reveal that a blockchain-based framework can effectively prevent cheating activities.It is also worth noting that the LMPs of boundary buses in Case IV are obviously lower than that in Case III, which also reflects the operating economy is better in Case IV.
The iteration processes of Lagrangian multipliers (LMPBB) in Case III and Case IV are illustrated in Figs. 9 and 10, respectively.LMP received by S1, S4 is almost the same as that received by S2.Therefore, LMPBBs received by S2 and S3 are selected to illustrate the iteration process.Since S2 and S3 both connect to two electricity subsystems, there are two LMPBBs for S2 and S3 in each case.The first LMPBB for S2 in Table 3 indicates that between S1 and S2, while the second LMPBB for S2 indicates that between S2 and S3.Similarly, the first LMPBB for S3 indicates that between S2 and S3, while the second LMPBB for S3 indicates that between S3 and S4.When cheating activity occurs, the LMPBB

Multi-energy system in North China
The proposed method is tested on a real-world multi-energy system in North China [40], and Fig. 11 depicts its topology.Eight urban energy systems are interconnected in the real-world multi-energy system, including those in Zhangjiakou, Beijing, Chengde, Langfang, Tianjin, Tangshan, Qinhuangdao, and Yulin.In each urban energy system, there are local coal-fired or natural gas-fired generators and loads, and those urban energy systems are interconnected by nine electric lines and six gas pipelines.Two wind farms are located at Zhangjiakou and Chengde, respectively.Additionally, the carbon emission coefficients for the coalfired generator and gas-fired generator as well as natural gas and coal prices are the same as those in Section 4.1.In refs.[40,41], comprehensive and detailed parameters for the multi-energy system in North China are provided.
To validate the superiority and computational performance of the proposed method, the performance comparisons of the proposed method and similar techniques are conducted, and the corresponding results are presented in Table 4.In particular, Table 4 contains three methods.Methods A and B are partially decentralized methods that refer to the LR and ADMM, respectively, and serve as the comparison baseline for the proposed fully decentralized method.The close proximity of the total costs of the three methods demonstrates that the computational precision of all three is assured.It is important to note, however, that the computation time of the proposed method is significantly less than those of the other two methods, and that its total cost and carbon emission are the lowest of the three.The proposed method reduces computation time by 37.7% compared to Method A and by 21.0% compared to Method B.
In summary, the proposed fully decentralized method significantly outperforms similar techniques that are partially decentralized (LR and ADMM) in terms of achieving a faster computational speed and maintaining the highest level of computation precision.
To validate the scalability and adaptability of the proposed fully decentralized method, result comparisons between the proposed fully decentralized method and the traditionally centralized method at varying wind penetration rates are conducted.The wind penetration rate is defined as the ratio between the installed wind capacity and the total peak demand of the whole multi-energy system.Fig. 12 illustrates the total operation cost of the proposed method as well as the cost variation between the proposed fully decentralized method and the traditionally centralized method.It is quite consistent with the intuition that the total operational cost decreases as the wind penetration rate rises.Although the total operational cost varies significantly, the cost variations fall within a narrow range, not exceeding 0.1%.The results in Fig. 12 further demonstrate the computational precision, scalability, and adaptability of the proposed fully decentralized method.

Real-world application
This section presents the way that the proposed decentralized energy   management is implemented in the real world.In most countries and regions, like the United States, China, and Europe, the whole energy system is managed in a decentralized manner.For instance, the whole electricity network in the United States is managed by several independent system operators (ISOs) [42].Each ISO manages a subarea of the whole electricity system and makes independent decisions.In China, there is a power grid company in each province for managing the provincial electricity network, and these provincial power grid companies are further coordinated by two national power grid companies.Similar frameworks are also used in other energy sectors like natural gas in the world.The proposed decentralized management is designed based on the real-world energy system infrastructure and can thus be applied in the real world.
When the proposed decentralized energy management is applied in the United States, ISOs could be the participants.More specifically, ISOs can solve their operation problem and exchange information with their peers based on the proposed OCD method.The exchanged information is updated using the asynchronous mechanism.Finally, the blockchain with SMR is applied to ensure the security of exchanged information.The proposed method can also be applied in other countries similarly.For instance, the provincial power grid company in China could be a participant in the proposed method.This paper wants to emphasize that these proposed techniques can be applied in practice individually.For instance, if ISOs have already used their own decentralized energy management rather than the proposed OCD method, they can still adopt the proposed blockchain with the SMR technique to enhance security.Therefore, the proposed techniques have full potentials to be applied in practice.

Different economic inputs and renewable resources
The proposed method can be easily adapted to different economic inputs and different types of renewable resources.The objective of the proposed method is to minimize the overall operation cost of the multienergy system.This objective can be easily changed into other economic objectives like network loss [43] or reliability indices [44].One advantage of the proposed decentralized management method is that it can accommodate both linear and nonlinear economic objectives while ensuring convergence.Conventional decentralized energy management methods like LR and ADMM can only ensure convergence when the objective is linear.
In the proposed method, only wind power is considered.The proposed can be easily expanded to consider other types of renewable energy [45], like solar, since the renewable energy model in the proposed method is generalized.For instance, if PV generation is considered, the following constraint can be added.And the model with added constraints can be solved using the proposed OCD decomposition method.0 ≤ P s,t ≤ P s,t ∀s, ∀t where P s, t represents the output of solar s at hour t.P s,t represents the maximum available power of solar s at hour t.

Conclusion
In this paper, a blockchain-enabled secure, fully decentralized energy management for a multi-energy system is proposed.With the introduction of OCD, individual energy systems directly exchange information with their peers by providing their boundary parameters for energy management rather than relying on a third party.An asynchronous mechanism is proposed for updating the boundary information in the OCD, guaranteeing that decentralized energy management can work even communication interruption occurs.Blockchain is adopted to ensure secure and tamper-proof information exchange among energy systems.More specifically, a SMR-based consensus algorithm, which is compatible with the asynchronous mechanism, is proposed for safeguarding exchanged information from malicious behaviors.
Simulation results based on a multi-energy system with seven subsystems and a real-world multi-energy system in North China are conducted to validate the superiority of the proposed method.The specific findings are drawn as follows: 1) The numerical results demonstrate the effectiveness of the proposed method in privacy protection and data security enhancement.2) The proposed method can prevent the cost increase caused by cheating activities, which can reach 17.6% in some subsystems.3) Additionally, the proposed fully decentralized method outperforms the partially decentralized method by 37.7% in reducing computation time.4) Also demonstrated are the computational precision, scalability, and adaptability of the proposed method.Our future work will exploit the application of blockchain in asset management for the multi-energy system.

Declaration of Competing Interest
The authors declare that they have no known competing financial interests or personal relationships that could have appeared to influence the work reported in this paper.
parent and child nodes of node i L e (b), L s (b) Set of electric lines whose ending or starting bus is bus b CU, GU Set of coal-fired and natural gas-fired generators (GFG) TPL, TL Set of tie-pipelines and tie-lines s(l), e(l) Set of starting and ending buses of electric line l B st (l), B ed (l) Set of starting and ending buses of tie-line l s a (l), s b (l) The first and second subsystems tie-line l connects to s a (ij), s b (ij) The first and second subsystems tie-pipeline ij connects to Parameters Δt Duration of each time period a u , b u , c u Economic coefficients of coal-fired unit u c em , c gs Prices of carbon emission and natural gas γ C , γ G

Fig. 1 .
Fig. 1.Frameworks of different energy management (a) centralized energy management (b) partially decentralized energy management, and (c) fully decentralized energy management.

3f + 1 Fig. 2 .
Fig. 5 shows the diagram of the proposed SMR-based consensus algorithm consisting of two stages.The first stage is broadcast, in which each energy system broadcasts its boundary parameters to the other energy systems.The other energy systems verify boundary parameters in

M
.Yan et al.

Fig. 9 .
Fig. 9. Iterative process of Lagrangian multipliers between systems S2 and S3 in Case III.

Fig. 12 .
Fig. 12. Cost comparison between the proposed and centralized methods under various wind penetration rates.
Gas flow velocity, diameter, length, cross-sectional area of pipeline ij G k , G kMin and max outputs of gas source k M ij , M ij Min and max mass flow rates of pipeline ij Natural gas pressure of gas resource k H ik , H in Incidence coefficients between gas node i and gas source k max Lower and upper limits of gas pressure at gas node iρ k, 0 ρ i,t , V b,t Pressure of gas node i and voltage of bus b at time period t G k,t sr Output of natural gas source k at time period t P u,t , Q u,t Active, reactive electricity output of generation unit u at time period t G u,t Natural gas consumed by gas-fired unit u at time period t θ b,t Bus angle of node b at hour t P w,t Actual power output of wind farm m G n,t pg , P n,t pg Natural gas output and electricity consumption of P2G

Table 2
Cost (k$) allocations in Cases I and II.

Table 3
Cost allocation and LMPBB comparison in Case III and Case IV considering cheating behavior.

Table 4
Performance comparison of the proposed method and similar techniques.