Many articles only contain a phrasing like
A miner
A
solves the hash problem and gives the result to the network to check. Once a majority of the network confirms,A
gets the reward.
But how does one protect his effort from being stolen? As I think:
A
solved the problem, soA
get original stringS
which could be hashed to target hashH
.A
sends his result to the network (some other miners) intending to get the reward.- Other nodes (miners) need to hash
S
and check whether the result equal toH
to determine whetherA
is right or not. (So I think here one can getS
andH
) - But
B
nearA
, he getA
's works, so he get theS
andH
. Then he can construct a new result send to others, claim thatB
solved the problem - If
B
can spread his result faster thanA
, he gets the reward.
I have seen Can a miner steal another one's block? , in which @Highly Irregular says
The block that Alice mined includes the mining rewards going to Alice's address. If Eve alters the block data to output the rewards to her own receiving address, then the nonce (and other variable values, I think "extranonce" and timestamp) that Alice used to solve the block will almost certainly no longer solve the block.
But he didn't tell how in detail.
@Stéphane Gimenez gave the normal steps of mining here, in which I didn't see a measure to prevent B
from stealing the block from A
(or how to validate the result is originally calculated by A
).