Loading Now
×

What is hashing algorithm in blockchain ?

What is hashing algorithm in blockchain ?

Today, we are going to explore Hashing Algorithms. In this lecture, we will learn what a Hashing Algorithm is and how it is used in Blockchain Technology. If you haven’t watched the previous videos on the Application of Blockchain and What is Blockchain, make sure to watch them first for a better understanding. We will discuss this in subsequent videos, but for now, understand that there are certain specific fields that are present in our Block. For example, Block Number indicates which number block it is, like the first Block, second Block, third Block, etc. The Data field tells us about the transaction we are conducting, meaning the transaction we have made is a type of Data. When we send money to someone, it appears in the form of Data when the Block is mined by a miner. Previous Hash and Hash are two important concepts here. Before understanding Previous Hash, let’s first understand the use of Hash. In a Blockchain, there are many Blocks, and each Block has a unique identity that differentiates it from other Blocks. It is crucial to understand how a Block is distinguished. Just as humans have fingerprints and each fingerprint is unique, similarly, a Block has a Hash that serves as its fingerprint, allowing us to identify which Block it is. This Hash is primarily generated through the SHA-256 algorithm. The process of creating this Hash and how it can specifically identify a Block is explained here. For example, if we take a general overview, SHA-256 algorithm works like this: we input any document, audio, video, etc., into the SHA-256 algorithm, and it instantly provides us with encrypted data in a specific form. This encrypted data consists of 64 characters, with each character being 4 bits, resulting in a total of 256 bits. This is why it is called SHA-256. There have been previous versions of SHA, but SHA-256 is currently the most popular and widely used. The process of creating the Hash is as follows: when we enter specific data into our Block, it immediately goes to the SHA-256 algorithm, which then converts it into an encrypted data form with a specific configuration. This data allows us to identify a particular Block, and each Block can also identify other Blocks. For example, in a Blockchain with two Blocks, there is Block number 1 and Block number 2. Notice that each has a specific Hash generated through the SHA-256 algorithm. This Hash can point to another Block using the Previous Hash. Let’s see an example. One thing I forgot to mention is that the Previous Hash for the first Block is 0 because it is not pointing to any other Block, as it is the first Block in our Blockchain. Therefore, it is also called the Genesis Block. Now, look at Block number 2. If a third Block is added to our Blockchain, the Previous Hash and Hash of the third Block will be the same, indicating that Block number 3 is pointing to Block number 2 because its Previous Hash has a value of this Hash. I hope it’s clear up to this point. If you still have any issues, please recommend them to me, and I will definitely resolve them

Now let’s talk about the five essential requirements of a hashing algorithm. The five requirements of a hashing algorithm are mainly that it must be one-way. One-way means that if you input some data and it generates encrypted data, it cannot be reversed. Secondly, it must be deterministic. Deterministic means that if you give it a specific input, a specific data, it will produce a specific output. Even if you give the same data a thousand times, a million times, it will always produce the same output. For example, it will always produce 845, never 846, and if you give ABC in our 256 algorithm, it will always produce 845. So this is essentially determinism. Next, fast computation is essential; the algorithm should not take too much time, otherwise, it will take a lot of time to encrypt data. When blockchain was created, its computation needed to be a bit faster. Collision resistance is something that prevents a hacker from easily hacking it. If a hacker can easily hack it, then many hackers could hack it together, and our data would be leaked, making it worthless to us. Now let’s try to understand what the avalanche effect is. If you look at this diagram, we gave a specific document here, which resulted in this encrypted data. The avalanche effect says that if you make a slight change in this document, like writing ADC instead of ABC, this value will change completely, and we will see its display now. Let’s now see how SHA256 works and how the avalanche effect and deterministic method demonstrate with SHA256 in a real display. There is a wonderful website, passwordgenerator.net, so first, say thanks to them. Now calculate SHA256 and see how it works.

Primary firmness is like you have chosen a house, and you said that this house is very good, I want to take this house. So, brother, if you want to take this house, what will you need? You will need money, and along with money, we will also have to sign a contract. When this contract is signed, whatever we have done, whatever we have registered, we will submit it to a government institution, through which we will get the title of this house. If you don’t understand what a title is, just understand that we have to prove to the government that we have taken this house now and we will pay the taxes and other dues for it. So what will the government do? They will register this information, and what are the ways the government has for registration at this time? They either keep a register where they enter everything, like in many government offices you have seen, many government offices still do not use computers and other things, they only maintain a physical copy and fill it up, and keep the files in a warehouse or a specific place. What is the second option, which has become a bit modern today? The government sometimes uses computers, they store all this information in a central database. A central database means that the government has set up a server for them and will store all the information on that server. If you think carefully, there is a big problem with both of these things. That is, if you do it in a register, then wherever you keep it, there may be a problem in that warehouse; due to some natural disaster, this warehouse or the office where you kept it could be damaged. And if you store it in a central database, it can be easily hacked by a hacker. Now if you think about it, you will understand that if a hacker hacks it, then all our information that was in the central database will be completely changed. In this case, too, if you see what the problem is, of course, there is a server that might not be affected by a natural disaster because it is in a specific location, but because it is a central database, it can be easily hacked.

Yes, a hacker can hack or it could be that some government employee can make changes here because we have no idea what is being changed since all of these things happen behind the scenes under government control. We only have the opportunity to know one thing. So, if there is any change in either of these two ways, whether a hacker hacks or someone tampers with it, then it is certain that your house is gone, and I think we will be in a situation like the one we are in at that time. To prevent such situations from happening, we need to use blockchain, and in the upcoming times, we will see a lot of use of blockchain. If you haven’t watched the video on how blockchain works, how blockchain is, and how blockchain can do this (some term), (some term), (some term), then definitely watch it, especially where I explained the difference between Centralized Network and P2P Network, so that understanding this video will be a bit easier for you. So, let’s start with the Distributed P2P Network. As I said in the previous video, in our Distributed P2P Network, there is no client-server. Here, the nodes interact with each other directly. If they need any file, they share it with each other. Now, let’s see how the Distributed P2P Network works in blockchain. Suppose there are A, B, C, E, and F who are all miners. These miners have mined some specific blocks and kept the blockchain to themselves. We will see in detail how the blockchain is mined in the next video. But for now, remember that each miner has a blockchain, and you will see that all blockchains are the same as each other, meaning the blockchain that A had is the same kind of blockchain that B has, C has, E has, and F has. Now let’s see how it is and due to the Distributed P2P Network, hackers cannot attack a specific block because a hacker can attack a specific blockchain, definitely, he can go there and attack his blockchain. Because if it is a Distributed P2P Network and in a Distributed P2P Network, there can be thousands, even millions of nodes or miners, then hacking the entire system and going to every place, going to A, then going to B, then going to C, then going to E, and going to F, and thus going to thousands of other nodes, changing everyone’s blockchain is very impossible. It is not possible at all because changing so many blocks at the same time in every system is not possible at all. That’s why hacking blockchain becomes absolutely impossible. So, on the basis of Immutability, from Distributed P2P Network

Post Comment