3 ms·
Why does the number have to be a nonce? If you can find a number that gives a block the correct number of zeros, but it has been previously used to give a total
by chrisseaton 10y ago
Why does the number have to be a nonce? If you can find a number that gives a block the correct number of zeros, but it has been previously used to give a totally different block the correct number of zeros, what is wrong with using it?
- detaro 10y agoIt's called that for whatever reason in bitcoin, but yes, there is no reason why it couldn't be reused in a different block. Maybe the name was used since it is similar to a cryptographic nonce in that it is choosen independently of the actual "payload" data?
- sowbug 10y agoIt doesn't, and there would be nothing wrong with using it. I haven't read TFA but it's probably using "nonce" in the more colloquial sense of a random number that is in a range so large that repetition is extremely unlikely. Finding that a single number solved two blocks would be very similar to finding a SHA-256 collision (Bitcoin uses a double-SHA scheme that I think was designed to address a length-extension concern).
- fabianfabian 10y agoits just named that way, probably as in you don't try the same number twice for finding the hash of one block. The same number can be used for other blocks or even the same block if you change something else in it (like add more transactions).
- DiThi 10y agoYou can start counting from zero or you can start with any of the previous numbers, but in the end the probability that it is the correct number is exactly the same. The header is always different than other headers (even if it's just for the block number, or "height"), that guarantees the probability is random.
- mthoms 10y agoBy design, the chance of a previous nonce being re-usable are virtually nill. http://preshing.com/20110504/hash-collision-probabilities/ http://preshing.com/20110504/hash-collision-probabilities/ The Bitcoin "nonce" is actually a much bigger number than shown in the video. 32 bits I believe.
- Natanael_L 10y ago32 bits is actually just 4 billion values. Technically it isn't enough to reliably find valid blocks with today's difficulty if that's all that you modify. That's why current miners tamper with both the coinbase transaction, timestamp AND the nonce to find potentially valid blocks in mining.
- mthoms 10y agoInteresting. Is that allowed by the protocol?
- Natanael_L 10y agoYes, because there's multiple valid ways to format coinbase transactions and there's a few bits worth of margin in the timestamps that you can change.