A Hashing Power Allocation Game with and without Risk-free Asset

Miners in various blockchain-backed cryptocurrency networks compete to maintain the validity of the underlying distributed ledgers to earn the bootstrapped cryptocurrencies. With limited hashing power, each miner needs to decide how to allocate their resource to diﬀerent cryptocurrencies so as to achieve the best overall payoﬀ. Together all the miners form a hashing power allocation game. We consider two settings of the game, depending on whether each miner can allocate their fund to a risk-free asset or not. We show that this game admits unique pure Nash equilibrium in closed-form for both settings.


Introduction
With the advancement of the blockchain technologies (a.k.a., distributed ledger technology), distributed applications (DApps) are burgeoning. Starting from the bitcoin, many altcoins have been proposed to achieve different goals. At the time of this writing, there are almost 1,600 cryptocurrencies with market capitalization totaling approximate $456 billion 1 , and among them Bitcoin, Ethereum and Ripple are the top three market-caped crypto-currencies.
Miners in these peer-to-peer networks play the important role of maintaining the integrity of the underlying blockchains, incentivized to earn digital currencies and transaction fees. Mining involves executing a distributed consensus protocol on how to achieve agreement of the underlying ledger when there is no central authority in presence. Among them, proof-of-work (PoW) [1] and proof-of-stake (PoS) [2] are the widely adopted consensus protocols by existing crypto-currencies.
For example, in the PoW framework, during a given average time period (e.g., every 10 minutes for Bitcoin), miners participate in a winner-take-all competition to extend the next block on the longest block chain by solving some cryptographic hashing proof-of-work, a mathematical puzzle. As a concrete case, in Bitcoin network, the puzzle goes as follows [3] : Given a difficulty d > 0, a challenge c and a nonce x (usually bit-strings), a function is called a Proof-of-Work (PoW) function if it has the following two properties: (i) F d (c, x) is fast to compute, given d, c, and x; and (ii) for fixed parameters d and c, finding x such that F d (c; x) = TRUE is computationally difficult but feasible. The difficulty d is used to adjust the time to find such an x.
With miners equipped with certain computing power (a.k.a., hashing power in Bitcoin network) and a large number of different cryptocurrencies to mine, they are facing the challenge on how to allocate their computing power to compete in mining each cryptocurrency to maximize their expected payoffs. Due to the competitive nature of the mining protocol, all miners together form a non-cooperative allocation game. This work aims to answer the following questions associated with the aforementioned game: 1) Does Nash Equilibrium (NE) exist?
3) Can the NE be computed efficiently?
We offer affirmative answers to all three questions for our game. We show that the NE allocation is unique and follows a proportional rule (Theorem 1) where each miner allocates his total computing power to a given cryptocurrency proportional to the percentage of the award among all currencies, while his expected revenue is proportional to the percentage of the hashing power possessed and the total award.
The equilibrium analysis of the allocation game is of both theoretical and practical relevance. On the theoretical side, we set up a succinct backbone model which admits a closed-form solution via non-trivial technical analysis. On the practical side, we provide insights which can help mining pool managers or individual miners in making the most important operational/tactical decisions, namely how to allocate the hashing power when facing under reward and peer competition.
To filter out the most salient factors that are of managerial relevance, we made some simplifications in the modelling, such as the the assumption that the cost to purchase certain hashing power is independent from the price of the currencies. However, this type of deviations from the realism on one hand may be a good approximation to reality and on the other hand is to be expected in an early attempt to apprehend an otherwise complex problem. Also, this work focuses on static games, and leave the discussion of dynamic games to future research.

Relevant Literature
Our computing power allocation game is relevant to several areas, including game theory, portfolio management, and market equilibrium models.
Several blockchain games (mainly non-cooperative in nature) are proposed in the recent literature to address and improve upon the limitations of existing distributed consensus mechanism in various crypt-currencies [4][5][6][7][8] , while some other games (mainly non-cooperative in nature) focus on the application layer without invoking any protocol technicality, such as the mining pool games [7,[9][10][11][12] . Our computing power allocation game is non-cooperative and focuses on the application layer; namely the allocation of mining resource. Furthermore, these games all deal with a single currency, which is a major difference from the game investigated in this work. Dimitri [13] studied a special case of our game where there is only one currency available for mining. [14] is a survey on this line of research.
Our computing power allocation game is similar to the extensively-studied general blotto game in the game theory literature [15][16][17][18] , but the two models have completely different utility functions to suit different applications in mind.
The resource allocation nature is also relevant to the large literature on portfolio management [19] , and the market equilibrium model, in particular the Fisher market [20,21] . However, the portfolio management literature usually assume that the supply of assets is independent from the allocation decision. And the Fisher market models focus on finding market-clearing prices and the allocation rule at market equilibrium.
The readers are referred to the survey [22] for research perspectives and challenges for Bitcoin and cryptocurrencies.
We describe the the hashing power allocation game in Section 3. We consider games without and with a risk-free asset in Sections 4 and 5, respectively.

The Hashing Power Allocation Game
There are n miners N = {1, 2, · · · , n} with computing powers h = (h 1 , h 2 , · · · , h n ) T ∈ R n + (the cost to possess such a computing power, expressed in fiat currency such as US dollar) and there are m cryptocurrencies M = {1, 2, · · · , m} available for mining. When there is a risk-free asset with return r, we introduce a dummy labeled as currency 0.
Miner i ∈ N allocates x ij ≥ 0 of his computing power to mine cryptocurrency j ∈ M . Let x i0 be the hashing power allocated to the dummy risk-free asset whose return is known as r for any amount allocated. Evidently, we have For each cryptocurrency j ∈ M , the n miners play a winner-take-all game and the winner is rewarded with uncertain reward vector R = (R 1 , R 2 , · · · , R m ) T (expressed in fiat currency such as US dollar) with mean vector E[R] = µ T = (µ 1 , µ 2 , · · · , µ m ) T . Miner i ∈ N wins cryptocurrency j ∈ M with probability proportional to its allocated computing power and his profit for mining cryptocurrency j ∈ M is given by Moreover the profit obtained with the risk-free asset is given by Therefore miner i's total profit is given by The mean profit of miner i is given by

Game without Risk-free Asset
We recall the result without a risk-free asset. When miners allocate all their funds to mining, the NE for the miners game can be obtained by solving the following n optimization problems based on (3): For any given i ∈ N , Theorem 1 (see [23]) Assume that m 1 µ ℓ ≥ n 1 h ℓ . The hashing power game with risk-neutral miners (4) admits the following unique NE along with each miner i's expected profit This result was obtained in our conference proceedings [23] . However the proof therein contains some errors. In this journal version we corrected all errors and include the full proof of Theorem 1 in the appendix.

Game with a Risk-free Asset
The main contribution of this work is to include a risk-free asset. When miners have the option to allocate their funds to both mining and the risk-free asset, the NE for the miners game can be obtained by solving the following n optimization problems based on (3): For any . This problem is equivalent to the following parametric problem: Using Theorem 1, the last problem is reduced to the following optimization problem Theorem 2 Assume that h 1 ≤ h 2 ≤ · · · ≤ h n . The solution to problem (7) is as follows.
(i) If This case includes all those miners who spend their entire cash.
This case includes all those miners who invest the same amount on the cryptocurrencies and invest the remaining amounts into the bond, earning an interest of r, respectively.
(iii) Otherwise, there exists an index 1 ≤ k ≤ n − 1 such that In this case, miners are divided into two classes: The first class {1, 2, · · · , k} contain those miners who spend their entire cash; and the second class {k + 1, k + 2, · · · , n} contains all those miners who invest the same amount on the cryptocurrencies and invest the remaining amounts into the bond, earning an interest of r, respectively.
The hashing power game with a risk-free asset (5) admits the following unique NE along with each miner i's expected payoff , · · · , n, so the solution to (7) is h i = h i for i = 1, 2, · · · , n. Otherwise, some or allh i =ĥ at the solution (7) so that f ′ i (h i ) ≥ 0 for i = 1, 2, · · · , n. The conclusion is obtained.
We make the following observations based on Theorem 2: 1) At the NE, the return keeps the same for all miners, that is,

2) At the NE, the marginal profit f
4) The total social welfare is increasing. The rate of increasing is larger than r.

Conclusion
Many future research problems are worth pursuing, such as the risk-averse miners and dynamic versions of the game.

Proof of Theorem 1
By the definition of Nash equilibrium, the computing power allocation profile x = (x 1 , x 2 , · · · , x n ) is an NE if and only if each miner's allocation is the best response to the others. Let us denote y j −i = l =i x lj . Then the best response of miner i is just the solution of the following optimization problem: However, there is one difficulty, that is at the point where for some cryptocurrency j ∈ M , x ij = 0 for each i ∈ N , U i is discontinuous. So we cannot apply the standard method directly in [24] to study Nash equilibrium. We first propose the following lemma to characterize an Nash equilibrium by pointing out that any Nash equilibrium could not be the discontinuous points.

Lemma 1
If allocation x is an NE, then i∈N x ij > 0 for each cryptocurrency j ∈ M .
Proof To obtain this characterization of NE, it is sufficient for us to prove that any allocation profile x, in which there is a cryptocurrency j ∈ M such that x ij = 0 for each i ∈ N , cannot be a Nash equilibrium.
W.l.o.g. we assume that x k1 = 0 for each k ∈ N . Then there must exist another cryptocurrency, say j = 2, with x i2 > 0 for miner i. That is, the allocation of miner i is On one hand, allocation x ′ i is feasible if 0 < ǫ < x i2 . On the other hand, if other miners remain their allocations unchanged and miner i reallocate his computing power as x ′ i unilaterally, then miner i will obtain the whole reward from cryptocurrency 1 and his utility shall be The difference of utility is The last inequality is from the definition of ǫ. Thus we can conclude that the allocation x in which for some j ∈ M , x ij = 0 for each i ∈ N , is not a Nash equilibrium. Obviously, given the other miners' allocation profile x −i , utility function U i is concave and the domain {(x i1 , x i2 , · · · , x im )| m 1 x ij = h i , x ij ≥ 0} is convex and compact. Therefore, the optimal solution of (8) is the KKT point. By the first-order optimality condition, there exists a Lagrange multiplier α i such that Intuitively, at an equilibrium, each miner has the same marginal value on cryptocurrencies which they place positive allocation to and has lower marginal values on those cryptocurrencies that they do not assign computing power.
We first prove that each element of the Nash equilibrium solution which satisfies KKT condition (9) is positive. Given an allocation, let Y j = n i=1 x ij , 1, 2, · · · , m, for convenience. Lemma 2 If x is the NE solution of (8) which satisfies KKT condition (9), then x ij > 0 for each i ∈ N and j ∈ M .
Proof We will prove the correctness of this lemma by supposing to the contrary that there is at least one zero element in x. Then we try to drive the contradiction by distinguishing following two cases.
Case 1 There is only one miner, say miner 1, whose allocation profile has at least one element equal to zero.
Without loss of generality, assume x 11 = 0. Of course, his allocation profile must has at least one positive element, say x 12 > 0. At this time, the number of miners must be greater than or equal to 3. Otherwise, if there are only two miners, then miner 2 can obtain the whole reward of cryptocurrency 1, even though he only allocates arbitrarily small and positive computing power. Therefore the fact of no lower limit to his allocation, results in the nonexistence of the NE. So there are at least 3 miners in the game.
Based on the condition that there is only one miner having zero element, it is obvious that x i1 > 0 and x i2 > 0 for each i = 2, 3 · · · , n. Obviously, Y 1 = n i=2 x i1 and Y 2 = n i=1 x i2 . Since x 11 = 0 and x 12 > 0, the KKT condition (9) promises For each miner i = 2, 3, · · · , n, the following equations are right by the conditions of x i1 > 0 and x i2 > 0 and the KKT condition (9), From (10) and (11), we have By combining (12) and (13), In addition, since (14) can be rewritten as However, the condition of x 12 > 0 shows the inequality in (15) can not hold. It is a contradiction. Case 2 There are at least two miners in the game, whose allocations have elements equal to zero.
For this case, we first discuss the subcase that there are two miners, say miner 1 and 2, and two crptocurrencies, say crptocurrency 1 and 2, such that x 11 = 0, x 12 > 0 and x 21 > 0, Therefore, by the KKT condition (9), we have Hence, by (16) and (17), which is not right, since x 12 > 0 by assumption. Next, we will discuss the rest case, in which there are more than be two miners whose allocations have some elements equal to zero. Without loss of generality, assume x 11 = 0. At the same time, miner 1 must also have at least one positive element, say x 12 > 0. Now let us define the miner set as N ′ = {i ∈ N |x i1 > 0}. Clearly, x i2 > 0 for each i ∈ N ′ . If there is one miner i ∈ N ′ having x i2 = 0, then the previous subcase happens. Thus we have Y 1 = i∈N ′ x i1 . Similar to the analysis for Case 1, we can get the followings by KKT condition (9). Therefore, In addition, by the condition of Obviously, (20) is not right, because x 12 > 0. Conveniently, the following corollary can be derived directly from Lemma 2.
Corollary 1 An allocation x in the hash power allocation game is a Nash equilibrium, if and only if for each miner i ∈ N and any cryptocurrency j, there is a constant α i satisfying Proof Since each element of a Nash equilibrium solution is positive by Lemma 2, then KKT condition (9) promises (21) directly.
Based on the sufficient and necessary condition for a Nash equilibrium in Corollary 1, we will prove Theorem 1.
Proof of Theorem 1 We first prove that a hash power allocation profile x = (x ij ) is a Nash equilibrium, if and only if it has the form as x ij = µj m ℓ=1 µ ℓ · h i , for any i ∈ N and j ∈ M . It is not hard to see that once each x ij has the form as which is irrelevant to the cyprocurrency j and such a ratio can be defined as α i . Then the allocation x = (x ij ) with x ij = µj m 1 µ ℓ · h i is a Nash equilibrium by Corollary 1.
From Equation (22), we continue to have Then for any j ∈ M , where the last equality is from (23). Also Equation (24) guarantees Furthermore, the difference between (23) and (25) is Since n i=1 α i = (n − 1) · m 1 µj n i=1 hi is a constant, the right side of (26) is only related to index i, denote it by γ i . Then x ij = γ i µ j . By the condition of