0
In bitcoin, miners hash the header twice with the SHA256 function. This header consists of the fields listed below:
- version (v)
- previousHashBlock (p)
- merkleRoot (m)
- time (t)
- difficulty (d)
- nonce (n)
Let's simplify and say that I am a pool miner with nonce range from 1-100. So if I do my share and find that on 9th minute the Nonce value of 91, solves the puzzle (proof of work). But by the time I send to network, merkleRoot and time has changed, so the nonce that I've found is not true anymore. We know that hash changes dramatically with slightest change of input, but in this formula, not one but TWO variable change constantly throughout my mining period (in this case 9 minute). Transaction occured and time changed. So how does this formula hold true thoughout the mining time?
SHA256(v + p + m + t + d + n(91)) => 0000000asd8f686asd6das
Where m and t changes constantly? Wouldn't 91 be irrelevant at the time of finding?
where does 2^32 comes from? is it the max possible nonce? or is it agreed share of the pool mining? if it take only a second, what do I do the rest of 10 minutes? – Prostak – 2018-01-22T23:52:10.367
There are 2^32 possible nonces since the nonce is 32-bits. Perhaps you have the misconception that there's one magic block that every miner is trying to mine. A miner is trying to mine any valid block that pays him the reward. If he can't mine a particular block, he'll just trying again with a slightly different block. If he has lots of fast hardware, he may be trying to mine 100's of possible different blocks at once. On average, someone somewhere succeeds once every 10 minutes. That's how hard mining is. – David Schwartz – 2018-01-22T23:53:52.360
thanks for responding btw! you are right, I did have this misconception... but does it mean, that it might be impossible to find jackpot with certain criterias.... i mean, it just does not exist... so let's say i have m and t, and no matter of nonce i use, it is impossible to get a hash with certain 0? so that means, that you have to modify time or merkleRoot ? – Prostak – 2018-01-22T23:59:46.100
@Prostak Right. It's trivial to get a new merkleRoot by just slightly changing the transaction that pays you the mining reward. So that gets you a whole new block to try all 2^32 nonces on. – David Schwartz – 2018-01-23T00:09:55.030
When you say "100's of possible different blocks at once", what do you mean? what variants do they introduce to block? time? and change transaction list? or is there a way to modify smth else? – Prostak – 2018-01-23T00:23:40.937
Typically they change the transaction that pays them the block reward and transaction fees. Changing one byte in the transaction is sufficient to give them an entirely new block to try all 2^32 nonces on. – David Schwartz – 2018-01-23T00:33:57.790