Blockhash for Randomness vs Block Withholding Attack

Here’s a more thorough analysis of a miner attack.

Let’s illustrate the probabilities:

There’s a 97% chance another miner finds the block, multiplied with a 1/4 chance it’s a winning block. Likewise the miner has a 3% chance of finding the block and then there’s another 1/4 chance it is a winning block.

However, if he does find a block and it’s a loser, an honest miner would broadcast it and get zero payout. Instead, an attacking miner sees an opportunity to withhold this block and so the tree replicates at this point. Then again there’s a slight chance the same repeats. Mathematically, the expected payout can be formulated as an infinite geometric series.

I made a table in excel to show the attacking miner’s profitability.

The selected cell shows a miner with a 2% share who places a 25 XCP wager at neutral odds at winning 100 XCP, but with a 3% fee on the payout, so it’s total 97 XCP. He has a slightly negative expected profit on this bet, even though a withholding attack is taken into account.

To understand what I mean by profit, consider the 100% column. In this hypothetical scenario the miner controls all the hashing power. He can withhold blocks until he finds one where he wins, thus he’s guaranteed to win. Since the payout after fee is 97 XCP and he wagered 25 XCP, his profit is 72 XCP.

A more realistic example is maybe a large 16% pool performing the attack. It turns out a 50/50 coin flip bet is the most lucrative. From 100 XCP at stake (50 of his own, 50 counterwager) he expects to earn 2.72 XCP.

Now take into account the opportunity cost. By withholding a block he loses (at the moment) roughly $30,000. He needs to expect to profit at least this amount on the lottery, else a withholding attack does not make sense.

Since he only profits an expected 2.72 XCP per 100 XCP at stake, the lottery must be worth at least $1.1 mlin, of which $550,000 worth of XCP is wagered by himself.

With a lower oracle fee, the threshold for a withholding attack is reduced somewhat - but not dramatically.

Even with no fee the 16% miner needs $690.000 at play on a coin flip to do a withholding attack.