Abstract
The blockchain is a distributed database whose data are stored and managed in every node in the network. By design, the information of trade records is difficult to tamper. Therefore, it can deal with the trust problem without a central operator. Blockchain technology has brought about major reform in the financial field and has been paid more and more attention in many fields. The combination of blockchain technology and energy trade seems to have good prospects due to their common features of distribution, diversity and marketization. In this paper, a new decentralized energy trading framework based on blockchain technology is presented and analyzed. In this framework, four basic participators in the market are set, which are the consumer, supplier, speculator (with energy storage capacity) and regulator. In addition, the order format and price clearing mechanisms are designed accordingly. The new framework can accommodate a large number of entities and enable them to achieve better economic benefits. Small examples are used to analyze the framework. It is concluded that this technology has significant under-researched potential to support and enhance the efficiency gains of the energy revolution, and areas for future research are identified.
1. Introduction
The demand of energy is growing worldwide, and this has to be met in a more environmental way, which has promoted the rapid development of distributed energy systems [1]. Moreover, the rapid development of technology has brought about a significant price reduction of photo voltaic panels and wind turbines, which led to the thriving of small-scale power plants. It is expected that most homes will be equipped with small-scale solar panels and wind turbines [2,3,4]. In the visible future, they can not only realize energy self-sufficiency but also can make profit by selling excess energy to the main grid. Meanwhile, a large number of autonomous systems brings scheduling difficulty to the central operator and affects grid security. Establishing a central operator will lead to a lot of problems, including high cost, low information security and personal privacy leakage [5,6]. Therefore, it is difficult to use the current centralized framework to operate future energy systems. In order to extract the most value from this trend, there is a need for understanding the future energy trading mechanism. Fortunately, the use of smart meters can realize autonomous bidirectional energy flow [7]. Nevertheless, considering the drawback of the existing trading process, a more suitable trading framework is needed to cope with the increasing number of entities who want to play a more important role in the energy market instead of being a passive buyer.
For a suitable energy trading framework, several requirements must be considered during the design period. The first is a low access threshold resulting in a larger amount of renewable energy resources. Secondly, a framework needs to design a mechanism to promote the deployment of energy storage devices to balance the fluctuations of the renewable energy resources and demand. Third, safety is always a priority, and the framework should fully consider the energy’s real-time balance in the network and prevent price gouging behavior.
To address these issues, we leverage an emerging technology which has been developed to allow a decentralized consensus between a large amount of non-trusted agents: the blockchain. Despite extensive and mature use in financial applications, the blockchain has just begun to attract the attention of researchers mostly in the smart grid area. This research can be roughly divided into the following categories.
Energy currency: A decentralized digital currency for renewable energy called NRGcoin was introduced by M Mihaylov [8]. Locally produced renewable energy is converted directly to NRGcoins independent of their value on the market. The currency can then be exchanged at any time on an open market for its monetary equivalent. A new energy trading currency based on Bitcoin was designed by M. T. Alam to represent the energy used to trade in the energy market to solve the proof of trading and privacy preservation problems [9].
Security and privacy analysis: Nurzhan Z.A implemented a proof of concept for a decentralized energy trading system using blockchain technology, multi-signatures and anonymous encrypted messaging streams, enabling peers to anonymously negotiate energy prices and securely perform trading transactions [10].
Considering the physical constraints in a grid: Eric Munsing presented a blockchain-based architecture for energy markets and posed a decentralized optimal power flow (OPF) model for scheduling shapeable loads on an electricity distribution network [11]. Xue Tai introduced improved convergence stability in a distributed security checking method tested in a six-node power system [12].
These works have not considered the special design of an energy trading mechanism, with distributed anonymous transactions and a detailed model of participants in particular not being mentioned. The example presented in this paper explores the potential of that scenario.
In this paper, we examine how a blockchain architecture can be used to distribute the aggregator’s role across all devices on a network. This integrated architecture is demonstrated on a blockchain platform controlling a trading simulation and demonstrates how to address incentive issues while respecting operational constraints.
The key contributions of this paper are the following:
- (1)
- A detailed description of a blockchain-based energy trading framework, including the trading architecture, focusing on distributed energy generation;
- (2)
- The four main roles of energy trading participants, including the buyer, consumer, speculator and regulator and their action patterns;
- (3)
- An analysis of this trading platform using the multi-agent method, which is addressed to show the efficiency of energy trading.
This paper is structured as follows. Section 1 starts with a brief introduction to the blockchain and its internal consistency with Internet energy. Section 2 presents the modeling of the four participants in buyer seller storage and inspection. In addition, an energy trading framework, the message transforming process during the trading and a detailed description of the price clearing mechanism are also addressed here. Section 3 introduces the multi-agent method to analyze the framework, and a case study is present to show the efficiency of this framework. In Section 4, we present the results from a simulation case, discuss the limitations and conclude by highlighting additional research opportunities.
As we know, it is the first time in this paper that a new energy trading mechanism based on the blockchain has been proposed and its promoting effect for renewable energy resources and energy storage deployment analyzed.
2. Methodology
2.1. Blockchain
Blockchain technology is a relatively new research area. It is first proposed in 2009 by Satoshi Nakamoto and used for financial safety and digitization of currencies [13]. Blockchains are designed for decentralized storage secured by a cryptographic signature and distributed maintenance. Figure 1 shows an example of a blockchain structure in Bitcoin, which is one of the most famous digital currencies. The hash in one block is calculated according to the content of this block through a cryptographic hash function (Bitcoin uses SHA-256). The hash can determine the input data’s integrity, because any changes in the original data will result in extensive changes to the hash [14,15]. Using the cryptographic hashes here will ensure that any changes to the block will cause mismatching of the hash and content. The hash in this block will be the header of the next block. A sequence of blocks linked by hash numbers is called a blockchain. One advantage of this mechanism is that if anyone attempts to tamper with the transaction information in a past block, all the subsequent blocks also need to be tampered with [16]. The information stored in the ledger is validated and maintained by every participator in the network, and thus no centralized authority is needed. It should be noted that multiple (but not necessarily all) nodes owe a full copy of the entire database.
Figure 1.
Example of a blockchain.
Bitcoin uses a proof-of-work consensus mechanism, where the ability to verify and publish a transaction is dependent on the computing power of a node [17]. Once a block is published, some reward will be given as encouragement. In order to publish a block and receive the reward, a node must complete the following steps, shown in Figure 2:
Figure 2.
Process to publish a block.
- Build a candidate block according to the submitted transaction;
- Generate a random number, add it to the content of the block and calculate a hash of the block using SHA-256 before comparing it with the target (a special number of leading zeros can be used to adjust the calculation’s difficulty);
- If the hash is not correct, a new random number will be generated repeatedly until a solution is found or the target is changed (in this case, another block is added in the chain);
- If the hash is correct, the block will be broadcast to the whole network;
- Once the majority node in the network accepts the block, it will be permanently added in the chain, and the publisher will be rewarded.
Bitcoin’s protocol ensures that a block is added to the chain roughly every 10 min by adjusting the difficulty of finding the hash target. An example of one block in Bitcoin is shown in Table 1 [17].
Table 1.
Summary of transactions from Bitcoin block No. 4644.
2.2. Blockchain-Based Energy Market Design
When dealing with the mechanism’s design, three key goals have to be considered:
- (1)
- How to deal with the agreement break, because of the inertial fluctuation property of renewable energy resources;
- (2)
- How to promote the use of storage in the network;
- (3)
- How to deal with grid security.
In this paper, a new blockchain-based energy trading market is designed accordingly. Participants in the market are divided into four populations: producer, consumer, speculator and regulator. The physical entities of each population are shown in Figure 3.
Figure 3.
Sample of roles for participants in energy trading.
In each dispatch cycle, consumers and suppliers will submit purchases, sale prices and quantities to the Internet according to the highest and lowest purchase price in the prior cycle. Each node will deal with the order handling and security check. The speculator can store energy during the low-price period and sell energy when the price is higher. The role of the regulator is to prevent price fluctuations and maintain the stability of the trading platform. After the optimal energy transfer route is solved, transactions are stored on the blockchain in the form of smart contracts, and money is transferred automatically after a transaction is completed.
- (1)
- Producer
In a bidding cycle, each generator is an independent participant with independent decision-making strategies and can adjust the bidding price and quantity simultaneously.
Assuming that there are n generators in the market, if the i-th generator posts an order with an initial bidding price and initial quantity , then the generator’s profit can be calculated by
where is the profit in the t-th time step. is the unit cost of producer i and is the breakdown loss.
If the producer does not produce energy, a financial loss will be generated. This is in line with the actual situation but also can prevent producers from maliciously reducing the production quantity and raising energy prices.
The operation goal for the generator can expressed as follows:
In the game process, the generators use a partial optimal response dynamic game study strategy to acquire the goal [18]. The process of the study can be described as follows:
The quantity adjustment strategies are as follows:
- (2)
- Consumer
Ordinary consumers have no speculative purposes. They have a hard energy demand; that is, within a certain range of time, the need for energy must be achieved through purchases. Their energy consumption can have a certain degree of delay, but the overall energy must be satisfied. In order to have the energy required, the consumer use the following strategy:
- (3)
- Speculator
Speculators in the field of energy aim to gain by placing orders in the trading market. They speculate that if the price is relatively low, they issue buy orders, and if the price is higher than expected, they issue sell orders. In particular, the i-th speculator issues a buy order when the price’s relative variation in a prior time window is higher than the threshold and issues a sell order when the variation is lower than . A speculator will issue buy orders when the price is low and sell orders when the price is higher.
In reality, a speculator may separate a portion of the storage capacity for ordinary energy producers. The motivations for this include the benefits of obtaining extra energy for trading or charging, considering that the producer tends to avoid breaking agreements.
- (4)
- Regulator
Traditional energy will also occupy a certain position for a period of time. For these traditional energy suppliers, they not only have to supply energy for profit, but their obligations also include a responsibility to ensure energy system security. Thus, on behalf of the traditional power plant and grid, the regulator’s goal is to avoid violent price fluctuations and ensure grid safety. When the price is higher than a certain value , a consumer order with a price lower than will complete the transaction with the regulator automatically. The regulator’s energy production volume is set to be infinity, which can ensure the safety of the network.
- (5)
- Order
The energy market is modeled as a model that flows into and out of trading orders. All orders have the following characteristics:
- Quantity: buy and sell a quantity of energy with the unit of kWh;
- Residual amount: used when an order is only partially satisfied by previous transactions;
- Order price: the price for selling or buying energy;
- Order time: the time when the order was issued;
- Expiration time: if the order is not (fully) satisfied, it is removed from the pool at this time.
- Price Clearing Mechanism
We implemented the price clearing mechanism by using a high-low matching (HLM) bidding mechanism like that presented in [18].
At every time step, the order pool holds the list of orders received. Buy orders are sorted in descending order. Sell orders are sorted in ascending order, including the limit price offered by the regulator. Orders with the same limit price are sorted in ascending order with respect to the order issue time.
At each step, various new orders are inserted, or old orders are withdrawn from the pool. As soon as the time comes, the first buy order and the first sell order from the lists are inspected to verify if they match. If they match, a transaction occurs. The order with the smallest residual amount is fully executed, whereas the order with the largest amount is only partially executed and remains at the head of the list, with its residual amount reduced by the amount of the matching order. Clearly, if both orders have the same residual amount, they are both fully executed. The price clearing process is shown in Figure 4. In this figure, C1–C8 is the bidding price for each consumer, and P1–P5 is the bidding price for each producer.
Figure 4.
Sample of price clearing mechanism.
- (6)
- Message Exchange Process
The scenario is visualized conceptually in Figure 5. It is envisaged that the machines participating in this system would each be equipped with a computer containing their digital representations, enabling them to interact with a blockchain. Here, the physical machines are replaced with physical simulations of Matlab.
Figure 5.
Visual presentation of participating in an energy market over a blockchain.
A typical trade proceeds as follows:
- The producer and consumer nodes send price request messages and receive the highest and lowest price in the prior round. According to this message, offers in kWh expressed in USD are prepared and published in the stream, as shown on Figure 6. The preparations require the producers to lock enough energy assets and encode the details of the exchange.
Figure 6. Diagram of the test platform. - Each node receives the messages and sends them to the order pool.
- The price clearing process is motivated after a certain period of time. The result will be sent to these nodes that send orders.
- The consumer and producer start to produce or consume, according to the order.
- Finally, the nodes in the network will calculate the reward and punishment according to their actions, and the result will be added to the blockchain permanently.
3. Case Study
The example was implemented on a Windows 10 computer using the multi-agent simulate platform JADE to simulate the multiple roles. JADE (Java Agent Development Framework) is a software Framework which distributed by Telecom Italia [19]. Multichain was used to establish a blockchain [20]. The test platform is shown in Figure 6.
Multichain is a software package in development that is designed as an off-the-shelf platform for the creation and deployment of private blockchains. In this implementation, the primary features of the blockchain include HLM price clearing mechanisms, which are easily implemented [21].
JADE is a software framework fully implemented in the Java language. JADE provides a simple yet powerful task execution and composition model, peer-to-peer agent communication based on the asynchronous message passing paradigm and many other advanced features that facilitate the development of a distributed system. In this implementation, multiple agents, including the producer, consumer, speculator and regulator, are modeled.
3.1. Design and Implementation
Table 2 and Table 3 provide the related data of seven generators and seven purchasers participating in the market [22]. Figure 7 provides the total energy consumption [23].
Table 2.
Initial bidding price and energy quantity of each generator.
Table 3.
Initial bidding price and energy quantity of each consumer.
Figure 7.
Demand quantity of total consumers.
3.2. Result and Analysis
Figure 8 shows the total trading curve of a 2-day bidding process. As the figure demonstrates, the order price of the generators was much lower than that of the consumers in the first 4 hours, so the total trading quantity was equal to the demand. However, after a certain period in the market, the generators began to use the price strategy in order to obtain more profit. Thus, the generators’ bidding capacity and the market’s total trading quantity started to decrease. With the demand increase, more energy was required, and in order to make more profit, the generators started to increase the quantity, and the consumers started to increase the bidding price. At about 9:00 a.m., the market’s equilibrium status was achieved, and the average total trading quantity followed the demand. After this point, the market was in a dynamic equilibrium stage.
Figure 8.
Total sales in the market.
Figure 9 shows the mean trading price of all agents. As Figure 9 illustrates, the bidding price before 4:00 a.m. increased dramatically when the initial trading price (0.024) was lower at the beginning. However, when the generator constantly increased its bidding price, and the power purchaser constantly decreased its bidding price, the gap between the bids began to narrow. Between 4:00 a.m. and 6:00 a.m., the generators continued intending to increase the bidding price, but the profit could no longer increase. At this point, the generators began to use the electricity quantity adjustment strategy in order to obtain profit, obliging the power purchasers to bid a higher price. As a result, the trading price of the whole market began to rise (reach 0.046) at 12:00 a.m. However, when the demand started to decrease, there was no more profit, and thus the generators started to adjust their quantities. The generators started to decrease their bidding prices, and the trading price started to fall. After this point, both sides were in a stationary equilibrium, and the generator and the purchaser reached a dynamic equilibrium. When the demand increased, the generators started to apply price and quantity adjustment strategies to increase the bidding price and quantity. The consumers had to adjust to this. When the demand decreased, the consumers start their dominance of the market. In the end, the two-sided bidding prices would follow the trend of energy demand.
Figure 9.
Trading price in the market.
4. Conclusions
In this paper, we have shown how decentralized trading and blockchains can be used to realize multilateral energy trading and guarantee fair payments without requiring a utility or centralized aggregator. In the energy trading platform, we designed the general roles of the participants, which are the consumer, producer, speculator and regulator. In addition, the general forms of the message and price clearing mechanisms were designed and discussed. By using this framework, we designed a structure that lends itself to flexible blockchain implementation and showed how blockchains and smart contracts can provide a natural solution for the trust, security, reliability and immutability requirements of trading operation.
The proposed architecture can be improved upon with contributions from active areas of control research, examining the privacy of consumption and production data, addressing uncertain data through a control method and robust optimization and developing fault detection algorithms to identify fraud and changes in the system’s architecture. We see blockchains and smart contracts as key technologies that enable distributed energy management among non-trusting entities at all scales of operation.
Author Contributions
Conceptualization, D.H., C.Z., H.H. and Q.L.; methodology, S.M. and D.Z.; software, S.M.; validation, S.M. and T.L.; formal analysis, C.W.; investigation, S.M.; resources, S.M.; data curation, S.M.; writing—original draft preparation, S.M.; writing—review and editing, T.L.; visualization, T.L.; supervision, D.Z.; project administration, D.H. and C.Z.; funding acquisition, D.H. All authors have read and agreed to the published version of the manuscript.
Funding
This work was supported by the State Grid Jiangsu Electric Power Company Ltd. R&D Program (Grant No. J2020020).
Institutional Review Board Statement
Not applicable.
Informed Consent Statement
Not applicable.
Data Availability Statement
Not applicable.
Acknowledgments
Not applicable.
Conflicts of Interest
The authors declare no conflict of interest.
References
- Han, J.; Ouyang, L.; Xu, Y.; Zeng, R.; Kang, S.; Zhang, G. Current status of distributed energy system in China. Renew. Sustain. Energy Rev. 2016, 55, 288–297. [Google Scholar] [CrossRef]
- Baliozian, P.; Al-Akash, M.; Lohmüller, E.; Richter, A.; Fellmeth, T.; Münzer, A.; Wöhrle, N.; Saint-Cast, P.; Stolzenburg, H.; Spribille, A.; et al. Postmetallization “Passivated Edge Technology” for Separated Silicon Solar Cells. IEEE J. Photovolt. 2020, 10, 390–397. [Google Scholar] [CrossRef]
- Padmavathi, L.; Ruijuan, S.; Jun, L. Electrical Collection Systems for Offshore Wind Farms: A Review. CSEE J. Power Energy Syst. 2021, 7, 1078–1092. [Google Scholar]
- Pilz, M.; Al-Fagih, L. Game-Theoretic Approaches to Energy Trading: A Survey. arXiv 2017, arXiv:1702.02915. [Google Scholar]
- Flores-Espino, Francisco. Compensation for Distributed Solar: A Survey of Options to Preserve Stakeholder Value; National Renewable Energy Laboratory United States: Golden, CO, USA, 2015. [CrossRef][Green Version]
- Melton, R.B. The View from the Top of the Mountain: Building a Community of Practice with the GridWise Transactive Energy Framework. IEEE Power Energy Mag. 2016, 14, 25–33. [Google Scholar]
- Kumar, P.; Gurtov, A.; Sain, M.; Martin, A.; Ha, P.H. Lightweight Authentication and Key Agreement for Smart Metering in Smart Energy Networks. IEEE Trans. Smart Grid 2018, 10, 4349–4359. [Google Scholar] [CrossRef]
- Mihaylov, M.; Jurado, S.; Avellana, N.; Van Moffaert, K.; de Abril, I.M.; Nowé, A. NRGcoin: Virtual currency for trading of renewable energy in smart grids. In Proceedings of the 11th International Conference on the European Energy Market (EEM14), Kraków, Poland, 28–30 May 2014; pp. 1–6. [Google Scholar]
- Alam, M.T.; Li, H.; Patidar, A. Notice of Violation of IEEE Publication Principles: Bitcoin for smart trading in smart grid. In Proceedings of the 21st IEEE International Workshop on Local and Metropolitan Area Networks, Beijing, China, 22–24 April 2015; pp. 1–2. [Google Scholar]
- Aitzhan, N.Z.; Svetinovic, D. Security and Privacy in Decentralized Energy Trading through Multi-signatures, Blockchain and Anonymous Messaging Streams. IEEE Trans. Dependable Secur. Comput. 2016, 15, 840–852. [Google Scholar] [CrossRef]
- Munsing, E.; Mather, J.; Moura, S. Blockchains for Decentralized Optimization of Energy Resources in Microgrid Networks. In Proceedings of the 1st IEEE Conference on Control Technology and Applications, Kohala Coast, HI, USA, 27–30 August 2017. [Google Scholar]
- Tai, X.; Sun, H.; Guo, Q. Electricity Transactions and Congestion Management Based on Blockchain in Energy Internet. Power Syst. Technol. 2016, 40, 3630–3638. [Google Scholar]
- Nakamoto, S. Bitcoin: A peer-to-peer electronic cash system. Consulted 2009, 1–9. Available online: https://bitcoin.org/en/bitcoin-paper (accessed on 10 April 2022).
- Rogaway, P.; Shrimpton, T. Cryptographic Hash-Function Basics: Definitions, Implications, and Separations for Preimage Resistance, Second-Preimage Resistance, and Collision Resistance; Springer: Berlin/Heidelberg, Germany, 2004. [Google Scholar]
- Lewis, A. A Gentle Introduction to Blockchain Technology. 2015. Available online: https://bitsonblocks.net/2015/09/09/a-gentle-introduction-to-blockchain-technology/ (accessed on 18 October 2016).
- Buterin, V. Proof of Stake: How I Learned to Love Weak Subjectivity. 2014. Available online: https://blog.ethereum.org/2014/11/25/proof-stake-learned-love-weak-subjectivity/ (accessed on 18 October 2016).
- Bitcoin Developer Guide. 2009. Available online: https://bitcoin.org/en/developer-guide (accessed on 17 November 2017).
- Qing, X.; Zhengyun, S. Application of high-low match methods to regional electricity market considering transaction costs. Power Syst. Technol. 2005, 29, 1–5. [Google Scholar]
- Robinson, C.R.; Mendham, P.; Clarke, T. MACSimJX: A Tool for Enabling Agent Modelling with Simulink Using JADE. J. Phys. Agents 2011, 4, 1–7. [Google Scholar] [CrossRef]
- Skarvelis-Kazakos, S.; Papadopoulos, P.; Unda, I.G.; Gorman, T.; Belaidi, A.; Zigan, S. Multiple energy carrier optimisation with intelligent agents. Appl. Energy 2016, 167, 323–335. [Google Scholar] [CrossRef]
- Greenspan, G. MultiChain Private Blockchain; Technical Report; MultiChain: Amsterdam, The Netherlands, 2015; pp. 1–17. [Google Scholar]
- Liu, Z.; Zhang, X.; Lieu, J. Design of the incentive mechanism in electricity auction market based on the signaling game theory. Energy 2010, 35, 1813–1819. [Google Scholar] [CrossRef]
- Weidlich, A.; Veit, D. A critical survey of agent-based wholesale electricity market models. Energy Econ. 2008, 30, 1728–1759. [Google Scholar] [CrossRef]
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations. |
© 2022 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 (https://creativecommons.org/licenses/by/4.0/).
