Abstract

Blockchain, as an emerging distributed data management technology, has attracted extensive attention in recent years. In particular, a public blockchain network can ensure data security by addressing computationally intensive cryptographic tasks. Therefore, for node devices, sufficient computing power is required. However, mobile devices with limited computing power do not meet the conditions required by public blockchain network applications (OZEX, CoininAsia, BitRewards, etc.). To copy with the mentioned problems, nodes can offload computing tasks to edge computing services with low latency. This paper mainly focuses on the trade between edge computing providers (ECP) and nodes. We build a computational resource market model based on auction. Meanwhile, we propose two strategies to deal with two methods of offloading to achieve higher system profit. We also prove that the proposed strategy has individual rationality, authenticity under resource constraints. The simulation results have significance for administrators of a public blockchain network to improve the efficiency of computing resource allocation.

1. Introduction

Since blockchain was first proposed in 2008, it has gradually expanded from cryptographic digital currencies to innovative applications in all walks of life [1]. Blockchain implements a decentralized system that can reach a consensus of trust in the digital space. By reaching a consensus among peers in the peer-to-peer (P2P) network, nodes jointly maintain a data chain that connects data blocks in a chain way in a chronological order [2]. Each block on the data chain is protected from tampering and forgery by digital signature and other data verification methods [3].

Proof of work (PoW) is an important consensus mechanism in the public blockchain, which is used to prove that a task is completed and the calculation is paid for [4]. The task is to compute a cryptographic security-related nonce value that leads the hash of the nonce and block data to be less than a given upper limit (depending on the mining difficulty). This calculation process is called mining [5], and the nodes that complete tasks to reach consensus are called miners. Miners broadcast transactions on the network after calculating the nonce value. Other nodes immediately verify the consensus after receiving the block containing transactions. After verification, the block will be added to their local node in the chain of block maintenance [4]. Only data which is packaged by the node that calculates the nonce value fastest can be added to the blockchain. In return, the miners can receive a reward as an incentive of mining. The reward consists of a fixed bonus and a variable transaction fee [6].

Unfortunately, solving the PoW puzzle in public blockchain requires sustained high computing power that mobile devices cannot afford [7]. In order to alleviate the problem of insufficient computing power, consensus nodes can offload their mining tasks to edge computing services, supporting applications based on the public blockchain [8]. Edge computing closer to data source is a comprehensive platform that provides network, computing, and storage. It enables data storage and computing power to be deployed closer to the edge of the user, thereby reducing network latency. Edge computing services can support more consensus nodes to mine tasks, which will significantly improve the robustness and security of the public blockchain network, further attracting more developers to join to promote the construction of public blockchain.

Further, edge computing matches the distributed model of blockchain on networking, computing, and storage. On the one hand, when blockchain nodes are deployed in edge node devices, edge computing services provide computing resources and storage capacity to a large number of scattered nodes in the blockchain. To copy with the problem of delay transmission in the case of coexistence of a large number of nodes, edge computing with low latency is a good response to the application demands of blockchain on the edge side. On the other hand, blockchain provides a trusted and secure environment for edge services, which ensure the integrity and authenticity of storage, achieving the collaborative management of resources among multiple subjects.

In this paper, we divide the nodes into full nodes and light nodes in a public blockchain network. Full nodal participation in the consensus process, i.e., miners, light nodes do not participate in the consensus process, in spite of can be rewarded by performing a portion of the computing tasks for full nodes for collaborative mining [9]. We also call light nodes “sharer.” We consider the trading between the edge compute provider (ECP) and the full node as well as the trading between the full node and the light node. From a system perspective, our goal is to maximize the social welfare of the public blockchain networks. Social welfare can be understood as system efficiency in [10]. In order to achieve the goal, we propose an edge computing resource market model based on auction for a public blockchain network. In addition, we designed an individual and truthful computing resource allocation mechanism.

The specific contributions of this paper are summarized as follows: (i)In the proposed edge computing resource market model, we consider the competitive relationship between miners in the public blockchain and maximize social welfare under appropriate network effect parameters(ii)Two offloading modes are proposed in a public blockchain network based on edge computing. Miners can offload their mining tasks to ECP or idle nodes, which takes advantage of idle resources in a network and reduces load on an edge server(iii)Two auction algorithms were used to improve network efficiency. The trade between ECP and miners was conducted through the Vickrey-Clarke-Groves (VCG) auction. The trade between miners and sharers was realized through Continuous Double Auction (CDA). Algorithms are designed to meet resource constraints, individual rationality, and authenticity

There have been many excellent works studying resource allocation problems among the edge providers and miners in a blockchain network. In [11], authors study the interactions among the cloud/edge providers and miners in blockchain using a multileader multifollower game-theoretic approach, in order to support proof-of-work-based blockchain application. In [12], the authors formulate resource allocation between ECPs and computationally constrained devices as a double auction game. Meanwhile, the experience-weighted attraction (EWA) algorithm is introduced to reach Nash equilibrium. The authors in [13] proposed a novel edge computing offloading framework, which applies decentralized resource management strategy based on auction to perform resource allocation to ECPs. In order to intelligently manage decentralized applications in a blockchain network, Edgence (EDGe + intelligENCE) is proposed by [14] to realize self-governing of the edge devices. In [15], dynamic resource allocation by combinatorial auction is mainly concentrated and the CA-PROVISION algorithm is used for providing pricing strategies. In [16], authors present a two-layer computation offloading paradigm that includes an edge computing provider (ECP) and a cloud computing provider (CCP) to jointly maximize the profits of each service provider and the payoffs of individual miners. In [17], a new model-free deep reinforcement learning-based online computation offloading approach was proposed for blockchain-empowered mobile edge computing in which both mining tasks and data processing tasks are considered. In [18], the authors introduced a broker to manage and adjust the trading market. Then, an iterative double-sided auction scheme was proposed for computing resource trading, where the broker solves an allocation problem to achieve the maximum social welfare meanwhile protecting the privacies of the buyers and the sellers. However, the above papers do not make good use of idle computing resources in the network. In this article, we consider the existence of competition among miners in the computing resource market model and propose two offloading models. Our model supports miners to offload tasks to idle nodes, which improves the utilization of computing resources in the network and reduces the load on edge servers. Further, on the basis of the above-mentioned papers, this paper realizes the optimal resource allocation of the public blockchain network through auction competition between miners and ECP.

3. System Model

3.1. Edge Computing Resources Trade Market Model

As shown in Figure 1, we propose a resources trade market model. There are two types of nodes: full nodes and light nodes in the public blockchain network with PoW as the consensus strategy. We consider an offload model where the full node could choose to offload the mining calculation task to ECP or to a light node for collaborative mining. In the proposed market model, auction strategy is used to guide trading. The miners submit their resource demands and corresponding bids . After receiving miner’s demands and bids, ECP uses different strategies to determine win miners , , and service prices according to different ways of offloading. In the case of task offloaded to edge sever, ECP uses the VCG auction strategy; in the case of task offloaded to light nodes, ECP uses the CDA strategy. This will be covered in detail in Section 3. To be clear, means that miner wins the competition and can be allocated to resources at price , while means that no resources are allocated and .

3.2. Mining Mechanism Supported by Edge Computing

The efficiency of blockchain is largely determined by network computing power, so how to ensure the availability of computing resources and the participation of devices will be the driving factors. Chang et al. [19] have discussed the incentive mechanism for edge computing-based blockchain in detail, so the focus of this chapter is on the mining mechanism. In order to balance market prices, optimize resource allocation, and minimize marginal loss, auction theory is applied to the computational resource allocation of the edge blockchain.

In the article, we assume that both the miner and ESP are rational and will bid the computational resources according to their actual needs. Device ’s hash capability is represented as where , is the computational resource unit required by device , and is an exponential parameter of hash power function [20].

In mining competition, miners need to be the first to find the correct nonce to solve the PoW problem and broadcast the block to reach consensus. The process of generating the new block can be described as a Poisson process with intensity [21]. Firstly, miners collect unconfirmed transactions represent by into their blocks. Secondly, miner broadcast its block to a blockchain network to reach consensus. The broadcast delay is affected by the size of transactions . Miner ’s expected reward consists of a fixed bonus and a variable transaction fee affected by . can be expressed as equation (2), where is the probability that miner reaches consensus and gets rewards.

Through the above mining competition, miners will only be rewarded if they succeed in creating blocks and reaching consensus. However, in the block broadcast process, the block that encapsulates more transactions has a higher latency. So, it may not reach a consensus first because of the high broadcast latency. It has a higher latency that the block encapsulates more transactions. This type of block is called an orphaned block. The miner ’s block broadcast latency is linear to the size of the encapsulated transactions, i.e., , ( is a constant) [22]. As mentioned earlier, the generation process of a block is a Poisson process with intensity , so miner ’s orphaning probability can be described as . Furthermore, the probability that miners will be rewarded can be calculated as follows:

4. Resource Allocation Based on Auction

In this part, we mainly introduce the auction strategy that the system executes when the computing task is offloaded to ECP or light nodes. Regarding how to decide which task is offloaded to ECP and which task is offloaded to light nodes, we have discussed in more detail in the previous study [23]. To rephrase briefly, Lyapunov theory and proposed deviation update decision algorithm (DUDA) are used to solve computation offloading decision-making and offloading update order-making.

4.1. Task Are Offloaded to ECP

When the miners’ tasks were offloaded to ECP, the VCG auction strategy was executed to determine winners and trade prices. Assume that is the unit cost of computing services provided by ECP. Moreover, in this offloading scenario, the social welfare of a network is the sum of all the miners’ rewards minus all the ECP’s costs. Therefore, maximizing social welfare can be described as the following optimization problem:

where is the constraint that needs to be met, and is the most computing resource unit that ECP can afford.

VCG auction is a method of distribution of goods with the optimization goal of maximizing social welfare. It uses the marginal damage caused by bidders to others as the bidding pricing rule. Therefore, VCG ensures that the best strategy for each bidder is to bid according to actual needs and value.

First, consider ECP auctioning a set of computing resources . Buyers can declare a set of bids , and bidders are sealed (only visible to the auction system), so they cannot see other people’s bids at any time. After all bids are completed, the auction will close.

Then, the auction system considers all possible bid combinations and reserves the bid combination that maximizes the total amount of bids. It should be noted that the price they pay is not the price they originally bid, but the marginal damage they cause to other bidders (at most as high as the original bid).

At the end of the auction, if the agent is completely rational and there is no collusion, we can assume that the willingness to pay has been truthfully reported, because each participant will only be accused of marginal damage to other bidders.

We solved this integer programming problem through a VCG auction using the following algorithm: first, determine the list of winning miners and then determine the final trade price based on marginal damage [24].

Input: ;
Output: ;
 1.    For each
 2.    ;;
 3.    End for
 4.    ;;;;
 5.    While &&;
 6.    ;
 7.    ;;;
 8.    
 9.    End while
 10.   For each ;
 11.   ;;;
 12.   ;;;;
 13.   While &&;
 14.   ;
 15.   ;;;
 16.   
 17.   End while
 18.   
 19.   End for
4.2. Task Are Offloaded to Light Nodes

In our scenario, there are some light nodes (sharers) in the blockchain network that have computing resources but do not participate in mining; they only help the full nodes (miners) perform computing tasks. When the miners’ tasks were offloaded to light nodes, the Continuous Double Auction (CDA) strategy was executed to determine winners and trade price [25].

In the CDA strategy, the miner’s (buyer) resource demand is , and corresponding bids are , assuming the trade price for the buyer is . The sharers (sellers) will also bid for the computing resource as. Let us define the seller’s trade price as . ECP acts as an auctioneer, and his income is that the seller’s trade price subtracted from the buyer’s.

Then, we discuss the validity of the CDA algorithm. Similar to Zhang et al. [26], we try to prove the validity from the following: (1)Individual rationality: both sellers and buyers need to make a profit(2)Resource constraints: if both seller and buyer agree to trade, equations (7) and (8) need to be met(3)Truthful: the seller ’s profit is defined as , and the buyer ’s profit is defined as . In the CDA process, the highest profits occur when participants compete based on the true price of the resource. In other words, the constraints of equations (11) and (12) have to be satisfied:

In the process of CDA in this paper, we set and used equation (13) to determine the trade price, with .

Input: ;;;
Output: matching relationship ; trading price
1. Sort bids of buyers with decreasing value.
2. Sort bids of sellers with increasing value.
3. For each ;
4. If then ;
5. Output , ;
6. End for

5. Experiment Results and Analysis

In this chapter, the auction strategy we proposed is simulated to verify the effectiveness and rationality. Simulation result proves that the strategy proposed has better system profits.

According to Figure 2, the value of reward factor also affects the system’s profits. It can be clearly seen that, with increasing of the reward factor in the number of different devices, the system’s profits have increased significantly. This is because the grown of reward factor incentivizes devices to rent computing resources from edge servers at a higher cost, leading to better expected profits.

The profits of different network roles are shown in Figure 3. Under the same circumstances, device-sharing computing resources have lower profits. Devices acting as a miner can get higher profits. Meanwhile, edge server provider can also get higher profits. It should be noted that as the number of devices increases, the profits to all roles in the system increased.

In Figure 4, we analyze the gap between demands and supplies in different cases. It is obvious that as the number of iterations increases, the gap gradually approaches zero. This shows that the strategy we proposed can meet the demand dynamically.

We compared the proposed strategy with mode A (offloading all tasks to ECP) and mode B (offloading all tasks to adjacent idle devices) in Figure 5. In (a), the convergence performance of the three models is compared. The system profit increases sharply in the first 20 iterations and then reaches a stable state, indicating that our mechanism has a faster convergence than the other two modes. This is because our model can offload mining tasks to idle devices, improving the utilization of computing resources. Moreover, because there are offloading decisions to be made, the plateau is reached relatively late. In (b), we compare the system profit of the three modes. With the increase of time, the system profit of all three modes will increase, but our strategy has higher returns. Offloading all mining tasks to idle devices causes longer delays, so mode B (offloading all tasks to adjacent idle devices) has the lowest return. In (c), we compare the average delay of the three modes. Since the miners who choose mode B are closer to the provider, the average delay is lower. Taken as a whole, our strategy performs better.

6. Conclusions

In this paper, we offload computing tasks to ECP or light nodes to alleviate the PoW problem in a public blockchain network. When miners offload tasks to the ECP, the VCG auction strategy is adopted to maximize the social welfare of resource allocation; when tasks are offloaded to light nodes, the CDA strategy is adopted to realize efficient allocation of computing resources. The authenticity, individual rationality, and effectiveness of the strategy are also proved in this paper. The simulation results prove that the proposed strategy can improve the profits of the system, as well as providing reference significance for the administrators of the public blockchain network.

Data Availability

Data are available upon request.

Conflicts of Interest

The authors declare that there is no conflict of interest regarding the publication of this paper.

Acknowledgments

This work is supported by the National Key R&D Program of China (2018YFB1402704).