An Incentive Mechanism for Energy Internet of Things Based on Blockchain and Stackelberg Game

In the Internet of Everything era, the Energy Internet of Things (IoT), as a typical application of IoT technology, has been extensively studied. Meanwhile, blockchain technology and energy IoT can be coordinated and complementary. The energy IoT is diversified and has a high transaction demand. it is an issue worthy of research to discuss the impact of the energy IoT environment on the performance of blockchain consensus algorithms and guarantee blockchain stability in energy IoT environment. In the research, an incentive mechanism based on Stackelberg game is proposed for the network scenario involving multiple roadside units and user nodes. The proposed strategy is analyzed through the Matlab simulation platform. The simulation results show that the proposed scheme can effectively protect the interests of blockchain users and miners. It also can improve the security and stability of the blockchain-based energy IoT system. Moreover, the numerical results not only verify the model feasibility. It also shows that when there are many blockchain miners, the model performance is fine. However, when the number of miners reaches a certain value, there will be unobvious growth. Furthermore, it is

In the Internet of Everything era, the Energy Internet of Things (IoT), as a typical application of IoT technology, has been extensively studied.Meanwhile, blockchain technology and energy IoT can be coordinated and complementary.The energy IoT is diversified and has a high transaction demand.it is an issue worthy of research to discuss the impact of the energy IoT environment on the performance of blockchain consensus algorithms and guarantee blockchain stability in energy IoT environment.In the research, an incentive mechanism based on Stackelberg game is proposed for the network scenario involving multiple roadside units and user nodes.The proposed strategy is analyzed through the Matlab simulation platform.The simulation results show that the proposed scheme can effectively protect the interests of blockchain users and miners.It also can improve the security and stability of the blockchainbased energy IoT system.Moreover, the numerical results not only verify the model feasibility.It also shows that when there are many blockchain miners, the model performance is fine.However, when the number of miners reaches a certain value, there will be unobvious growth.Furthermore, it is also confirmed that the wireless energy IoT environment will also create a certain impact on the game model.


The ideal response time demand * x The optimal pricing strategy that can maximize r U .

INTRODUCTION 1
Energy IoT is a new energy internet system based on cutting-edge technologies such as 5G and artificial intelligence, combined with energy.According to the complementary mode of different energy sources, energy internet greatly promotes the linkage between electricity, fossil, and heat energy sources with the help of internet *Corresponding Author Email: junquan123gong@163.com(J.Gong) technology [1].Meanwhile, blockchain technology and energy IoT can be coordinated and complementary in integrated development.This complement is mainly reflected in decentralization, collaborative autonomy, marketization, and smart contracts.As a cutting-edge technology, blockchain deeply integrates a series of emerging computer technologies such as distributed data storage, P2P (peer-to-peer) transmission, consensus mechanism, encryption algorithm, and so on.It also displays distinct application characteristics of decentralization, openness and transparency, traceability, and tamper-proofness [2].The application value and application scenarios of blockchain technology in the field of energy IoT have been deeply discussed in a large number of studies.Zhao et al. [3] summarized and introduced the development status of blockchain energy application engineering at home and abroad.And it has provided reliable development ideas and suggestions for the engineering application of blockchain technology in China's energy field.Zhang et al. [4] comprehensively and systematically sorted out the application dimensions of blockchain technology in the energy Internet.The key role of blockchain technology in the field of energy Internet has been elaborated in detail from the perspectives of energy, information and value.Fernández-Caramés et al. [5] described the demand for blockchain technology in the IoT field and the impact of its application on the development of the modern IoT.Doshi and Varghese [6] examined how renewable energy and AI-powered IoT can be used to improve agriculture.The paper explores how to use technologies to optimize crop yield, reduce water consumption and improve the efficiency of the agricultural industry.The authors also discussed potential challenges and solutions to ensure successful implementation of smart agriculture.Wang and Liu [7] presented an energy efficient optimization method for smart-IoT data centers based on task arrival.The authors proposed a task scheduling algorithm to minimize energy consumption while ensuring system performance.The algorithm dynamically assigns tasks to different nodes based on task arrival, system load, and energy consumption.This approach is compared with existing scheduling algorithms.The results show that this method improves energy efficiency while maintaining system performance.
However, the most concerned challenge is that the current performance of the traditional blockchain cannot meet the needs of high-frequency data usage.The traditional single-chain structure results in a limited number of transactions that can be processed in a consensus cycle.This cannot meet the dynamic scalability requirements for performance of blockchain technology in the actual production.Therefore, for the scalability of blockchain, a distributed ledger based on DAG is proposed, which greatly improves the system performance under high concurrency.How to balance the response strategies of each participant to protect the interests of blockchain users, miners and the system is a problem worth studying.
Game theory is a mathematical model for the study of strategic interactions between rational decision makers [6,7].It can be used to analyze the strategies of nodes and the interactions between nodes.Due to the power of game theory, it is one of the new trends of future development to use game theory to solve the optimization problem in blockchain.The optimization problem, especially the CAP theory problem in current blockchain [8], is namely impossible triangle: decentralization, scalability and security.Secondly, the Stackelberg game model is generally widely used to solve the pricing problem between service providers and users [9,10].For wireless environments like Energy IoT, the work of end users needs to rely on the purchase of computing resources from edge computing networks.Modeling the interaction between the two using Stackelberg games is a problem worth investigating for system optimization.Nejati and Faraji [11] dealed with the issue of actuator fault detection and isolation for a helicopter unmanned aerial vehicle.The authors proposed a methodology based on the observer and residual generation technique to detect and isolate actuator faults in real-time [11].Khosravian and Maghsoudi [12] discussed the design of an intelligent controller for station keeping, attitude control, and path tracking of a quadrotor using recursive neural networks.The authors proposed a control scheme based on the fusion of multiple recursive neural networks for precise control of the quadrotor [12].Xiong et al. [13] discussed about cloud computing and pricing management for blockchain networks.Wei et al. [14] also investigated on application of blockchain for uncertainity in energy pricing and market pricing for the enegy sectors.
Given the basis of game theory and the problems faced in this paper, this paper proposes a Stackelberg game-based incentive mechanism based on the DAG consensus mechanism.The game model simulates the interaction between blockchain users and miners, verifying the existence of the game balance point.The simulation results show that the algorithm can effectively improve the system security and stability.Specifically, it aims to improve the system security by encouraging miners to join the blockchain network, while meeting the needs of blockchain users.The rest of the paper is organized as follows.Section 2 introduces the related problems and system models.Section 3 introduces the best solution analysis and leader analysis.In section 4, the simulation results are analyzed and the system performance is evaluated numerically.Finally, section 5 summarizes this paper.The research objective of this paper is to propose an incentive mechanism based on Stackelberg game model to simulate the transaction behavior between blockchain users and miners.The proposed scheme can effectively protect the interests of blockchain users and miners.The security and stability of the blockchain-based energy IoT system has been improved.

1. System Model
Our model consists of two entities: 1. blockchain user, namely solar inverter, vehicle, etc.; 2. Blockchain consensus node, namely roadside unit with computing and storage capabilities, also known as miner, as shown in Figure 1.It is noteworthy that in DAG, miners do not need a lot of computing resources in mining, just needing to verify every collected transaction.This is referred to as mining behavior in this paper.Blockchain users deliver transactions to miner nodes through wireless channels.
Wireless channels require all blockchain users in the area covered by miners' nodes to compete with each other.Miner nodes communicate with each other via wired channels, run DAG consensus algorithms, validate and store the collected transactions.This consumes computing and storage resources.Due to the selfishness of nodes themselves, this is unfair for miners.Therefore, to maintain the normal operation of the blockchain system, it is reasonable for miners to charge certain transaction fees from blockchain users.For blockchain users, the transaction verification will cause new delays, so the process from publication to confirmation of transactions in the blockchain will go through two stages: delivery and verification.
The blockchain network model considered in this study consists of multiple blockchain user clusters, each of which receives data by a miner node.Where,   and the other part is the transaction verification delay () After joining the blockchain network, the user response time is more affected by the verification delay.The delay () v T  for transactions to be validated at miner nodes is the time it takes for the cumulative weight of blockchain transactions to reach the weight threshold.Due to the directed acyclic graph property in DAG, the verification delay is proportional to the transaction generation rate  .It means that blockchain users need to generate more transactions to meet the lower response delay requirements.
Here, in view of the queuing process in the first stage, this paper only considers the transaction verification delay under stable high load.According to the description in DAG white paper, the change process of verification delay with transaction arrival rate  can be expressed as: Since this study only considers the block verification process during the high load phase, we need to add a restriction on the transaction generation rate, i.e.: where, N represents the mean value of the distributed blockchain user nodes.Meanwhile, it should be made clear that in the transaction delivery, the wireless channel capacity is limited.Therefore, the wireless channel will restrict the transaction delivery after the service intensity 1   .Therefore, this section sets restriction 1   , which can be specifically expressed as follows:

Analysis of Stackelberg Game Model Problem
To encourage blockchain miners to share their computing resources, more miners are motivated to participate in the blockchain consensus to improve the system security.The system has the authority to require blockchain users to pay a fee for each transaction.And it allows blockchain users to have different needs for response time.Therefore, there is a non-cooperative game between blockchain users and miners.In this paper, an incentive mechanism based on Stackelberg game model is proposed to simulate the interaction between blockchain users and miner nodes.Where, the set of blockchain miners is the leader and blockchain users are the followers.Miners charge transaction fees at the expense of computing and storage resources, while blockchain users have higher demand for system response time.This paper mainly uses a game theory model to maximize the benefits of blockchain users and miner nodes.And it verifies the existence of equilibrium points in this game.

1. Benefit Function of Blockchain Users
In terms of blockchain users, its benefit function includes satisfaction function of response time and incentive cost, namely transaction cost.The response time here represents the verification delay of transactions in the DAG network.Due to the different load of transactions arriving in the network, transactions have different verification delays.Therefore, the user's benefit function can be defined in the following equation: 12 ( , ,..., ) In general, logarithmic function is used to evaluate user satisfaction [11].Therefore, in this paper, the satisfaction function of blockchain users with respect to response time is expressed as follows: ( ) where,  represents the weight factor of the response ( ) , so that can be clearly understood Equation (6).
Through the above analysis, the expression of user benefit function can be rewrite as follows: ( ) log 1 ( )

Benefit Function of Blockchain Mine
For the blockchain miners, their benefit function is defined as the charged transaction fees minus the cost of computing resources consumed per transaction.Miners aim to help blockchain users verify and store valid transactions and charge transaction fees x for each transaction, thereby maximizing revenue.Mathematically, the optimization problem can be expressed as follows: where,

=2
dag sc TPS L N  represents the system throughput in the blockchain network under the wireless channel service strength 1   .That is, the number of transactions verified per second in the blockchain network.In Equation ( 8), the first term represents the average verification revenue of all blockchain miners.The second term is the computing and storage cost in each transaction c .This paper assumes that each user has the same transaction request, i.e.
i   .
In general, the benefit functions of leaders and followers are expressed as follows:

ANALYSIS OF OPTIMAL SOLUTION
According to the Stackelberg game model proposed in section 2.2, both blockchain users and miners are rational users who want to maximize their revenues.If one party achieves the maximum revenue, it will damage the other party's revenues and eventually lead to game breakdown.Therefore, an equilibrium point must be found so that both buyers and sellers can accept it.In the model, firstly, blockchain miners fix the price of each transaction on the basis of their own cost function to gain the optimal total reward * r U from their own strategy space.Secondly, blockchain users choose respective response time strategy according to the pricing of miners.In this section, backward induction [15,16] will be used is the optimal equilibrium point of the non-cooperative Stackelberg game.

1. Follower Analysis
Through backward induction, first the benefit maximization strategy of the follower blockchain user is analyzed.For the benefit function of blockchain users, its derivative is as follows: From the analysis of the above two expressions combined with the derivation in section 3, the second clearly convex function with respect to  .Due to the constraint conditions in Equation ( 9), generally Lagrange multiplier method is used to solve the optimization problem.After substituting the constraint conditions into the benefit function, the following expression can be obtained. ( Based on this, the KKT condition can be obtained as shown in Equation (12).Where, * represents the optimal solution.
Let ( ) , then the optimal policy *  of blockchain users can be obtained.

2. Leader Analysis
On the basis of the optimal strategy of the following blockchain user, the second step of backward induction method is to use the obtained optimal strategy solution of the follower and substitute it into the leader's utility function.Then the first order and second derivative analysis is used in the Stackelberg game to find the optimal strategy * x of the leading blockchain miner.
For the blockchain consensus node, based on backward induction, the second derivative of r U with respect to x can be expressed as follows: To prove the existence of extreme values of r U , the concavity and convexity must be analyzed first.Therefore, to further solve the first and second derivatives of  with respect to x , the following expression can obtained: By analyzing the above equation, the first and second derivatives ( ) in Equation ( 15) can be obtained.Finally, through the above analysis, it can be obtained that when ( ) ( ) , and the benefit function r U of blockchain miners is a convex function with respect to x .Therefore, when =2 0 , the optimal strategy price * x of blockchain miners can be obtained, namely: where, * x has a negative solution, which does not meet the conditions and will not be discussed here.Meanwhile, as can be seen from Equation ( 17 However, in a distributed environment, since the two sides of the game are non-cooperative, neither the blockchain miner nor the user knows the optimal strategy of the other.Therefore, this paper uses the classical iterative method [17] to find the optimal solution, and this process is shown in Algorithm 1.
In Algorithm 1, if the iterative convergence condition is not met, the value calculated in this round will be used as the initial value for the next round of update, and this process will be repeated until , The above analysis, on the basis of definition 1, demonstrates that the optimal solution is the unique equilibrium solution by proving 1 and 2. globally optimal.In particular, it is proved in section 3.1 under KKT, so l L is a convex function with respect to  , which meets the contents of Definition 1. Proof 2: For blockchain miners, when the user gets the ideal response time demand ()  , the optimal trading strategy  can be obtained.As proved in section 3.2, under the condition ( ) x is the optimal pricing strategy that can maximize r U .

PERFORMANCE EVALUATION
In this paper, an incentive scheme based on Stackelberg game is proposed for the network scenario involving multiple roadside units and user nodes.The proposed strategy is analyzed through the Matlab simulation platform.The following will first explain the scenario setting of simulation verification.The specific simulation parameters are shown in Table 1.
In this section, the system performance is evaluated numerically from three aspects.First, the update process of blockchain user and miner policies with the number of iterations is examined.Second, the influence of user distribution on benefit function in the energy IoT scenario is considered.Third, as the number of blockchain miners increases, the change trend of the benefit function is analyzed.
Miners, as leaders, first have the authority to formulate pricing strategies.This is to update respective strategies for following blockchain users on the basis of miners' strategies to meet their own response time requirements.Figure 2 represents the iterative update process of transaction pricing for blockchain miners.In this figure, transaction price decreases with an increase in the number of iterations, which ultimately converges to a stable value.This is because only when the transaction price x is lower, blockchain users will choose  transaction price falls, a greater number of transactions in the network will make miner's total revenue increase.In addition, as the number of miners increases, so does the ability to collect transactions in the network.Therefore, despite the low transaction price, the miners' revenue can still be guaranteed.
Figure 3 shows the change trend of the transaction demand rate of blockchain users with the number of iterations under different number of miners.Similarly, it can be seen from the figure that with an increase in the number of iterations, the transaction demand rate of blockchain users increases and finally enters a stable state.This is because as the number of miners increases, the transaction price decreases, which exactly encourages blockchain users to demand faster transaction rates.
Where, verification delay () v T  is a function of  , which represents the transaction verification delay of blockchain users.As can be seen from Figure 4, with an increase in the number of iterations, the value of () v T  will gradually decrease, which is consistent with the analysis result in Figure 3. Since () v T  is inversely proportional to  , when  increases, the user's verification delay will decrease.Consequently, the benefit function of the user is guaranteed, and eventually, () v T  will tend to a stable value.
Figures 5 and 6 show the impact of the number of miners on the benefit functions of blockchain users and miners themselves.According to the figure, as the number of miners increases, the benefit function of blockchain users and miners will also increase.This is because more miners can process more transactions per unit time.That is, the number of transactions participating in the consensus process per unit time increases.This leads to the decrease of verification delay, the improvement of   This paper also shows distribution comparison of four groups of blockchain users in Figures 5 and 6.It can be seen that, due to the limitation of wireless environment, under greater blockchain user distribution area, that is, greater  value, the benefit function will be greater.
However, despite the continuous increase in  value, the difference between the two curves =0.15, =0.20   in the figure is obviously less than that of =0.05, =0.10  .This is because the dense distribution of blockchain users will lead to the continuous decline of transaction delivery efficiency in the wireless environment.This will slow down the growth in the number of transactions in the network, reducing benefits for blockchain users and miners.
Through the above simulation, it can be concluded that the incentive mechanism proposed in this paper not only miners to join the blockchain network.This increases the system stability and meets the response time requirements of blockchain users.This is the purpose of this algorithm, namely, not only guaranteeing the interests of both parties of the game, but also improving the distributed stability of the system.

DISCUSSION
The proposed incentive mechanism based on Stackelberg game has numerically proved to be beneficial for both blockchain users and miners.Simulation results have shown that the proposed scheme can effectively protect the interests of blockchain users and miners, and improve the security and stability of the blockchain-based energy IoT system.This conclusion is supported by the results of several studies.For example, a survey conducted by Liu et al. [8] on blockchain on the use of game theory to analyze the incentives of different participants in an energy blockchain system found that the incentive mechanism proposed in their study was able to balance the interests of energy producers, consumers, and miners.Similarly, a study by Sun et al. [18] investigated on the impact of game theory on the security of blockchainbased energy trading systems, and found that gametheoretic approaches can effectively enhance the security of energy trading systems.Moreover, a study by Dong et al. [19] on the use of game theory to optimize the performance of blockchain-based energy trading systems found that the game-theoretic approach can effectively improve the performance of blockchain-based energy trading systems.These studies all provide evidence that the proposed incentive mechanism based on Stackelberg game can protect the interests of blockchain users and miners, and improve the security and stability of the blockchain-based energy IoT system.

CONCLUSION
In this paper, the Stackelberg game is used to coordinate the needs of blockchain users and miners.Blockchain users can upload data to the DAG blockchain by paying a fee to blockchain miners.Miners can gain revenue by charging transaction fees.Through the game, on the one hand, the revenue of the whole blockchain miners can be guaranteed, and on the other hand, the response time demand of blockchain users can be guaranteed.The numerical results not only verify the model feasibility, but also show that when there are many blockchain miners, the model performance is fine, but when the number of miners reaches a certain value, there will be unobvious growth.Furthermore, the wireless energy IoT environment can be confirmed that it will also create a certain impact on the game model.The simulation results also show that with an increase in the number of miners, the benefit function of blockchain users and miners will also increase.This is because more miners can process more transactions per unit time.This can reduce verification delay, improve blockchain users' satisfaction, and an increase in the transaction demand.For blockchain miners, although the transaction price is falling, more transactions in the system can also ensure that miners gain decent revenue.Overall, the results of this study show that the proposed incentive scheme based on the Stackelberg game model can effectively protect the interests of blockchain users and miners, and improve the security and stability of the blockchain-based energy IoT system.This research has several limitations.First, it only focuses on the game model between blockchain users and miners, and does not consider the impact of other factors on the system performance.Second, the simulation parameters are only applied in the energy IoT environment.There is no discussion on the application of the proposed model in other scenarios.Third, the game model in this paper only considers the response time requirements of blockchain users, and does not consider the resource utilization efficiency of blockchain miners.To further improve the system performance, there is still a lot of work to be done in the future.First, the game model should be extended to consider the resource utilization efficiency of blockchain miners.Second, the game model should consider the impact of other factors on system performance such as network latency, transaction broadcast delay, etc. Third, the application of the proposed model should be further extended to other scenarios.Finally, additional research should be done to explore other incentive mechanisms for blockchain networks.

doi: 10 .
5829/ije.2023.36.08b.07The satisfaction function of blockchain users () iThe verification delay of the transaction under high load.Theweight factor of the response time function, cThe computing and storage cost in each transaction l L A convex function with respect to  ()

1 ,
..., c NN = represents the set of miner nodes.The number of blockchain users within the coverage area of each miner follows Poisson distribution, and the transaction arrival rate of users is , i iN   .Moreover, each user has an independent satisfaction function whose value is related to its own response time needs and the miner's pricing x of the transaction.In the blockchain- based energy IoT, the user's response time () s T  is composed of two parts.The first part is the queuing and service time in the wireless phase ( )

Figure 1 .
Figure 1.Game Model time function, and () i  represents the verification delay of the transaction under high load.It has been calculated previously.It can be known that () i  is a function inversely proportional to the transaction rate i  .Let to first analyze the benefit function of the following blockchain user, especially the verification delay, to obtain the optimal equilibrium point *  and benefit function * l U of the blockchain user.Then, analysis will be made on the optimal equilibrium point * x and benefit function * r U ofthe leading blockchain miner.Finally, in the distributed environment, the optimal solution can be obtained with the help of our proposed iterative update function.Therefore, definition 1 can be obtained based on the above analysis.Definition 1: Let the policy set of blockchain users be miner strategy set excluding.Then, the strategy ( )  of both parties in the previous round must be obtained first.

Proof 1 :Algorithm 1 1 :
For blockchain user, when the transaction price x is fixed, *  makes the user benefit function l U Iterative update algorithm Input: initial value ,, ttt x  J , convergence accuracy  , other parameter values of energy IoT.The number of initialization iterations =0 t ; the flag bit flag=flase, the initial value of t

Figure 2 .
Figure 2. Update Process of Transaction Price Strategy with the Number of Iterations

Figure 3 .
Figure 3. Update process of demand strategy for transaction arrival rate with the number of iterations

Figure 4 .
Figure 4. Update Process of Transaction Verification Delay with the Number of Iterations

Figure 5 .
Figure 5. Benefit Function of Blockchain Users

Figure 6 .
Figure 6.Benefit Function of Blockchain Miners The research is supported by: Basic and Advanced Research Projects of CSTC (No. cstc2019jcyj-zdxmX0008); the Science and Technology Research Program of Chongqing Municipal Education Commission (No. KJZD-K201900605); The project of Chongqing big data application and Development Administration Bureau (No.22-30);The project of Housing and Urban-rural Development Commission of Chongqing Municipality (No.2021-0-104).

TABLE 1 .
Simulation Parameters of the Game Model