Many articles only contain a phrasing like
Asolves the hash problem and gives the result to the network to check. Once a majority of the network confirms,
Agets the reward.
But how does one protect his effort from being stolen? As I think:
Asolved the problem, so
Aget original string
Swhich could be hashed to target hash
Asends his result to the network (some other miners) intending to get the reward.
- Other nodes (miners) need to hash
Sand check whether the result equal to
Hto determine whether
Ais right or not. (So I think here one can get
A, he get
A's works, so he get the
H. Then he can construct a new result send to others, claim that
Bsolved the problem
Bcan spread his result faster than
A, 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