<p>The first transaction in a block is the so-called coinbase transaction and it is this that pays block-reward and transaction fees to the miner's address.</p>
<p>Note that these details are <em>contained within the block</em> and are not external accompanying information.</p>
<p>This coinbase transaction's data affects the block hash, so changing the coinbase output to pay a bad guy would change the block hash to one that almost certainly fails to be less than the target and so is an invalid block.</p>
<hr />
<blockquote>
<p>he reads my candidate solution, steals it and writes a new candidate block that he sends on the network with his public key and his signature.</p>
</blockquote>
<p>a block with (i.e. <em>containing</em>) a different public key or a different signature is a different block with a different hash - the &quot;solution&quot; is different and almost certainly invalid (hash &gt; target).</p>

CC BY-SA 4.0
2023-09-14T18:40:17.750Z
Thanks you answered my question. I had not understood before that the cryptographic problem was different for each of the miner because each miner included his own public key in the transaction
totalMongot
CC BY-SA 4.0
2023-09-13T19:18:42.587Z
2023-09-13T20:09:54.467Z
2023-09-13T20:09:54.467Z
RedGrittyBrick
<p>Some questions already adressed similar issues (<a href="https://bitcoin.stackexchange.com/questions/54535/preventing-fraud-in-a-mining-pool">preventing fraud in a mining pool</a>, <a href="https://bitcoin.stackexchange.com/questions/10687/what-prevents-a-pool-miner-from-stealing-an-entire-block">what prevents a pool miner for stealing an entire block</a>) but my question is different from those, if I understand correctly the mechanism.</p>
<p>Here is my point: Let's say for simplification there are only three nodes in the blockchain:</p>
<ul>
<li>Platform node, the only platform where you can exchange BTC for FIAT, in America</li>
<li>My node, in Europe</li>
<li>Bad guy's node, in Europe</li>
</ul>
<p>My and bad guy's node are both mining, as well as Platform's node. Now, imagine I find the solution for a block at T time. At T + 1 second, my node sends the solution on the network. My solution is made of:</p>
<ul>
<li>My public key where I'm getting the reward</li>
<li>Data = block with the solution</li>
<li>Signed Data with my key</li>
</ul>
<p>At T+ 2 seconds, bad guy's node receives the solution. But bad guy has a special code snippet: he reads my candidate solution, steals it and writes a new candidate block that he sends on the network with his public key and his signature.</p>
<p>Because he has better connection, CPU or whatever network tricks, Bad Guy's candidate block arrives to platform's node at T+3 seconds and my candidate block arrives at T+4 secondes.</p>
<p><strong>Question:</strong>
So in this situation, the reward from mining would go to the bad guy's node from the point of view of the platform's node. And I would not be able to recover them in FIAT. What mechanism prevents such a stealing?</p>

CC BY-SA 4.0
2023-09-13T18:17:51.253Z
The block is not protected by the block author’s signature, it is protected by proof of work. Does https://bitcoin.stackexchange.com/q/95564/5406 answer your question?
Murch
CC BY-SA 4.0
2023-09-14T18:38:54.563Z
Interesting link, but this does not address my question. It would be interested though to integrate my question in this subject
totalMongot
<mining-pools><block><mining-reward>
What prevents a faster, better-connected node stealing a miner's block solution?
totalMongot
# What prevents a faster, better-connected node stealing a miner's block solution?

(Asked by: username_0 on 2023-09-13)

Some questions already adressed similar issues ([preventing fraud in a mining pool](https://bitcoin.stackexchange.com/questions/54535/preventing-fraud-in-a-mining-pool), [what prevents a pool miner for stealing an entire block](https://bitcoin.stackexchange.com/questions/10687/what-prevents-a-pool-miner-from-stealing-an-entire-block)) but my question is different from those, if I understand correctly the mechanism.

Here is my point: Let's say for simplification there are only three nodes in the blockchain:

* Platform node, the only platform where you can exchange BTC for FIAT, in America
* My node, in Europe
* Bad guy's node, in Europe

My and bad guy's node are both mining, as well as Platform's node. Now, imagine I find the solution for a block at T time. At T + 1 second, my node sends the solution on the network. My solution is made of:

* My public key where I'm getting the reward
* Data = block with the solution
* Signed Data with my key

At T+ 2 seconds, bad guy's node receives the solution. But bad guy has a special code snippet: he reads my candidate solution, steals it and writes a new candidate block that he sends on the network with his public key and his signature.

Because he has better connection, CPU or whatever network tricks, Bad Guy's candidate block arrives to platform's node at T+3 seconds and my candidate block arrives at T+4 secondes.

**Question:**
So in this situation, the reward from mining would go to the bad guy's node from the point of view of the platform's node. And I would not be able to recover them in FIAT. What mechanism prevents such a stealing?

**Tags:** mining-pools, block, mining-reward

> **Comments:**
> **username_1**: The block is not protected by the block author’s signature, it is protected by proof of work. Does https://bitcoin.stackexchange.com/q/95564/5406 answer your question?  
> **username_0**: Interesting link, but this does not address my question. It would be interested though to integrate my question in this subject  

---

## 1 answers

### Answer by username_2 on 2023-09-13. Score: 4 | Accepted answer

The first transaction in a block is the so-called coinbase transaction and it is this that pays block-reward and transaction fees to the miner's address.

Note that these details are *contained within the block* and are not external accompanying information.

This coinbase transaction's data affects the block hash, so changing the coinbase output to pay a bad guy would change the block hash to one that almost certainly fails to be less than the target and so is an invalid block.

---

> he reads my candidate solution, steals it and writes a new candidate block that he sends on the network with his public key and his signature.

a block with (i.e. *containing*) a different public key or a different signature is a different block with a different hash - the "solution" is different and almost certainly invalid (hash > target).

> **Comments:**
> **username_0**: Thanks you answered my question. I had not understood before that the cryptographic problem was different for each of the miner because each miner included his own public key in the transaction  

---

