Double Auction-Based Two-Level Resource Allocation Mechanism for Computation Offloading in Mobile Blockchain Application

It is increasingly popular that platforms integrate various services into mobile applications due to the high usage and convenience of mobile devices, many of which demand high computational capacities and energy, such as cryptocurrency services based on blockchain. However, it is hard for mobile devices to run these services due to the limited storage and computational capacity. In this paper, the problem of computation offloading that requires sufficient computing resources with high utilization in large-scale users and multiprovider MEC system was investigated. A mechanism based on the combinatorial double auction, G-TRAP, is proposed in this paper to solve the above problem. In the mechanism, resources are provided both in the cloud and at the edge of the network. Mobile users compete for these resources to offload computing tasks by the rule that the edge-level resources will be allocated at first while cloud-level resources could be the supplement for the edge level. Given that the proof-of-work (PoW), the core issue of blockchain application, is resource-expensive to implement in mobile devices, we provide resource allocation service to users of blockchain application as experimental subjects. Simulation results show that the proposed mechanism for serving large-scale users in a short execution time outperforms two existing algorithms in terms of social utility and resource utilization. Consequently, our proposed system can effectively solve the intensive computation offloading problem of mobile blockchain applications.


Introduction
With the thriving of mobile communication technology and the popularity of mobile devices, the platform services have been expanded on mobile terminals. However, many services are restricted on mobile devices owing to complex computing or too high latency requirements, e.g., autonomous driving services and mobile blockchain services [1]. Recently, blockchain has been continuously combined with many applications in various fields [2], such as e-commerce, the Internet of things [3], and supply chain. ence, various research institutions attach great importance to this technology and publish academic achievements related to blockchain.
Technically, the essence of blockchain is a distributed ledger based on asymmetric encryption algorithms, and it consists of a combination of blocks linked by hash functions. To confirm and secure the consistency and validity of transactions in the blockchain network, the participants need to complete a computation-intensive task [4], i.e., the proof-of-work (PoW) puzzle [5], which is characterized by the need of consuming significant central processing unit (CPU) resources. According to [6], the core of the PoW process is that the consensus node computes the PoW solution to the cryptographic puzzle, which is formed based on the root hash value of the Markle tree calculated by a newly generated transaction. e Markle tree will be deeper and the calculation will become more complicated when the number of transactions generated by blockchain increases, which sets an extremely high demand for computing capability of the mobile devices. Although the CPU of mobile devices has developed powerfully, it still can hardly meet the demand of many computing tasks of applications in a short time. us, blockchain applications cannot be widely used in mobile devices, which limits mobile blockchain applications' development.
Mobile edge computing (MEC) [7] provides an exemplary method for solving such problems. To support the offloading of computation-intensive tasks, mobile edge computing can provide mobile users with computing and storage resources to solve limitations related to the hardware [8,9]. In particular, it overcomes the drawbacks of mobile cloud computing, which could cause long latency and backhaul bandwidth congestion [10][11][12]. Because the computing capacity and appropriate incentive policies are of great importance to users of mobile blockchain applications, it is vital to decide how to offload the computing tasks of the PoW puzzle to the mobile edge computing in the mobile blockchain system.
Given that the resource allocation mechanism involves an incentive policy to allow participants to maintain longterm resource transactions independently, the auction mechanism can be applied in resource allocation as a market-incentive mechanism [13]. Furthermore, considering the characteristics of the PoW consensus mechanism [5], i.e., low latency and rewarding users for broadcasting a new block successfully, users need computing resources to accomplish more computing tasks in a short time to have more chances for obtaining rewards. Furthermore, the edge computing service providers hope to get revenues by selling resources. Consequently, the auction model can provide a fair competition market for resource trading mentioned above.
ere have been several works that focus on using auctions or other economic methods to solve the computation offloading problem of the mobile blockchain system. Jiao et al. first investigated resource management and pricing in the mobile blockchain with an auction model [14]. In [14], the resource allocation problem is modeled to maximize the social welfare of edge computing service providers (ESPs) considering the competition between miners and the utility of blockchain network. In [15], Xiong et al. adopted the twostage Stackelberg game to maximize both the profits of the ESP and the individual utilities of miners. Li et al. designed a long-term auction-based incentive mechanism POEM+ in [16], where the edge servers were encouraged to share their resources to expedite the PoW process execution of mobile devices with an approximation ratio. However, the deficiency of the aforementioned works is that no algorithm or simulation addressed the scenario of large-scale user groups for the mobile blockchain system. e lack of edge-level resources has also posed a significant obstacle in computation offloading. In response, Bahreini et al. [17] studied resource allocation and pricing in the two-level edge computing system. ey proposed a mechanism combining features from both positions and combinatorial auctions to meet the competition and heterogeneous demand of virtual machine (VM) instances for mobile users. e proposed allocation mechanism in [17] provides heterogeneous types of resources for multilocation resource selection based on location information, which contributes to solving intensive computation offloading problems. Unfortunately, this work only considered resource transactions between a single provider and mobile application users, without considering that there will be multiple service providers at the same time in the market.
With the above observations, the promotion of mobile blockchain applications is proposed as a research object in this paper. Correspondingly, a two-level combinatorial double auction mechanism that includes two levels of resources is proposed to solve the computation-intensive offloading problem of mobile blockchain applications mentioned above. In the mechanism, the providers who can provide cloud-edge two-level service are called cloud-edge computing service providers (C-ESPs). e C-ESP can schedule cloud-level resources to supplement the edge-level resources through the cloud computing center. Moreover, this mechanism considered that mobile users usually prefer edge-level computing close to applications. e main contributions of this paper are summarized as follows: (i) An allocation mechanism based on the combinatorial double auction is proposed for cloud-edge computing resource allocation. In the mechanism, the computing tasks in generating a new block and broadcasting throughout the whole mobile blockchain network to make consensus can be offloaded to C-ESPs. (ii) Resource allocation and pricing algorithms are proposed to determine winners and final prices, which satisfy the economic attributes of auction truthfulness, individual rationality, budget balance, and computation efficiency. (iii) e proposed mechanism is simulated in various situations. e simulation results show that the proposed mechanism is effective with large-scale user group participation and outperforms in terms of resource utilization.

Related Work
To overcome the resource constraints of mobile devices, the existing works have widely studied resource allocation problem of computation offloading in MEC systems [18] from different fields. In [18], the authors analyzed that the computation offloading is a critical use case regarding the MEC as it can save energy and/or speed up the process of computation from the user perspective. In [19], the authors proposed an adaptive wireless resource allocation strategy of computation offloading service under a three-layered vehicular edge cloud computing framework, which can ensure endurance mileage of electric vehicles when a large number of computation-intensive applications bring colossal energy consumption to the vehicle. To support resource-intensive applications running on the industrial Internet of things (IIOT) devices, the authors in [20] presented a distributed game-theoretic approach to achieving multihop cooperative computing offloading of the IIOT in the edge computing system.

2
Mobile Information Systems Second, many researchers focused on the resource allocation of multiple service providers and multiple user scenarios by applying the double auction model. Moreover, the double auction model is an economic model widely used in resource allocation that encourages buyers and sellers to bid simultaneously to reach a deal by the incentive mechanism. And during the auction, buyers can bid on combined goods, and buyers and sellers choose each other based on bids' details. In [21], Singhal et al. proposed a combinatorial double auction model for resource allocation. Buyers bid for a package of resources and pay for it one time, which can improve resource utilization and resource efficiency allocation. In the [22], the authors proposed a breakeven-based double auction (BDA) and a dynamic pricing-based double auction (DPDA) to determine the matched pairs between IIOT mobile devices (MDs) and edge servers, as well as the pricing mechanisms restricted by the actual situation for higher system efficiency.
ese two algorithms mainly modeled the two-side interaction between MEC servers and IIOT MDs. ey described a double auction framework to address interaction and maximized the system efficiency where IIOP MDs request computing services with claimed bids and servers sell service with a reported price. In [23], the authors further adopted the auction model and proposed a resource allocation mechanism based on combined double auction to allocate VM instances of ESPs to miners by considering group buying. Although this article considers multiservice provider and multiuser scenarios, it lacks the expansion of future intensive task offloading.
Furthermore, a few recent computing offloading studies have brought edge and cloud computing together to support computation-intensive and latency-critical applications. e architecture of MEC can be further extended to serve users in different scenarios. e authors in [24] modeled the dataintensive service as a W-DAG (weight directed acyclic graph) to investigate the task placement problem for supporting data-intensive services with guaranteed QoS, i.e., shorter service delay in a cloud-edge system according to the business logic analysis. In [25], the authors derived a closedform optimal task splitting strategy as a function of the normalized backhaul communication capacity and the normalized cloud computation capacity under the collaboration between cloud computing and edge computing. Fu et al. proposed an economical and flexible framework for IIOT by integrating the function of data preprocessing, storage, and retrieval based on both fog computing and cloud computing [26]. In [27], Chen et al. proposed a multiuser multitask computation offloading framework for a green mobile edge cloud computing system where the dynamics of energy arrivals at the mobile edge cloud and task arrivals at different mobile devices are jointly considered.
With the investigation of these research studies on multiposition resource allocation and the computation offloading in mobile blockchain, a cloud-edge two-level double auction mechanism is proposed for intensive computation offloading scenarios in mobile blockchain applications. e rest of the paper is organized as follows. e system model and problem formulation are described in Section 3. e mechanism is presented in Section 4. Section 5 introduces the simulation setup as well as discusses the simulation results. Finally, the conclusion is given in Section 6.

System Model and Problem Formulation
e considered system provides K types of VM instances from cloud-edge two levels. In the system, users and C-ESPs submit bids to a central auctioneer separately to buy or sell VM instances. When the edge-level computing server cannot satisfy large-scale offloading requests from mobile users, resources are scheduled and supplied for edge computing nodes from cloud-level servers to form a cloud-edge two-level auction market. Moreover, a total revenue optimization problem of the system is formulated by jointly considering the profit of users and C-ESPs. Compared to single-level edge computation offloading, this model meets more needs of multiple users and improves resource utilization.

System Model.
is auction system consists of mobile blockchain networks, computing service providers, and the auctioneer. In our mobile blockchain network, the mobile devices continuously run the consensus protocol to confirm and secure distributed data or information transmission in the background. erefore, mobile devices need to solve the PoW problem that involves calculating a nonce output value that satisfies a given condition. However, it is hard for a mobile user to continuously run such challenging programs that require a large volume of CPU computing resources. It is considered that mobile users could offload the task of solving the PoW problem to nearby cloud-edge computing servers deployed by C-ESPs to get over the computing limitation problem of mobile devices. In particular, C-ESPs announce to the auctioneer services for the supply of VM instances and bid information.
e mobile users submit their resource demands and bid information to the auctioneer. After receiving the demands and bids, the auctioneer selects winners including users and C-ESPs according to the allocation algorithm and matching mobile users and C-ESPs as the allocation matrix X � x ij , the detail of which will be presented in Section 3.2.
As shown in Figure 1, the cloud-edge two-level auction system includes C-ESPs, mobile blockchain application users, and auctioneers. C-ESPs sell VM instances to users, and users purchase the VM instance for completing the mathematical puzzles of PoW in blockchain applications. Assume that VM instances can be differentiated by diverse computing resources, such as memory, CPU capacity, and storage. It is considered that each C-ESP provides multiple VM instances at two levels, edge (l � 1) and cloud (l � 2), where l denotes the location of VM instances. Each user demands a bundle of diverse sorts of instances to complete computing tasks.

Defining Bid Information of Users. C-ESPs and users submit bid information to the auctioneer, and the bid of user
denotes the demand of user i for the instance k, and v user i signifies the reward valuation obtained by users after solving the PoW problem and broadcasting the result in the whole blockchain network.

Calculating Reward Valuation as the Bid of Users.
In the mobile blockchain network, users compete to be the first to solve PoW problem with correct nonce value to receive rewards that are considered the value, v user i , offered by users in this auction system, thence calculating valuation for rewards of all users at first. Assume that the computing power of each VM instance is 1 and each user can successfully purchase required resources. With the allocation x ij and demand d k i , the proportion of the computing capacity of the user i in the whole blockchain network can be represented as follows: According to the reference in [14], the generation of new blocks follows a Poisson distribution process with a constant rate 1/λ throughout the whole blockchain network. Before the tournament, users collect unconfirmed transactions into their blocks. e first mobile user to successfully make the block achieve consensus can get the reward consisted of a fixed reward R and a flexible fee r. e flexible reward is proportionate to the number of transactions s included in the block, and the proportionality coefficient is denoted as r.
us, the potential rewards of user i can be expressed as follows: where P(c i , s) represents the probability where the user i is the first to work out the computing task and generate a new block. However, the user will not be rewarded if the new block cannot reach consensus on the entire network in time, and such blocks are called orphaned blocks [14]. e broadcasting time τ is proportional to the transaction volume contained in a new block, and the proportionality coefficient can be denoted as ξ; then, τ � ξ · s. Moreover, blocks with large transaction volumes require more propagation time, which may lead to high latency and fail to reach consensus, so blocks with a larger transaction size are more likely to become orphaned blocks. e time of generating a new block obeys Poisson distribution, so the orphaning probability can be approximated as follows: e probability that a user creates a new block and rewarded can be described as follows: e potential reward can be rewritten as follows:

Defining Bid Information of C-ESPs.
e bid of C-ESPj is specified as a 3-tuple (q lj . Moreover, q k lj indicates the number of instances provided by C-ESPj from the lth level, p k j denotes the ideal price of instance k determined by C-ESP j, and π j is the basic energy consumption unit for using VM instances provided by C-ESP j. Besides, K sorts of VM instances are distinguished by computing resource configuration in this model, and the weight of each kind of VM instance is defined as ω k . e energy consumption function of VM instances is defined as cos t(ω k ) � ω k · π j based on ω k , which means that the cost of using computation resource will be higher with the higher resource configuration of the VM instance.

Calculating Bids of C-ESPs with Communication
Consumption. e distribution of C-ESPs and users is shown in Figure 2, where the communication transmission between C-ESPs and users comprises the path loss, which is assumed to include in the bid of C-ESPs. Specifically, h ′ is defined as the threshold of the distance between users and C-ESPs. When the distance between C-ESPs and users exceeds h ′ , the bid will increase in proportion based upon the excess. For C-ESP j, the price of instance k charged for user i can be expressed by where h ij denotes the distance between user i and C-ESP j, and we calculate the average prices of all users. erefore, the bid of instance k determined by C-ESP j is formulated as

Problem Formulation.
e previous section has described information of C-ESPs and users as the input to the system. is section mainly defines the output of the system, i.e., the results of resource allocation and pricing, and optimizes this allocation problem as much as possible.
e mechanism proposed (detailed in Section 4) in this work is a combinatorial double auction mechanism with resource location information. e rules are as follows: (i) each user can purchase a bundle of VM instances from no more than one C-ESP; (ii) selling VM instances of cloud level will cost more than the edge level due to the consumption caused by the resource scheduling; (iii) moreover, the bids of users and C-ESPs should be processed by the auctioneer separately. Assume that there are M C-ESPs and N users, and their matched results can be denoted as a M × N matrix X, whose elements can be denoted as x ij . e value of x ij can be indicated as follows: According to auction rule (i), the first restriction can be formulated as follows: In addition, the supply of each C-ESP is limited. When allocating VM instances to users, the auctioneer will make sure that the remaining resources of the current C-ESP meet the requirements of the current user. Namely, the total demands of matched users cannot exceed the capacity of C-ESP. e capacity constraint of C-ESPs can be formulated as follows: We define the winner set W containing the user who can successfully match C-ESP based on above two constraints.
Along with the allocation, the auctioneer also calculates the payment of users and C-ESPs. e final charge of user i is denoted as p i that user i actually pays to the provider. p j is employed to denote the payment of C-ESP j as the revenue obtained from matched users for serving. U j and U i represent the utility of C-ESPs and users, respectively, and the utility of the user i is defined as follows: and the utility of the C-ESP j is defined as follows: For C-ESP j, v C− ESP j is the total offer of instances supplied for matched users. c j denotes the cost incurred on the process that C-ESP j provides service to users. As an edge computing service provider, the costs generated by the edgelevel are within its bid considerations while the excess consumption from the cloud level will affect the C-ESP revenue. erefore, we assume that the additional resource expenses will only be brought by operating cloud-level VM instances. y k i represents the number of the instance k purchased by user i from cloud level of C-ESP j. e utility of C-ESP can be rewritten as follows: In this paper, we attach importance to economic efficiency and aim to maximize the total utility of users and C-ESPs. erefore, the allocation of VM instances problem in the proposed mechanism can be formulated as follows: where two constraints mean that the user can match with no more than one C-ESP and the capacity of C-ESPs is limited. is resource allocation problem can be proved as the NPhard problem, which cannot reach the optimal in a limited time. According to [13], it can be simplified to the winner determination problem. Table 1 shows the notation used in this paper.

The Resource Auction Mechanism: Greedy Two-Level Resource Allocation and Pricing (G-TRAP)
In this section, a corresponding auction mechanism is proposed to solve the VM instance allocation and pricing problem. e proposed mechanism, G-TRAP, can be divided into two parts as follows. In the first part, a greedy mechanism is designed to complete VM instances allocation since it is unlikely to find a polynomial-time optimal solution of the allocation problem mentioned in Section 3. Moreover, this allocation mechanism trades resource in the two-level resource system under the consideration of combining location information and weights of VM instances, which can improve resource utilization. e second part is pricing, in which an improved Vickrey-Clarke-Groves (VCG) mechanism [28] is applied to calculate the payments of participants to ensure the truthfulness of the auction.

Allocation
Algorithm. e first algorithm contained in G-TRAP is the allocation algorithm. Given bids of C-ESPs and users, our objective is to maximize the total utility of participants during allocation. e resource allocation is an NP-hard problem, so the greedy algorithm is customized to solve the problem in this work.

Calculating Bid Density and Ranking.
In the first stage, the bids of C-ESPs and users are sorted based on bid densities. Considering that users and C-ESPs prefer to trade in edge-level resources rather than cloud-level resources, we define the size of resources owed by C-ESP j, s j , related to the type and the location of VM instances. e bid density of the C-ESP can be calculated as follows: Similarly, the user's bid density can be expressed as follows: where α l is defined as the preference factor for level l and set to distinguish the weight of resources between cloud level and edge level and v i /v j is the valuation of bidders. en, C-ESPs are sorted in ascending order, and users are sorted in descending order based on the bid density.

Allocating in Order.
In the second stage, users are assigned to the C-ESPs in sorted order. When a user matches a C-ESP, the C-ESP will firstly check whether there are enough resources at the edge level or not. If (1) the bid density of user i is not less than C-ESP j′s and (2) the number of K sorts of instances required by user i does not exceed the remaining resource at the edge level of C-ESP j, C-ESP j and user i will match each other. Suppose only condition (1) is satisfied and the remaining of edge level cannot meet the demands of user i. In this case, C-ESP j will assign cloud-level instances as complements to user i according to the constraints. en, C-ESP j updates the capacity if sufficient resources are available to the current user. Besides, we denote y k i as the number of k th VM instances purchased by user i from the cloud level.
It is explained here that each user can only purchase all needed VM instances from one C-ESP. e user i will continue to match with the next C-ESP ranked behind C-ESP j if the two fail to match. e element x ij of matrix X is marked after matching successfully, and user i is added to the winner set W. e specific details of the allocation are shown in Algorithm 1.

Pricing Schema and Calculating Total Utility.
After matching C-ESPs and users through the allocation algorithm, the payment of users and the revenue of C-ESPs will be calculated separately. We employ the improved VCG price mechanism to pricing. VCG auction always charges the winner the highest bid of losers [28]. In this paper, we define the VCG price vcg p of a user as the product of the size of resources obtained by user i and the biggest bid density among losers: To make sure individual personality and maximize the effectiveness of C-ESP, the final charge price of user i is the maximum value of VCG price, the offer of matched C-ESP, and the compromise price. e compromise price is defined as the average value of the next lower bid density of C-ESP and VCG price. e final payment of users can be expressed as follows: After calculating the charge of users, the payment of C-ESPs can be figured out as follows: e total utility includes the utility of users and C-ESPs. e details of pricing are shown in Algorithm 2.

Properties of G-TRAP.
In the following, it is shown that G-TRAP is actually an incentive mechanism to solve the distribution problem defined above and it satisfies the economic properties include truthfulness, individual rationality, budget balance, and computing efficiency [29]. Definition 1. (truthfulness). An auction is truthful if any participant's utility is maximized for the actual valuation of bidders. Four properties, including monotonicity, criticalness, exactness, and participation, form the sufficiency for a mechanism with truthfulness.

Theorem 1. Algorithm G-TRAP is truthful.
Proof 1. From the allocation algorithm, it can be seen that users are first sorted in descending order according to bid density and join in allocation. erefore, users can improve their ranking by raising the bids or reducing the configuration of purchased resources to make allocation more likely. Accordingly, the winner decision algorithm of our mechanism is monotonous. Secondly, the VCG price is calculated by multiplying the size of resources and the maximum bid density among losers who would win if the winner does not participate in the auction. Obviously, our mechanism is of exactness and participation. erefore, our mechanism is truthful. □ Definition 2. (individual rationality). Individual rationality means that each participant's utility is non-negative, i.e., U i > 0, U j > 0, for ∀i, j ∈ W.

Theorem 2. Algorithm G-TRAP is individually rational.
Proof 2. Charges of users are determined by the largest among VCG price, the offer of matched C-ESP, and the average value of the next lower bid density of C-ESP and VCG price. VCG price is the product of � � s i √ and v max loser / ������� � s max loser √ which is the highest bid density of losers. us, VCG price is generally lower than the user's valuation. As shown in the 6th to the 12th line of pricing algorithm, the value of p i is certainly less than user's valuation, which means that user utility must be non-negative. According to the 5th line of allocation algorithm and the 5th and 8th lines of pricing algorithm, it can be concluded that the return of C-ESP must be greater than its valuation, and individual rationality of C-ESP is also proved.

Numerical Simulation Setup.
In previous research studies on mobile blockchain application computation offloading [14-16, 21, 23], the number of users tested in the simulations did not exceed 900. ere were no tests for a large-scale user group. To build an intensive computation offloading scenario, we expend the number of users gradually increases from 1 to 5000 during the simulation process while keeping the number of C-ESP as 200 and the number of K types of VM instances unchanged. Moreover, the effect of the cloud-edge capacity ratio of the algorithm is also tested based on 5000 users. Note that the simulation results Mobile Information Systems 7 obtained in this section are based on an average over multiple iterations. Two comparing algorithms proposed in existing work [23] are added to evaluate the performance difference between G-TRAP and edge-only computing systems. STGA: this scheme is a combinatorial double auction [23] called step greedy algorithm. Computing tasks will match edge computing providers (only supply edge computing resources) according to the bid size. After matching, the utility in this scheme calculated follows the VCG mechanism. SMGA: compared with the STGA, the only difference is that the smooth greedy algorithm [23] depends on a curve discount function to solve the allocation problem between a group of users and edge computing providers (only supply edge computing resources). e evaluation results show that it performs better than STGA.
In order to test the three algorithms legally, we use the same input file. All data in the figures are obtained by simulation on MATLAB R2019b.

Calculating Rewards of Users in Mobile Blockchain
Network. Firstly, we calculate the rewards of the PoW consensus algorithm, which depends on whether the mobile user broadcasts a block successfully in the mobile blockchain as the bid of each user. According to Section 3.1.2, the reward of successfully adding to the chain is divided into two parts, including fixed bonus R and variable r · s. In the simulation, we set R � 20 and r � 0.04 and assume that the size of block s follows the uniform distribution U(0, 1000). Hence, each end if (xxviii) end while (xxxi) end for (xxx) Output: set of winners W, relation matrix X ALGORITHM 1: G-TRAP: resource allocation algorithm. 8 Mobile Information Systems user who successfully adds a new block in the public chain will gain 20 + 0.04 · s.

Calculating the Bids of C-ESPs Based on the Distribution of the Network.
e network model is assumed to be a topological graph, where the locations of C-ESPs and users are generated randomly. According to the nodes' distribution, we assume that the distance between the user i and C-ESP j, h ij , is randomly generated in the range of [40, 60], and the threshold h ′ is fixed to 50. e bid of C-ESPs that includes communication consumption is averagely estimated based on the ratio of h ij and h ′ .

Setting Related Parameters of Auction.
Assume that there are four types of VM instances demanded by users and the amount of VM instances required is set to obey the uniform distribution of U (1,5). Based on Amazon's Elastic Compute Cloud (EC2) M3 series instances, we consider that these four types of VM instances provided by C-ESPs are defined as medium, large, xlarge, and 2xlarge, each equipped with a combination of three types of resources, including vCPU, memory, and storage. e resources are sold by cloud level and edge level of C-ESP. en, we assume that the number of VM instances for each C-ESP is subject to a uniformly distributed dataset of U (30, 35). e unit price of C-ESP is randomly generated during the range of [ 0.1 · W k − 0.05, 0.1 · W k + 0.05 ] in which W k is the weight corresponding to each VM instance of C-ESP, and 0.1 · W k denotes the basic unit price of k th instance. We assign the weight α l to differentiate instance in edge-level (α 2 ) and cloud-level (α 1 ) and set four combinations of α l which are (α 1 � 0.2, α 2 � 0.8), (α 1 � 0.4, α 2 � 0.6), (α 1 � 0.7, α 2 � 0.3), and (α 1 � 0.9, α 2 � 0.1) to construct sets of VM instances. e basic energy consumption unit π j is set with three different value ranges [1, 1.5 ]) and C-ESPs will pay different resource costs for diverse types of VM instances. e distribution of parameters of VM instances generated in simulations is shown in Table 2.

Setting Cloud-Edge Ratio.
We define a parameter, called cloud-edge capacity ratio, C r , which is the ratio of the capacity for each VM instance at the cloud and the capacity at the edge level. e values of C r are expressed as C r � 1, (6/4), (7/3), (8/2), (9/1).

Impact of Reward Parameters for Successful Broadcasting of Users.
Firstly, we consider the impact of fixed bonus R and the transaction fee r for broadcasting a block on the mechanism. It is observed from Figure 3 that if the blockchain network raises R and r, the total utility and the percentage of winners will be increased nearly in proportion. e reason is that users can obtain more rewards by completing computing tasks as expected and the bids increase correspondingly.

Impact of the Number of Mobile Users N.
We next investigate the effects of user amount on the performance of G-TRAP with different sets of VM instances of C-ESPs. For this purpose, we keep the number of resources provided to users unchanged and increase the number of users continually. And we also compare the performance of G-TRAP against that of STGA and SMGA in [23]. e total utility of G-TRAP is shown in Figure 4(a), which shows that as the number of users increases, the total utility also increases. Moreover, Figure 4(a) shows that the greater relative weight of VM instances of edge level brings more total utility. It is due to the fact that users and C-ESP Mobile Information Systems prefer to trade VM instances of the edge level. As shown in Figure 5(a), the total utility of STGA and STMA is far less than that of G-TRAP since they only provide edge-level resources and offer group buying discounts without applying cloud-level resources. Figure 4(b) shows the percentage of winners with different sets of instances. When the number of users does not exceed 4300, the percentage of winners exceeds 70%, up to 90%, and not less than 55% at worst. It can be considered that G-TLRA performs well in intensive scenarios of computation offloading. Again, the winning ratio is highest with the setting of α 1 � 0.9 and α 2 � 0.1. As shown in Figure 5(b), the winning ratio of G-TRAP is much higher than that of STGA and STMA. In the STGA and STMA, each user can purchase VM instances from one C-ESP, and the resources of edge level are insufficient, which reduces the probability of users successfully obtaining a bundle of VM instances. However, C-ESPs in G-TRAP can serve more users by providing more VM instances from cloud level.
It can be seen from Figure 4(c) that when the number of users increases, the resource utilization of G-TRAP first reaches 1 with the setting of α 1 � 0.9 and α 2 � 0.1. us, G-TRAP performs better with the rise in the weight of edgelevel resources. However, STGA and STMA cannot achieve the full utilization of resources, as shown in Figure 5(c). In STGA and STMA, the provider sells VM instances of the edge level where remaining resources cannot satisfy the demands of resources requested from the user behind. In summary, G-TRAP is more suitable for various scenarios of intensive computation offloading than STGA and STMA. Figure 6, we vary the distance range between users and C-ESPs as [40,70], [40,80], and [40, 90] and then compare with previous results. As expected, the larger communication distance range will lower the percentage of winners and lower the resource usage ratio. is is because that the longer uploading distances of tasks cause more communication loss, and the bids of C-ESPs will increase, which lowers the ranking of several C-ESP and reduces the matching between C-ESPs and users in turn.

Impact of Cloud-Edge Capacity
Ratio. Further, we examine the impact of cloud-edge ratio C r on the performance of G-TRAP. e total number of VM instances of C-ESPs is set to follow the uniform distribution of U (0, 2000), and the number of users is set to 5000; then, we change the value of C r in G-TRAP. Figure 7(a) shows the effects of C r on the execution time of G-TRAP with different sets of VM instances. It can be seen that the execution time of G-TRAP is insensitive to variations in C r and is less than 0.018 seconds, which can    verify that the computing efficiency of G-TRAP is well when serving a large-scale user group. Figure 7(b) shows the impacts of C r on the number of served users. When C r is 1, the value of α 1 and α 2 has little effect on the number of users matched with C-ESP successfully, while the higher C r is, the larger the difference of served user amount with different sets of α 1 and α 2 is. Moreover, the larger difference between α 1 and α 2 brings a greater change in the number of served users. With the increasing of C r , the served user amount of the last two sets increases well, that is(α 1 � 0.7, α 2 � 0.3) and (α 1 � 0.9, α 2 � 0.1), while decreasing in the first two sets. is is because that the total bids of C-ESPs remains unchanged when C r increases, and the total amount of resources raises because of the increase in ratio between α 1 and α 2 . As a result, the bid density of C-ESP decreases so that it matches more users. In a word, increasing the difference between α 1 and α 2 and the value of C r can encourage more users to participate in the auction. Figure 7(c) shows the effects of the total utility of G-TRAP with varying settings of instances. Similarly, the total utility does not change much with different sets of α 1 and α 2 when C r is 1. As C r increases and α 1 is less than 0.5, the bid density of C-ESP increases, which can lead to a reduction in the number of served users and reduce the total utility.

Conclusions
In this paper, an efficient resource allocation with a pricing mechanism, G-TRAP, is proposed to support the offloading of compute-intensive tasks generated by mobile blockchain from mobile devices to the cloud-edge computing system. In this mechanism, the two-level resource allocation system provides users more bidding options, which increases the matching probability between users and C-ESPs. And the improved VCG pricing mechanism guarantees the individual rationality of participants and maximizes the benefits of C-ESPs as much as possible. Moreover, the proposed mechanism is proved to satisfy the economic properties of the auction model by theoretical analysis. e simulated results prove that this mechanism can run with short execution time and the near optimality of resource utilization, which make it a suitable candidate for deployment in current and future mobile blockchain systems and other service applications involving massive computing tasks.
Data Availability e simulation data of our algorithm implementation, which is used to support the findings of this study, are available from the corresponding author upon request.

Conflicts of Interest
e authors declare that there are no conflicts of interest regarding the publication of this paper.