What is a Bitcoin Nonce?

In the “Proof of work,” consensus algorithms are arbitrary sets of numbers, each used only once – these are called a “Nonce.” These Nonces are four-byte fields in a block header, with its value being adjusted by miners to keep the hash of the block equal to or less than the current hash target set by the network.

Hash: A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed length. A hash is created using an algorithm and is essential to blockchain management.” – Investopia definition

According to the Bitcoin protocol, the formatting of the serialized headers is part of the Bitcoin consensus rules. They are serialized into an 80-byte format then hashed as part of Bitcoin’s “proof of work” algorithm.

An example format of a block header, with the Bitcoin nonce included, is seen below:

4VersionThe block version number dictates which set of consensus rules to follow.
32Previous block header hashIncluding the previous block header hash ensures no previous block can be changed without also changing this block’s header.
32Merkle root hashThe Merkle root derives from the hashes of all transactions included in this block, ensuring that none of those transactions are modified without modifying the header.
4TimeThe block time is when the miner began hashing the header. This time must be higher than the median time of the previous 11 blocks. Full nodes on the network will not accept blocks with headers, which are more than two hours in the future according to their computer clock.
4nBitsAn encoded version of the target threshold. This block’s header hash must be less than or equal to the target hash value set by the network.
4NonceAn arbitrary number that miners change in order to modify the header hash and produce a hash that is less than or equal to the target hash value set by the network.

Bitcoin Nonce & Proof of Work

A distributed network of anonymous peers maintains the Bitcoin blockchain. The individual who adds a block to the blockchain must first go through the proof of work mining process. The miner (the individual who is participating in this mining process) is required to take the data from the block header (input) then run it through the cryptographic hashing algorithm repeatedly. For Bitcoin systems, this is called Secure Hash Algorithm 256 (SHA-256)

Miners hash slight variations of the input data (the nonce) until the hash of the header block is a hash equal to or less than the target hash value that is set by the network. To find such a hash value in the mining process is to find the “Golden Nonce.”

Any bad actor who seeks to modify past blocks would have to work much harder to change ANY previous block. The reason is to change transactions included in previous blocks; this bad actor would have to change all subsequent blocks that came before it. Therefore, the cost to replace blocks increases with each new block added to the blockchain, thereby multiplying the “Proof of Work” process.

The target hash value is known as network difficulty. This feature reveals how difficult it is to find a hash rate that is below the network target hash rate. Network difficulty is altered every 2,016 blocks, depending on how long it took to find the last 2016 blocks. Then calculations are made on the number of seconds it took between the generation of the first and last of those previous blocks. It takes approximately two weeks to mine 2016 blocks. So, should the blocks be found in less than two weeks, the difficulty level increases. On the other hand, if it takes longer than two weeks to discover the 2016 blocks, the network difficulty decreases. Adding new blocks to the blockchain is only done if the hashed value is at least as challenging in difficulty as expected by the consensus protocol.

About the author

Born in Illinois and the third oldest child of 10 children. Gail learned many lessons in life that would serve her well in her future. Patience, sharing, compassion, understanding, love, and acceptance were a way of life. Family is significant to Gail as a mother of three herself.
Gail lives by the motto "live and let live," and she takes pride in helping others. Educated, yes, but believes life is the best teacher and learning depends highly on an open mind.


  1. what a great explanation of the “nonce” and how Intricate but in reality simplistic the blocks and theories can be and how some of this actually works I think ?? this is also in depth just how deep trying to be not legit is almost futile and waste of most peoples times — sure there will always be some who try to cheat and steal –unfortunately but True — thank you Gail —

  2. Gail, you never fail to educate with each blog you post. There are terms we hear or read about that, at times, make no sense. Having you define it all here for anyone seeking to learn all they can in this beautiful crypto world is a blessing. There was a time that the word nonce was used so much that it was thought to be an actual swear word. Now, we know it as a generic insult. Thanks again for providing the extra tools to make our jobs easier.

  3. In my opinion it is a little bit difficult to understand but it is a very good explanation of what bitcoin nonce is. And this I am sure for hackers or con artists who will try to change the data will be very difficult and of course will waste time. So that for us as bitcoin users all this time the funds will be protected.

  4. Thanks again Gail for another informative post. In describing what a nonce is, you have also helped to peel back a few more layers of that complex ‘onion’ known as Bitcoin. Now we have more questions to research, and to add to our knowledge of the ‘Proof of Work” blockchain.

  5. Do you hear me laughing, Gail? I am laughing at my self for the lack of knowledge. Duh? Huh? As I read your blog a couple of times, realising the block is in my head, I began to comprehend. As yet, I do not know all the words and their meanings, but what I see is that it is a laborious process to add to or take away, from what is set to be. It is hard to disrupt the blockchain and its viable mission to keep every transaction free from corruption.

  6. I do not want my comment about my laughing to be thought frivolous or disrespectful. I have great respect for Gail and all she shares with us. Her knowledge is invaluable. I had been struggling to understand something else I had been reading and berating myself. I came in here and read her blog, and I went, huh? Then I started laughing at myself. Laughter is the best medicine and frees our minds. I, for one, know how valuable Gails information and the knowledge gained from it is. I am blessed to learn from you all.

  7. Thanks again Gail, for educating us with this blockchain term.
    Sometimes this it is easy to understand how the blockchain works but with each lesson given it seems that more is under the hood.
    So when someone asks me, what is bitcoin nonce? It is an arbitrary number that is used in Bitcoin’s proof of work consensus algorithm.

  8. Thank you Gail. You are so knowledgeable about the block-chain and always ready to teach and explain the intricacies of what makes them work. It is pretty far over my head but as I read your blogs tings do become clearer. As I said before. when I was in high school our high tech was a slide rule. We have come so far since them it is mind boggling. Again thank you.

  9. I had no idea what a nonce was so again Thank you Gail for the great blog, You hear these terms but some of us never know what they mean so thank you for always being on top of things. Your definitely a great leader and teacher.

  10. This is the best way to learn the Blockchain. I can’t thank you enough for your Blockchain education. Your blog on nonce is definitely ‘one bite at a time’. Every time I read it I learn something new and then I can embody my knowledge. I ditto Tracy, you are a leader and mentor in Blockchain education. Thank you!

  11. so in agreement with the replies here on how great the post is by Gail but also this as is many of her postings are multiple reads at least for me and then slowly but surely the info and knowledge starts to become part of my thinking and then the operations in business start to be simpler to understand also — many thanks —

  12. Very educational blog I like the way you lay it out and explain it so thoroughly it seems like it would be very difficult to cheat the system there seems to be a lot going on to make sure it is all legit. The blockchain does a lot more then I ever imagined so many different operations one depending on the other it is a amazing invention for computers.

  13. Thanks again Gail, for educating us with this blockchain term.
    Sometimes this it is easy to understand how the blockchain works but with each lesson given it seems that more is under the hood.
    So when someone asks me, what is bitcoin nonce? It is an arbitrary number that is used in Bitcoin’s proof of work consensus algorithm.
    (for missed points)

  14. I just learned something, but I am not sure what it was that I learned. This is very educational if I can just figure out how and where I am going to be able to use the information. It is the 2nd or 3rd time I have read about algorithms in the last few weeks. My knowledge compartments are filling up if I can just remember all of the knowledge.

  15. had to come back here and read this a couple more times after the Ring blog posting — so many ways to look at this also and with the Nonce factor it appears also to be security feature and even though algorithms tend to be patterns this type has so many factors to help keep each unhackable ??? not sure if correct but am learning and very appreciative —

  16. was directed back to read this great blog posting on the Nonce and the intricacies of some parts of the Blockchain — I am learning but some of this will stay above my grade and when definitive answers would be needed will seek Pros help — this is such a simple but teaching blog and fits so well –thank you still G —

  17. It is good to know that a nonce helps to verify the user through randomness and time-stamping, and limits a hackers ability to use prior communications to impersonate legitimate parties.

  18. It is said that one often needs excellent computational power to even begin to try and solve the nonce and that the Nonce is difficult to find and is considered a way to weed out the less talented crypto miners.

  19. I find it fascinating but at the same time worrying that people think they need to know everthing about everything.Take cars for example. Most functions in a car are now computer controlled but the majority of car owners are really only concerned whether it works and is reliable. You dont need to be a computer wizard to buy a good car. Likewise with bitcoin All most of us are concerned with is Is it legal, Is it withdrawable., can it be used safely and finally what is it worth. I am not concerned beyond those parameters

  20. Gail, as always, this article is very informative,very detailed information about Bitcoin Nonce,this is a very secure way to exchange bitcoin, detecting and protecting against attacks,this shows the different functions of the blockchain.Thank you Gail for sharing very informative information.

  21. as we head into another year –or as most call it a New year 2021 looks to be very very intriguing and understanding more of this Nonce and how it fits is to me a good thing — I keep reading learning thru-out this Blog area and am very much Thankful for all the Info shared here — awesome —

  22. Great Blog Gail. You are so knowledgeable about the block-chain and always ready to teach and explain the intricacies of what makes them work. It is pretty far over my head but as I read your blogs tings do become clearer and easier to understand, and I would like to thank you for all that you do because it is truly appreciated and I don’t know what I would do without you and your how to guides.

Leave a Reply

Your email address will not be published. Required fields are marked *