Abstract
Blockchain technology develops rapidly, which has a broad application prospect in solving security problem of the Internet of things (IoT). However, IoT devices with limited computing resources cannot afford high computing cost of blockchain mining. To solve this problem, edge computing is introduced to improve resource allocation efficiency in trusted IoT network based on blockchain. Therefore, IoT devices can choose to offload tasks to edge servers or local collaborative mining devices. Moreover, to maximize system revenue, a two-stage auction strategy is put forward to reasonably allocate computing resources in blockchain network. In the first stage of auction strategy, computing tasks can be offloaded to edge server, and the second stage realizes resource allocation of collaborative mining devices to utilize idle computing resource adequately. Simulation results show that the proposed strategy performs better than linear search algorithm in terms of effectiveness and rationality.
Access provided by Autonomous University of Puebla. Download conference paper PDF
Similar content being viewed by others
Keywords
1 Introduction
First proposed by Satoshi in 2009, blockchain has attracted attention from both academia and industry [1]. Blockchain is a distributed database replicated and shared among members of network. When transaction is created, blockchain node verify transaction safely and transparently through the mining process. Then, transactions are added into chains, where links between blocks and their contents are cryptographically protected and cannot be forged [2]. Its features include security, transparency, distribution, tamper-proof, traceability, etc.
However, the development of blockchain in IoT devices (Electricity, transportation, logistics, etc.) is hindered by a major challenge brought by proof-of-work (PoW) process [3]. The main obstacle is that mobile devices with limited energy fall short to afford high computing resources of mining process. Some researches adopts cloud computing to address this problem. A resource allocation mechanism had been proposed to offload mining tasks to cloud server in [4]. However, it is not efficient due to high latency. Therefore, edge computing is a promising technology. In [5], author proposed a method to offload the task to edge server to decrease delay, but resources of idle devices in network are wasted. Idle devices in network can share computing resources with miners to assist in mining, then they can obtain rewards according to their contribution [6]. To improve resource allocation efficiency and utilize idle computing resource in blockchain network, a resource allocation mechanism is proposed in this paper where mining task can be offloaded to both edge server and local collaborative mining devices.
Compared with traditional resources allocation, innovations of our work lie in offloading of devices mining tasks to both edge computing server and co-mining devices, based on our proposed two-stage auction strategy. The main contributions of this paper are summarized as follows:
-
Two offloading modes are proposed in the resource allocation mechanism based on edge computing. Miners can offload their mining tasks to non-mining devices or edge server, which takes advantage of idle resources within blockchain network and reduces load on edge server.
-
A two-stage auction strategy is proposed to optimize system revenue. The resource allocation for offloading computing tasks to edge server is implemented in the first stage, and the second stage realizes resource allocation of offloading tasks to collaborative mining equipment.
-
Simulation is conducted to evaluate key performance parameters including number of devices, reward factors, number of transactions and so on. And simulation results show that the proposed strategy performs better than linear search algorithm.
The rest of this paper is organized as follows: Sect. 2 reviews the system model. Section 3 presents the resource allocation strategy. The evaluation function is presented in Sect. 4. Section 5 analyzes experimental results and corresponding discussions. Section 6 presents conclusions and future work.
2 System Model
2.1 Network Model
As shown in Fig. 1, we consider a scenario where edge computing server (ES) provides resources for devices with insufficient computing resource to support blockchain services. There are \( N = \{ 1,2, \ldots ,n\} \) devices with certain computing resource under an edge computing server. Due to lack of computing resource of device, they can offload their tasks to edge server to complete consensus process. In this paper, we define the computing resource that devices need to obtain from the edge server as \( d = \{ d_{1} , \ldots ,d_{i} , \ldots ,d_{n} \} \), and auction price of device is \( b = \{ b_{1} ,b_{2} , \ldots ,b_{n} \} \). \( X = \{ x_{1} ,x_{2} , \ldots ,x_{n} \} \), \( x_{i} \in \{ 0,1\} \) is used to indicate whether edge server allocates computing resources to device. \( {\text{P}}\text{ = }\left\{ {p_{1} ,p_{2} , \ldots ,p_{n} } \right\} \) denotes actual transaction price of computing resources.
In order to maintain the stability of blockchain network, a s-type utility function is used to describe benefits of blockchain network as Eq. (1) shows. With the increasing of computing resources, devices can get more rewards. Therefore, as more and more devices participate in mining process, blockchain network will also be safer and more stable.
where \( d_{N} = \sum\nolimits_{i \in N} {d_{i} x_{i} } \) is the sum of computing resources, and \( \mu ,\,\nu \) are positive parameters. It’s a slowing down of the utility function, and it’s going to go to 1.
2.2 Mining Mechanism Supported by Edge Server
Given \( x_{i} \), \( d_{i} \) and \( g_{i} \), device \( i's \) hash capability \( \gamma_{i} \) is represented as Eq. (2).
where \( \sum\nolimits_{i \in N} {\gamma_{i} = 1} \) and \( \alpha \) is an exponential parameter of hash power function. \( g_{i} \) is defined as the computing resource of each device. \( \gamma_{i} (d,x) \) is hash power function with parameter is set as \( \alpha = 1.2 \) in the rest of this section [7].
In mining competition, miners need to be the first to find correct nonce to solve POW problem and propagate the block to reach consensus. The generation of new blocks follows a Poisson process with a constant rate \( 1/\lambda \). Firstly, miners collect unconfirmed transactions represent by \( S = \{ s_{1} ,s_{2} , \ldots ,s_{n} \} \) into their blocks [8]. Secondly, miner \( i \) broadcast its block to blockchain network to reach consensus, The propagation delay is affected by the size of transactions \( s_{i} \). The first miner which reach consensus can get a reward \( R \) composed of a fixed bonus \( T \) and a flexible fee affected by transactions \( s \) and the transaction fee rate \( r \). Thus, miner \( i's \) expected reward \( R_{i} \) is expressed by Eq. (3).
Through mining competition above, getting rewards involves building blocks and reaching consensus. The probability of building a new block \( P_{i}^{m} \) is equal to miner \( i's \) hash power. However, the miner may even lose the tournament if its new block does not achieve consensus as first. This kind of mined block that cannot be added on to the blockchain is called orphaned block [8]. Moreover, the block containing larger size of transactions has higher chance becoming orphaned. Here, we assume that miner \( i's \) block propagation time \( \tau_{i} \) is linear to the size of transactions in its block, i.e., \( \tau_{i} = \xi s_{i} \).\( \xi \) is a constant that reflects the impact of \( s_{i} \) on \( \tau_{i} \). Since the arrival of new blocks follows a Poisson distribution, miner \( i's \) orphaning probability can be approximated by \( P_{i}^{o} = 1 - e^{{ - \frac{1}{\lambda }\tau_{i} }} \) [9]. After substituting \( \tau_{i} \), \( P_{i} \) can be calculated as follows.
According to above mechanism, to maximize utility of system, an optimal function can be represented as Eq. (5)
where \( {\text{Ecs}} \) refers to cost of unit computing resources of edge computing server, \( cs_{i} \) refers to cost of device \( i's \) computing resources. Assume that computing resources of edge computing server is C. Then total computing resources that all devices can obtain from edge server should be less than C.
3 Resource Allocation Strategy
In this section, in order to solve proposed optimization problem (maximizing system benefits), a two-stage resource auction strategy is designed as Fig. 2 shows. In the first stage, VCG auction is used to realize resource allocation between edge servers and devices. In the second stage, vickrey auction is used to realize allocation between miner and sharer. In addition, we also prove the rationality and authenticity of strategy.
3.1 Allocation Between Edge Server and Devices Based on VCC Auction
In the first stage of auction, VCG auction is adopted. Device \( i \) first sent \( d_{i} \) and offer \( b_{i} \) to edge computing server. After receiving the bids from all devices, edge computing servers would select winner, allocate corresponding computing resources and determine actual transaction price according to VCG auction rules.
Thus, devices in blockchain network can be divided into two categories. As winner of the first auction, such devices can obtain computing resources from edge server, and act as miners in blockchain network. In addition, such devices also act as buyers in the second stage of Vickrey auction. Other devices are failed devices in the first phase of auction, which do not have enough computing resources to solve PoW problem, so they can only serve as computing resource sharing devices in blockchain network. We define \( x_{i} \in \left\{ {0,1} \right\} \), when \( x_{i} = 1 \), device \( i \) is a miner, \( x_{i} = 0 \) means device \( i \) is a sharer.
3.2 Allocation Between Miners and Sharers Based on Vickrey Auttion
In particular, for buyer \( j \), we calculate and get a composition of the agreed-price matrix \( v_{j}^{i} \). Therefore auction bidding price in the second stage can be described by means of matrix Η.
Two problems need to be solved in the second stage of auction. The first is how to match sellers and buyers. To solve this problem, we adopt the second price matching mechanism according to the rules of Eq. (6).
where \( p_{j}^{2nd} \) is final transaction price of device \( j \).\( \nu_{j}^{i} \) is the agreed price where device \( j \) is in resource sharer set \( N\backslash W \) and device \( i \) is in miner set W.
As for the second problem is how to determine actual transaction price between miner and sharer. \( \delta \in (0,1) \) is defined. we will determine price of device resource interaction according to the rule of Eq. (8).
where \( \delta \) is the weight of pricing process, which is decided through negotiation between seller and buyer.
4 Evaluation Function in a Two-Stage Auction
In this section, in order to assess two stage auction strategy reasonably on the resource allocation strategy in blockchain network based on edge computing, we establish the profit function of edge service provider, miner and sharer, it provides a basis for simulation to verify that strategy is reasonable, flexible, and effective.
Firstly, for resource-sharing device \( j \in N\backslash W \) in the blockchain network, the cost paid by device in two-stage auction process is the cost of selling its computing resources in the second-stage auction process.
The income obtained by resource-sharing device j in two-stage auction is obtained by assisting some mining devices in the second stage auction
So device \( j's \) net income is (11).
Then for miners \( i \in W \), its costs in the process of two stage auction can be divided into two parts: payment of purchasing computing resource from edge computing server in the first stage of auction, as well as costs for collaborative mining resources sharing devices in the second stage of auction.
Income of miner in two-stage auction is expected reward for participating in mining process, and miner’s income is Eq. (13)
Finally, for edge computing service provider, the cost obtained in two-stage auction is operating cost of edge server for selling edge computing resources:
Profit of edge computing server is paid by miners for gaining computing resource.
Therefore, edge computing service provider gains a net profit in two-stage auction process as follows:
Above all, the overall income of whole system can be calculated as follows.
5 Experiment Results and Performance Analysis
In this chapter, the two-stage auction strategy is simulated to verify the effectiveness and rationality of the two-stage auction strategy, and is compared with linear search algorithm mentioned above. Simulation result proves that the strategy proposed has better system benefits.
We first analyze the relationship between number of auction winners (i.e., miner) and number of network devices under different amount of computing resource of edge server. In Fig. 3, as the amount of devices increases, the number of winners grows at a gradually slowing rate, and then converges to a stable value. At same time, we find that the stable value is determined by computing resource provided by edge server.
As shown in Fig. 4, with the increasing of packaging transaction in different number of devices, the system revenue will first increase and then gradually decline after reaching maximum value. Reason is that as transaction rises, the propagation delay will also increase. Hence a larger probability of generating isolated blocks and reducing the system revenue will rise.
In Fig. 5, we compared the relationship between buyer’s bidding price and trading price in the first stage of auction when there are 30 edge devices. The encapsulation information of block is in optimal area value as shown in Fig. 5 and other fixed parameters are complied with Table 1. As can be seen from Fig. 5, due to the adoption of VCG auction strategy, the final price of buyers is generally lower than bidding price, thus avoiding buyers from being cheated in auction process.
In addition, we also compared our proposed two-stage auction algorithm with existing linear search algorithm. The results are shown in Fig. 6, our proposed two-stage auction strategy has better performance than existing strategy in improving the revenue of system.
6 Conclusion and Future Work
In this paper, we propose a resource allocation mechanism for blockchain network based on edge computing to solve the PoW problem, where blockchain is used to solve the security problem of IoT. In order to maximize the system revenue, a two-stage auction strategy is proposed. Offloading computing tasks to edge server is implemented in the first stage, and the second stage realizes resource allocation of collaborative mining devices. Then, in simulation, we studied the effects of various parameters such as number of devices, transaction and reward factor on policy performance. Moreover, the performance of our mechanism is compared with linear search method, the simulation results show that under our proposed mechanism, system can get better benefits. In the future, we will consider the different requirements of the devices.
References
Fakhri, D., Mutijarsa, K.: Secure IoT communication using blockchain technology. In: 2018 International Symposium on Electronics and Smart Devices (ISESD), Bandung, pp. 1–6 (2018)
Sun, G., et al.: Research on public opinion propagation model in social network based on blockchain. Comput. Mater. Continua 60(3), 1015–1027 (2019)
Deng, Z., Ren, Y., Liu, Y., Yin, X., Shen, Z., Kim, H.-J.: Blockchain-based trusted electronic records preservation in cloud storage. Comput. Mater. Continua 58(1), 135–151 (2019)
Jiang, X., Liu, M., Yang, C., Liu, Y., Wang, R.: A blockchain-based authentication protocol for WLAN mesh security access. Comput. Mater. Continua 58(1), 45–59 (2019)
Samaniego, M., Deters, R.: Blockchain as a service for IoT, pp. 433–436, December 2016
Liu, M., Yu, F.R., Teng, Y., Leung, V.C.M., Song, M.: Computation offloading and content caching in wireless blockchain networks with mobile edge computing. IEEE Trans. Veh. Technol. 67(11), 11008–11021 (2018)
Jiao, Y., Wang, P., Niyato, D., Xiong, Z.: Social welfare maximization auction in edge computing resource allocation for mobile blockchain, pp. 1–6, May 2018
Qin, R., Yuan, Y., Wang, F.: Research on the selection strategies of blockchain mining pools. IEEE Trans. Comput. Soc. Syst. 5(3), 748–757 (2018)
Qin, R., Yuan, Y., Wang, S., Wang, F.: Economic issues in bitcoin mining and blockchain research. In: 2018 IEEE Intelligent Vehicles Symposium (IV), pp. 268–273, June 2018
Acknowledgment
This work is supported by the Science and Technology Project of State Grid Corporation of China: Security Protection Technology of Embedded Components and Control Units in Power System Terminal (Grant No. 2019GW—12).
Author information
Authors and Affiliations
Corresponding author
Editor information
Editors and Affiliations
Rights and permissions
Copyright information
© 2020 Springer Nature Singapore Pte Ltd.
About this paper
Cite this paper
Gong, W., Yuan, Y., Zhao, D., Zhang, W., Shao, S. (2020). A Resource Allocation Mechanism for Edge-Blockchain. In: Sun, X., Wang, J., Bertino, E. (eds) Artificial Intelligence and Security. ICAIS 2020. Communications in Computer and Information Science, vol 1252. Springer, Singapore. https://doi.org/10.1007/978-981-15-8083-3_58
Download citation
DOI: https://doi.org/10.1007/978-981-15-8083-3_58
Published:
Publisher Name: Springer, Singapore
Print ISBN: 978-981-15-8082-6
Online ISBN: 978-981-15-8083-3
eBook Packages: Computer ScienceComputer Science (R0)