Next Article in Journal
Stochastic Bilevel Program for Optimal Coordinated Energy Trading of an EV Aggregator
Previous Article in Journal
Optimization of Cerbera manghas Biodiesel Production Using Artificial Neural Networks Integrated with Ant Colony Optimization

Energies 2019, 12(20), 3812;

Consortium Blockchain-Based Microgrid Market Transaction Research
School of Economic and Management, Taiyuan University of Technology, Jinzhong 030600, China
College of Computer Science and Technology, Lvliang University, Lvliang 033000, China
School of Information and Computer, Taiyuan University of Technology, Jinzhong 030600, China
Shanxi Coking Coal Group Co. Ltd., Taiyuan 030024, China
Author to whom correspondence should be addressed.
Received: 19 August 2019 / Accepted: 3 October 2019 / Published: 9 October 2019


The microgrid trading market can effectively solve the problem of in-situ consumption of distributed energy and reduce the impact of distributed generation (DG) on the grid. However, the traditional microgrid trading model has some shortcomings, such as high operation cost and poor security. Therefore, in this paper, a microgrid market trading model was developed using consortium blockchain technology and Nash game equilibrium theory. Firstly, blockchain container is used to authenticate the users who want to participate in the transaction. Then, the pricing system collects and integrates transaction requests submitted by users, then formulates transaction pricing strategy of microgrid using Nash equilibrium theory. Finally, the price, trading volume, and user information are submitted to the blockchain container for transaction matching to achieve the transaction. After the transaction is completed, its related information is recorded in the hyperledger and the dispatch system is called. The scene simulation was implemented on Fabric 1.1 platform and the results analyzed. Results show that the trading model proposed in this paper greatly reduces the cost of electricity purchase and improves the benefits of electricity sales. Besides, the model is far more capable of handling transactions than the models based on Bitcoin and Ethereum.
microgrid market; electricity transaction; consortium blockchain technology; Nash game equilibrium theory

1. Introduction

With the gradual depletion of energy resources and deterioration of the environment, energy development is facing the challenge of clean utilization and high efficiency. Renewable energy, including wind power, photovoltaic power (PV), hydropower, and biomass power generation is vigorously promoted by the development of energy transformation [1]. Although the traditional centralized power generation and long-distance transmission of the power grid are stable, there are also problems such as inflexible unit start-up, high transmission cost, and single power supply form [2]. In order to optimize the grid structure and solve the problem of distributed energy in-situ consumption and instability, the microgrid composed of distributed power sources, energy storage devices, energy conversion devices, loads, monitoring, and protection devices have been vigorously developed [3,4]. The development of microgrids can promote distributed power utilization, reduce centralized power supply capacity and losses, and improve grid peak-to-valley performance, thus achieving demand-side management (DSM) and efficient utilization of resources [1]. Among them, the microgrid market provides a platform for small-scale consumers to exchange local energy, which is an essential link in the operation and development of microgrid [5]. Therefore, how to develop a flexible, efficient, and secure microgrid trading platform is of great significance in the development of microgrids and even renewable energy.
The microgrid market can promote the balance of power generation and consumption in the region and solve the problem of local consumption of distributed energy [6,7]. Therefore, in order to promote the development of the microgrid market, scholars in related fields have conducted in-depth research on the microgrid market business model [8], trading mechanism [9,10,11,12,13], and market model [14,15]. In [15], a bargain-based energy trading market was designed. A decentralized algorithm was proposed to develop a bargaining system, and the impact of this energy trading model on the transaction cost of microgrid was analyzed. Most of these studies focus on the market mechanism under the traditional trading model of a single transaction and intermediary supervision. Through intermediaries and other institutions, management costs are relatively high.
With the rapid growth of the global microgrid market, the addition of energy storage technology has made the market entity involved in microgrid market transaction diversified. Market entities begin to shift from producers or consumers to prosumer. The decentralized trading model can effectively reduce the management and operation costs of the energy market, so it has attracted full attention and has been applied to the research of the microgrid market [8,16,17]. In [18], a hierarchical architecture model was proposed, and a peer-to-peer (P2P) energy trading platform based on game theory was developed. However, with the development of energy transaction mode towards decentralized mode, there are some hidden dangers of information security. User information and transaction data are easily tampered with, and information security cannot be effectively guaranteed. Promoting the decentralized transaction mode of the microgrid, reducing the operation cost of the microgrid market, and ensuring the security of microgrid transaction information are the new directions of microgrid market research. Therefore, new technologies are needed to support them.
Blockchain is a decentralized solution that does not require any third-party organization. Besides, the nodes in the blockchain are anonymous, which makes other nodes more secure to confirm transactions [5]. Through continuous exploration, scholars have found that blockchain technology has the characteristics of decentralization and tamper-resistant, which can reduce the operation cost of microgrid market, it can ensure the security of microgrid transaction and make the transaction process of microgrid market more transparent [19,20,21]. In [19], seven components based on blockchain technology were introduced, and an efficient energy market framework for microgrid was developed. Then, the Brooklyn microgrid project was evaluated based on the required components. In [21], an information flow trading model using blockchain was developed. At the same time, ant colony optimization algorithm was improved by improving pheromone concentration and adjusting parameters to solve the trading model of the microgrid group. At present, these studies are more focused on market competition strategy or goal optimization. Few studies have carried out specific analysis and experimental simulation of microgrid transactions based on blockchain technology. Besides, in the early stage of blockchain technology research, the implementation platform of this technology mainly relies on Bitcoin and Ethereum [22,23]. These two technologies have strong transaction processing ability and can make the transaction process more transparent, but they require higher cost and have poor privacy. The consortium blockchain technology is a blockchain technology with authorized nodes [24,25]. This technology has low energy consumption, secure privacy, and is suitable for small community-based power systems.
Developing an energy trading system, in addition to advanced technology as a support, also requires a matching approach to develop a flexible market mechanism to achieve micro-grid market transactions. The key to studying the trading mechanism of microgrid market is the mutual competition behavior of different stakeholders in the market, and the Nash equilibrium theory is an excellent method to solve this kind of problem [26,27,28]. The application of this method in the research of microgrid trading market has essential theoretical and practical significance.
In summary, according to the characteristics of diversification of microgrid market participants, the pricing strategy of microgrid transaction market based on Nash equilibrium theory is proposed in this paper. At the same time, in order to achieve decentralized transaction and ensure the security of information and data, the microgrid market trading system is developed using the consortium blockchain technology in this paper. The trading model proposed in this paper can improve flexibility and efficiency in the microgrid trading process, and ensure transaction security. More specifically, the contributions of our work are:
A novel pricing strategy for microgrid market transactions is proposed based on Bayesian-Nash equilibrium theory. In this paper, the pricing strategy of the microgrid market is formulated based on the Bayesian-Nash equilibrium theory, with the goal of low purchase cost and high sales efficiency. The proposed pricing strategy can effectively improve the efficiency of electricity sales and reduce the cost of electricity purchases.
The microgrid market trading model is developed using consortium blockchain technology. In this paper, the trading model of microgrid market is developed by combining the consortium blockchain technology with the pricing strategy proposed, and the simulation experiment is carried out. The trading model of microgrid market proposed in this paper can realize decentralized trading mode, increase the interests of microgrid users, and ensure the security of transaction information and transparency of transaction process. At the same time, the energy trading platform can effectively solve the problem of local consumption of distributed energy.
Four chaincodes are developed, including the identity verification unit chaincode, buyer/seller unit (BU/SU) chaincode, matchmaking transaction chaincode, and transaction compensation chaincode. The chaincodes are deployed in Hyperledger Fabric 1.1 platform to simulate the transaction authentication process. Compared with Ethereum and Bitcoin, the method proposed in this paper is more efficient in dealing with transactions, thus shortening the time of trading in the microgrid market.
The paper is organized as follows: Section 2 introduces related work on Nash equilibrium theory and blockchain technology. Section 3 presents the relevant methods and the trading model of the microgrid market using consortium blockchain. Section 4 shows a case, then simulates the text model, and further analyzes the feasibility of the model based on the simulation results. Section 5 gives the conclusions and future work.

2. Related Work

In this section, we review related works about the microgrid market and the application of blockchain technology in the microgrid.

2.1. Microgrid Trading Market

With development of the economy, demand for electricity is seeing a sharp increase. Distributed generation (DG) can reduce the distance of power transmission and improve energy efficiency. At the same time, DG incorporates a large number of renewable energy sources such as wind power and PV, providing a platform for the use of clean energy. Although the DG has many advantages, the development of DG has been hampered by the high cost of single-machine access and poor controllability. In order to solve the problems of DG and promote its development, a "microgrid" is proposed [29]. The microgrid market can provide a trading platform for consumers and generators in the local community to effectively address the local consumption of DG and promote the efficient use of clean energy. In addition, the microgrid market can mitigate the impact of DG on the grid and reduce losses caused by long-distance transmission [18]. Therefore, the researches on the microgrid market have attracted the attention of scholars in the industry.
Microgrid is a typical representative of the transition from traditional power system to smart grid. In the early stage of microgrid market research, the microgrid market entrusted intermediary operators to operate and manage [24,25,30]. In [31], an optimization scheme based on a multi-agent system is proposed to solve the problem of a decentralized operation of microgrid.
The microgrid market trading platform is gradually moving towards a decentralized trading model [32,33]. In [34], a two-layer hybrid model (BI-HMOEA) was proposed based on the Stackelberg game model, and an open energy market model was developed. The model can reduce energy consumption while reducing carbon emissions. In [35], a decentralized electricity trading market was designed based on the battery function, and the linear optimization model is used to save the local electricity cost to the greatest extent. The decentralized trading model can save operating costs in the microgrid market. However, issues of trust and security are great challenges for decentralized transactions.

2.2. Application of Blockchain Technology in Microgrid

Blockchain technology is a new application mode of computer technology such as distributed data storage, P2P, consensus mechanism, and encryption algorithm. The essence of blockchain is a globally shared distributed ledger. By establishing a distributed trust mechanism through self-certification, it can maintain a growing list of data records. The method has the characteristics of decentralization, high credibility, and data cannot be tampered [36]. In view of this, blockchain technology can be used as a powerful technical support for decentralized transaction mode. It can reduce the cost of market operations and enhance the security and transparency of user information and transaction data. In recent years, blockchain technology has been applied in the research of finance [37,38,39], supply-chains [40,41], medical care [42,43,44], and smart cities [45,46]. With the deepening of research on blockchain technology, the technology is gradually being applied in smart grids [47,48,49,50,51].
Applying blockchain technology to distribution network technology operation is a relatively new research direction [52,53,54]. In [50], blockchain technology was used to provide ancillary services to the microgrid market, taking into account technical issues that may arise during the decentralized transaction of the microgrid. The decentralized trading model has become one of the trends in smart grid development. However, the decentralized trading model also faces security challenges while saving operating costs and improving operational efficiency. In this case, blockchain technology has become the most powerful technical support for building a power trading system [51,53,55].
In recent years, the research of block chains has focused more on Bitcoin and Ethereum [56]. In [56], Ethereum was used to build a renewable energy trading platform. The advantage of the complete decentralization of the public blockchain is undoubtedly a huge innovation in the way distributed nodes communicate. However, the way in which public blockchain are completely anonymized and open. Therefore, public blockchain is not applicable to distributed energy transactions. The consortium blockchain can be supervised by controlling the authority of the accounting nodes participating in the consensus. Its low development cost and secure privacy make it suitable for small energy systems such as microgrid [57,58,59]. In [59], an energy trading framework was proposed using consortium blockchain technology and used in different scenarios of the Internet of Things (IoT).

3. Microgrid Market Trading Model Using Consortium Blockchain Technology

In this section, a microgrid market trading model based on the consortium blockchain technology is developed. First, the related technologies involved in the model are introduced. Then, the development process of the microgrid trading system based on the alliance blockchain technology is described in detail.

3.1. Related Technology Introduction

This section presents the Bayesian-Nash equilibrium theory, consortium blockchain technology involved in developing the trading model of microgrid market.

3.1.1. Bayesian-Nash Equilibrium Theory

In the microgrid, the order of user’s strategies does not affect game results, and information is not fully available. Therefore, Bayesian-Nash equilibrium theory is chosen to develop a microgrid pricing strategy.
The definition of Bayesian-Nash equilibrium is as follows: A i ( θ i ) ,   i = 1 , 2 , n denotes type dependent strategy space; θ i ,   i = 1 , 2 , n denotes strategy; p r i = p r i ( θ i | θ i ) ,   i = 1 , 2 , , n denotes conditional probability; u i denotes the self-utility function.
There are n individuals participate in the static game G [28]:
G = { A 1 , A n ; θ 1 , , θ n ; p r 1 , , p r n ; u 1 , , u n }
The strategy combination { a i * ( θ i ) } i = 1 n of Bayesian-Nash equilibrium solutions has the characteristics of type dependence, in which each participant i relies on the strategy θ i of the other participant type-dependent strategy a i * ( θ i ) in the case of maximizing the self-utility function u i . That is, the strategy combination a * = ( a 1 * ( θ 1 ) , a n * ( θ n ) ) is a Bayesian-Nash equilibrium, for any i , a i A 1 ( θ i ) , there are:
a i * ( θ i ) arg max p r i ( θ i θ i ) u i ( a i ( θ i ) , a i * ( θ i ) ; θ i , θ i )

3.1.2. Consortium Blockchain

The concept of blockchain was first proposed by Satoshi Nakamoto in 2008 [60]. In recent years, the attitude of the world towards Bitcoin has risen and fallen, but as one of the bottom technologies of Bitcoin, blockchain technology has been paid more and more attention [61].
At present, according to the degree of decentralization, blockchain technology can be classified into three categories: public blockchain, consortium blockchain and private blockchain. In the public blockchain, any individual or group can send transactions, and anyone can participate in the consensus process. However, the public blockchain is energy-intensive and uncontrollable. Private blockchain only uses the general ledger technology of blockchain to keep accounts, generally used in an enterprise or institution [62].
Blockchain in which multiple nodes are selected from a group or industry as accounting nodes are called consortium blockchain. Different from all nodes in the public blockchain participating in the consensus process, only pre-selected accounting nodes participate in the consensus process of the consortium blockchain, while other nodes can participate in the transaction, but not in the accounting process. It has both privacy of private blockchain and decentralized thinking of public blockchain, so consortium blockchain has the following characteristics [57,62]:
Low transaction cost and fast speed: some nodes participate in verification and accounting during the transaction process, and a small number of consortium nodes have high credibility, which simplifies the authentication process and makes it faster than the public blockchain.
High security of data information: different from the public blockchain, participants in the consortium have access to the data of the consortium blockchain. Access is restricted to provide better privacy protection.
Controllability: the consortium blockchain has the advantage of expandability in the short term, and has a certain degree of regulation.
Private chains are not suitable for microgrid because there are multiple market entities involved in microgrid transaction. On the other hand, the microgrid is not the same as the power grid, and the number of market entities in microgrid transaction is much smaller than that of the power grid. At the same time, market entities need to have specific qualifications to conduct transaction, so the consortium blockchain is more suitable for the research of microgrid transaction market.

3.1.3. Hyperledger Fabric

Hyperledger Fabric is the foundation platform of the consortium blockchain, an open source project initiated by the Linux Foundation in 2015, which is mainly used to promote blockchain digital technology and transaction verification. Hyperledger Fabric is not a completely open system, and access to the network requires authorization.
Fabric adopts a modular design in the architecture, which is mainly composed of three service modules: membership services, blockchain services and chaincode services, as shown in Figure 1. Membership services provide membership registration, identity protection, content protection, and transaction auditing functions to ensure platform access security and rights management. Blockchain services are used for formula management of nodes, distributed calculation and storage of ledgers, and implementation of P2P protocol functions between nodes. It is the core component of the blockchain and provides the underlying support for the main function of the blockchain. The chaincode services provides an execution engine for smart contracts, providing a deployment environment for contract code programs [63]. The chaincode can be developed in a variety of programming languages, including Go, Java, Node.js. Currently, the most well-supported is the chaincode written in Go.
Fabric 1.1 supports three consensus algorithms, including distributed queue (Kafka), simple Byzantine fault tolerance (SBFT), and single node consensus (Solo). Kafka is a high-throughput distributed publishing messaging system with multiple sorting nodes, which avoid single-point failures and cause the entire network to crash. SBFT handles transactions faster and has better scalability. Solo is a sort method completed in a single node, which is easy to be implemented and is suitable for simulation in a simple experimental environment [64,65].

3.2. The Trading Model of Microgrid Market Using Consortium Blockchain

In this section, the microgrid market trading model is developed using consortium blockchain technology. First, the overall model framework is introduced, and then a trading strategy based on Bayesian-Nash equilibrium is proposed. Finally, according to the transaction strategy and transaction mode, the smart contract is compiled to develop the trading model using the consortium blockchain and Nash game equilibrium theory.

3.2.1. Overall Structure

The trading model of the microgrid market is hour-ahead trading, and the overall model structure is shown in Figure 2. The core of the transaction mainly consists of two parts: pricing system and blockchain container. In pricing system, the transaction price and transaction volume are formulated through the proposed pricing strategy according to the transaction request. In the blockchain container, the transactions are matched in the matchmaking transaction center (MTC) and then the transactions are checked in the transaction compensation system. Finally, transactions are submitted to the ordering service (OS) for a transaction order, which be recorded to the ledger and settle the transactions.
The specific process includes five stages:
Certification stage of market entities: each market entity was applied for identity and verifies whether it is qualified to enter the market for trading. The demand information of verified market entities was published.
Pricing strategy stage: the microgrid has multiple market entities, including users and DGs. According to the Bayesian-Nash equilibrium theory of incomplete information static game, the transaction price and transaction volume are determined.
Transaction execution stage: the transaction information is sent to the Blockchain Container, and the transaction is matched in the MTC. Then users sign the smart contract according to price and transaction volume. Then the transaction information is submitted to the OS for a transaction order, which will be recorded to the ledger and complete the transaction authentication.
Transaction compensation phase: this phase calculates and compensates the difference between supply and demand and generation error by establishing a connection with the power grid.
Settlement stage: when the transaction is completed, transaction data is recorded and settled, then the Dispatch System is called to complete the energy dispatch.

3.2.2. Pricing Strategy of Microgrid Using Bayesian-Nash Equilibrium

According to users load historical data and DGs power prediction data in the microgrid, the user load and the power generation output power of each transaction period in the next transaction operation period can be found. The power load of user i during trading period t is indicated as follows [66]:
e L , i = [ e L , i 1 , e L , i 2 , , e L , i t ] i = 1 , 2 , , n ; t = 1 , 2 , , 24
where, n is the number of users in the microgrid. It is assumed that one trading cycle is 24 h and the trading period is 1 h.
According to the configuration parameters of the DG and the external conditions, the output power of DG can be predicted. The prediction result can be depicted as follows:
e D G , i = [ e D G , i 1 , e D G , i 2 , , e D G , i t ] i = 1 , 2 , , n ; t = 1 , 2 , , 24
where, the symbol refers to the same as above.
The net output power of user i during the trading period t is indicated as follows:
e N O P , i t = e D G , i t e L , i t i = 1 , 2 , , n ; t = 1 , 2 , , 24
Therefore, the net output power of user i during the transaction cycle is depicted as follows:
e N O P , i = [ e N O P , i 1 , e N O P , i 2 , , e N O P , i t ] i = 1 , 2 , , n ; t = 1 , 2 , , 24
The net output power of the microgrid is expressed as:
e n e t = i = 1 N s e N O P , i + j = 1 N b e N O P , j
In this paper, the operating mode of the microgrid is the grid-connected microgrid. Users in the microgrid change roles according to their needs. When e n e t < 0 , the buyers and sellers in the microgrid play a game to determine the optimal price and the amount of electricity traded. At the same time, the sellers adjust their electricity load e L , i to obtain more benefits. Then electricity is traded, and the insufficient power is supplemented by the grid.
During the trading period t, the microgrid users can be classified into two categories: the seller and the buyer. N is the collection of all users in the microgrid, N b is the collection of power buyer, and N s is the collection of power sellers. When e N O P , i 0 , the user is a buyer, which is denoted as j ,   j N b ; when e N O P , i < 0 , the user is a seller, denoted as i ,   i N s . The transaction principle of grid-connected microgrid is to give priority to the internal user needs of microgrid. In the case of insufficient power in the microgrid, users purchase from the grid, and if there is residual power in the micro-grid, the grid will purchase. Therefore, the internal price of microgrid fluctuates with operation of the microgrid and the supply and demand of power in each period. The internal price of microgrid should satisfy the following conditions:
p s < p t < p b   t = 1 , 2 , , 24
where, p t is the internal electricity price of the microgrid in period t, p s is the price of “surplus power to the grid”, and p b is the price of electricity sold by the grid. In order to facilitate the description of the strategy model, the subsequent analysis defaults to a trading period t.
Sellers will adjust their electricity consumption behavior to obtain higher benefits. Therefore, the benefit function of sellers is introduced, which is indicated as follows:
u i = λ i ln ( 1 + e L , i )   + p ( e D G , i e L , i )   i N s
where, u i is the benefit of the seller i in period t, and λ i is the adjustment coefficient of the seller’s consumption behavior, p is the electricity price in the microgrid.
For buyers, the lowest purchase cost is expected. The purchasing cost of the buyer comes from the purchasing of electricity in microgrid and power grid. Therefore, the purchasing cost of the buyer is expressed as follows:
C j = q j p + ( e L , j e D G , j q j ) p b   j N b
where q j is the amount of power purchased by the buyer j from the microgrid in period t, and 0 q j e L , j e D G , j .
To summarize, the buyer and seller in a microgrid constitute a multi-participant game model. The game model is expressed as follows:
G = { ( N b N s ) , { E i } i N s , { u i } i N , P , C t }
where, the seller group N s adjusts the electricity consumption plan according to the electricity price. E i is the strategy set of electricity consumption e L , i of the seller i, P is the strategy set of internal price of power in the microgrid, C T is the total cost of power purchasing by buyers in the microgrid, which is described as follows:
C T = j N b C j = p i N s ( e D G , i e L , i ) + p s [ j N b ( e L , j e D G , j ) i N s ( e D G , i e L , i ) ]
The purchased electricity quantity q j of the buyer j is as follows:
q j = i = 1 N s | e N O P , i | e L , j e D G , j j = 1 N b e N O P , j j N b
Buyers expect the lowest cost of electricity purchase, and sellers expect a maximum benefit from electricity sales. Therefore, the equilibrium of the game model G is the optimal solution to the problem. By finding the optimal solution, the optimal price can be obtained, and then the power consumers adjust the power consumption strategy according to the price.
Therefore, the strategic equilibrium ( e * , p * ) in period t of the Nash equilibrium game G is the equilibrium point of the game G, if and only if e and p satisfy the following conditions:
u i ( e * , p * ) u i ( e i , e i * , p * ) i N s , e i E i
C t ( e * , p * ) C t ( e * , p ) p P
where e * = [ e L , 1 , e L , 2 , , e L , N s ] , e i * = [ e L , 1 , e L , 2 , , e L , i 1 , e L , i + 1 , , e L , N s ] .
When e n e t 0 , that is the generating power of the microgrid is a surplus, then electricity is sold to customers at the price of compromise transaction price p a = p s + p b 2 , and the surplus power is sold to the grid at the price of p s .

3.2.3. Deployment of Smart Contracts

In this paper, the consortium blockchain technology is selected to develop the trading model of the microgrid market, and the smart contracts are deployed in the Fabric platform in the form of chaincode. Therefore, in this section, four chaincode stages are deployed, including the user authentication stage, supply and demand information release stage, and transaction matching stage, transaction compensation stage. Corresponding to the four chain codes built on Hyperledger Fabric 1.1, including authentication unit chaincode, buyer/seller unit (BU/SU) chaincode, and matchmaking transaction chaincode, transaction compensation chaincode.

Authentication Unit Chaincode

The contract is used to confirm whether the buyer and the seller are eligible to participate in the microgrid market transaction, and strictly examine the qualifications and identities of users. The contract input is the basic information submitted by the user applying to enter the microgrid market transaction. The basic information that needs to be audited by the BU includes the type of the power purchase user, the real name and identification number (ID) of the legal person or representative of the buyers, the credit record and the purpose of the power purchase. The basic information that needs to be audited by the SU includes the type of DG, the real name and ID of the legal person or representative of the user, the installed capacity and the credit record. The contract output is identity authentication information in a specific format. The basic elements of BU chaincode and SU chaincode are shown in Table 1 and Table 2.

BU/SU Chaincode

The chaincode is used to collect the energy demand information of the BU and the information of the SU, then distribute it all to the network. The chaincode inputs of the BU are the expected delivery time of the BU, the account address, and users’ ID of the BU. The input information is collected and integrated as user demand information with a specific format by the chaincode. The chaincode collects the above input information, then calls the private key of the BU to sign the integrated information. The chaincode output is the energy demand information with the user’s signature. Chaincode allows the BU to modify or withdraw the published information in a short time after release. The chaincode’s elements are shown in Table 3.
The inputs of the SU chaincode are the total amount of electricity required by the BU, the amount of electricity sold by the SU, the price of electricity, the account address of the SU, and the user ID for a certain period of time. The chaincode integrates the above input information and calls private key of the SU to sign the integrated information. The output is energy sales information with the user’s signature. The basic elements of chaincode are shown in Table 4.

The Matchmaking Transaction Chaincode

The inputs are demand information issued by BU and the sale information issued by SU. The chaincode matches the power unit with the power unit according to the trading strategy, completes the transaction authentication, and then forms a specific transaction path for each pair of matching buyers and sellers to generate transaction records. Then, all the information in the transaction path is encrypted with its private key to generate a random number, and then submits it to the fabric ledger for recording. The basic elements of chaincode are shown in Table 5.

Transaction Compensation Chaincode

Transaction compensation chaincode includes supply and demand compensation chaincode and error compensation chain code. The inputs of supply and demand compensation chaincode are the demand and supply of electricity, transaction price, and grid’s price. The chaincode calculates the supply and demand difference according to the submitted electricity sales and purchase information. When the amount of electricity sold submitted by the sellers is lower than the demand of buyers; that is, the difference is less than 0. The supply compensation chaincode is used to connect the grid to purchase electricity. Then the costs are borne by the buyers. When the difference is greater than or equal to 0, the chaincode is used to connect the grid, and the surplus power of the microgrid is sold to the grid. The basic elements of chaincode are shown in Table 6.
The inputs of error compensation chaincode are the agreed transaction volume, actual transaction volume, transaction price, and grid’s price. If sellers cannot provide the agreed transaction volume due to the forecast error, the chaincode calculates the difference, then purchases the power from the power grid and deliver it to the buyers. The costs are borne by the sellers. Finally, all the information in the transaction path is encrypted with its private key to generate a random number and then submits it to the Fabric ledger for recording. The basic elements of chaincode are shown in Table 7.

4. Case Study

In this section, the pricing strategy and trading model of microgrid market proposed in this paper were simulated and tested firstly. Through the deployment of chaincodes, a microgrid trading process is taken as an example to verify the feasibility of the trading model. Then, the transaction performances of the trading model were evaluated using Hyperledger Caliper. The experiment of the case was done on three computers. The consensus mechanism used in simulation experiment is Solo. The Go language was used to write the deployed chaincode [67].

4.1. Scene Settings

The simple microgrid market trading scenario was set up and then was simulated in a simplified Fabric network environment. The simplified transaction process is shown in Figure 3. Assuming that the DPGS in the microgrid is the PV system, the transaction period involved in the simulation experiment is limited to the period when the PV system has power output. Therefore, the basic data of 12 transaction periods from 7.00 to 18.00 are shown.
The PV output power refers to the calculation result of the PV output power of certain places on July 1. The microgrid consists of five users, each with a PV system and a smart meter. The parameters of PV systems and smart meter are the same, and the installed capacity of users is different. The initial power load and PV power of each user in the microgrid are shown in Table 8 and Table 9, respectively. The price of “surplus power to the grid” for local PV users is 0.77 yuan, and price of power grid is 0.85 yuan.
The net PV power of each user participating in the microgrid transaction is shown in Table 10. It can be found that the PV output power of user 1 and user 2 is much larger than load, and their net PV power is greater than 0. Therefore, user 1 and user 2 are sellers. The PV output power of users 3, 4, and 5 is less than load, and the net PV is less than 0. Therefore, users 3, 4 and 5 are buyers. All sellers are divided into seller group, and all buyers are divided into buyer group. The power supply and demand of users are shown in Table 11. The sale of electricity in period 13 and 14 is larger than the demand. After the seller sells the electricity to buyers, the surplus power is sold to the power grid at the price of "surplus power to the grid". In other periods, electricity sales are less than demand, and therefore, after purchasing electricity in the microgrid, buyers need to purchase a certain amount of electricity from the grid to meet their demand.

4.2. Simulation Results

The simulation results mainly include two parts. The first is the calculation result of the pricing strategy of the trading model. The second part is the performance test of transaction processing of the trading model. Through the analysis and discussion of the simulation results of these two parts, the microgrid market trading model was analyzed and evaluated.

4.2.1. Pricing Strategy Simulation Results

In this paper, the particle swarm optimization (PSO) algorithm was used to simulate and calculate the pricing strategy model, to find the optimal price of the microgrid market transactions and the optimal benefits of sellers.
The calculation results of the optimal electricity price for each period and the electricity load adjusted by sellers according to the electricity price and benefit are shown in Table 12. The trading power is shown in Table 13. It can be found from Table 12 that the electricity price in each period is between the price of “surplus power to grid” and grid price. In the period of large demand for electricity, the price of electricity increases correspondingly. In order to obtain more revenue, sellers adjust their power load correspondingly.
The transaction volume of each user is shown in Table 13. The negative number represents the sales volume of sellers, and the positive number represents the purchasing power of buyers.
Therefore, the purchase cost of the trading model proposed in this paper and the cost of purchasing electricity from the grid are shown in Figure 4. The power sales benefit of the model and power sales benefit of “surplus power to grid” are shown in Figure 5. The results of electricity purchase cost show that the trading model proposed in this paper has lower electricity purchase cost than that of the power grid. The results of electricity sale benefit show that the electricity sale benefit obtained by way of “surplus power to grid” is much less than that obtained by the model proposed in this paper. In summary, the simulation results of the model show that the decentralized trading model of the microgrid saves the profit of the middlemen, increases the revenue of the seller, and reduces the electricity purchase cost of the buyer. In addition, the microgrid market trading model proposed in this paper can effectively solve the problem of the DG in-situ consumption, decrease power interaction, and thus reduce impact on the grid.

4.2.2. Performance Evaluation

The transaction capabilities of the proposed trading model were tested using Hyperledger Caliper. Hyperledger Caliper is a blockchain performance benchmarking framework. It allows users to test different blockchain solutions using predefined use cases and get a set of performance test results.
The transaction processing capability of a blockchain network is mainly reflected in two aspects: throughput and latency. Throughput is a critical reference index to measure a blockchain solution. This index is used to represent the number of transactions that blockchain network can handle in a certain period. Tps (transaction per second) is generally used to represent the number of transactions that can be processed per second. Latency refers to the time it takes for a blockchain system to process a transaction. In performance testing, the latency of requests refers to the time when a transaction moves from client to blockchain network and obtains the corresponding network. In general, ms (milliseconds) is used as the unit of this index.
Caliper sends transaction requests to the blockchain network through the preset http port, observing the trend of throughput and latency of the proposed model by continuously increasing send rate. The results are shown in Table 14.
For observing the transaction process capability of the model proposed in this paper more intuitively, the data of Throughput and Average latency indicators was extracted, which are concerned about from the table and draw Figure 6.
Throughput and average latency were analyzed, respectively. The case of average latency is shown in the form of a histogram in Figure 6. It can be seen in Figure 6 that with the increase of send rate, the average latency of the proposed model shows an overall upward trend. Before 280 tps, the growth of average latency was relatively flat, basically maintained at 1000 ms. When the sending rate exceeded 280 tps, it showed a sharp growth trend.
Throughput is shown in Figure 6 in the form of a broken line graph. With the increase of send rate, the overall throughput of the proposed model shows an upward trend, but when it reaches the saturation point of 280 tps, the throughput no longer grows, remaining in a stable state.
For evaluating the performance of the model based on the federated blockchain technology in this paper, the results of the proposed model with the bitcoin-based and the Ethereum -based trading model were compared. The comparison results are shown in Figure 7. As can be seen from the figure, regardless of the level of the send rate, the throughput of the trading model based on the consortium blockchain technology is significantly better than the other two blockchain trading models.

5. Conclusion

In this study, the Nash equilibrium theory was combined with consortium blockchain technology to develop a trading model of a microgrid market and simulate the trading scenario. The analysis for results are as follows:
The pricing strategy based on Nash equilibrium theory can be used in power trading in the microgrid market. During a transaction cycle, the pricing strategy proposed in this paper can reduce the purchase cost of power consumers by about 5%, compared with the way of power grid. For sellers, the power-selling benefit of using this pricing strategy is nearly double that of the use of “surplus power to grid”. In addition, the price set by this model is higher than that of “surplus power to grid”. Therefore, in order to obtain higher profits, sellers adjust their power load.
Conducting electricity transactions within the microgrid market can solve the problem of in-situ consumption of DG. The buyers first purchase the power in the microgrid. When the output power of the DG in the microgrid is insufficient, the buyers purchase the power shortage from the grid. This method can reduce the power interaction between the microgrid and the grid, thereby reducing the impact of the microgrid on the grid.
The transaction processing capability of blockchain technology is mainly reflected in two aspects: Throughput and Latency. The trading model based on consortium blockchain technology proposed in this paper is superior to Bitcoin and Ethereum in terms of Throughput and Latency evaluation. In other words, compared to Bitcoin and Ethereum, the microgrid market trading model using consortium blockchain technology has dramatically improved the speed and ability of processing transactions.
However, the simulation scenario set in this paper is relatively simple, and the transaction volume is small. Therefore, whether this model can perform well in the actual application scenario needs further verification.

Author Contributions

W.Z. conceived, designed the experiments, and wrote the paper; J.Z., J.L., Y.Q. and Z.J. analyzed the data. X.Y. modified manuscript; Z.C. and C.W. performed the experiments; All authors read and approved the final manuscript.


This study is funded by the National Natural Science Foundation of China (Project no. 41401655), the National Natural Science Foundation of China (Project no. 61872261), the Qualified Personnel Foundation of Taiyuan University of Technology (Project No. 2013W005), Program for the Top Young Academic Leaders of Higher Learning Institutions of Shanxi (Project No. 163080127-S) and Program for the Philosophy and Social Sciences Research of Higher Learning Institutions of Shanxi (Project No. 2016311).

Conflicts of Interest

The authors declare no conflict of interest.


  1. Zia, M.F.; Elbouchikhi, E.; Benbouzid, M. Microgrids energy management systems: A critical review on methods, solutions, and prospects. Appl. Energy 2018, 222, 1033–1055. [Google Scholar] [CrossRef]
  2. Jiayi, H.; Chuanwen, J.; Rong, X. A review on distributed energy resources and MicroGrid. Renew. Sustain. Energy Rev. 2008, 12, 2472–2483. [Google Scholar] [CrossRef]
  3. Bayindir, R.; Hossain, E.; Kabalci, E.; Perez, R. A comprehensive study on microgrid technology. Int. J. Renew. Energy Res. 2014, 4, 1094–1107. [Google Scholar]
  4. Lasseter, R.H.; Piagi, P. Microgrid: A conceptual solution. In Proceedings of the IEEE Power Electronics Specialists Conference, Aachen, Germany, 20–25 June 2004; pp. 4285–4291. [Google Scholar]
  5. Mengelkamp, E.; Gärttner, J.; Rock, K.; Kessler, S.; Orsini, L.; Weinhardt, C. Designing microgrid energy markets: A case study: The Brooklyn Microgrid. Appl. Energy 2018, 210, 870–880. [Google Scholar] [CrossRef]
  6. Peng, K.; De, L.; Lin, G. Distributed EMPC of multiple microgrids for coordinated stochastic energy management. Appl. Energy 2017, 185, 939–952. [Google Scholar]
  7. Coelho, V.N.; Cohen, M.W.; Coelho, I.M.; Liu, N.; Guimarães, F.G. Multi-agent systems applied for energy systems integration: state-of-the-art applications and trends in microgrids. Appl. Energy 2017, 187, 820–832. [Google Scholar] [CrossRef]
  8. Hanna, R.; Ghonima, M.; Kleissl, J.; Tynan, G.; Victor, D. Evaluating business models for microgrids: Interactions of technology and policy. Energy Policy 2017, 103, 47–61. [Google Scholar] [CrossRef]
  9. Sinha, A.; Basu, A.; Lahiri, R.; Chowdhury, S.; Chowdhury, S.; Crossley, P. Setting of market clearing price (MCP) in microgrid power scenario. In Proceedings of the 2008 IEEE Power and Energy Society General Meeting-Conversion and Delivery of Electrical Energy in the 21st Century, Pittsburgh, PA, USA, 20–24 July 2008; pp. 1–8. [Google Scholar]
  10. Ferruzzi, G.; Cervone, G.; Delle Monache, L.; Graditi, G.; Jacobone, F. Optimal bidding in a Day-Ahead energy market for Micro Grid under uncertainty in renewable energy production. Energy 2016, 106, 194–202. [Google Scholar] [CrossRef]
  11. Pei, W.; Du, Y.; Deng, W.; Sheng, K.; Xiao, H.; Qu, H. Optimal bidding strategy and intramarket mechanism of microgrid aggregator in real-time balancing market. IEEE Trans. Ind. Inform. 2016, 12, 587–596. [Google Scholar] [CrossRef]
  12. Cintuglu, M.; Martin, H.; Mohammed, O. Real-time implementation of multiagent-based game theory reverse auction model for microgrid market operation. IEEE Trans. Smart Grid 2015, 6, 1064–1072. [Google Scholar] [CrossRef]
  13. Li, B.; Roche, R.; Paire, D.; Miraoui, A. A price decision approach for multiple multi-energy-supply microgrids considering demand response. Energy 2019, 167, 117–135. [Google Scholar] [CrossRef]
  14. Wang, H.; Huang, J. Bargaining-based energy trading market for interconnected microgrids. In Proceedings of the 2015 IEEE International Conference on Communications (ICC), London, UK, 8–12 June 2015; pp. 776–781. [Google Scholar]
  15. Kim, H.; Thottan, M. A two-stage market model for microgrid power transactions via aggregators. Bell Labs Tech. J. 2011, 16, 101–107. [Google Scholar] [CrossRef]
  16. Cornélusse, B.; Savelli, I.; Paoletti, S.; Giannitrapani, A.; Vicino, A. A community microgrid architecture with an internal local market. Appl. Energy 2019, 242, 547–560. [Google Scholar]
  17. Zhang, C.; Wu, J.; Zhou, Y.; Cheng, M.; Long, C. Peer-to-Peer energy trading in a Microgrid. Appl. Energy 2018, 220, 1–12. [Google Scholar] [CrossRef]
  18. Efanov, D.; Roschin, P. The all-pervasiveness of the blockchain technology. Procedia Comput. Sci. 2018, 123, 116–121. [Google Scholar] [CrossRef]
  19. Wang, J.; Wang, Q.; Zhou, N.; Chi, Y. A novel electricity transaction mode of microgrids based on blockchain and continuous double auction. Energies 2017, 10, 1971. [Google Scholar] [CrossRef]
  20. Xu, Z.; Yang, D.; Li, W. Microgrid Group Trading Model and Solving Algorithm Based on Blockchain. Energies 2019, 12, 1292. [Google Scholar] [CrossRef]
  21. Castellanos, J.A.F.; Coll-Mayor, D.; Notholt, J.A. Cryptocurrency as guarantees of origin: Simulating a green certificate market with the Ethereum Blockchain. In Proceedings of the 2017 IEEE International Conference on Smart Energy Grid Engineering (SEGE), Oshawa, ON, Canada, 14–17 August 2017. [Google Scholar]
  22. Lundqvist, T.; De Blanche, A.; Andersson, H.R.H. Thing-to-thing electricity micro payments using blockchain technology. In Proceedings of the 2017 Global Internet of Things Summit (GIoTS), Beijing, China, 22–23 June 2017. [Google Scholar]
  23. Gai, K.; Wu, Y.; Zhu, L.; Qiu, M.; Shen, M. Privacy-preserving energy trading using consortium blockchain in smart grid. IEEE Trans. Ind. Inf. 2019. [Google Scholar] [CrossRef]
  24. Cox, W.; Considine, T. Energy, micromarkets, and microgrids. In Proceedings of the Grid-Interop 2011, Phoenix, AZ, USA, 5–8 December 2011. [Google Scholar]
  25. Bhuvaneswari, R.; Srivastava, S.; Edrington, C.; Cartes, D.; Subramanian, S. Intelligent agent based auction by economic generation scheduling for microgrid operation. In Proceedings of the 2010 Innovative Smart Grid Technologies (ISGT), Gaithersburg, Sweden, 19–21 January 2010. [Google Scholar]
  26. Allevi, E.; Aussel, D.; Riccardi, R. On an equilibrium problem with complementarity constraints formulation of pay-as-clear electricity market with demand elasticity. J. Global Optim. 2018, 70, 329–346. [Google Scholar] [CrossRef]
  27. Lu, Q.; Lü, S.; Leng, Y. A Nash-Stackelberg game approach in regional energy market considering users’ integrated demand response. Energy 2019, 175, 456–470. [Google Scholar] [CrossRef]
  28. Howson, J.T., Jr.; Rosenthal, R.W. Bayesian equilibria of finite two-person games with incomplete information. Manag. Sci. 1974, 21, 313–315. [Google Scholar] [CrossRef]
  29. Asmus, P. Microgrids, virtual power plants and our distributed energy future. Electr. J. 2010, 23, 72–82. [Google Scholar] [CrossRef]
  30. Oyarzabal, J.; Jimeno, J.; Ruela, J.; Engler, A.; Hardt, C. Agent based micro grid management system. In Proceedings of the 2005 International Conference on Future Power Systems, Amsterdam, Netherlands, 18 November 2005. [Google Scholar]
  31. López, M.; Martín, S.; Aguado, J.; De La Torre, S. Market-oriented operation in microgrids using multi-agent systems. In Proceedings of the 2011 International Conference on Power Engineering, Energy and Electrical Drives, Malaga, Spain, 11–13 May 2011. [Google Scholar]
  32. Long, C.; Wu, J.; Zhang, C.; Thomas, L.; Cheng, M.; Jenkins, N. Peer-to-peer energy trading in a community microgrid. In Proceedings of the 2017 IEEE Power & Energy Society General Meeting, Chicago, IL, USA, 16–20 July 2017. [Google Scholar]
  33. Kim, H.; Lee, J.; Bahrami, S.; Wong, V. Direct energy trading of microgrids in distribution energy market. IEEE Trans. Power Syst. 2019, 1. [Google Scholar] [CrossRef]
  34. Belgana, A.; Rimal, B.P.; Maier, M. Open energy market strategies in microgrids: A Stackelberg game approach based on a hybrid multiobjective evolutionary algorithm. IEEE Trans. Smart Grid 2014, 6, 1243–1252. [Google Scholar] [CrossRef]
  35. Lüth, A.; Zepter, J.M.; del Granado, P.C.; Egging, R. Local electricity market designs for peer-to-peer trading: The role of battery flexibility. Appl. Energy 2018, 229, 1233–1243. [Google Scholar] [CrossRef]
  36. Yaga, D.; Mell, P.; Roby, N.; Scarfone, K. Blockchain Technology Overview; National Institute of Standards and Technology: Gaithersburg, MD, USA, 2019.
  37. Cocco, L.; Pinna, A.; Marchesi, M. Banking on blockchain: Costs savings thanks to the blockchain technology. Future Internet 2017, 9, 25. [Google Scholar] [CrossRef]
  38. Fanning, K.; Centers, D.P. Blockchain and its coming impact on financial services. J. Corp. Account. Financ. 2016, 27, 53–57. [Google Scholar] [CrossRef]
  39. Tso, R.; Liu, Z.Y.; Hsiao, J.H. Distributed E-Voting and E-Bidding Systems Based on Smart Contract. Electronics 2019, 8, 422. [Google Scholar] [CrossRef]
  40. Petersen, M.; Hackius, N.; von See, B. Mapping the sea of opportunities: Blockchain in supply chain and logistics. it-Inf. Technol. 2018, 60, 263–271. [Google Scholar] [CrossRef]
  41. Francisco, K.; Swanson, D. The supply chain has no clothes: Technology adoption of blockchain for supply chain transparency. Logistics 2018, 2, 2. [Google Scholar] [CrossRef]
  42. Angraal, S.; Krumholz, H.M.; Schulz, W.L. Blockchain technology: applications in health care. Circ. Cardiovasc. Qual. Outcomes 2017, 10, e003800. [Google Scholar] [CrossRef] [PubMed]
  43. Kuo, T.T.; Kim, H.E.; Ohno-Machado, L. Blockchain distributed ledger technologies for biomedical and health care applications. J. Amer. Med. Inf. Assoc. 2017, 24, 1211–1220. [Google Scholar] [CrossRef] [PubMed]
  44. Hussein, A.F.; ArunKumar, N.; Ramirez-Gonzalez, G.; Abdulhay, E.; Tavares, J.M.R.; de Albuquerque, V.H.C. A medical records managing and securing blockchain based system supported by a genetic algorithm and discrete wavelet transform. Cogn. Syst. Res. 2018, 52, 1–11. [Google Scholar] [CrossRef]
  45. Sun, J.; Yan, J.; Zhang, K.Z. Blockchain-based sharing services: What blockchain technology can contribute to smart cities. Financ. Innov. 2016, 2, 26. [Google Scholar] [CrossRef]
  46. Han, H.; Hawken, S. Introduction: Innovation and identity in next-generation smart cities. City Culture Soc. 2018, 12, 1–4. [Google Scholar] [CrossRef]
  47. Pop, C.; Cioara, T.; Antal, M.; Anghel, I.; Salomie, I.; Bertoncini, M. Blockchain based decentralized management of demand response programs in smart energy grids. Sensors 2018, 18, 162. [Google Scholar] [CrossRef]
  48. Noor, S.; Yang, W.; Guo, M.; van Dam, K.H.; Wang, X. Energy Demand Side Management within micro-grid networks enhanced by blockchain. Appl. Energy 2018, 228, 1385–1398. [Google Scholar] [CrossRef]
  49. Andoni, M.; Robu, V.; Flynn, D.; Abram, S.; Geach, D.; Jenkins, D.; McCallum, P.; Peacock, A. Blockchain technology in the energy sector: A systematic review of challenges and opportunities. Renew. Sustain. Energy Rev. 2019, 100, 143–174. [Google Scholar] [CrossRef]
  50. Musleh, A.S.; Yao, G.; Muyeen, S. Blockchain Applications in Smart Grid–Review and Frameworks. IEEE Access 2019, 7, 86746–86757. [Google Scholar] [CrossRef]
  51. Siano, P.; De Marco, G.; Rolán, A.; Loia, V. A Survey and Evaluation of the Potentials of Distributed Ledger Technology for Peer-to-Peer Transactive Energy Exchanges in Local Energy Markets. IEEE Syst. J. 2019, 3454–3466. [Google Scholar] [CrossRef]
  52. Di Silvestre, M.L.; Gallo, P.; Ippolito, M.G.; Sanseverino, E.R.; Zizzo, G. A technical approach to the energy blockchain in microgrids. IEEE Trans. Ind. Inf. 2018, 14, 4792–4803. [Google Scholar] [CrossRef]
  53. Li, J.; Zhou, Z.; Wu, J.; Li, J.; Mumtaz, S.; Lin, X.; Gacanin, H.; Alotaibi, S. Decentralized On-Demand Energy Supply for Blockchain in Internet of Things: A Microgrids Approach. IEEE Trans. Comput. Soc. Syst. 2019, 1–12. [Google Scholar] [CrossRef]
  54. Di Silvestre, M.L.; Gallo, P.; Ippolito, M.G.; Musca, R.; Sanseverino, E.R.; Tran, Q.T.T.; Zizzo, G. Ancillary Services in the Energy Blockchain for Microgrids. IEEE Trans. Ind. App. 2019, 1. [Google Scholar] [CrossRef]
  55. Devine, M.T.; Cuffe, P. Blockchain Electricity Trading Under Demurrage. IEEE Trans. Smart Grid 2019, 10, 2323–2325. [Google Scholar] [CrossRef]
  56. Kang, E.S.; Pee, S.J.; Song, J.G.; Jang, J.W. A blockchain-based energy trading platform for smart homes in a microgrid. In Proceedings of the 2018 3rd International Conference on Computer and Communication Systems (ICCCS), Moscow, Russia, 28–30 April 2018. [Google Scholar]
  57. She, W.; Yang, X.; Hu, Y.; Liu, Q.; Liu, W. Transaction certification model of distributed energy based on consortium blockchain. J. China Univ. Sci. Technol. 2018, 48, 307–313. [Google Scholar]
  58. Kang, J.; Yu, R.; Huang, X.; Maharjan, S.; Zhang, Y.; Hossain, E. Enabling localized peer-to-peer electricity trading among plug-in hybrid electric vehicles using consortium blockchains. IEEE Trans. Indust. Inf. 2017, 13, 3154–3164. [Google Scholar] [CrossRef]
  59. Li, Z.; Kang, J.; Yu, R.; Ye, D.; Deng, Q.; Zhang, Y. Consortium blockchain for secure energy trading in industrial internet of things. IEEE Trans. Ind. Inf. 2017, 14, 3690–3700. [Google Scholar] [CrossRef]
  60. Satoshi Nakamoto, S. Bitcoin: A Peer-to-Peer Electronic Cash System. Consulted 2009. Available online: (accessed on 2 July 2016).
  61. Nofer, M.; Gomber, P.; Hinz, O.; Schiereck, D. Blockchain. Bus. Inform. Syst. Eng. 2017, 59, 183–187. [Google Scholar] [CrossRef]
  62. Zheng, Z.; Xie, S.; Dai, H.; Chen, X.; Wang, H. Blockchain challenges and opportunities: A survey. Int. J. Web Grid Serv. 2018, 14, 352–375. [Google Scholar] [CrossRef]
  63. Nasir, Q.; Qasse, I.A.; Abu Talib, M.; Nassif, A.B. Performance analysis of hyperledger fabric platforms. Secur. Commun. Netw. 2018, 2018, 14. [Google Scholar] [CrossRef]
  64. Zhang, S.; Zhou, E.; Pi, B.; Sun, J.; Yamashita, K.; Nomura, Y. A Solution for the Risk of Non-deterministic Transactions in Hyperledger Fabric. In Proceedings of the IEEE International Conference on Blockchain and Cryptocurrency (ICBC), Seoul, South Korea, 15–17 May 2019. [Google Scholar]
  65. Kang, J.; Xiong, Z.; Niyato, D.; Wang, P.; Ye, D.; Kim, D.I. Incentivizing consensus propagation in proof-of-stake based consortium blockchain networks. IEEE Wirel. Commun. Lett. 2018, 8, 157–160. [Google Scholar] [CrossRef]
  66. Xue, L. Research on Photovoltaic Microgrid Trading System Based on Blockchain Technology. Doctoral Dissertation, University of Electronic Science and Technology of China, Sichuan, China, 17 December 2018. [Google Scholar]
  67. The Linux Foundation. A Blockchain Platform for the Enterprise-Hyperledger Fabric. 2019. Available online: (accessed on 10 August 2019).
Figure 1. Overall architecture of Fabric.
Figure 1. Overall architecture of Fabric.
Energies 12 03812 g001
Figure 2. Overall structure of the microgrid market trading model.
Figure 2. Overall structure of the microgrid market trading model.
Energies 12 03812 g002
Figure 3. Transaction flow.
Figure 3. Transaction flow.
Energies 12 03812 g003
Figure 4. Costs of electricity purchase.
Figure 4. Costs of electricity purchase.
Energies 12 03812 g004
Figure 5. Benefits of electricity sales.
Figure 5. Benefits of electricity sales.
Energies 12 03812 g005
Figure 6. The performance of the throughput and latency.
Figure 6. The performance of the throughput and latency.
Energies 12 03812 g006
Figure 7. Performance comparison results of the methods.
Figure 7. Performance comparison results of the methods.
Energies 12 03812 g007
Table 1. Basic elements of authentication unit chaincode for the BU.
Table 1. Basic elements of authentication unit chaincode for the BU.
The Parameters’ NameTypeMeaning
Customer typeByteBuyers’ type (commercial, industrial, resident, etc.)
BU IDInt64ID number of the BU
Basic informationByteReal-name authentication of buyers identity
Credit recordByteBuyers’ defaults, loan overdue, and criminal records
PurposeBytePurpose of purchasing electricity by buyers
Table 2. Basic elements of authentication unit chaincode for the SU.
Table 2. Basic elements of authentication unit chaincode for the SU.
The Parameters’ NameTypeMeaning
Power generation typeByteType of power generation (wind, biomass, solar)
Basic informationByteReal-name certification of the sellers
SU IDInt64ID number of the SU
Installed capacityInt64Power generation capacity
Credit recordByteSellers’ defaults, loan overdue, and criminal records
Table 3. Basic elements of the BU chaincode.
Table 3. Basic elements of the BU chaincode.
The Parameters’ NameTypeMeaning
BU addressByteAccount address of the BU
BU IDByteID of the BU
Energy demand informationInt64Generated by the BU chaincode
SignatureByteGenerated by the private key of the BU
Delivery TimeInt64Determined by the BU
PriceFloat64Power price
Table 4. Basic elements of the SU chaincode.
Table 4. Basic elements of the SU chaincode.
The Parameters’ NameTypeMeaning
SU addressByteAccount address of the SU
SU IDByteID of the SU
Energy sale informationByteGenerated by the SU chaincode
SignatureByteGenerated by the private key of the SU
Delivery timeInt64Planned sales of the SU
Electricity supplyFloat64Energy price per kWh
Table 5. Basic elements of the matchmaking transaction chaincode.
Table 5. Basic elements of the matchmaking transaction chaincode.
The Parameters’ NameTypeMeaning
SU addressByteAccount address of the SU
SU IDByteID of the SU
BU addressByteAccount address of the BU
BU IDByteID of the BU
Transaction volume Float64Transaction volume allocated by the system
Transaction priceFloat64Power price per kWh in microgrid
Table 6. Basic elements of supply and demand compensation chaincode.
Table 6. Basic elements of supply and demand compensation chaincode.
The Parameters’ NameTypeMeaning
SU addressByteAccount address of the SU
SU IDByteID of the SU
BU addressByteAccount address of the buyer unit
BU IDByteID of the buyer unit
Agreed electricity salesFloat64Net output power of the sellers
Agreed electricity purchasesFloat64Demand power submitted by the user
DifferenceFloat64Difference between supply and demand
Microgrid compromise priceFloat64Electricity price for oversupply
Grid’s priceFloat64Electricity price per kWh in grid
Electricity Price in microgridFloat64Electricity price per kWh in microgrid
Table 7. Basic elements of error compensation chain code.
Table 7. Basic elements of error compensation chain code.
The Parameters’ NameTypeMeaning
SU addressByteAccount address of the SU
SU IDByteID of the SU
BU addressByteAccount address of the BU
BU IDByteID of the BU
Transaction RecordByteTransaction records in the blockchain
HashByteEncrypt order information
Agreed transaction volumeFloat64Planned sales of the SU
Actual transaction volumeFloat64Actual power generation of SU
DifferenceFloat64Difference due to prediction errors
Grid’s priceFloat64Electricity price per kWh in grid
Electricity Price in microgridFloat64Electricity price per kWh in microgrid
Table 8. User power load (kW·h).
Table 8. User power load (kW·h).
PeriodUser 1User 2User 3User 4User 5
Table 9. PV output power (kW·h).
Table 9. PV output power (kW·h).
PeriodUser 1User 2User 3User 4User 5
Table 10. Net PV power (kW·h).
Table 10. Net PV power (kW·h).
PeriodUser 1User 2User 3User 4User 5
Table 11. Total electricity sold and total electricity purchased (kW·h).
Table 11. Total electricity sold and total electricity purchased (kW·h).
PeriodTotal Electricity SoldTotal Electricity PurchasedMicrogrid Net Output
Table 12. Electricity price and transaction volume.
Table 12. Electricity price and transaction volume.
PeriodPriceElectric Load of the seller i (kW·h)
eL,1 e L , 2
Table 13. User transaction volume in microgrid (kW·h).
Table 13. User transaction volume in microgrid (kW·h).
PeriodUser 1User 2User 3User 4User 5
Table 14. Caliper’s pressure test results.
Table 14. Caliper’s pressure test results.
TestNameSuccessFailSend Rate (tps)Max Latency (ms)Min Latency (ms)Avg Latency (ms)Throughput (tps)

© 2019 by the authors. Licensee MDPI, Basel, Switzerland. This article is an open access article distributed under the terms and conditions of the Creative Commons Attribution (CC BY) license (
Back to TopTop