<p>It's not a valid working process: the block hash commits to all transactions.</p>
<p>First of all a miner cannot &quot;find a right hash&quot; then insert a double-spend transaction. This would invalidate the hash (and the block, actually).<br />
For the same reason, a node receiving the block cannot malleate the coinbase transaction. It would not be able to &quot;immediately produce a block&quot; either.</p>
<p>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, ...).<br />
The cost of producing a valid PoW is so high that you would not expect a miner to commit energy to an invalid block.</p>

CC BY-SA 4.0
2020-12-20T11:42:30.373Z
2022-06-21T09:22:40.990Z
2022-06-21T09:22:40.990Z
Antoine Poinsot
<p>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</p>
<p>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.</p>
<p>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 ?</p>

CC BY-SA 4.0
2020-12-21T18:54:44.743Z
Related: https://bitcoin.stackexchange.com/q/95564/5406, https://bitcoin.stackexchange.com/q/51300/5406, https://bitcoin.stackexchange.com/q/17231/5406, …
Murch
<blockchain><security><mining-pools><mining-theory><hash>
Stealing a correct hash because of an invalid block
Saxtheowl
# Stealing a correct hash because of an invalid block

(Asked by: username_0 on 2020-12-20)

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 ?

**Tags:** blockchain, security, mining-pools, mining-theory, hash

> **Comments:**
> **username_1**: Related: https://bitcoin.stackexchange.com/q/95564/5406, https://bitcoin.stackexchange.com/q/51300/5406, https://bitcoin.stackexchange.com/q/17231/5406, …  

---

## 1 answers

### Answer by username_2 on 2020-12-20. Score: 4 | Accepted answer

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.


---

