1

Suppose that a miner find the right hashes but involuntarily or by malicious intention then create an invalid block, like trying to double spend a transaction

My guess is that the moment this block is broadcast the first node to receive and test this block will immediately copy the correct hashes and produce a block of his own this one valid and with his own coinbase address.

I know that this scenario has little chance to happen because miner know that their coinbase will be steal and rejected by the network, but is this a valid working process ?

Saxtheowl
  • 2,800
  • 9
  • 17
  • 35
  • Related: https://bitcoin.stackexchange.com/q/95564/5406, https://bitcoin.stackexchange.com/q/51300/5406, https://bitcoin.stackexchange.com/q/17231/5406, … – Murch Dec 21 '20 at 18:54

1 Answers1

4

It's not a valid working process: the block hash commits to all transactions.

First of all a miner cannot "find a right hash" then insert a double-spend transaction. This would invalidate the hash (and the block, actually).
For the same reason, a node receiving the block cannot malleate the coinbase transaction. It would not be able to "immediately produce a block" either.

In addition, blocks have consensus rules and a valid block does not only consist of a block header hash inferior to the target but must respect a number of other rules as well (locktimes, existing outpoints, valid scripts, ...).
The cost of producing a valid PoW is so high that you would not expect a miner to commit energy to an invalid block.

Antoine Poinsot
  • 8,334
  • 2
  • 17
  • 34