5

I understand that to mine a block, miners solve a cryptographic problem and the solution can be easily verified by other nodes on the network, appending the new block to their blockchain.

But why do miners consent that some other miner managed to mine a valid block before them? Why don't they claim that some other miner's block is invalid even if it actually isn't, and buy time to mine one themselves? Is it because all non-miners will validate anyway and miners don't want to risk having a discarded chain?

9

Mining is a random, progress-free process. Miners are essentially attempting to find a partial pre-image of a hash. Each new (valid) block candidate has exactly the same minuscule chance of yielding a new block. This means that finding a block for the next height is just as likely as finding a block that competes with the current chain-tip.

However, finding the next block is a lot more profitable: the current chain-tip has already been relayed to a large part of the network and all other miners are trying to find it's successor. Mining has a real cost, and only blocks that end up being a part of the best chain get paid out. To successfully compete with the current chain-tip, the miner would have to first find that competing block and then another to make it part of the best chain. It doesn't make sense for a single miner to try to find two blocks while all remaining miners only needs to find one more block to thwart him. Rather, the miner will spend a fraction of a second to validate the current chain-tip and try to find the next block.

There are two exception to the above behavior: Firstly, when a miner controls a significant portion of the total hashrate, they can theoretically attempt to increase their revenue disproportionately by starting to mine on new found blocks before publishing them, gambling on finding two blocks before the remaining network does. This attack is referred to as. Secondly, when a miner controls at least half of all mining power, they can maintain a monopoly on creating blocks by ignoring all foreign blocks and outhashing all other mining power in a so-called . This is a popularly discussed failure scenario for Bitcoin and would likely undermine trust in Bitcoin altogether.

| improve this answer | |
  • Is there something preventing the majority-attack from claiming credit for the foreign block instead of just ignoring it? – JollyJoker Apr 27 at 13:18
  • 2
    @JollyJoker: Assuming that with "claiming credit" you mean "changing the coinbase transaction to send the block reward to the attacker", yes: they'd have to change a transaction in a block. Changing a transaction by any byte will change the transaction's id. This will mean that the Merkle root no longer matches the block's transaction body, so they have to update the Merkle root. Changing the Merkle root changes the hash of the block header, which invalidates the proof of work. ⇒ changing any byte in a block means starting over. – Murch Apr 27 at 14:49
9

But why do miners consent that some other miner managed to mine a valid block before them?

Any miner that is spending resources to find a new block will want to ensure that they are spending those resources in a way which gives them the highest chance of finding a valid block. Doing anything which lowers this chance is counter to their incentives, especially considering the competitive nature of mining.

So consider that when a miner hears about a new block, they would have two options:

  • Start mining on top of the new block
  • Ignore the new block, keep mining on the old one

With option one, if the miner is successful in finding the next new block, then they will receive the block reward for it.

With option two, if the miner is successful in finding a valid block, they will submit it to the network, but the network will already have heard about the other block at that same height. In this case, the rest of the network's miners will have already been mining on the block our miner chose to ignore. So now our block-ignoring miner will have to mine another block, so that their chain will become longer than the other chain that the other miners are working on. Otherwise, if the other miners extend their chain first, our block-ignoring miner will have wasted resources trying to create their own chain!

If the other miners have more hashpower than the block-ignoring miner, then it is very likely the block-ignoring miner will fail. Consider that if you had 10% of the hashpower, you would fail to find the next block 90% of the time. And of course finding two blocks in a row is even harder!

Remember that mining is a memoryless, poisson distributed process, which means that every individual attempt at finding a valid hash has an equal probability of success. Think of it like rolling a di: if you roll ten '5's in a row, your chance of rolling a '5' on the next roll is still (1/6). The same principle applies to mining.

Why don't they claim that some other miner's block is invalid even if it actually isn't, and buy time to mine one themselves?

Every node on the network checks to see if each new block is valid, so there is no way for a miner to 'claim a block is invalid'. It simply is valid, or is not, this is easy for nodes to verify themselves.

Is it because all non-miners will validate anyway and miners don't want to risk having a discarded chain?

Yes.

| improve this answer | |
  • very well explained – Aditya Apr 26 at 17:09
5

But why do miners consent that some other miner managed to mine a valid block before them? Why don't they claim that some other miner's block is invalid even if it actually isn't, and buy time to mine one themselves? Is it because all non-miners will validate anyway and miners don't want to risk having a discarded chain?

Yes, it's precisely because of the behavior of honest non-miners.

If miners want to get paid, their blocks have to be accepted by the honest non-miners who are willing to buy bitcoin from them. Honest non-miners accept only valid blocks and prefer the "longest" chain of such blocks.

If a miner ignores a valid block, they will produce a shorter chain if they successfully mine a block. So they are less likely to get paid. If a miner mines on top of an invalid block, there is zero chance any honest non-miner would ever accept their block, so they can't possibly get paid.

So miners are incentivized to validate every block before they mine on top of it and to mine on top of the "longest" valid chain they can find at any particular time.

| improve this answer | |
0

The miners gather up as many transactions as can fit into a block, and go through a mathematical process to verify the block and add it to the chain of past blocks. Miners are then rewarded in freshly minted bitcoin for contributing their computing resources to the network. Validated transactions are stored into a block and are sealed by a lock (hash). This block becomes part of the blockchain when other computers in the network validate if the lock on the block is correct. Now the transaction is part of the blockchain and can not be altered in any way.

| improve this answer | |
  • Hey Lilmighty, this answer does a decent job of describing the mining process. I'd have the nit that finality of transactions is always probabilistic as a competing valid chain-tip of greater length could displace a previously created chain-tip. However, the question here was more specifically about the incentives of miners to move to mining the next block which this answer doesn't cover yet. – Murch Apr 26 at 8:03
  • @Murch...after I re-read the question then my answer I was just starting to realize that. Thank you for the feedback tho! I need it, that was only my 2nd answer ever! – Lilmighty Apr 26 at 8:11

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.