When I see the block info on blockchain, I see that there is a field named "nonce", I could not find any relevant information on web regarding what a nonce is. Please explain what a nonce is what is the purpose of it.
3 Answers
Nonce is a 32 bit arbitrary random number that is typically used once. In Bitcoin's mining process, the goal is to find a hash below a target number which is calculated based on the difficulty.
Proof of work in Bitcoin's mining takes an input consists of Merkle Root, timestamp, previous block hash and few other things plus a nonce which is completely random number. If the output results in hash is smaller than the target hash you win the block and the consensus is reached.
You need to brute force all possible nonce in order to luckily find a hash smaller than the target hash. It could literally be any number between 0 and 2^31
-
2But if the nonce is 32-bit, that is only 4 billion tries maximum, which is about a few minutes with a good nVidia card, right ? or is the speed much lower than that ?– MattCommented Dec 4, 2017 at 16:48
-
I think you forgot to talk about the extra nonce... and that answers my question above.– MattCommented Dec 4, 2017 at 16:57
-
2There is no extra nonce. Your right. its a small number relatively but you have to remember the each second the timestamp changes new tx comes which changes the root and others so all accumulated plus nonce become a large set of options for miners. Commented Dec 5, 2017 at 15:51
-
Only a fixed set of tx are accepted when creating the block. And there is a max number of tx for a block. And please browse for extra nonce ;) bitcoin.stackexchange.com/questions/32603/…– MattCommented Dec 5, 2017 at 19:32
Yet another info and info, NONCE stands for: Number used ONCE
-
This does not provide an answer to the question. Once you have sufficient reputation you will be able to comment on any post; instead, provide answers that don't require clarification from the asker. - From Review– MercedesCommented Aug 30, 2023 at 16:43
-
1Note that “number used once” is a decent memory hook to remember how a nonce is used in cryptography but it’s not the source of the word. My understanding is that it derives etymologically from “for the once”. Nonces don’t have to be numbers.– Murch ♦Commented Sep 15, 2023 at 14:35
Believe me or not, but I believe the answer is that the nonce helps make it difficult for each miner to solve a block. Just as the difficulty readjusts every ten blocks and blocks are mined every ten minutes, based on the nonce and the difficulty? Did I say that right?