Source-linked AI summary
Unstable Throughput: When the Difficulty Algorithm Breaks
Dragos I. Ilie, Sam M. Werner, Iain Stewart, William J. Knottenbelt
TL;DR
Fluctuating miner hash rate and coin-hopping can interact with BCH’s cw-144 difficulty algorithm to produce unstable block timing. The paper derives NEFDA, a negative exponential filter algorithm, and simulations show it reduces target volatility and high variations in block solve times.
Problem
In cw-144, a simple moving average and economically rational miner behavior contribute to a positive feedback loop associated with unstable transaction throughput.
Source: B. Positive Feedback Loop in Simple… · p. 2Method
The paper derives NEFDA mathematically from exponential smoothing and compares it with cw-144 in simulated mining with coin-hopping hash-rate changes.
Source: §I · p. 1, §V · p. 3, §VI · p. 4Results
Simulations show NEFDA reduces target volatility and high variations in block solve times compared with cw-144.
Source: §VII · p. 4Takeaways & Limitations
NEFDA avoids forming a positive feedback loop and can cope with sudden hash-rate fluctuations.
Source: §VII · p. 4
Abstract
from arXiv · showhide
In Proof-of-Work blockchains, difficulty algorithms serve the crucial purpose of maintaining a stable transaction throughput by dynamically adjusting the block difficulty in response to the miners' constantly changing computational power. Blockchains that may experience severe hash rate fluctuations need difficulty algorithms that quickly adapt the mining difficulty. However, without careful design, the system could be gamed by miners using coin-hopping strategies to manipulate the block difficulty for profit. Such miner behavior results in an unreliable system due to the unstable processing of transactions. We provide an empirical analysis of how Bitcoin Cash's difficulty algorithm design leads to cyclicality in block solve times as a consequence of a positive feedback loop. In response, we mathematically derive a difficulty algorithm using a negative exponential filter which prohibits the formation of positive feedback and exhibits additional desirable properties, such as history agnosticism. We compare the described algorithm to that of Bitcoin Cash in a simulated mining environment and verify that the former would eliminate the severe oscillations in transaction throughput.
I. INTRODUCTION
PoW difficulty algorithms estimate hash rate from past blocks to balance transaction throughput, but fluctuating miner participation can expose them to instability. The paper presents NEFDA and evaluates it against cw-144, while relating its derivation and properties to prior difficulty-algorithm research.
I. INTRODUCTION
- Difficulty algorithms aim to stabilize throughput, but fluctuating computational power and miners shifting resources across chains can expose vulnerabilities and unstable block timing.Bitcoin Cash is cited as an example of observed instability.Source: §I · p. 1
- The paper derives NEFDA, a negative exponential filter difficulty algorithm, and compares its properties and performance with cw-144 in simulated mining.The introduction notes that proposals to replace cw-144 had already been put forward.Source: §I · p. 1
II. RELATED WORK
- Prior difficulty-algorithm research includes simulations of ASERT and EMA, while this work differentiates itself through a first-principles derivation of NEFDA and its properties.EMA is described as an approximation of ASERT that avoids exponential computation.Source: §II · p. 1
III. BACKGROUND
- Difficulty algorithms estimate hash rate from recent block data, with reactiveness reflecting how well they limit lag between actual and estimated hash rate.Difficulty adjustments are deterministic and based on prior blocks so nodes can independently agree on them.Source: §III · p. 1
A. BTC Difficulty Algorithm
BTC updates difficulty every 2,016 blocks using elapsed mining time, whereas BCH’s cw-144 estimates hash rate per block from an approximately 144-block window.
A. BTC Difficulty Algorithm
- BTC updates difficulty every 2,016 blocks, approximately every two weeks, based on the previous difficulty and the actual time to mine those blocks.The ideal inter-block time is 10 minutes; the passage identifies the elapsed time as the actual time for the last 2,016 blocks.Source: A. BTC Difficulty Algorithm · p. 2
B. BCH Difficulty Algorithm
- BCH’s cw-144 adjusts difficulty per block to respond to hash-rate influxes and effluxes, estimating hash rate from chain work divided by elapsed time.The elapsed time is capped between half a day and two days to prevent abrupt difficulty changes.Source: B. BCH Difficulty Algorithm · p. 2
- cw-144 computes chain work by summing block difficulties over an approximately 144-block interval, then uses the resulting hash-rate estimate to set new difficulty.The interval runs from Bstart to Bend.Source: B. BCH Difficulty Algorithm · p. 2
IV. EMPIRICAL ANALYSIS OF BCH’S DA
Although cw-144 achieves a daily average solve time of 10 minutes, Bitcoin Cash shows more severe hourly block-count swings than Bitcoin, especially in later months.
IV. EMPIRICAL ANALYSIS OF BCH’S DA
- The empirical analysis examines issues arising from the use of cw-144 in Bitcoin Cash.Source: §IV · p. 2
A. Oscillations in Number of Blocks Mined per Hour
- A daily average solve time of 10 minutes masks substantial intraday variation in BCH block arrivals.The reported daily average is the intended cw-144 target, despite the hourly oscillations.Source: A. Oscillations in Number of Blocks… · p. 2
- BCH’s hourly block counts oscillate more severely than BTC’s, with more later one-hour periods containing either many blocks or none.Figure 1 compares the number of blocks mined per hour in BTC and BCH.Source: Figure 1 · p. 2, A. Oscillations in Number of Blocks… · p. 2
B. Positive Feedback Loop in Simple Moving Averages
The simple moving average and coin-hopping behavior combine to create a positive feedback loop in BCH block solve times. NEFDA is derived using exponential smoothing and real-time targeting (RTT), with a separate section devoted to RTT safety.
B. Positive Feedback Loop in Simple Moving Averages
- Short solve times falling out of cw-144’s 144-block window lower estimated hash rate, while long solve times falling out raise it.The moving average gives departing solve times equal weight, creating correlation between solve times 144 blocks (24 hours) apart.Source: B. Positive Feedback Loop in Simple… · p. 2
- Coin-hopping miners move computational power to BCH when it becomes more profitable, then leave as difficulty rises and profitability falls.The resulting short solve times are followed by long solve times when difficulty is too high, reinforcing the cycle; the effect is more significant because BCH’s base hash rate is approximately 3% of BTC’s.Source: B. Positive Feedback Loop in Simple… · p. 2
V. NEGATIVE EXPONENTIAL FILTER DIFFICULTY ALGORITHM
- NEFDA is mathematically derived from exponential smoothing, a technique for removing noise from time-series data.The derivation introduces the decay/smoothing factor S.Source: §V · p. 3
- NEFDA uses real-time targeting, dynamically adjusting the difficulty of the block being mined as time passes.The paper says it argues for the safety of this less popular technique in Section V-C.Source: §V · p. 3
1) Estimating Current Hash Rate:
The method estimates current network hash rate by exponentially smoothing block difficulties, using mined blocks as samples.
2) Estimating Current Hash Rate:
- Block difficulties are exponentially weighted to estimate the current network hash rate.The method treats each difficulty D_i as the hashes computed at time t_i.Source: 1) Estimating Current Hash Rate · p. 3
- The actual hash-rate function is unavailable, so the estimate relies on samples taken when blocks are mined.The estimate uses the series of block difficulties.Source: 1) Estimating Current Hash Rate · p. 3
- On average, D_i represents the number of hashes computed during the interval (t_i−1, t_i].The estimate approximates those hashes as occurring at t_i.Source: 1) Estimating Current Hash Rate · p. 3
2) Difficulty Computation:
The section obtains the next block’s difficulty by unwinding the recurrence relation to D_0.
2) Difficulty Computation:
- The next block’s difficulty D_n is obtained by unwinding recurrence relation (8) back to D_0.The passage introduces the resulting expression as the difficulty of the next block.Source: 2) Difficulty Computation · p. 3
- The section presents the unwound expression as the next-block difficulty.The provided text identifies this role but does not give the expression’s readable formula.Source: 2) Difficulty Computation · p. 3
- The derivation starts from recurrence relation (8) and unwinds it all the way to D_0.The supplied passages do not state the resulting expression’s terms.Source: 2) Difficulty Computation · p. 3
3) Correction:
A correction to the exponential factor is justified by considering a constant-hash-rate scenario in which average difficulty should not change.
3) Correction:
- When T ≪ S, the approximation 1 + T/S ≈ e^T/S motivates correcting the discrete-series bias.The passage identifies the correction as addressing bias from using discrete difficulties rather than a continuous hash-rate function.Source: 3) Correction · p. 3
- Under constant hash rate, the expected average rate of change in difficulty is R = 1.The scenario assumes the rate remains constant for many blocks between m and n.Source: 3) Correction · p. 3
- The derivation uses the geometric mean of consecutive difficulty ratios from block m to n to determine the correction constant.It sets S = 1, implying c = e^T/S.Source: 3) Correction · p. 3
- Applying the justified correction to equations (8) and (9) yields relative and absolute forms.The passage does not provide those forms in readable text.Source: 3) Correction · p. 3
A. Properties
History agnosticism means block-arrival timing does not influence the difficulty of the block currently being mined.
A. Properties
- The distribution of blocks within a time period does not influence the current block’s difficulty.Equation (13) makes difficulty at time tα depend only on blockchain height, regardless of when earlier blocks were mined.Source: 1) History Agnosticism · p. 3
- Block-arrival history is irrelevant whether blocks were mined long ago, recently, or evenly over time.Source: 1) History Agnosticism · p. 3
- Equation (13) bases difficulty at time tα only on blockchain height.Source: 1) History Agnosticism · p. 3
2) Lack of Autocorrelation:
NEFDA’s history agnosticism entails no positive autocorrelation, while its smoothing factor controls responsiveness and its simulations show behavior under extreme coin-hopping conditions.
2) Lack of Autocorrelation:
- History agnosticism entails a lack of autocorrelation and prevents hash-rate spikes or deserts from creating positive feedback.Sudden hash-rate changes may still cause temporary spikes or deserts, but their duration is expected to be much shorter.Source: 2) Lack of Autocorrelation · p. 3
B. Smoothing Factor Considerations
- S sets NEFDA’s maximum upward difficulty adjustment rate; for BCH, the proposed heuristic suggests approximately 12 hours.Difficulty can increase by at most a factor of e in S/T blocks; smaller S is recommended for regularly fluctuating hash rates, while larger S can reduce volatility for relatively stable hash rates.Source: B. Smoothing Factor Considerations · p. 4
C. Real Time Targeting Considerations
- NEFDA’s timestamp manipulation affects only the block with the dishonest timestamp, unlike cw-144’s lowered difficulty for the next 144 blocks.Building on such a dishonest block entails mining toward difficulty eT/S times higher than the previous block; the authors argue that honest miners would not risk accepting it.Source: C. Real Time Targeting Considerations · p. 4
VI. SIMULATION
- 599.97 s for NEFDA versus 604.34 s for cw-144; hourly block-count autocorrelation shows no positive feedback for NEFDA.cw-144 has significant positive autocorrelation at multiples of 24 hours, while NEFDA has negative correlation between consecutive hourly buckets. The simulation uses 100,000 blocks, with greedy and variable coin-hoppers each at four times the base hash rate.Source: §VI · p. 4, Figure 3 · p. 4
VII. CONCLUSION
The conclusion identifies cw-144’s positive feedback loop as a source of throughput instability and presents NEFDA as a simulated alternative intended to reduce it.
VII. CONCLUSION
- Economically rational miner behavior can combine with cw-144’s positive feedback loop to produce severe transaction-throughput instability.Source: §VII · p. 4
- NEFDA is derived to avoid positive feedback and cope with sudden hash-rate fluctuations.Source: §VII · p. 4
- Simulations show NEFDA reduces target volatility and high variations in block solve times.Source: §VII · p. 4
- The authors describe appropriately configured NEFDA as a viable alternative for large and small blockchains that may support more stable transaction throughput.Source: §VII · p. 4