You might have heard of Bitcoin hashing power, Litecoin hashing power and many things about hashing. The more hashing power you have, the more amount you will earn at least in the world of cryptocurrency. Let’s dive into detail and understand What is hashing in Blockchain. Hashing is the only thing that links the blocks in the blockchain. Each block contains the hash of the previous block and so on. To understand in a bit more detail please refer to this video.
One more thing if you don’t understand what is Blockchain please refer to this URL: What is Blockchain? And How Does It Work?
What is Hashing?
To understand hashing let’s consider a small tool that helps to calculate the hash online for any given specific algorithm. The URL of the tool is here https://www.tools4noobs.com/online_tools/hash/. Here we will select the algorithm sha256, the popular bitcoin algorithm. Now here we enter “Hello World”, and you got the hash. Please make a note that for Hello World we got this hash. Now we just add a dot to the hello world and click on hash this, well our hash has changed. Please see the image below, it will help you to understand what is hashing.
Now we will write 200-character text and click on Get Hash, we got this hash.
So here I needed to explain 3 things
- Even if you change a single character in the hash, the hash will change.
- If you have 100 characters or 1000 characters the length of the hash will remain the same.
- One more important part is that hash is one way. If you convert a text into a hash there is no way to convert it back to the actual value.
These 3 properties make hashing a must-have concept for blockchain Well, here a lot of mathematical calculations are involved to calculate the hash. We don’t into the mathematical formula but just try to understand that there are different types of algorithms to calculate the hash like sha256, Scrypt, X11, etc.
Importance of Hashing in Blockchain
When you do some transaction in Bitcoin or any other blockchain network, the data of block number 1 is hash and it’s added in the link section of block number 2. When block number 3 is created hash of block number 2 is created and it’s stored in the link section of block number 3. If someone tries to modify block number 2, even the smallest modification will change the hash and the link will be destroyed. All the nodes will reject the data.
Technical Definition for your Interview
If we define hashing in Blockchain it will be like this “Hashing is a process which accepts a string of any length and converts them into encrypted data of fixed length using available algorithms”