Have you heard about the blockchain before? You know, that awesome new technology everyone is making a big deal about? Although you may still ignore what makes it so special technically, you simply know that it is another cutting-edge technology which could end up changing your life. Maybe you’re one of those who decided they wouldn’t spend time trying to figure out how it actually works. After all, very few people would decompose their newly bought I-Phone to find out how it was made. Same for the blockchain; it won’t really matter until it is actually helpful or fun to use. Or would it?
The blockchain (especially the public blockchain) was invented to be economically and socially disruptive. The very reason for its existence is to transform the way we transact and exchange value by suppressing the need for a costly and intrusive mediator (or middleman). If it succeeds in its purpose and is widely adopted, it may have profound consequences on our society. Experts realize this (see my previous article) and praise the benefits of a new decentralized economy. But skeptics also see the issues which could result from its use (see this article).
Knowing a little bit about the blockchain may be helpful for the future. The interest around the blockchain technology keeps on rising and we may one day have to decide whether we should use it in our daily activities. Understanding the blockchain can be challenging but resources are available to get you introduced to the topic.
I encourage all to do their own research on this topic and get an idea of what this technology looks like. In this article, I’ll focus on the technical aspects of the blockchain.
Every blockchain in the world will be dealing with following elements:
These elements are essential characteristics of a blockchain.
Blocks and Hashes
Since the blockchain is a chain of blocks, the first step to mastering the blockchain is to understand what a block is. Generally speaking, a block is a set of recorded transactions meant to be added to an existing chain. Here’s an example of a block.
The above block contains a number of transactions of different types. Transactions may refer to an exchange of value, a confirmation, a change of role, etc. As a matter of fact, our block can contain any information you would like.
However, using this block enables you to make it available and readable to everyone as soon as that block is added to the chain. Anyone who has access to the chain will be able to see your transactions. But even so, no one will be able to change the data without getting noticed. How is a simple block of data not vulnerable to attacks and corruption when that block is accessible to thousands of individuals in an unsupervised way? Thanks to cryptography (more specifically cryptographic hash functions)!
Cryptographic hash functions are awesome! Feel free to read up on how a cryptographic hash function works but a summary is that it takes your whole block of data and compresses it into a short message called a hash signature. Every block will have its own unique hash (collisions — two different blocks having the same hash signature — are possible but extremely rare). Changing even one tiny bit of data on a block will automatically cause its hash signature to be significantly different. Imagine, for example, that one individual named Kevin wanted to change a transaction on Block 68. The true hash signature of block 68 would be enough to tell there has been a change.
Cryptographic hash functions are what makes the blockchain reliable. An effective hash function is one that (1) dramatically changes its result when the block is even slightly modified, (2) has low chances of collisions, and (3) is time efficient. A good blockchain is one with a great hash function first and foremost. Bitcoin, for instance uses SHA256 while Ethereum uses Keccak-256.
An unbreakable chain
Here’s how, with only blocks and hashing algorithms, you can create a chain of information that can preserve its integrity while being shared with everyone within a network. Let’s take the block from the previous paragraph and give it a header.
Typically, the block header contains information about the block but we will focus on 2 key pieces of information:
Here’s what the blockchain looks like:
The block header helps you know two things:
Note that the very first block of the chain , called Block 0 or Genesis Block, is different from the other blocks since there is no preceding block. This is what it typically would look like.
A Peer to Peer Network
Now that we understand what the blockchain is — a ledger of transactions that is effective at keeping its integrity — we need to explain the last valuable quality that sets it apart as an innovative technology: it is a distributed ledger. A typical blockchain is shared across a large peer-to-peer network of hundreds to thousands of computers — usually called nodes or miners — responsible for:
I hope you can see now that the blockchain allows any transaction to be recorded in a transparent and secure way without the help of a bank or a money transfer agency. If you would like to trade an asset, you simply need to submit a transaction to the blockchain network. Once the computers of the network agree to write the transaction on a block and add that block to the chain, this transaction remains on the blockchain permanently. How do thousands of computers manage to achieve regularly consensus? I shall address that question in my next article.