- Toshendra Kumar Sharma
- December 10, 2018
Technology is very dynamic and is ever changing. The same applies to Blockchain as well. It has grown up recently and has garnered the attention of most of the industries around the world. When it comes to its application part, then the world stands divided into two parts, one which says that Blockchain has the potential to change the world and the other which means that Blockchain is an unregulated technology. It’s like a bubble that will soon burst. Whatever be the case, an important point to note about this technology is that it is rising and is soon going to become a part of mainstream business operations. There are changes which are taking place for making Blockchain a reliable technology. In this blog, I will be focussing on “Nonce” which it is used in Blockchain to enhance its authentication and also ensure security.
The term golden nonce with Bitcoin mining perspective is a hash value which is lesser than the target. The world evolved from the term golden tickets which are referred to as nonce meeting the mining requirement that existed as early as 8th April 2011.
What is Nonce?
To explain it in simple words, a nonce is a combination of two words, “n” which means number and “once” which means one time. Thus, nonce means using a number just once. Technically nonce is a 32-bit arbitrary random number which can be used one time.
We all know that the mining process of Bitcoin involves Proof-of-work which means that the miners need to find hash which can solve the arithmetic puzzle. Once they find the hash, they win the block. As a miner, you need to find all the possible hash that will make you reach the target. This random number can be anything between 0 and 2^32.
To make the mining process and rewards more authentic, the nonce is timestamped. This is to ensure exact timeliness. It requires clock synchronization between organizations.
Explaining nonce in Blockchain
Well, leaving aside the technical explanation of nonce, let us have a quick look at what exactly is a nonce. Let us say in a class the teacher gives a problem that students need to solve, the one who does it first wins an award.
315+?=319
Now let’s take this scenario away from the class and explain it with the help of Blockchain:
In the case of Blockchain, the miners need to find the right number which needs to be added to the block and solve the puzzle. In this case, the students are the miners who are competing for the award.
4 is the nonce which can be used just once. It’s proof that you have found the answer for the same.
319 is the level of difficulty so that the teacher has control over the awards to be given.
Application-
- Authentication-
The primary application of nonce is an authentication process. It uses a nonce to make sure that old communications are not reused. It is used in HTTP digest access authentication to calculate an MD5 digest of the password. The nonce is different every time the 401 authentication code is presented. Thus making the repetition of attack difficult. Taking this application in real life scenario when the supplier gets the repetition of the same order under one name and with same purchase information. When nonce is used, it gives originality to the message such that if the supplier receives any other order from the same person with the same nonce, then the supplier can discard the order.
- Hashing-
Nonce can be used in the Proof-of-Work system to vary input to a cryptographic hash function. This is done to get a hash for specific information that will fulfill a hypothetical condition. This was used to solve the problem of email spam where the email senders were asked to find the hash values for the email which had an arbitrary number of zeroes, by hashing the same input with a large number of nonce values till the desired hash value was obtained.
So basically we can say that nonce is a part of the proof-of-work consensus mechanism which is a hash value that is lesser than the target. This is basically to curb down the problem of double attack and ensure security.