How the Blockchain Works

How the Blockchain Works

One of the most common questions that a beginner can't get his/her head around is how does the blockchain even work. Well, let's understand this process in the most simplest way possible.

In order to understand this we need to look at the block itself and it's structure first.

Block and it's Structure

A block is basically a data structure within the blockchain database, And in a single block there's data stored. The first thing stored on the block would be the relevant information or data, Such as for bitcoin it would be the transaction information. The next thing stored on the block is the hash which is a kind of a unique code. And the third thing stored on the block would be the hash of the previous block. Also the first ever block on the blockchain is not storing any hash and is called the genesis block. It is also known as block zero. Since it is the very first block upon which additional blocks in a blockchain are added, It is the ancestor that every other block can trace it's lineage back to, Since every block references the one preceding it. So the genesis block helps track the history and keeps the information unique and secure which also makes the blockchain a lot more reliable.

block.png

How this makes the blockchain reliable

Let's say if you fancied your chances against the blockchain and tried to change the data of a block. By doing this the hash will automatically change which means the previous block also receives irrelevant, invalid information and that's how the block would be rejected.

Now let's say you got angry at the blockchain for rejecting your block and went all out against it and tried to change all the hashes then it would take you an insane amount of time. Let's make this exciting by an example. Suppose you wanted to change the hash of a bitcoin block, Approximately it would take you ten minutes to change the hash of one block and if there were ten million blocks, it would take you 200 years to change all the hashes. This is implemented through a consensus protocol called Proof of Work.

blocks.png

What is Proof Of Work

Proof of work (POW) is a consensus protocol used by two of the most famous blockchains Ethereum and Bitcoin. It requires members of a network to expend effort solving an arbitrary mathematical puzzle to prevent anyone from gaming the system. This protocol is used in mining new blocks and keeping the system safe from attacks.

Now let's look at some use cases to understand how this entire process can be helpful in solving real world problems.

Use Case-1

The biggest use case is in the cryptocurrency domain. It has eliminated the middlemen and banks for more efficiency in sending money to another person. Let's look at an example so this makes sense for beginners too.

Suppose you're in India right now and you wanted to send some money to your friend in the US. You would have to send the money through banks and they would have to convert the money into USD from INR which means they would also charge some bank fee for the transaction. But comparing this to cryptocurrency, You would be paying a very tiny amount which is almost equal to nothing compared to the what the banks would be charging you for the transaction. Just like gold it would transfer from asset to asset and no conversion of currency would be taking place at all which is one reason you wouldn't have to pay crazy transaction fee at all.

Use Case-2

Another use case is in the real estate domain where the data is stored on the blockchain and all of the trading records are stored on the blockchain and that automatically makes tracking the history of a property a lot easier.

Use Case-3

We know how everyone's complaining after elections take place in a country and their favorite party does not win the elections. In the future we may see the blockchain technology get implemented for clear and not tempered elections.