Blockchain Hashing(SHA256) Introduction

0xJinbe
Coinmonks
3 min readJul 1, 2022

--

Let’s take a look at SHA256 in action. Let’s demonstrate this using https://andersbrownworth.com/blockchain the site offers an excellent demo to show how hash values ​​work. When you get to the site, navigate to the hash section from the top and you should end up with a screen similar to a large rectangle. For starters you will notice that I have a place to enter data and a corresponding hash value, what this site does is generate a unique hash using SHA256 of whatever data you enter.

Try typing something and watch how the hash value changes every time the data changes, if I type in the blockchain developer nano degree program it gets a hash value. This hash is the only value for this string of text, if I remove some texts like the word developer, the hash becomes something completely different. It’s something unique to the new words I’ve written. If I type the word developer back into my original texts, I’m back to the original hash.

The value for this data will always be the exact same string. If anyone in the world were to enter that same string they would also get the exact same hash output, but if the data is similar but not exactly the same then it will be a completely different hash value. Similar data does not necessarily mean that the hash values ​​are similar. Changing the data slightly can result in a completely different and unrelated hash value.

The hash’s sole purpose is to ensure that it’s a unique value is not something to reference if you’re interested in understanding how the data is related. This is the basic purpose of a SHA256 Hash, it is used to produce a digital identity for any data value. Keep this basic idea in mind as we get into blocks, blockchains, and more detailed concepts. Hash always serves this simple purpose which is true whether we type data ourselves, get data from somewhere else, or the data is an entire block including many transactions. I hope this demo helps make hashing a little more accessible. Feel free to play around with this tool to help get a better idea of ​​how hash values ​​work.

A hash is a fingerprint for information. It is a unique sequence of letters and numbers that represent a set of data. To get a hash value, you start with a bit of data and go through a hash function. The hash function maps a group of this data to a unique hash value. It will take the information you provide and create a completely unique hash value. This hash value now acts as a unique identifier for the original data. This allows you to identify a given dataset much more easily by referencing its hash value. SHA256 is a specific hash function. SHA stands for Secure Hashing Algorithm and 256 represents the output of the algorithm.

New to trading? Try crypto trading bots or copy trading

In this case, it tells us that the number you will get back as a hash value is a 256-bit number. There are many different hash functions, but Bitcoin uses SHA256 to create a unique hash value for each block on the blockchain. The reason for this is to create a unique identifier for each block that exists in the chain. This allows us to do some cool stuff, like references are blocked by their hash value. It even creates the base from which we can join blocks together in a chain. To understand how this builds the chain, we will need to understand blocks and blockchains a little better. This will be the subject of our next text.

See you later :))

Join Coinmonks Telegram Channel and Youtube Channel learn about crypto trading and investing

Also, Read

--

--

0xJinbe
Coinmonks

Brazilian Web3 FrontEndDev | Blockchain educational Writer @coinmonks | Open for projs 🚀https://www.jinbe.dev/