Learn · IV

On Luck and Patience

The arithmetic of rain

An expected value is a promise made to a crowd, not to you.

The pool page tells you that at your hashrate a block arrives every so many days. That number is the expected time between blocks,

T = D · 232 / h

and it is honest. One petahash at 84 G gives a little over four days; ten petahash, ten hours. But it is a promise made to a crowd of miners, or to you across a very long life. It is not a promise about this month.

Over a stretch of time t you expect μ = t / T blocks, and the number you actually get is Poisson:

P(K = k) = e−μ μk / k!

Read it slowly. Within one expected time you find at least one block 63% of the time. Within two, 86%; within three, 95%. About one time in seven you wait more than twice as long as expected, and nothing is wrong. Try your own rig.

Figure 1

Your next stretch of time

Chance of each number of blocks over the period. Difficulty is the network's live figure.

Expected blocks—
Chance of none—
90% range—
Expected time—

The gaps between blocks are exponential, and the exponential's density is highest at zero. Short gaps are the most common kind, so blocks arrive in clumps, separated by droughts. Eyes raised on calendars see streaks and slumps in this. They are only what independence looks like.

Figure 2

Three years of rain

Three simulated years of a rig that expects a block every four days, about 91 a year. Each tick is a block.

Luck does average out, but more slowly than intuition expects. The relative spread of a Poisson count is 1/√μ. Over 10 expected blocks one standard deviation of income is about ±32%; over 100, ±10%. To be 90% sure of landing within 10% of the expectation you need about 270 expected blocks. For a single modern machine that is decades; for a small one, lifetimes.

Figure 3

How slowly luck averages out

Twelve simulated solo miners. Each line is what one has been paid so far, after our 2% fee, as a share of the full luck-free reward; it jumps at each block and sags in between. The faint curves are 98% × (1 ± 1.645/√μ), where about 90% of miners sit once μ is large. For comparison: a hypothetical pay-per-share pool charging 4%, a typical fee at the large Bitcoin pools.

Solo, after 2%Pay per share, after 4%

Look at what the comparison really is. A pay-per-share pool pays you the expected value of every share the moment you send it, whatever luck brings. It is selling insurance, and its fee is the premium. Solo mining keeps the premium and keeps the risk. On the same coin, the uninsured miner earns more on average, by the difference in fees (less the rare orphan); the insurer exists because averages are cold comfort to anyone with a power bill. The pool page's live comparison is a different question: solo ECX here against Bitcoin pay-per-share, per terahash.

So the question that matters is not the average. It is runway. If you can keep paying for power through k expected block times, the chance of reaching the end of that runway without a single block is

P(no block within kT) = e−k37% for k = 1 · 5% for k = 3 · 0.7% for k = 5

A miner with five expected block times of runway is playing a game with the odds well understood. A miner with one is buying a lottery ticket with good odds. Both are fine, as long as each knows which game they are in. And as the first essay showed, a drought earns you nothing: the expected wait always starts from now.

A few practical truths, in the same spirit:

  • When your block comes, the whole reward, less our 2% fee, is paid to your address inside the block itself.
  • A found block's reward must wait 100 blocks, about 17 hours, before it can be spent.
  • Rarely, two miners find a block at the same height and the network keeps only one. The other is orphaned and pays nothing. Luck giveth; luck taketh away.
  • Our Telegram bot, once you /watch your address, tells you when your wallet finds a block and when your rigs stop sending shares.