If you’ve ever wondered how a blockchain works and have been confused with all the technicalities, you are in the right place at the right time! The key to learning more about blockchains is the Cryptographic Hash Function, which is literally the key to the blocks. Before learning more about hash functions and what miners are exactly doing, we must first learn about blocks.
A block is essentially a collection of records, a list of transactions, documents, smart contracts, etc. In the case of Bitcoin, each block in the blockchain contains a collection of transaction records called a ledger.
Blocks have a limit for how much data they can store in them. They aren’t unlimited, and once they are full, they get added to the system, and more blocks need to be created. Bitcoin can store an average of 1500 transaction records in one block. Once a block gets full, they need to get verified to be added to the network. This process of verifying and adding blocks is called ‘mining’. We can mine the blocks and verify them by finding their hash.
A hash function is a system where you give it an input, and it gives you a hash. The hash acts as a key to the block, and what miners are actually doing is that they’re trying to find the hash to verify the block and receive rewards. This system uses complex mathematical algorithms to function, and it is impossible to find the hash’s input. Also, one cannot reverse or predict the hash; the only way of finding the hash is by guessing and checking.
SHA stands for Secure Hashing Algorithm, and 256 refers to the number of 0s and 1s the function gives out. Computers convert these 0s and 1s to numbers and letters, making it a total output of 64 letters. Whether you put in a word or the entire Wikipedia, it will always have an output containing 256 zeros and ones. Computers convert these 0s and 1s to letters and numbers. Here are some facts about the SHA-256 Hash Function you need to know before we go further are:
We have tested out an example of the hash changing entirely with a slight change, so you can further understand the process and see how much power and resources it takes to find one single hash. Using SHA-256 online, the hash for the word “cryptologist” is ‘c0c51439c1237b90a8237316c19ef4ead080f1eb7988ad067de49f7063a6c568’. However, when you change it to “Cryptologist” it changes to ‘9a90f9d03dedf24ccd26c8ce691b16bf439cdd66131df23efbb0cdb39859abd5’, which is a completely different hash!
Bitcoin requires a special hash with many zeros. The recently solved block at the time of writing this post had this hash: ‘000000000000000000067e3653db7c1152a734fc9c77e49e00b73fc76583206d’, which has 19 zeros at the beginning!
The hashing function is mainly used for the Proof-of-Work consensus mechanism. It is the mechanism used in Bitcoin, in which miners prove their work by mining and solving the blocks and are rewarded with Bitcoins in return. It is how new Bitcoins are created! Miners currently receive 6.25 Bitcoins each time they mine a new block. However, this will be cut in half due to Bitcoin Halving.
Once a miner solves a block and receives their reward, the miner adds “person X has received 6.25 BTC for solving the block” on the top of the block. Then, the hash of the solved block gets added to the next block. In fact, the previous block’s hash is used to calculate the next block’s hash, resulting in a chain of blocks or blockchain! Whatever data put on the blockchain is written down in history forever, and no one can go back and change anything, i.e., adding more money to their account. If someone tries to go back and edit an old block, all the newer ones change because the hashes are also changed.
If someone or a group of people have authority over a system and control it, it means the system is centralised. However, the systems where more than one person or group has access to the data and can control it are decentralised.
Take Bitcoin as an example again. Instead of one person having access to all transactions on Bitcoin’s blockchain, everyone has access to the list and can vote and mine on the blockchain. You can check out this website for a list of recent transactions on the Bitcoin blockchain.
Since decentralisation means everyone can vote, consensus mechanisms are needed to make sure everyone is on the same page. Proof-of-Work, Proof-of-Stake and Proof-of-Authority are examples of different consensus mechanisms. These mechanisms also ensure no one cheats on the network and makes a fake vote.
Since everyone can vote on the system, it’s natural to think, “But what if someone tries to make a fake vote to get Bitcoins in their account?” Well, it is not going to happen, thanks to asymmetric encryption. To learn more about this encryption, you can check this article.
Congratulations! You have made it this far, and it means now you know the importance of hash functions, how they are used to prevent scams, and how decentralisation is more than just an ideology. We hope this article has shed some light on blockchain mechanics without being too technical. Also, we hope it has connected all the pieces of the puzzle you’ve been searching for. Here at Cryptologi.st, we believe knowledge is the key to making confident investment decisions, just like how a hash is used to solve a block!
To quickly compare available options and make the best investment decision, check out our website.
Any advice contained in this website is general advice only and has been prepared without considering your objectives, financial situation, or needs. You should not rely on any advice and/or information contained in this website and before making any investment decision we recommend that you consider whether it is appropriate for your situation and seek appropriate financial, taxation, and legal advice.
© 2022 - Created by Cryptologi.st