[Paper Review] Analysis of Difficulty Control in Bitcoin and Proof-of-Work Blockchains
This paper proposes a stochastic model for block arrival times in Bitcoin and proof-of-work blockchains, explicitly modeling difficulty as a random variable dependent on prior block times. It derives the marginal distribution of blocktimes as a Lomax distribution, showing that expected blocktime is $\frac{\theta_n}{N-1}$ and variance is $\frac{\theta_n^2 N}{(N-1)^2(N-2)}$, with key insight that even with constant hashrate, blocktimes are faster by a factor of $N/(N-1)$ due to the retargeting rule.
This paper presents a stochastic model for block arrival times based on the difficulty retargeting rule used in Bitcoin, as well as other proof-of-work blockchains. Unlike some previous work, this paper explicitly models the difficulty target as a random variable which is a function of the previous block arrival times and affecting the block times in the next retargeting period. An explicit marginal distribution is derived for the time between successive blocks (the blocktime), while allowing for randomly changing difficulty. This paper also aims to serve as an introduction to Bitcoin and proof-of-work blockchains for the controls community, focusing on the difficulty retargeting procedure used in Bitcoin.
Motivation & Objective
- To develop a stochastic model for block arrival times that accounts for the dynamic difficulty retargeting rule in Bitcoin and similar proof-of-work blockchains.
- To explicitly model the difficulty target as a random variable dependent on previous block arrival times, capturing the feedback loop in the system.
- To derive the marginal distribution, expected value, and variance of blocktimes under this stochastic model.
- To provide a foundation for controls theory analysis of blockchain systems, particularly focusing on difficulty adjustment mechanisms.
- To compare analytical results with simulations to validate the model's accuracy under varying network conditions.
Proposed method
- Model block arrival times as a doubly stochastic Poisson process where the intensity depends on prior block times through the difficulty retargeting rule.
- Define the difficulty adjustment period as $N=2016$ blocks, with difficulty updated every $N$ blocks based on actual time elapsed.
- Use an Erlang distribution to model the average hashrate $\bar{\lambda}_n$ over each retargeting interval, derived from the sum of $N$ exponential inter-arrival times.
- Derive the marginal distribution of blocktimes $X_{(n-1)N+k}$ for $n>1$ by compounding an exponential distribution with a random rate parameter drawn from an Erlang distribution.
- Apply compound distribution theory to show that the resulting marginal distribution is Lomax with shape $N$ and scale $\theta_n = \frac{\delta_n}{\beta}$.
- Compute the expected value and variance of blocktimes using the properties of the Lomax distribution, accounting for stochastic difficulty.
Experimental results
Research questions
- RQ1How does the difficulty retargeting rule in Bitcoin affect the statistical distribution of block arrival times?
- RQ2What is the marginal distribution of blocktimes when difficulty is dynamically adjusted based on past block times?
- RQ3How do the expected value and variance of blocktimes change under stochastic difficulty compared to a fixed-difficulty model?
- RQ4What is the impact of the retargeting period $N$ on the stability and predictability of blocktimes?
- RQ5How does the model's analytical prediction compare to simulated block arrival patterns?
Key findings
- The marginal distribution of blocktimes $X_{(n-1)N+k}$ for $n>1$ is Lomax with shape $N$ and scale $\theta_n = \frac{\delta_n}{\beta}$, derived from compounding an exponential distribution with a random rate from an Erlang distribution.
- The expected blocktime is $\mathbb{E}[X_{(n-1)N+k}] = \frac{\theta_n}{N-1} = \frac{N}{(N-1)\delta_n}\beta$, which exceeds the target $\beta$ by a factor of $\frac{N}{N-1}$ even under constant hashrate.
- The variance of blocktimes is $\mathrm{Var}[X_{(n-1)N+k}] = \frac{\theta_n^2 N}{(N-1)^2(N-2)} = \frac{N^3}{(N-1)^2(N-2)\delta_n^2}\beta^2$, which diverges for $N=2$ due to infinite variance in the Lomax distribution.
- For $N=2016$ as in Bitcoin, the expected blocktime is only slightly faster than $\beta$, with $\frac{N}{N-1} \approx 1.000496$, indicating high stability.
- Simulations confirm that the difficulty adjustment algorithm performs poorly for small $N$, such as $N=2$, where the variance is infinite and blocktimes fluctuate wildly.
- The model reveals that the standard Bitcoin retargeting rule introduces inherent statistical variability in blocktimes, even when hashrate is constant, due to the stochastic nature of the difficulty update process.
Read this paper
Open the full text in the Nubint reader and ask about any passage as you read.
Read this paper on NubintThis review was generated by AI from the original paper. Please check the paper before citing it.