A Novel Computing Power Allocation Algorithm for Blockchain System in Multiple Mining Pools Under Withholding Attack

To overcome the fast-changing block withholding attacks among multiple mining pools composed of miners in the blockchain system, this paper proposes a mining pool computing power allocation (MPPA) algorithm, which significantly improves the revenues of mining pools with block withholding attacks. MPPA first establishes the revenue optimization model of mining pools, which includes current adequate total computing power, the revenues of honest mining, and the revenues of block withholding attacks. Then MPPA calculates the revenue gain generated by block withholding attacks on other mining pools. To adjust the fixed computing power in each iteration, we have the mining pool computing power allocation algorithm with a fixed change of computing power (MPPA_F). To adjust the optimal recovery and attack computing power, we have the mining pool computing power allocation algorithm with an optimal change of computing power (MPPA_O). The simulation results demonstrate that MPPA_F and MPPA_O can find the optimized solutions of power computing allocation for each mining pool and outperform the state-of-arts such as WSFS, ALLC, and ALLD.


I. INTRODUCTION
With the popularity of digital cryptocurrencies such as bitcoin, blockchain technology has attracted people's attention. First of all, blockchain technology is applied to digital cryptocurrencies, such as bitcoin, ETH, XRP and EOS. Considering the characteristics of blockchain technology, such as decentralization, trust mechanism and data encryption, blockchain technology is also applied to intelligent transportation, health care and other fields of the internet of things besides digital crypto-currency [1]- [4]. So we consider the blockchain in our paper. In the blockchain [5]- [8], miners follow the same accounting transaction rules and reach the consensus by the proof of work consensus mechanism (POW) [9]. Through the generation of blocks (mining) to The associate editor coordinating the review of this manuscript and approving it for publication was Yuan Gao . obtain revenues, data among nodes share safely. However, a single node needs a long time to mine the block successfully. To improve the node's mining revenue, we consider that many miners form a mining pool in the blockchain. The mining pool includes a pool manager and multiple nodes. All nodes carry out mining at the same time, i.e. they carry out part work certificate. Receiving part work certificate of each node, the pool manager estimates the work of each node based on the ratio of its part work certificate. If a node generates a full work certificate, then it sends the work certificate to the pool manager. The pool manager publishes the full work certificate to the bitcoin network and distributes the revenue according to the actual workload of each node [10].
However, the security issues are still challenging the blockchain system due to selfish mining attack. In pool mining, selfish mining attack is an attack strategy based on POW. The attacker (malicious miner or malicious mining pool) does not broadcast the newly mined block. It chooses to keep the block or release the block when appropriate. Pool block withholding (PBWH) attack is a recently discovered selfish mining attack. In the PBWH, the attack pool infiltrates some computing power into the attacked mining pool. Then it performs PBWH attack. That is, it retains all newly discovered blocks in the attacked pool [11], [12]. At present many scholars have studied the attack strategy between two mining pools. However, this strategy is difficult to be applied to the mutual real-time attacks among multiple mining pools. The mutual attack strategy of multiple mining pools does not consider the mining cost and the dynamic PBWH attacks among multiple mining pools. Therefore, based on the above references, we propose a mining pool computing power allocation algorithm with block withholding attacks among multiple mining pools (MPPA) [13]. Briefly, our contributions are as follows: 1. MPPA divides the computing power in the mining pool into the computing power of honest mining and computing power of block withholding attack according to their functions. Then MPPA proposes the revenue optimization model of each mining pool with the costs of honest mining and block withholding attack.
2. MPPA calculates the revenue gain generated by block withholding attacks on other mining pools. For adjusting fixed computing power in each iteration, we have the mining pool computing power allocation algorithm with fixed change of computing power (MPPA_F). For adjusting the optimal recovery and attack computing power, we have the mining pool computing power allocation algorithm with optimal change of computing power (MPPA_O).
3. MPPA_F and MPPA_O could effectively ensure the maximum revenue of single mining pool, and improve the overall revenue of all mining pools. MPPA_F and MPPA_O are suitable for the fast-changing block withholding attack environment among multiple mining pools.
The rest of the paper is organized as follows. In Section 2, we describe the related work. In Section 3, we describe our algorithm principles, which include model establishment and model solution. The simulation results are presented in Section 4. Finally, we conclude the paper and describe future work in Section 5.

II. RELATED WORK
Rosenfeld [14] firstly proposes the concept of block withholding attack in 2011. In his paper, he defines block withholding attack as a miner's act in a mining pool deliberately discarding blocks or delaying the submission of blocks to the pool manager. Then Eyal [11] considers that the mining pool can execute block withholding attacks. In his paper, in order to improve their revenues, malicious mining pools assign computing power to carry out block withholding attack on other mining pools. Afterward, Luu et al. [15] consider that an attacker carries out block withholding attacks on a mining pool or multiple mining pools. And they find that there is a motive for attackers to carry out block withholding attack in the long-run. Then more and more scholars study block withholding attacks. Currently, some scholars focus on block withholding attacks between two mining pools. For example, Tang et al. [16], [17] analyze the existing conditions of Nash equilibrium in the process of POW, and use the zero-determinant strategy to optimize the miner's strategy selection. Considering the cooperation of two mining pools, Di et al. [18] analyze the parameter value and corresponding mining strategy between the two mining pools according to the mining pools' computing amount. Wang et al. [19] propose a two-stage game model to consider whether the mining pool is open or not and whether it is attacked. It analyzes the Nash equilibrium condition of the game based on weight to obtain a strategy selection method of mining pool based on the game theory. Chatterjee et al. [20] establish a model of digital cryptocurrency attack. Then it proposes an ergodic average revenue game algorithm. Houlihan et al. [21] analyze the optimal penetration algorithm of two mining pools attacking each other under extreme symmetry, symmetry and general conditions. Then it obtains the pure Nash equilibrium condition under the anarchy state. Considering sponsored block withholding attacks, Bag et al. [22] analyze the computing power allocation strategy of nodes attacking one or two mining pools. Considering the computing power of mining pool and block propagation delay, Liu et al. [23] propose an evolutionary mining strategy with the probability, average time, revenue and other formulas of the mining pool. Kim et al. [24] establish a revenue model of mining pool, and analyze the impact of block withholding attack on the migration of mining pools and miners with evolutionary game theory. The works [16]- [24] mainly consider the situation of mutual attacks between two mining pools. But there are multiple mining pools attacking each other in practice.
Therefore, some scholars focus on the PBWH attack method among multiple mining pools. For example, Eyal [11] proposes the strategy selection of maximum revenue with mutual attacks among multiple mining pools. Wang et al. [25] regard the game behavior among multiple mining pools as an iterative prisoner's dilemma model. It uses the policy gradient algorithm of deep reinforcement learning to select the mining strategy of multiple mining pools. Considering revenues of block withholding attacks, Luu et al. [15] establish a revenue maximum model with computing power revenue and transaction volume revenue. Considering that a node attacks a single mining pool and multiple mining pools, Tosh et al. [26] propose a revenue computing method to search the Nash equilibrium point. Considering the revenue of the mining pool and miner selection, Haghighat et al. [27] analyze the mining pool profitability with mining pool attractiveness and miner migration rate. Considering the uncle reward, Chang et al. [28] propose computing power allocation strategy of mining pools to improve the revenues of mining pools. But the works [11], [15], [25]- [28] do not consider the cost of mining and the dynamic attack among multiple mining pools.

III. ALGORITHM PRINCIPLES
As shown in Fig.1, there are multiple mining pools composed of multiple miners in the network. Based on the current situation, each mining pool selects computing power for honest mining, and selects computing power to infiltrate into other mining pools for block withholding attacks. The goal of each pool is to maximize its revenue. However, the following two problems still need to be solved to obtain the optimal computing power allocation scheme of each mining pool, which could maximize their revenues. The first is how to set up the revenue mining pool' optimization model according to the current computing power of all mining pools and the computing power allocation of each mining pool. The second is how to use a heuristic algorithm to solve the optimization model according to the current situation. The details are as follows.

A. MODEL ESTABLISHMENT
We assume that there are N mining pools in the network that receive other computing power, and attack other mining pools. x i represents the computing power of mining pool i, α ij represents the computing power ratio of mining pool i in mining pool j. When i = j, α ii represents the computing power ratio of the mining pool i for honest mining. When i = j, α ij represents the computing power ratio of mining pool i in mining pool j for block withholding attack. The current effective total computing power in the blockchain is where, A represents the current effective total computing power. The mining difficulty in POW is adjusted according to the current total network computing power, and each mining pool needs to consume electric energy and other resources during mining. Therefore, the revenue of honest mining for each mining pool i is where, C w represents the cost coefficient of honest mining in mining pool i, which is related to the computing power of the mining pool and the local electricity price. We consider that the cost of block withholding attack in the mining pool is different from the cost of honest mining. Then the revenue of block withholding attack in mine pool i against mine pool j is where, C p represents the cost coefficient of block withholding attack of mining pool i. β ij = x i /x j , then the average revenue of each mining pool is In order to ensure its own revenue, each mining pool maximizes its revenue as much as possible. Therefore, we establish the revenue optimization model of the mining pool i as follows.
The optimization model (5) can be solved by artificial intelligence algorithms such as genetic algorithm and particle swarm optimization algorithm. But the solving process is very complex. Considering the computing power, revenue and other information of the mining pool, we use the heuristic algorithm to calculate the revenue increment of block withholding attacks on other mining pools according to computing power loss interval of the mining pool. After that, according to the increase and decrease of revenue increment, the mining pool selects different strategies of computing power allocation. If the revenue increment decreases, the recovery computing power will be used for honest mining.
Otherwise, the mining computing power will be transferred to block withholding attacks on other mining pools. Therefore, the solving process of the optimization model (5) can transform into the optimal computing power allocation problem of the mining pool i and other mining pools. According to the computing power of mining pool i and the computing power of mining pool j, the current total revenue of honest mining in mining pool i and its block withholding attack on mining pools j are calculated.
When the computing power of honest mining in mining pool i transforms into the computing power of block withholding attack on pool j, the revenue of mining pool i is Considering the block withholding attack of each mining pool, we retain part of computing power υ for honest mining, which could attract other mining pools to be attacked, and avoid attracting the attention of the blockchain. Therefore, where A represents the total effective computing power of the whole network, B represents the total computing power in mining pool i, C represents the total computing power in mining pool j. In the mining process, honest computing power needs mine fully, and computing power of block withholding attack sometimes does not need to play its full role [29]. We use the average principle to allocate the revenue of mining pools. Therefore, the cost of block withholding attack is not higher than the cost of honest mining, namely 0 < C P ≤ C w . Then the revenue increment f ij of the computing power of block withholding attack on mining pool j is (8), as shown at the bottom of the next page.

1) MPPA_F SOLUTION (FIXED LOSS INTERVAL OF COMPUTING POWER)
We assume that each mining pool i can obtain the information of its own, such as its total computing power B, initial computing power x i , current revenue R ii , the ratio α ij of computing power used to be block withholding attack on other mining pools. It can find the total effective computing power A of the whole network and the information of mining pool j, such as its total computing power C, initial computing power x j and current revenue R jj . Because it is impossible to obtain the computing power of block withholding attack of other mining pool on itself, mining pool i can't obtain its computing power coefficient α ii and the computing power coefficient α jj of other mining pool j. But it can estimate the coefficient based on current revenue as follows.
After each mining pool has known the computing power coefficient α ii of its own and other mining pool j, the computing power allocation strategy of each mining pool i according to fixed revenue increment f ij is as follows.
Step 1: After a certain time T , according to formula (8), the mining pool i calculates revenue increment f ij between itself and other mining pools. Then it establishes a revenue increment matrix γ 1 by the calculation result.
where, f ij = 0, if i = j. It represents that the mining pool i does not carry out block withholding attacks on its own mining pools.
Step 2: Mining pool i analyzes the revenue increment matrix γ 1 . If f ij < 0, it records f ij and the corresponding mining pool number. Then it obtains the set of f ij < 0. Mining pool i selects the mining pool, which has the maximum absolute value of revenue increment as the object of computing power recovery. If multiple mining pools have the same maximum absolute value of revenue increment, mining pool i randomly selects one mining pool as the object of computing power recovery.
Step 3: If the recoverable computing power of the object is higher than , mining pool i recovers the computing power for honest mining. Otherwise, it recovers all the computing power.
Step 4: Mining pool i calculates f ij between mining pool i and other mining pool j respectively with the formula (8). Then it obtains the revenue increment matrix γ 2 by the calculation result.
Step 5: Mining pool i analyzes revenue increment matrix γ 2 . If f ij > 0, it records f ij and the corresponding mining pool number. Then it obtains the set of f ij > 0. Mining pool i actively selects the mining pool, which has the maximum value of revenue increment as the object of computing power assignment. If multiple mining pools have the same maximum value of revenue increment, mining pool i randomly selects one mining pool as the computing power assignment object.
Step 6: Mining pool i needs to reserve the computing power υ for honest mining. If x i α ii − υ is higher than , it assigns computing power to block withholding attack on the computing power assignment object. Otherwise, it assigns x i α ii − υ. Skip back to step 1.
The pseudo code of MPPA_F is as follows: Each mining pool repeats steps 1-6 above to adjust the its computing power allocation from time to time. Finally, they can obtain their computing power allocation strategy to improve their revenue.

2) MPPA_O SOLUTION (OPTIMAL CHANGE OF LOSS INTERVAL OF COMPUTING POWER)
Because each mining pool's situation is different, mining pool i calculates optimal attack computing power and optimal recovery computing power according to the computing power information of mining pool i and other mining pool j. That is, the mining pool calculates the revenue increment f at ij with the formula (8) when the optimal value's range of attack computing power is 0 ≤ ≤ α ii . If f at ij > 0, the computing power is beneficial for block withholding attack on the mining pool j. Otherwise, it is not beneficial. The mining pool selects the maximum f bat ij and selects the corresponding bat ij as optimal attack computing power. Similarly the mining pool calculates the revenue increment f re ij when the optimal value's range of recovery computing power is −α ij ≤ ≤ 0. If f re ij > 0, the recovery computing power is beneficial. Otherwise, it is not beneficial. The pool selects the maximum f bre ij and selects the corresponding bre ij as optimal recovery computing power. The specific calculation method of optimal attack computing power and optimal recovery computing power is as follows.
The following formula by substituting the variable into formula (8) is obtained. Formula (11), as shown at the bottom of the next page, transforms into the following form.
Considering that each mining pool retains the computing power υ for honest mining, the total computing power of honest mining in each mining pool is not equal to 0 in any case. Moreover, the computing power B in mining pool i and computing power C in mining pool j are not equal to 0. That is, (12) is not equal to 0. Then we use the derivative method to get the maximum value with the definition field 0 ≤ ≤ α ii of formula (8)-(12) [30].
The formula (14) transforms into the following form.
According to formula (14), the monotonicity of f at ij relates to the positive and negative of g( ). The function g 1 ( ) is a sixth-order equation. The equation can be solved to calculate the roots by genetic algorithm, artificial bee colony algorithm, particle swarm optimization algorithm and other artificial intelligence. The root-finding method in MATLAB, MathWorks and other software can be used to calculate the root ZS i of g 1 ( ) = 0. Considering the number of real roots and the image property of higher-order polynomial function, the pool calculates the maximum value of f at ij with the monotonicity of g 1 ( ). The specific steps of each mining pool i are as follows.
Step 1: If there is no real root ZS i of g 1 ( ) in the range of 0 ≤ ≤ α ii , it means that 0 ≤ ≤ α ii does not intersect with horizontal ordinate. Mining pool i calculates g 1 (0) and g 1 (α ii ). Otherwise, skip to step 3. If g 1 (0) > 0 and g 1 (α ii ) > 0, f at ij > 0 which represents that formula (12) is monotonically increasing. Then bat ij = α ii and return. Otherwise, skip to step 2.
Step 3: Mining pool i substitutes several real roots of g 1 ( ) in the range of 0 ≤ ≤ α ii into formula (11) to calculate the values of F 1 (0), F 1 (α ii ) and F 1 ( ZS i ). It selects the maximum value as optimal attack increment revenue f bat ij . Then it takes the corresponding as bat ij , which is current optimal attack computing power.
Each mining pool performs steps 1-3 above to obtain optimal attack computing power bat ij and optimal attack increment revenue f bat ij . Therefore, it is convenient to adjust the allocation of computing power which improves the revenue.
Similarly, the calculation method of optimal recovery computing power is as follows. The pool substitutes variable into formula (8) for calculation. Then it gets formula (17), as shown at the bottom of the next page. As the subsequent processing method is similar to the specific calculation method of optimal attack computing power bat ij . Referring above theory, the pool obtains the optimal recovery computing power btr ij and the corresponding optimal recovery increment revenue f bre ij . The computing power allocation strategy of mining pool i is obtained by successfully calculating the optimal attack computing power and optimal recovery computing power. The specific implementation steps of each mining pool i are as follows.
Step 1: After a certain period of time T , mining pool i uses the formula (17) and the derivative method to obtain the derivative f re ij . Then it converts the derivative f re ij into g 2 ( ).
Step 2: Mining pool i solves the real root ZS i,re by the root program. Calculating the F 2 ( ZS i,re ) of each real root, F 2 (0) and F 2 (−α ij ), mining pool i selects the maximum value in F 2 (0), F 2 (−α ij ), and F 2 ( ZS i,re ) of each real root. Then the maximum value is recovery increment revenue f bre ij . The optimal recovery computing power is an independent variable btr ij which corresponds to the recovery increment revenue f bre ij . If there are the multiple same btr ij , then the pool i randomly selects one as current optimal recovery computing power.
Step 3: The maximum value matrix λ of recovery computing power consists of optimal recovery increment revenue f bre ij . The optimal value matrix σ of recovery computing where, f bre ij = 0 and btr ij = 0, ifi = j. It represents that mining pool i does not carry out the block withholding attack power on its own mining pool and recover the computing power from its own mining pool.
Step 4: Mining pool i analyzes the maximum value matrix λ of recovery computing power. If f bre ij > 0, it records f bre ij , corresponding btr ij and mining pool number. Then it obtains the set of all f bre ij > 0. If there are multiple same maximum values, the mining pool i randomly selects a maximum value to obtain its corresponding mining pool and optimal recovery computing power. Otherwise, the mining pool i selects the mining pool and optimal recovery computing power corresponding to the maximum value. Then it actively recovers the optimal recovery computing power of selected mining pool for honest mining.
Step 5: Mining pool i uses the derivative method to obtain derivative f at ij . Then it converts the derivative f at ij into g 1 ( ).
Step 6: Mining pool i solves real roots ZS i,btr by root program to obtain the F 1 ( ZS i,btr ) of each real root, F 1 (0) and F 1 (α ii ), mining pool i selects the maximum value in F 1 (0), F 1 (α ii ) and F 1 ( ZS i,btr ) of each real root. The maximum value is optimal attack increment revenue f bat ij . The corresponding independent variable bat ij is an optimal attack computing power. If there are multiple same bat ij , then the pool i randomly selects one as current optimal attack computing power.
Step 7: The maximum attack computing power matrix η consists of calculated f bat ij . The optimal attack computing power matrix ρ consists of corresponding optimal attack computing power bat ij .
where, f bat ij = 0 and bat ij = 0, ifi = j. It represents that mining pool i does not assign its computing power to carry out block withholding attack power on its own mining pool.
Step 8: Mining pool i analyzes the maximum attack computing power matrix η. If f bat ij > 0, it records f bat ij > 0, corresponding bat ij and mining pool number. Then it obtains the set of f bat ij > 0. If there are multiple same maximum values, the mining pool i randomly selects a maximum value to obtain its corresponding mining pool and optimal attack computing power. Otherwise, the mining pool i selects the mining pool and optimal attack computing power corresponding to the maximum value. Then it assigns the optimal attack computing power to carry out block withholding attack on the selected mining pool.
Step 9: If x i α ii −υ is higher than bat ij , mining pool i assigns computing power bat ij to carry out block withholding attack on the assignment object. Otherwise, it assigns computing power x i α ii − υ. Skip back to step 1.
Each mining pool repeats steps 1-9 to adjust the allocation of its computing power from time to time. Finally, it can obtain the computing power allocation strategy to improve its revenue.
The pseudo code of MPPA_O is as follows:

3) TIME COMPLEXITY ANALYSIS
According to the characteristics of mining pool allocation, we analyze the time complexity of MPPA_F and MPPA_O. MPPA_F in each mining pool mainly includes three parts: revenue increment matrix calculation, computing power recovery and assignment, and revenue calculation of the mining pool. The first part is to calculate the computing power revenue increment of its own mining pool and other mining pools by formula (8), that is, the time complexity is (N ), where N represents the mining pool quantity. The second part is the computing power recovery and assignment of each mining pool, that is, the time complexity is (N ). The third part is to calculate the current revenue of the mining pool by formula (4), that is, the time complexity is (N ). Therefore, the time complexity of MPPA_F is (N ).
MPPA_O in each mining pool mainly includes three parts: optimal computing power calculation, computing power recovery and assignment, and revenue calculation of the mining pool. The first part is to calculate the root of function (16) of its own mining pool and other mining pools by root program. According to its root, the pool calculates the computing power revenue increment, that is, the time complexity is (χN ), where χ represents the time complexity of the selected root method. The second part and the third part are the same as MPPA_F. Therefore, the time complexity

IV. ALGORITHM SIMULATION A. SIMULATION PARAMETERS AND PERFORMANCE PARAMETERS
In order to verify the performance of MPPA, we use MAT-LAB software to perform algorithm simulation and comparison. In the algorithm simulation, we first numerically simulate the computing power allocation of each mining pool, and calculate its honest mining revenue and block withholding attack revenue by formula (4). In the MPPD_F, mining pool calculates the revenue increment by formula (8), and Algorithm 2 MPPA_O Solution Input: the computing power coefficient of each mining pool α ij , ∀i, ∀j Output: the solutions of power computing allocation for each mining pool 1: for i = 1; i <= N ; i + + do 2: for j = 1; j <= N ; j + + do 3: assign computing power x i α ii − υ to carry out block withholding attack 28: end if 29: end for performs computing power recovery and computing power assignment through the algorithm steps. In the MFFD_A, mining pool uses the derivative method to calculate optimal attack computing power and optimal recovery computing power by formula (17), and performs computing power recovery and computing power assignment through the algorithm steps. Then they obtain the revenue of each mining pool through multiple iterations. The simulation parameters are in Table 1. Then we study the influence of cost of honest mining, cost of block withholding attack, mining pool quantity, computing power allocation among mining pools and attack ratio among mining pools. We use Win Stay Fail Shift(WSFS) [9], ALL Cooperate (ALLC) [10], All Defect(ALLD) [10], MPPA_F and MPPA_O to calculate the average revenue of mining pool under different mining pool quantity. Among them, ALLC and ALLD are fixed strategy for the computing power allocation of mining pools. All the mining pools in ALLC strategy are always fully honest mining. In WSFS strategy, the mining pool initially adopts the full honest mining strategy. If the revenue is lower than threshold, it will switch between full honest mining strategy and full block withholding attack strategy. Otherwise, the strategy will remain unchanged. ALLD strategy chooses full honest mining strategy for some mining pools, and the other mining pools always adopt a full block withholding attack.
We define the average revenue of the mining pool as where, S i av represents the revenue of mining pool i in the tth iteration, N represents the mining pool quantity, R t av represents the average revenue of mining pool after the tth iteration.

1) INFLUENCE OF COST OF HONEST MINING
To analyze the influence of cost of honest mining on the average revenue in MPPA_F and MPPA_O, we select the cost 0.01, 0.02, 0.03 and 0.04 of honest mining, cost 0.01 of block withholding attack and other parameters in Table 1. As shown in Fig.2 and Fig.3, with the increase of cost of honest mining, the convergence rate and convergence value of average revenue of the mining pool in MPPA_F and MPPA_O gradually decrease, but the decline degrees of convergence value slow down. This is because: when the cost of honest mining and cost of block withholding attack are both 0.01, the computing power of block withholding attack among mining pools is relatively small. So the average revenue of mining pools of the two algorithms converge to the optimal values quickly (both algorithms are 90). With the increase of cost of honest mining, MPPA_F and MPPA_O need more time to allocate computing power for block withholding attacks. So their rates of convergence decrease. At the same time, the convergence value of the average revenue of the mining pool decreases due to the decrease of mining revenue. However, the two algorithms can adjust computing power. Then the computing power of block withholding attack among mining  pools increases gradually and the computing power of honest mining decreases accordingly. It not only improves the block withholding attack revenue of mining pools, but also reduces the influence of cost of honest mining on the average revenue of mining pools, resulting in the convergence value of the average revenue of mining pools becoming 81.6, 74.9, 70.3 in MPPA_F and 81.8, 75.5, 71 in MPPA_O. Therefore, the decline of the convergence value of the average revenue of mining pools slows down.

2) INFLUENCE OF COST OF BLOCK WITHHOLDING ATTACK
To analyze the influence of cost of block withholding attack on the average revenue of mining pool in MPPA_F and MPPA_O, we select the cost 0.05 of honest mining, cost 0.02, 0.03, 0.04, 0.05 of block withholding attack and other parameters in Table 1. As shown in Fig.4 and Fig.5, with the increase of cost of block withholding attack, the convergence rate of average revenue of mining pools in MPPA_F and MPPA_O gradually increase, but their convergence values gradually decrease, and the degrees of decline slow down. This is because: when the cost of block withholding attack is 0.01 and the cost of honest mining is 0.05, the computing  power of block withholding attack among mining pools in the two algorithms is relatively large. So it takes a long time to allocate the computing power of mining pools, and their average revenues converge to the optimal values (60.5 in MPPA_F and 61 in MPPA_O). With the increase of the cost of block withholding attack, MPPA_F and MPPA_O can complete the computing power allocation of block withholding attack in a shorter time, resulting in a faster rate of convergence. At the same time, the mining pool needs to consume more cost to carry out block withholding attacks, resulting in the decline of convergence value of the mining pool's average revenue. However, due to the algorithm's automatic adjustment of computing power allocation, the computing power of honest mining among mining pools gradually increases, and the computing power of block withholding attack begins to decline. It not only improves the mining revenue of mining pools, but also reduces the influence of cost of block withholding attacks on the average revenue of algorithms, resulting in the convergence value of average revenue of mining pool becoming 54.9, 51.5, 50 in MPPA_F and 55.5, 51.8, 50 in MPPA_O. Therefore, it slows down the decline of the convergence value of the average revenue of the mining pool. At the same time, before the average revenue of mining pools reaches the equilibrium state, some mining pools assign more  computing power to carry out block withholding attack and obtain more revenue. Then some mining pools do not obtain reasonable revenue. They adjust the computing power by MPPA_O, which improves their revenue. Finally, the average revenue of the mining pools fluctuates a little before reaching the equilibrium state.

3) INFLUENCE OF MINING POOL QUANTITY
To analyze the influence of mining pool quantity on the average revenues of mining pool in MPPA_F and MPPA_O, we select the cost 0.05 of honest mining, cost 0.01 of block withholding attack, mining pool quantity 7, 9, 11, 13 and other parameters in Table 1. As shown in Fig.6 and Fig.7, with the increase of mining pool quantity in MPPA_F and MPPA_O, the initial average revenues of the mining pool gradually decrease. Then the convergence rate and convergence value of average revenues of the mining pool gradually decrease, but the decrease of convergence values slow down. This is because: according to formula (8), the initial computing power of each mining pool is the same and the mining pool does not use block withholding attack in the beginning. With the increase of mining pool quantity, the effective computing power in the whole network also rises correspondingly and the network revenue value of each iteration is same. So the initial average revenue and convergence value of the  mining pool obtained through mining decreases gradually. Due to the limited revenue of computing power of honest mining in each mining pool, the mining pool automatically adjusts the computing power [31]. It lets more computing power carry out block withholding attacks, resulting in a decrease in its convergence rate. At the same time, the two algorithms automatically adjust the computing power allocation, and the block withholding attack revenues of mining pool increase, so the convergence value in MPPA_F changes from 107.4 to 77.5, 59.2, 48.5, and the convergence value in MPPA_O changes from 107.8 to 80 3, 62.2, 51.2. The decline of the convergence value of the average revenue of mining pools slows down.

4) INFLUENCE OF COMPUTING POWER ALLOCATION AMONG MINING POOLS
To analyze the influence of uneven allocation of computing power among mining pools on the average revenue of unit computing power of mining pool in MPPA_F and MPPA_O, we select the initial computing power 1.2 of 50% mining pools, the initial computing power 0.8 of other 50% mining pools, and other parameters in Table 1. The average revenues of the unit computing power of the mining pool are defined as the ratio of total revenue and total computing power of all mining pools. As shown in Fig.8 and fig.9, at the beginning of the algorithm, mining pools play games with each other and adjust their computing power to carry out honest mining and mutual block withholding attacks. Therefore, before the equilibrium state is reached, the average revenues of mining pools have obvious jitter, but the curves converge to equilibrium. As shown in fig.8, in MPPA_F, the convergence value of average revenue of unit computing power in the pools with small initial computing power is slightly greater than that in the pools with large initial computing power. This is because: MPPA_F uses a fixed loss interval of computing power to adjust computing power. The mining pool with small initial computing power can quickly adjust its computing power to occupy the advantage of revenue allocation, which improves the average revenue of unit computing power. As shown in Fig.9, in MPPA_O, the convergence value of unit computing power in the mining pool with large initial computing power is slightly greater than that in the mining pool with small initial computing power. This is because: MPPA_O uses the optimization method to calculate the optimal recovery computing power and optimal attack computing power. The mining pool with small initial computing power can adjust its own computing power and occupy advantage in the early iteration. But the mining pool with large initial computing power not only can quickly adjust its own computing power according to the current computing power situation, but also use the advantage of larger computing power to carry out block withholding attack. It occupies an advantage in revenue distribution to improve the average revenue of its unit computing power. In conclusion, MPPA_F is slightly beneficial to the mining pool's revenue acquisition with small initial computing power. MPPA_O is slightly beneficial to the revenue acquisition of the mining pool with large initial computing power.

5) INFLUENCE OF ATTACK RATIO AMONG MINING POOLS
To analyze the influence of computing power allocation among mining pools on the average revenues of MPPA_F and MPPA_O, we select the attack ratio 100%, 90%, 80%, 70% among mining pools, and other parameters in Table 1. As shown in Fig.10 and Fig.11, with the decrease of attack ratio among mining pools, the convergence value of block withholding attack revenue in MPPA_F and MPPA_O decreases gradually. But the convergence value of honest mining revenue increase gradually. Moreover, the convergence value of block withholding attack revenue decreases more than that of honest mining revenue. The dominant position of revenue changes from block withholding attack revenue to honest mining revenue. This is because: with the decline of attack ratio among mining pools, the computing power of honest mining among mining pools gradually rises, while computing power of block withholding attack gradually decreases. So the mining revenue also gradually rises, and the block withholding attack revenue gradually decreases. The factor also directly leads to the dominant position of honest mining revenue. At the same time, due to the decline of attack ratio, the mining pools reduce the number of attack objects. Therefore, in MPPA_F, the convergence value of honest mining  revenue increases by 12%, 11%, 9%, and the convergence value of block withholding attack revenue decreases by 13%, 14%, 17%. In MPPA_O, the numbers are 15%, 13%, 7% and 16%, 20%, 18% respectively. In the two algorithms, the decrease range of convergence value of block withholding attack revenue is larger than an increased range of honest mining revenue.

6) INFLUENCE OF LOSS INTERVAL OF COMPUTING POWER
To analyze the influence of loss interval of computing power on the average revenue of the mining pool in MPPA_F, we select the cost 0.05 of honest mining, cost 0.01 of block withholding attack, loss interval 0.01, 0.02, 0.03, 0.04 of computing power and other parameters in Table 1. Because MPPA_O can calculate the optimal loss interval of computing power, it is unnecessary to consider the influence of loss interval of computing power. As shown in Fig.12, with the increase of the loss interval of computing power, the convergence value of the average revenue of the mining pool in MPPA_F gradually decreases and the decrease range becomes larger, but its convergence rate gradually increases.  This is because: MPPA_F realizes computing power allocation of the mining pool by setting a loss interval of computing power. If the loss interval of computing power sets too large, the convergence can be achieved at a faster rate, but it only converges to different local optimal solutions. There is no good adjustment in computing power. Then the convergence value of the average revenue of the mining pool decreases. The larger the loss interval of computing power, the farther the optimal local solution from the optimal global solution is, and the larger the decrease range are. Then a small loss interval of computing power can effectively improve the convergence value of the average revenue of the mining pool. However, if the interval of each computing power adjustment is less, the algorithm will spend more time to find the optimal value and reduce the convergence rate.

7) ALGORITHM PERFORMANCE COMPARISON
We select parameters in Table 1 to calculate the average revenues of the mining pool in MPPA_F and MPPA_O. As shown in Fig.13 and Fig.14, although the convergence rate and convergence value of the average revenue of the mining pool in MPPA_O are better than that in MPPA_F, the computing time in MPPA_O is significantly longer than that in MPPA_F. This is because: MPPA_O calculates the optimal recovery computing power and attack computing power  to adjust computing power with the optimization method. So mining pools in MPPA_O converge at the faster convergence rate, and they can obtain the optimal convergence value of the average revenue of the mining pool. MPPA_F adjusts the interval loss of computing power by fixed value to distribute computing power of the mining pool. The allocation strategy converges to an local optimal solution, so the convergence rate and the convergence value of the average revenue of the mining pool in MPPA_F are lower than that in MPPA_O. Because of the optimization method, MPPA_O spends more time to slove the maximum value. The computing time in MPPA_O is much longer than that in MPPA_F. At the same time, MPPA_F is easy to fall into the optimal local solution during the iterative process, so the computing time of MPPA_F presents a ladder shape.
We select the mining pool quantity 7,9,11,13,15,17,19 and other parameters in Table 1 to calculate the convergence values of average revenue of mining pool in WSFS, ALLC, ALLD, MPPA_F and MPPA_O. As shown in Fig.15, with the increase of mining pool quantity, the average revenues of the mining pool in WSFS, ALLC, ALLD, MPPA_F and MPPA_O gradually decrease. The average revenues of the mining pool in ALLC, ALLD and WSFS are relatively close, while that in MPPA_O and MPPA_O are relatively close and obviously larger than the first three algorithms. This is because: with the increase of mining pool quantity and the same network revenue value for each iteration, WSFS, ALLC, ALLD, MPPA_F and MPPA_O reduce the honest mining revenue of each mining pool, resulting in the gradual decline of average revenue of mining pool. All the mining pools in ALLC insist on honest mining all the time and do not maintain revenue through block withholding attack, so the average revenue of mining pool is the lowest. WSFS adjusts computing power allocation of each mining pool through threshold value. ALLD only selects some mining pools to carry out block withholding attack. Therefore, the average revenue of the mining pool in ALLD is poor, and the average revenue of the mining pool in WSFS is larger than that in ALLD. However, due to single adjustment of computing power in WSFS, MPPA_O and MPPA_F dynamically adjust the computing power of mining pool to improve the average revenue of the mining pool by calculating the revenue increment. So the average revenues of the mining pool in MPPA_O and MPPA_F are larger than that in WSFS, ALLC and ALLD.

V. CONCLUSION
The paper proposes a mining pool computing power allocation algorithm (MPPA) with block withholding attacks among multiple mining pools. First, the algorithm considers that there are multiple mining pools composed of miners and pool manager in the network. The mining pools carry out dynamic block withholding attacks on other mining pools. Considering honest mining and block withholding attack, we establish the mining pool optimization model, which includes the current effective total computing power, the honest mining revenue of each mining pool, the revenue of block withholding attack and the average revenue of each mining pool, etc. Secondly, according to the optimization model, MPPA calculates the revenue gain generated by block withholding attacks on other mining pools. For adjusting fixed computing power in each iteration, we have the mining pool computing power allocation algorithm with a fixed change of computing power (MPPA_F). For adjusting the optimal recovery and attack computing power, we have the mining pool computing power allocation algorithm with an optimal change of computing power (MPPA_O). Finally, we analyze the influence of cost of honest mining, cost of block withholding attack, mining pool quantity, computing power allocation among mining pools, attack ratio among mining pools and loss interval of computing power on the average revenue of the mining pool. Then we compare the average revenues of mining pool in WSFS, ALLC, ALLD, MPPA_F and MPPA_O.
The simulation results show that MPPA can find the optimal computing power allocation strategy for each mining pool to reasonably allocate computing power. Therefore, MPPA not only improves the average revenue of the mining pool, but also reduces the influence of block withholding attack of other mining pools on mining pool revenue of its own. MPPA outperforms the state-of-arts such as WSFS, ALLC and ALLD. Since MPPA does not consider the selection of miners in the mining pool yet, the next stage's goal is to consider the miner individual and propose the mining revenue maximization algorithm of miners.