Next Article in Journal
Short-Term Wind Power Prediction Based on Data Decomposition and Combined Deep Neural Network
Previous Article in Journal
Multivariant Analysis of Photovoltaic Performance with Consideration of Self-Consumption
 
 
Font Type:
Arial Georgia Verdana
Font Size:
Aa Aa Aa
Line Spacing:
Column Width:
Background:
Article

Blockchain Smart Contract-Enabled Secure Energy Trading for Electric Vehicles

1
State Key Laboratory of Smart Grid Protection and Control, Nanjing 211106, China
2
NARI Group Corporation, Nanjing 211106, China
3
School of Electrical Engineering and Automation, Harbin Institute of Technology, Harbin 150001, China
4
College of Telecommunications and Information Engineering, Nanjing University of Posts and Telecommunications, Nanjing 210003, China
5
School of Mathematics and Information Technology, Jiangsu Second Normal University, Nanjing 210013, China
*
Author to whom correspondence should be addressed.
Energies 2022, 15(18), 6733; https://doi.org/10.3390/en15186733
Submission received: 11 August 2022 / Revised: 31 August 2022 / Accepted: 12 September 2022 / Published: 14 September 2022
(This article belongs to the Section G1: Smart Cities and Urban Management)

Abstract

:
In this paper, a blockchain-enabled energy trading method is proposed to deal with the inefficiency and security issues in energy trading for electric vehicles in smart grids. It includes the design of a smart contract and the excitation mechanism of energy sharing. The credit points of each vehicle as a node are considered in the design of the smart contract, which is used to supervise the process of energy trading. A strategy to estimate the credit points of each node and describe the excitation mechanism is illustrated. The connection between the credit points and the probability that a node would be accepted for energy trading has been established. To control the energy trading access, a double auction method is used to choose the part of the nodes participating in energy trading. Only selected nodes with winning bids can supply or request energy from the blockchain-based platform. Then it reaches the conclusion that the higher the credit points they have, the more trading initiative they would have during the energy transaction and transmission. The smart contract design and the excitation mechanism proposed in this paper would reward the vehicles that perform well and punish the beguiling vehicles for regulating the trading process.

1. Introduction

Nowadays, the energy system reform for energy sharing between electric vehicles (EVs) is a problem to be solved urgently. The energy sources are limited. However, the energy demand is increasing, which is a more prominent problem in developing countries. Therefore, it is necessary to build an energy-sharing system that balances energy demand and supply.
Compared with traditional fuel vehicles, EVs are environmentally friendly as they have lower operating costs and produce near-zero carbon emissions. In addition, EVs are also an essential part of managing the energy needs of smart cities. However, there are many problems with energy trading for EVs, limiting their participation in vehicle-to-grid (V2G) energy sharing [1]. Among them, when EVs trade energy through remote servers, security issues remain the most important factor in successful transactions. In this regard, blockchain has become one of the most prominent technologies, meeting the security needs of systems in an efficient manner [2]. Due to the good data transparency and reliability of the blockchain, its application has gradually developed from a single cryptocurrency to more different fields. The key technologies in a blockchain, such as consensus mechanisms, encryption algorithms, smart contracts, and distributed data storage, can be used to solve some of the difficult problems in the construction of the Energy Internet [3]. In blockchain applications, smart contracts are often used to automate contract terms, hashing algorithms to protect information confidentiality, consensus mechanisms to protect data integrity, and asymmetric keys to secure data flow security [4].
The characteristics of blockchain technology are very consistent with the development directions of the energy internet in the new era. Therefore, it can be predicted that the introduction of blockchain technology into the energy industry has a broad application prospect [5,6].
In order to cope with the depletion of traditional energy in the future, the whole energy system has undergone great changes [7]. Traditional energy trading is mainly a way of resource allocation with centralized optimal decision-making. A trading energy approach based on a double auction mechanism was proposed for demand response to the operation of an electric power distribution system [8] and for microgrid energy transactions [9]. However, energy trading requires a large number of third-party management institutions to build and maintain the trading credit under the centralized trading mode, resulting in unnecessarily high costs. Therefore, the distributed market mode will be more suitable for energy management than the centralized management mode. In [10], the authors put forward a regional alliance consensus method of energy blockchain based on a credit evaluation. In [11], an energy internet model based on blockchain, as well as a decentralized energy internet intelligent transaction mode and trust mechanism, were proposed. In [12], a blockchain-based security demand response management scheme for energy transactions was proposed to handle demand response in the smart grid ecosystem at lower communication and computing costs. In [13], a dynamic virtual resource allocation mechanism was proposed to enable a survivable virtual network node when the underlying network elements (nodes or links) failed accidentally. In [1], the authors proposed a blockchain-based edge services framework for secure energy transactions in the vehicle-to-grid ecosystem. In addition, plenty of other research efforts also used smart contracts to manage energy-sharing systems. In [14], the authors explored the application of blockchain and smart contracts in smart grids and evaluated the network resiliency of smart grids and the security of energy trading applications. In [15], a smart contract was established between the users who executed the program to guarantee the trust to participate in network access services.
All the papers listed above solve energy problems by reducing high energy transaction costs. However, they lack considering trading credits, which can make sure that more nodes have the motivation to participate in energy trading. The Energy Internet can accept various forms of energy and users, which is a great challenge for platform management. The information from EVs to utilities needs to be protected so that both EVs and utilities can trust the information used in energy trading decisions [16]. There are still lots of problems that need to be solved for the sake of creating a canonical and efficient trading environment, especially the settlement and management of contracts. Thus, this paper tries to design the smart contract especially for energy trading, to incent the participation of energy owners, and to update credit coins for each vehicle to adapt to the energy-sharing situations for EVs. In this case, the energy owners are motivated to share their energy to enhance their credit coins.
The contributions of this paper are summarized as follows.
(1)
A blockchain-enabled smart contract model is designed and built for energy trading between EVs. In the proposed model, the credit points for each vehicle are counted to enhance the level of integrity of energy-sharing participants. More successful energy trading will increase their credit points while breaking a blockchain contract will lower their credit points.
(2)
For the energy trading access process, a double auction model is deployed to select part of the participants to join in energy trading. The selection is mainly based on their bidding amounts. Different from the traditional auction method, here, the number of winning resource requesters and the number of winning resource suppliers can be different. This step can motivate more participants to follow the trading rules and increase their participation motivation.

2. Blockchain Enabled Energy Trading System Architecture

This section will introduce the architecture of the energy trading system designed in this paper to give an overview of the blockchain-enabled energy trading mechanism.
A. 
Core Architecture
The energy internet is designed to promote cooperation between energy systems, such as electric, heat, and electrified traffic. Thus, an energy trading platform that can complete energy trading between several kinds of energy is urgently needed. After considering all the demands, an energy trading system that acts as the basic infrastructure is proposed to act as an idealized solution. It is composed of a transaction layer, an extension layer, and a blockchain layer. The transaction layer is to deal with the energy trading between multiple systems under the support of the extension layer [17,18].
B. 
Blockchain Layer
The blockchain layer is the underlying technology foundation of the transaction architecture, which consists of the vehicle-to-vehicle (V2V) networks and the blockchain storage devices. The blockchain layer has a large number of energy-sharing participants; the vehicles as nodes are all equal and connected with each other in a flat topological structure to form a V2V network [19]. The addition of the blockchain layer introduces blockchain technology into the energy trading of the energy internet. It forms a distributed bookkeeping system through distributed data block storage, replacing the dependence on credit intermediaries [20]. All data is recorded on each node of the blockchain network. Anyone can become a witness of the transactions on the network, while the transactions can be conducted directly between any nodes in the network. Meanwhile, all transaction records and historical data are stored in blocks of the blockchain. It is further ensured that they are difficult to tamper with.
C. 
Extension Layer
The extension layer has three functions: smart contract, weak centralized transaction management, and energy sharing excitation. The heading architecture of this layer is the applicator, and it encapsulates the code of various application scenarios. Through the combination of various business scenarios, it can help blockchain operate well in many different scenarios.
(1) 
Smart Contract
The smart contract designed in this paper consists of two main parts, energy trading contract parameters, and energy trading contract rules, which means that the smart contract built here is a complex code to carry out the contract rules. To be specific, the steps of building and executing a blockchain-based smart contract are listed as follows. First, all the parties should work out an energy trading contract according to their needs. Then, the parties signing the contract shall reach an agreement on the contract content. They even need to check and test the contract code if necessary and spread it to the whole network node through the V2V network as well as store it. Finally, when each party has completed the task according to the agreed conditions, the smart contract stored in the blockchain will be carried out automatically [21].
The application of smart contract technology enables the energy sharing process to have the characteristics of autonomy, reliability, security, high speed, and high efficiency. It can encapsulate several predefined energy resource states, energy sharing trigger conditions, corresponding operations, etc. After being signed by all parties, it is attached to the blockchain data in the form of program code. After being propagated and verified by the blockchain network, it is recorded in the distributed ledger of each node, and the contract is activated and executed after confirming that certain trigger conditions are met.
(2) 
Weak centralized transaction management
When there is a dispute in trading, it is difficult to solve the problem completely only through the enforcement of the system itself and the smart contract. What is more, transaction rules and equipment safety standards need to be developed by regulators. Therefore, it is necessary to manage energy transactions. Thus, this paper involves the concept of a weak centralized transaction management. By weak centralization, the determination of energy price and transaction record can all be decided and executed by the participating nodes independently. Compared with other nodes, weak central institution has the rights to account management and transaction supervision.
(3) 
Incentive mechanism
A kind of complete and efficient mechanism that can motivate the enthusiasm of each node and can increase the cost of cheating is necessary for the extension layer. To be specific, this mechanism is reflected as the evaluation and reward of reliable transmission and high-quality transactions of each node in the energy trading network [22]. The incentive mechanism is embodied by a parameter called credit point, which can make a node obtain more trading initiative. Each node tries to earn more credit points to enhance the probability of being served in the future.
However, incorrect execution will result in a lower credit score. Therefore, the credit point value is an incentive means to motivate more nodes to participate in energy sharing in order to earn credit points. When more and more nodes participate in energy sharing, the energy trading market can continue to be developed.
D. 
Transaction Layer
The transaction layer includes multiple systems such as the power system, thermal system, gas system, and transportation system. The systems are coupled and interconnected to form a hybrid energy system. The trading system having been designed can be used for energy trading in different scenarios. Under the energy internet, the main participants of energy trading include the energy consumers(requesters) and the energy holders (suppliers). Each subject initiates and completes the energy transaction in this layer. Users send transaction data and information to smart contracts in the extension layer to form feasible transactions through rules set in smart contracts and weak centralized management. Finally, the relevant data will be stored in the blockchain layer [23].

3. Energy Trading Model Based on Incentive Mechanism

This paper will focus on the transaction model of incentive mechanism, which will be divided into four parts: smart contract design, energy trading model, double auction model, and energy transaction process. In terms of smart contracts, the incentive mechanism that can punish illegal nodes is designed. The design of an incentive mechanism can standardize the transaction process and solve the problems associated with inefficient energy transactions.
A. 
Smart Contract Design
In the process of energy transactions, a smart contract is used to restrict the users’ behavior and maintain the fairness of the transactions. The incentive mechanism designed in this paper is also realized through the design of a smart contract in the credit points and settlement rules. Figure 1 describes the application of the intelligent contract in the process of energy transactions based on an incentive mechanism. The steps for deploying smart contracts in energy trading go as follows.
First, a distributed shared network including information from all parties would be designed. The process where the nodes make a deal with each other would be recorded chronologically on the database blockchain [24]. Secondly, the energy production region, the equipment, as well as all the factors would be mapped as virtual property following certain regulations and would be recorded in uses’ accounts in the format of property points. Thirdly, the smart contract model is designed. The property in the real world, together with the behaviors, such as changing, transferring, or using virtual assets, would all activate the implementation of the smart contract. At the same time, the property points of nodes participating in this process would be changed. Last but not the least the actual production activities would be carried out if the conditions required for each production link were fully raised. After each resource, owners must trade according to the rules; otherwise, their credit points would be deducted as punishment. To conclude, the energy trading process would operate automatically with the help of the smart contract model designed in this paper. The parameters and rules used in the design are listed as follows.
(1) 
Contract Parameter
(a) Basic user information. The user information includes the username, ID, account address, energy available for sale, and expected transaction price.
(b) Block network and nodes of energy trading system: The alliance block sharing network is composed of energy production, energy selling, energy trading, and energy settlement. They can be divided into different types of nodes through their links and can be given different kinds of operation rights. What is more, they can record the information interaction process between nodes on a reliable database blockchain that cannot be distorted chronologically.
(c) Credit points: The credit points of the vehicles would be reevaluated when an energy transaction or an energy transmission occurs. As a kind of incentive mechanism in blockchain, the credit points can help a node obtain more transaction initiatives. The credit points can reflect the quality and enthusiasm of a node participating in energy transactions in the network. It mainly includes two indicators: transaction quality evaluation and energy transmission contribution.
The transaction quality, as the first indicator, is closely related to the success degree of energy transactions. The quality of a transaction will be affected if the energy owners originally devote some part of their energy. It will also be affected if the seller cannot share its energy successfully. In fact, the actual energy turnover may be different from the ideal turnover. Thus, the first indicator, i.e., the transaction quality indicator Q, can be expressed as
Q = 1 | E r e a l E p l a n | E p l a n
where E r e a l represents the actual energy turnover and E p l a n represents the ideal energy turnover. The credit point is decided by the difference between the actual energy turnover and the ideal energy turnover. If the difference is bigger, the quality Q is also lower. It means that the credit points will be the maximal one if the energy supplier can share its energy equal to the quantity it has planned. The credit points will be lower than one if it cannot provide energy as it has promised.
The second indicator of the credit points for a node is the contribution of energy transmission, which is formulated in (2), where n is the number of intermediate nodes participating in energy transmission. The difference between energy transmission contributions can be reflected by the behavior of maximizing self-interest when the nodes participate in the transaction in the energy-sharing V2V network since the principle of voluntary participation gives the node the right to choose not to take other nodes into account.
T x = Q x / n
Thus, the credit point value can exhibit the contribution of each node for the sake of activating the participation rate of the V2V network nodes and increasing the transmission efficiency of V2V network. The account of credit points of each node can be expressed as
c = α x = 1 A T x + β y = 1 B Q y
In (3), T x represents the node contribution participating in the xth energy transmission; Q y represents the transaction quality evaluation of the yth transaction; A and B represent the total number of times the node participated in energy transmission and transactions; α and β are weight factors whose values can show the importance given to energy transmission and transactions.
(d) Property points: The vital resource of the trading chain, including energy production, energy selling, energy trading, and energy settlement, are mapped as fictitious property. Additionally, they are also recorded in the sellers’ personal accounts in the format of property points. Thus, the property points can act as the mapping of actual property [24].
(e) Energy demand and quotation scope of buyers and sellers: In this paper, the sellers can adjust their quotation scope in order to complete the transaction quickly and earn more profits. Honestly speaking, the quotation scope can be decided according to the supply and demand relationship between energy sellers and energy buyers.
(f) Willingness to trade: The willingness to trade can be shown as specific points and can help the users match their idealized traders. In this paper, the willingness to trade can be defined according to several factors, such as the transaction price, energy demand, property points, and reputation value [25]. This strategy can help reduce the number of transactions between users and can increase trading efficiency.
(2) 
Contract Rules
(a) Transaction confirmation rule: Before the user publishes the transaction information, the system determines the user’s information, such as ID and account address. After the transaction is matched, the system confirms the transaction information, such as the energy trading turnover on both parties and the price of energy transactions.
(b) Transaction willingness rule: When one user publishes the transaction demand, all users with transaction intention hope to complete the transaction. However, in order to quickly achieve a satisfactory transaction, when users of both sides conduct transaction matching, the matching degree of users’ transaction willingness and the block network node to which they belong shall be taken into consideration. Meanwhile, users with high credit points and high bidding values will be preferred to complete transaction matching.
In order to improve the dissemination of the system resources and play an incentive role in energy-sharing transactions, the nodes with energy demand choose the node that has higher credit points to respond to the transaction request. When node i receives an energy transaction request from node j, the probability of node i responding to node j is P i j . This paper takes a piecewise formula in (4) to determine the energy responding probability P i j in different circumstances, as in [26].
P i j = { 1 , c i c j f ( c i ) f ( c j ) , c min c i < c j 0 , c i < c min
where c i is the credit points of energy supplier i, and c j is the credit points of energy requester j, which is a constant for a specific energy requester j. When c i is greater than c j , the probability that P i j of node i will respond to node j is 1, because all nodes always want to trade with someone who has higher credit points than themselves. c min in (4) is the minimum credit points required by node j. When c i is less than c min , the probability P i j is equal to 0. It means that if the credit points of node i are lower than the minimum threshold set by node j, then node i will not be able to trade with node j. When c i is between c min and c j , the probability of P i j is expressed as f ( x ) , where f ( x ) is a monotonically increasing function with credit point x. One of the classical f ( x ) constructors is given specifically here, f ( x ) = ln 1 c min 1 x as in [26,27]. As the denominator f ( c j ) is a constant for the specific node j, the energy trading probability P i j increases with the increase of f ( c i ) for a specific node j. It means that a node i with a higher credit point has a higher f ( c i ) so that it has a bigger energy trading probability, P i j , to be chosen by node j. This f ( x ) construction is consistent with the increasing trend of the response probability for energy trading.
(c) Qualification auditing rule: The system will check the users’ transaction status (whether there are unfinished transactions, etc.), historical transactions, and transaction records to make sure the bidding participants have access to admissibility.
(d) Transaction settlement rule: After the completion of each transaction, the income, which includes the income from sales and the income from the national subsidy policy, will be settled in accordance with the regulations. The rule will be written into the smart contract in the form of a digital code, and the property points shall be settled after the completion of the transaction.
(e) Credit points settlement rule: The credit point of a user changes after each transaction according to the smart contract. Smart contracts penalize users who fail to complete the transaction within the specified time.
The penalty will take the form of a deposit deduction. When one of the user’s transactions fails or times out, the credit point of this transaction is zero. Furthermore, the user’s deposit will be deducted by λ of the trading price as a penalty. If the user’s deposit is fully deducted, he will no longer be able to participate in the transaction. Other values can also be considered accordingly. The credit points of one successful transaction are expressed as Δ c in (5).
Δ c = ( 1 λ ) ( α T x + β Q y )
B. 
Energy Trading Model
For a specific energy requester j, its goal is to choose an energy seller who has enough energy and the highest transaction probability.
i * = arg max i , i S P i j ,   for   a   specific   node   j , j [ 1 , 2 , , R ] s . t .   { c i c min E i E p l a n , j E i E r e a l , i * d i j d max i [ 1 , 2 , , S ]
where E i is the energy property of node i. The energy quantity for any energy trading candidates should not be smaller than the amount of energy that the energy requester node j requests, i.e., E i E p l a n , j , i [ 1 , 2 , , S ] . This is a prerequisite for a node to be a candidate for energy selling. The energy quantity that the chosen node i * provides should be lower than the energy it holds, i.e., E i E r e a l , i * . The last constraint means that the distance between any energy seller candidate and the energy requester j should not be far away from each other. Otherwise, the energy transmission between them is impossible.
C. 
Double Auction Model for Energy Sharing
In an energy trading system, participating users require not only adequate energy resources but also sufficient energy supplies to sell their energy. By using McAfee’s double auction, a two-sided incentive model for energy sellers and energy buyers is built here. The McAfee double auction is used to motivate energy requesters and suppliers in an online fashion. Both of them are randomly joining the blockchain platform anytime. Once an energy requester or a supplier arrives, the platform will make irrevocable decisions based on the current situation on whether to accept the energy requester as a winner and how much it should pay or receive. The detailed steps of McAfee’s double auction are as follows:
(1) Energy trading bids sorting: Assume the bids of energy requesters as B r , and the bids of energy suppliers as B s . For M energy requesters, sort the B r in a non-increasing order, and sort the bids B s for N energy suppliers in non-decreasing order.
B 1 r B 2 r B R r B M r
B 1 s B 2 s B S s B N s
(2) Energy trading winners’ selection: Find the index of the least profitable energy transaction, ( R , S ) = arg max ( B R r B S s ) as in [28]. The first R energy requesters in (7) and the S suppliers in (8) are the auction winners. This makes sure that all the bids of the requesters are higher than the bids of the suppliers. The winning selection is dynamically updated when there are new energy requesters or when suppliers arrive as in [29]. If an energy requester’s bid is higher than the bidding threshold B R r , the platform will agree its access directly. Similarly, if an energy supplier’s bid is lower than the selling threshold B S s , the platform will also agree to its access directly. This auction mechanism only decides which nodes participate energy trading. The energy requesters have permission to select any supplier between 1 and S to trade energy. Which one to choose is also determined by the credit points formulated in (6).
(3) Energy Trading pricing: The blockchain-based platform charges all the winning energy requesters equally according to the bid of the R th requester B R r . It pays all winning energy suppliers equally with the bid of the S th supplier B S s .
The blockchain-based platform can receive energy-sharing requests at any time. The energy suppliers can participate in the energy-sharing platform at any time as well. When an energy requester arrives, the platform should immediately decide whether to accept the energy requester’s requests at this time. As selfish nodes, any energy supplier that wants to select the energy transaction tasks can obtain maximum benefit and submits the corresponding bids accordingly. Then, the platform responds immediately to an energy supplier when it arrives, including whether it accepts its access and at what the price is if accepting it.
D. 
Energy Transaction Process
The specific process of energy trading based on the incentive mechanism designed in this paper is shown in Figure 2. The process is divided into six parts: user registration, requirements publishing, qualification auditing, transaction confirmation, transaction execution, and transaction settlement [19]. The detailed introduction for it is as follows.
(1) User Registration: Users who participate in energy transactions first need to register on the blockchain network and accept the operating rules of the blockchain network and market transaction rules. At the same time, users need to pay a deposit. After the user submits a registration application, the blockchain network assigns the user an account address.
(2) Requirements Publishing: Before the transaction, users who are short of or have excess energy need to publish their transaction information to the blockchain network, including user ID, account address, the energy available for sale or energy to be purchased, the expected price, etc.
(3) Qualification Auditing: The system will check the user’s transaction status (whether there are unfinished transactions, etc.), historical transactions, and transaction records. Transactions that do not comply with the rules will not be approved. Users whose deposits have been fully deducted will also not be able to participate in the transaction.
(4) Transaction Confirmation: Considering the matching degree of users’ transaction willingness, the node to which they belong, and the user’s credit points, users on both sides conduct transaction matching. The information is broadcast to the blockchain network after determining the amount and the price of energy between the participating users. Other nodes in the blockchain network will verify the information after receiving it. After verification, the transaction information is written to the blockchain. The information written on the blockchain is permanently stored and cannot be tampered with.
(5) Transaction Execution: During the transaction, each user trades according to the transaction information. Users are required to trade in accordance with the amount of transaction information on time. In order to guarantee the fairness of the transaction, users who fail to complete the transaction or who fail to complete the transaction within the specified time are punished.
(6) Transaction Settlement: After the end of the transaction, the system will send the actual transaction data of all participating users to the blockchain network. Additionally, it will settle the account according to the transaction data and records through the smart contract; then, it will change the number of property points in the accounts corresponding to each participating user. Users who have successfully traded according to rules would get credit points.

4. Simulation and Results

Based on the analysis above, a trading platform is designed that would encourage each node to participate actively in energy trading. Under the action of the incentive mechanism, each node cooperates actively and effectively.
The default values of α and β are 0.5, so the range of the credit value is [0,1). By taking the derivative of (4), it can be found that the differential coefficient of (4) is always greater than zero, so probability P increases monotonically on [0,1). The initialized symbol values are summarized in Table 1. Other initialization values are also applicable. These can be chosen according to the system requirement or the energy trading participants.
Figure 3 shows the curve of the response probability P i j of node i. It can be seen from the graph that probability P i j is a monotone increasing function. When the credit points of node i are higher, the probability of node j being responded to by vehicle i is higher. The simulation result shows that the higher the credit points of the user, the more opportunities they have to trade. It also shows the user who has high credit points has the right to trade with an excellent user with a high level of energy trading. These advantages can not only encourage users to actively participate in the transaction but also urge users to improve the transaction quality and abide by the transaction rules. In conclusion, the incentive mechanism in energy trading is effective and significant.
Figure 4 shows the total energy transaction amounts when the number of energy requesters is increasing. The “Actual energy request” line means the total energy amount requested by the user. The “Maximal probability-based selection” as the proposed scheme choose energy suppliers according to their response probability for specific energy requesters. The “Maximal energy supply-based selection” is one of the most popular at present, which chooses the energy supplier with the highest residual energy. The “random selection” scheme randomly selects energy suppliers. From Figure 4, when there are more energy requests, the total energy turnover increases. The proposed maximal probability-based energy trading supplier selection is better than the random selection or the maximal energy supply-based selection, approximating the optimal solution.
Figure 5 shows the total energy transaction amounts when the number of energy suppliers increases. More suppliers mean that there are more candidates that can be chosen by the energy requesters. Thus, the performance gets better when there are more choices. As in Figure 4, the proposed method has the best total energy turnover except for the ideal scheme. It means this mechanism could motivate more participants to join in the energy trading and follow the trading rules. It can also be seen that the performance of random selection is worse when there are more energy providers. The proposed scheme can maximize the usage of all available energy resources when there is enough energy supplier. At this time, all the energy demand can be guaranteed.
Figure 6 and Figure 7 illustrate the performance reduction of the total energy transaction amount when the energy trading does not use blockchain smart contract technology. In the real scenario, the probability of not complying with the contract is not too high. However, to highlight the performance difference, it is assumed that the energy suppliers break the contract rules with a probability of 10%. Thus, the performance is much worse when the energy trading is not protected by a smart contract.

5. Conclusions and Prospect

This paper illustrates a smart contract model based on the incentive mechanism. At the beginning of this paper, the energy trading system architecture is exhibited, followed by the contract parameters and rules included in the design of the smart contract, the energy trading model, the double auction incentive method, and the energy trading process with flow chart goes next. In the end, the simulation to prove the efficiency of the proposed maximal probability-based energy trading access method was introduced. As the access probability is associated with the credit point value, the energy trading participants all have the incentives to complete the energy trading process honestly with the purpose of enhancing their credit points. Or they will be punished by the blockchain smart contract enabled platform. While using blockchain technology to conduct energy trading transactions, vehicles with higher credit points are more likely to complete their idealized transactions. By using the double auction method to guarantee the winners’ bidding values, the price that the energy suppliers can obtain is more satisfactory.
The energy trading mechanism based on blockchain has many advantages for blockchain technology, which can facilitate the development of energy trading. In the future, this energy trading mechanism can be further applied to different kinds of resources, even renewable energy such as wind energy and natural gas. At the same time, specific parameter settings and process design can be further planned according to the latest policies issued by relevant departments, combined with the marginal cost of energy transactions and market conditions. By considering domestic regulations specific to each country (taxation, specific incentives, export restrictions, etc.) in the smart contracts design process, the proposed method can be extended to be used in international energy trading. With the advantages of smart contract, the trading participants will pay more attention to following the transaction rules.

Author Contributions

Conceptualization, F.X., K.C. and W.L.; Methodology, Q.W.; Project administration, F.X., K.C. and W.L.; Resources, H.Z. (Haitao Zhao) and H.Z. (Hui Zhang); Supervision, H.Z. (Haitao Zhao) and H.Z. (Hui Zhang); Writing—original draft, Q.W.; Writing—review & editing, K.C., Y.N. and W.X. All authors have read and agreed to the published version of the manuscript.

Funding

This research was funded by the State Key Laboratory of Smart Grid Protection and Operation Control’s 2019 open project [SGNR0000KJJS1907525], the Future Network Scientific Research Fund Project [FNSRFP-2021-YB-31], Natural Science Foundation of Jiangsu Province (BK2021022532), the Natural Science Research Project of Jiangsu Higher Education Institutions [21KJB510027], and the NJUPT Scientific Research start-up Foundation [NY220121].

Conflicts of Interest

The authors declare no conflict of interest.

References

  1. Jindal, A.; Aujla, G.S.; Kumar, N. SURVIVOR: A blockchain based edge-as-a-service framework for secure energy trading in SDN-enabled vehicle-to-grid environment. Comput. Netw. 2019, 153, 36–48. [Google Scholar] [CrossRef]
  2. Lin, C.; He, D.; Huang, X.; Choo, K.-K.R.; Vasilakos, A.V. Bsein: A blockchain-based secure mutual authentication with fine-grained access control system for industry 4.0. J. Netw. Comput. Appl. 2018, 116, 42–52. [Google Scholar] [CrossRef]
  3. Wu, J.; Tran, N.K. Application of blockchain technology in sustainable energy systems: An overview. Sustainability 2018, 10, 3067. [Google Scholar] [CrossRef]
  4. Zeng, Z.; Li, Y.; Cao, Y.; Zhao, Y.; Zhong, J.; Sidorov, D.; Zeng, X. Blockchain technology for information security of the energy internet: Fundamentals, features, strategy and application. Energies 2020, 13, 881. [Google Scholar] [CrossRef]
  5. Zhou, Z.; Tan, L.; Xu, G. Blockchain and Edge Computing Based Vehicle-to-Grid Energy Trading in Energy Internet. In Proceedings of the 2018 2nd IEEE Conference on Energy Internet and Energy System Integration (EI2), Beijing, China, 20–22 October 2018; pp. 1–5. [Google Scholar]
  6. Lu, X.; Guan, Z.; Zhou, X.; Du, X.; Wu, L.; Guizani, M. A Secure and Efficient Renewable Energy Trading Scheme Based on Blockchain in Smart Grid. In Proceedings of the 2019 IEEE 21st International Conference on High Performance Computing and Communications; IEEE 17th International Conference on Smart City; IEEE 5th International Conference on Data Science and Systems (HPCC/SmartCity/DSS), Zhangjiajie, China, 10–12 August 2019; pp. 1839–1844. [Google Scholar]
  7. Cheng, L.; Qi, N.; Zhang, F.; Kong, H.; Huang, X. Energy Internet: Concept and practice exploration. In Proceedings of the 2017 IEEE Conference on Energy Internet and Energy System Integration (EI2), Beijing, China, 26–28 November 2017; pp. 1–5. [Google Scholar]
  8. Fuller, J.C.; Schneider, K.P.; Chassin, D. Analysis of Residential Demand Response and double-auction markets. In Proceedings of the 2011 IEEE Power and Energy Society General Meeting, Detroit, MI, USA, 24–29 July 2011; pp. 1–7. [Google Scholar]
  9. Wang, J.; Wang, Q.; Zhou, N. A Decentralized Electricity Transaction Mode of Microgrid Based on Blockchain and Continuous Double Auction. In Proceedings of the 2018 IEEE Power & Energy Society General Meeting (PESGM), Portland, OR, USA, 5–10 August 2018; pp. 1–5. [Google Scholar]
  10. Zhang, T. Research on Energy Scheduling Trading and Safety Regulation Based on Blockchain. Ph.D. Thesis, North China Electric Power University, Beijing, China, 2019. [Google Scholar]
  11. Yang, X. Research on Distributed Energy Scheduling and Multi-User Transaction Method Based on Blockchain. Ph.D. Thesis, Zhengzhou University, Zhengzhou, China, 2019. [Google Scholar]
  12. Jindal, A.; Aujla, G.S.; Kumar, N.; Villari, M. GUARDIAN: Blockchain-based secure demand response management in smart grid system. IEEE Trans. Serv. Comput. 2019, 13, 613–624. [Google Scholar] [CrossRef]
  13. Cao, H.; Zhao, H.; Luo, D.X.; Kumar, N.; Yang, L. Dynamic virtual resource allocation mechanism for survivable services in emerging NFV-enabled vehicular networks. IEEE Trans. Intell. Trans. Syst. 2021, 6, 1–13. [Google Scholar] [CrossRef]
  14. Mylrea, M.; Gourisetti, S.N.G. Blockchain: A path to grid modernization and cyber resiliency. In North American Power Symposium (NAPS); IEEE: Piscataway, NJ, USA, 2017; pp. 1–5. [Google Scholar]
  15. Gao, J.; Asamoah, K.O.; Sifah, E.B.; Smahi, A.; Xia, Q.; Xia, H.; Zhang, X.; Dong, G. Gridmonitoring: Secured sovereign blockchain based monitoring on smart grid. IEEE Access 2018, 6, 9917–9925. [Google Scholar] [CrossRef]
  16. Chaudhary, R.; Jindal, A.; Aujla, G.S.; Aggarwal, S.; Kumar, N.; Choo, K.K.R. BEST: Blockchain-based secure energy trading in SDN-enabled intelligent transportation system. Comput. Secur. 2019, 85, 288–299. [Google Scholar] [CrossRef]
  17. Liu, Z. Research on Regional Energy Internet Energy Trading Method Based on Blockchain. Ph.D. Thesis, North China Electric Power University, Beijing, China, 2019. [Google Scholar]
  18. Zhang, B. Design and Implementation of Power Trading Platform Based on Block Chain. Ph.D. Thesis, University of Electronic Science and Technology of China, Chengdu, China, 2018. [Google Scholar]
  19. Abdella, J.A.; Shuaib, K. An Architecture for Blockchain based Peer to Peer Energy Trading. In Proceedings of the 2019 Sixth International Conference on Internet of Things: Systems, Management and Security (IOTSMS), Granada, Spain, 22–25 October 2019; pp. 412–419. [Google Scholar]
  20. Yang, J.; Paudel, A.; Gooi, H.B. Blockchain Framework for Peer-to-Peer Energy Trading with Credit Rating. In Proceedings of the 2019 IEEE Power & Energy Society General Meeting (PESGM), Atlanta, GA, USA, 4–8 August 2019; pp. 1–5. [Google Scholar]
  21. Ouyang, L. Smart contract: Architecture and progress. J. Autom. Acta Autom. Sin. 2019, 45, 445–457. [Google Scholar]
  22. 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), Nagoya, Japan, 27–30 April 2018; pp. 472–476. [Google Scholar]
  23. Qi, B.; Xia, Y.; Li, B. Photovoltaic Trading Mechanism Design Based on Blockchain-based Incentive Mechanism. J. Power Syst. Autom. Autom. Electr. Power Syst. 2019, 43, 132–139+153. [Google Scholar]
  24. Liu, Y. Research on tea transaction model based on blockchain smart contract. Computer and information technology. J. Comput. Inf. Sci. Comput. Inf. Technol. 2018, 154, 69–72. [Google Scholar]
  25. Lindsay, J. Smart Contracts for Incentivizing Sensor Based Mobile Smart City Applications. In Proceedings of the 2018 IEEE International Smart Cities Conference (ISC2), Kansas City, MO, USA, 16–19 September 2018; pp. 1–4. [Google Scholar]
  26. Chaoju, H.; Chao, T. Research on P2P Incentive Mechanism. In Proceedings of the 2010 International Forum on Information Technology and Applications, Kunming, China, 16–18 July 2010; pp. 47–50. [Google Scholar]
  27. Zhang, G.; Huang, Y. Bi-directional selection mechanism based on reputation. J. Comput. Appl. 2009, 3, 34–36. [Google Scholar] [CrossRef]
  28. Liu, S.; Yu, Y.; Guo, L.; Yeoh, P.L.; Ni, Q.; Vucetic, B.; Li, Y. Truthful Online Double Auctions for Mobile Crowdsourcing: An On-demand Service Strategy. IEEE Internet Things J. 2022, 9, 16096–16112. [Google Scholar] [CrossRef]
  29. Zhao, D.; Li, X.Y.; Ma, H. Budget-Feasible Online Incentive Mechanisms for Crowdsourcing Tasks Truthfully. IEEE/ACM Trans. Netw. 2016, 24, 647–661. [Google Scholar] [CrossRef]
Figure 1. The energy trading process using smart contract.
Figure 1. The energy trading process using smart contract.
Energies 15 06733 g001
Figure 2. Process of energy trading.
Figure 2. Process of energy trading.
Energies 15 06733 g002
Figure 3. The probability P i j when the quantity of credit points c i varies.
Figure 3. The probability P i j when the quantity of credit points c i varies.
Energies 15 06733 g003
Figure 4. The total energy transaction amount when the number of energy requesters varies.
Figure 4. The total energy transaction amount when the number of energy requesters varies.
Energies 15 06733 g004
Figure 5. The total energy transaction amount when the number of energy suppliers varies.
Figure 5. The total energy transaction amount when the number of energy suppliers varies.
Energies 15 06733 g005
Figure 6. The performance with/without blockchain when the number of energy requesters varies.
Figure 6. The performance with/without blockchain when the number of energy requesters varies.
Energies 15 06733 g006
Figure 7. The performance with/without blockchain when the number of energy suppliers varies.
Figure 7. The performance with/without blockchain when the number of energy suppliers varies.
Energies 15 06733 g007
Table 1. The initial values of the parameters.
Table 1. The initial values of the parameters.
ParameterInitial Value
E p l a n , E r e a l 15~60 kWh
α, β0.5
A, B10
c min 0.1 or 0.2
c j 0.8 or 0.9
λ 0, if the energy supplier obeys the transaction rule 0.005, else
Publisher’s Note: MDPI stays neutral with regard to jurisdictional claims in published maps and institutional affiliations.

Share and Cite

MDPI and ACS Style

Xue, F.; Chang, K.; Li, W.; Wang, Q.; Zhao, H.; Zhang, H.; Ni, Y.; Xia, W. Blockchain Smart Contract-Enabled Secure Energy Trading for Electric Vehicles. Energies 2022, 15, 6733. https://doi.org/10.3390/en15186733

AMA Style

Xue F, Chang K, Li W, Wang Q, Zhao H, Zhang H, Ni Y, Xia W. Blockchain Smart Contract-Enabled Secure Energy Trading for Electric Vehicles. Energies. 2022; 15(18):6733. https://doi.org/10.3390/en15186733

Chicago/Turabian Style

Xue, Feng, Kang Chang, Wei Li, Qin Wang, Haitao Zhao, Hui Zhang, Yiyang Ni, and Wenchao Xia. 2022. "Blockchain Smart Contract-Enabled Secure Energy Trading for Electric Vehicles" Energies 15, no. 18: 6733. https://doi.org/10.3390/en15186733

Note that from the first issue of 2016, this journal uses article numbers instead of page numbers. See further details here.

Article Metrics

Back to TopTop