SIAM News Blog
SIAM News
Print

Cryptocurrencies, Mining, and Mean Field Games

By A. Max Reppen and Ronnie Sircar

Most discussion about cryptocurrencies—particularly Bitcoin—concerns the wildness of their prices, which seem to follow perpetual cycles of speculative mania and ensuing collapse. This article is not about their prices. Instead, we are interested in understanding and modeling the interactions of Bitcoin miners and the consequent evolution of wealth inequality among participants. A primary debate in regulatory conversations pertains to whether cryptocurrencies are currencies or commodities (or even share-like assets with their initial coin offerings). Although this issue is not settled by any means, the U.S. Commodity Futures Trading Commission classifies cryptocurrencies as commodities, and their electronic structure of production mirrors the uncertainty and language of mining resources in finite supply.1 The latter connects us to game theoretic models that researchers have developed to explain energy production from various sources, many of which—like oil—are exhaustible [8, 9].

Much of the promise and buzz around crypto comes from novice investors who score a quick profit off of an astounding price soar — doesn’t everyone know someone who claims to have had such speculative success at one time or another?2 But again, we are not discussing prices here. One argument maintains that data privacy concerns might conceivably be allayed by a payment and banking system that is founded on the underlying blockchain technologies, though a largely unregulated network could have myriad unintended benefits for trafficking and laundering. The hype may parallel that of the liberating internet a quarter-century ago, which promised that anyone would be able to communicate whatever they wanted to everyone. Now of course we do just that. Time will tell the future of cryptocurrencies in society.

Many interesting modern problems in financial mathematics and engineering lie at different points along the spectrum between economic and financial models. In our classification, one might think of economic models as concerned with the “why” and “how,” and financial models more with the “what.” Economic models are primarily intended to describe interdependencies, and for this purpose they are often simple — particularly about including evolution over time. As such, they may cover only one or two periods of time. These models largely ignore complex stochasticity, often subsuming uncertainty into expected quantities. But they focus on players—investors, producers, and consumers—whose rationales dictate demand and supply, as well as market mechanisms that clear them through prices. Financial models are phenomenological; prices look unpredictable and are modeled directly as stochastic processes that are intended for calibration from past data. Market participants are price takers, and price models are usually driven by some uncontrolled Brownian motions without addressing cause.

Figure 1. Evolution of the wealth distribution of miners over time. Low-wealth miners stop mining (mass accumulates at the threshold point) because they cannot compete at a small scale, which further drives profits to wealthier miners. Figure courtesy of the authors.
In the context of so-called proof-of-work cryptocurrency mining, an economic model captures the cost-reward structure of mining. The cost is typically the marginal cost of electricity, and the potential reward is the units of currency that are rewarded to successful miners. Similar to models of natural resource extraction, the miners are producers — but in this case the product is numbers. These numbers, called hashes, come from processing transaction data. Because of the demand for processing, there is effectively also a demand for hashes. Like in any other market, the suppliers (miners) are competing to satisfy this demand. And as with other markets, the (expected) reward per hash obtained is diminishing in the aggregate supply (mining power).

However, calling this system a market for hashes masks the actual mechanism, since it is not the numbers that are valuable. Instead, the value lies in the process that “extracts” (mines) the numbers; the numbers themselves are just a byproduct. This process is an artificial math puzzle that is meant to disincentivize bad behavior by forcing miners to provide proof-of-work that some effort has been exerted in the form of electricity paid. But because of the puzzle’s construction, there is only demand for certain numbers, i.e., solutions to the puzzle. Moreover, the puzzle is constructed so that any attempted solutions have an equal chance of being correct, thus causing correct solutions to appear randomly. So while an oil producer outputs a barrel of oil with relative certainty, a miner outputs a binomial random variable that is only observable after production. The success probability of the binomial variable is adjusted by the “demand” and decreasing in the supply.

A successful outcome is the right to record the next set of transactions—the next block—on the blockchain. Simplified, miners only receive the reward (the solution hash “bought” on the market) if the block is consistent with past blocks. Since the mining cost is paid upfront, only consistent blocks are accepted. In particular, the market demand is such that the average rate of global success is constant. Altogether, a miner’s success probability for the next block is their share of total hash production. Miner \(i\) who produces \(\alpha^i\geq0\) hashes has a success probability of \(\alpha^i/(M \bar{\alpha})\), where \(M\) is the number of miners, \(\alpha^j\) is the effort of miner \(j\), and \(\bar{\alpha}\) is the average hash rate \(\frac1M\sum_{j=1}^M \alpha^j\). 

We now describe a model that we developed and studied with Zongxi Li3 [7]. For a large number of miners, \(\alpha^i\) has a relatively small impact on the global average. Thus, \(M \bar{\alpha} \approx \alpha^i + (M-1) \bar{\alpha}\) and \((M-1)\bar{\alpha}\) approximates the aggregate competition. The competition for each reward is repeated indefinitely. In continuous time, every miner chooses their hashing rate \(\alpha^i_t\). The binomial outcomes are represented by a counting process \(N^i_t\) with a jump intensity \(\lambda_t^i\) that is proportional to the share of global hashes:  

\[\lambda_t^i =\frac{\alpha^i_t}{D(\alpha^i_t + (M-1)\bar{\alpha_t})}, \quad D>0.\tag1\]

With a reward \(r\) per success and a cost \(c\) per hash, a miner’s wealth evolves as \(\textrm{d}X^i_t = - c \alpha^i \textrm{d} t + r \textrm{d}N^i_t\). All miners maximize their expected utility \(U\) at a fixed horizon \(T\):

\[v(t,x; \bar{\alpha}) = \sup_{\alpha}\mathbb{E}[U(X^i_{T})|X^i_{t} = x].\]

The interaction between agents in \((1)\) occurs through the mean global hash rate, so we have a mean field game of controls — also known as an extended mean field game [3]. Researchers have also studied a related mean field game with individually controlled stochastic jumps that represent new oil discoveries [4]; in our model \((1)\), the jump intensities depend on the mean field interaction.

Given the actions of other miners, which are represented by their average \(\bar{\alpha}\), a representative miner finds the optimal hash rate \(\alpha^*\)—the best response to the observed aggregate competition \((M-1)\bar{\alpha}\)—by solving the Hamilton-Jacobi-Bellman (HJB) partial differential-delay equation

\[\partial_t v + \sup_{\alpha\geq0}\left(-c \alpha \partial_x v + \frac{\alpha}{D(\alpha+(M-1)\bar{\alpha}_{t})}\Delta v\right) = 0.\tag2\]

Here, \(v(T,x)=U(x)\) and \(\Delta v= v(t,x+r;\bar{\alpha}) - v(t,x;\bar{\alpha})\). To close the system, we use the Fokker-Planck equation for the probability density \(m(t, x; \bar{\alpha})\) of the miner’s wealth at time \(t\): 

\[\partial_t m - \partial_x (c\alpha^{*}(t,x)m) -\]

\[\frac{1}{D}\left(\frac{\alpha^{*}(t,x-r)}{\alpha^{*}(t,x-r)+(M-1)\bar{\alpha}_t}m(t,x-r;\bar{\alpha})-\frac{\alpha^{*}(t,x)}{\alpha^{*}(t,x)+(M-1)\bar{\alpha}_t}m(t,x;\bar{\alpha})\right) = 0.\tag3\]

The mean field equilibrium is the fixed point

\[\bar{\alpha}_t^* = \int_\mathbb{R} \alpha^*(t, x; \bar{\alpha}^*) m(t, x; \bar{\alpha}^*) \textrm{d} x,\tag4\]

which is characterized by equations \((2)\), \((3)\), and \((4)\). This characterization is amenable to numerical analysis, which one can implement by iteratively solving \((2)\) and \((3)\), together with an updating step based on \((4)\) in between.

Figure 2. The share of total profits for a miner with cost \(k_c c\) instead of \(c\). With only a 30 percent advantage, the advantaged miner captures 90 percent of the total profits with \(M=1000\) competitors. Figure courtesy of the authors.

Numerical computations reveal the presence of a phenomenon called preferential attachment, or “the rich get richer,” which means that those who have more also receive more in a manner that is disproportionate to the wealth difference. These results are consistent with empirical findings [6]. Figure 1 shows the evolution of the wealth distribution of miners. The source of this preferential attachment is the fact that wealthier miners have disproportionally strong incentives to mine, which leads to the emergence of mining pools in the real world. This growth of wealth imbalances has the potential to drive mining centralization, which weakens the security of cryptocurrency. These effects are exacerbated when some miners have a cost advantage over the competition, i.e., lower costs \(c\) than others. This last point is illustrated in Figure 2, where one miner has a cost advantage and captures most of the net profits in the market.

Thus far, our analysis has been primarily numerical. However, this application motivates the mathematical study of these novel mean field games of intensity control, as well as their coupled system of partial differential-delay backward HJB and forward Fokker-Planck equations.

This work is based on Ronnie Sircar’s invited talk at the 2020 SIAM Annual Meeting, which took place virtually last July. Sircar’s presentation is available on SIAM’s YouTube channel.


1For example, Bitcoin were created in January 2009 and are limited to 21 million, with about 17 million currently in circulation.
2There may be cryptocurrencies that are this modern commodity’s analog of snake oil.
3Other recent studies focus on very different aspects of cryptocurrency mining [1, 2, 5].


References
[1] Alsabah, H., & Capponi, A. (2020). Pitfalls of Bitcoin’s proof-of-work: R&D arms race and mining centralization. Preprint, SSRN.
[2] Bertucci, C., Bertucci, L., Lasry, J.-M., & Lions, P.-L. (2020). Mean field game approach to bitcoin mining. Preprint, arXiv:2004.08167.
[3] Carmona, R., & Delarue, F. (2018). Probabilistic theory of mean field games with applications I-II. Cham, Switzerland: Springer.
[4] Chan, P., & Sircar, R. (2017). Fracking, renewables, and mean field games. SIAM Rev., 59(3), 588-615.
[5] Cong, L., He, Z., & Li, J. (2020). Decentralized mining in centralized pools. Rev. Fin. Studies, hhaa040.
[6] Kondor, D., Pósfai, M., Csabai, I., & Vattay, G. (2014). Do the rich get richer? An empirical analysis of the Bitcoin transaction network. PLoS ONE, 9(2), e86197. 
[7] Li, Z., Reppen, M., & Sircar, R. (2019). A mean field games model for cryptocurrency mining. Preprint, arXiv:1912.01952.
[8] Ludkovski, M., & Sircar, R. (2015). Game theoretic models for energy production. In R. Sircar, R. Aïd, & M. Ludkovski (Eds.), Commodities, Energy and Environmental Finance. New York, NY: Springer.
[9] Sircar, R. (2009, January 10). Modeling the market for a diminishing resource. SIAM News, 42(1), p. 1.

A. Max Reppen is an assistant professor at Boston University’s Questrom School of Business. He received his Ph.D. from the Department of Mathematics at ETH Zürich and was previously a postdoctoral research fellow in Princeton University’s Department of Operations Research and Financial Engineering (ORFE). Ronnie Sircar is a professor in the Department of ORFE at Princeton.

blog comments powered by Disqus