The public ledger that is the secret sauce behind web3. What it is and why it’s so important.

Untitled

Since a Blockchain is a series of blocks organised in a chain (bet you're glad you started reading this revolutionary stuff), this chapter is going to be organised in the same way.

Let's start with our first block...

Block 1: The Basics

We'll start with the example of signing up for Facebook. When you sign up with your name, email and any other information you need to provide, this data is stored in a database. That database is privately owned by Facebook. They decide what to do with your data. When you sign up, you are having to trust Facebook with your data. If Facebook is hacked, the hackers may be able to alter your data.

In contrast to this, a blockchain is a decentralised, distributed ledger. It's completely public. All entries to the ledger can be seen, and no one owns the information on the blockchain.

"Distributed" means that the current state of the ledger is replicated across many different machines. Together, those machines agree by consensus on what the current state of the ledger is and validate any changes being made. Blockchain networks are secured by cryptography. The idea is that the blockchain records information in such a way that it is very difficult to cheat or hack. Once some data has been recorded inside a blockchain, it becomes very difficult to change.

Block 2: Inside a Block

Each block contains some data, the hash of the block, and the hash of the previous block. A hash is like the fingerprint of a block. It identifies that block's contents and it is always unique. Changing the data inside the block will cause the hash to change. If the hash changes, that block is no longer the same block it was before.

Block 3: Creating a Chain

The third element we mentioned that goes into each block is the hash of the previous block. This is what is used to create a chain. Every block except the very first one points to a previous block. So what happens if you try to tamper with one block in the chain? The data inside it changes, so the hash changes. All of the following blocks in the chain are now invalid because they are pointing back to a hash that doesn't exist anymore.

What about the first block?

The first block is a little bit special, and the name for it is the Genesis Block or Block 0. It can't point back to a previous block because it is the first one in the chain. Every subsequent block in the chain can be traced back to this genesis block.

Block 4: Consensus Mechanisms