Selfish Mining/Block Withholding Attack

Published by Mario Oettler on

The block withholding attack, also called selfish mining, comprises a strategy where a miner who finds a block withholds it.

It was first described by Hal Finney. You can read the original post here:

A more formal description provided by the Cornell university can be found here:

As we said, the attacker mines a valid block B but doesn’t publish it immediately. Instead, he starts to build upon this withheld block secretly. If the miner is successful and finds a second block C before any other miner publishes a block, he publishes both blocks.

The selfish miner keeps his block B secret that builds upon block A

If another miner publishes a block in the meantime, the selfish miner immediately publishes his block. In this case, we have a race condition. The attacker now hopes that other miners learn of his quicker and build on top of it or that his head start is big enough to find the second block first.

As soon as another miner publishes a block B’, the selfish miner publishes his block too.

This attack harms other miners as they continue hashing on an old block, wasting their resources. But this attack can also be used to launch a double-spend attack where the attacker includes a transaction from the address I to address II in a block he mined but didn’t publish. He controls both addresses. Then he buys something and creates a transaction from address I to the vendor’s address. After receiving the goods, he publishes the block with the first transaction (from I to II). Further readings: