Blockchain technology is all the rage these days. You hear about it more and more yet what does it really do and how can you use it?
Below, I try to explain some of the fundamental concepts of blockchain. As a summary, blockchain is fundamentally made of two concepts:
a distributed ledger - all participants in the chain has a copy of what is happening
cryptographic hash functions - data can be anonymized but still verified. Changing a single thing changes the hash and invalidates the block and subsequent blocks.
It is valuable because the need for a third party has gone. Removing a third party reduces costs and time as well as improving trust and security. Think of third parties as entities like banks, auditors or even governments.
Alright, let’s get into some details.
First some history. Let’s step back about a 1000 years to the the tiny island of Yap. There was no gold or silver on Yap, but they discovered limestone on an island several hundred miles away. They carved this limestone into large stone discs which they brought back to Yap on their boats. At some point they decided to use these stones as their money.
Now, these stones were heavy - often heavier than a car. So to use them as money you couldn’t hand it over or move them around easily. They stayed in key spots on the island and everyone on the island memorized who owned which stone(s). When someone went to use their stone to buy something they announced it to the island. All the people on the island would update their memorized list of who owned what stone. The stone itself would stay in place but everyone on the island knew who owned it.
This is a distributed ledger and is the concept at the heart of Blockchain.
Why is this so useful?
Imagine instead of everyone knowing who owned what stone, the people of Yap decided to trust one person to maintain this information. This person would have to be trustworthy. Anytime someone wanted to make a transaction they would have to go through this person. The person may start charging a fee for this service. This is like a bank and can be thought of as a centralized ledger.
At it’s core, blockchain is a distributed ledger. Instead of islanders it is now many computer nodes that have copies of this ledger. The more nodes there are then the harder it is for someone to tamper with or alter the transactions. To do so they would have to alter over 50% of the nodes. This is far harder than having to alter records controlled by a single party.
Additionally, you no longer have to pay for a third party to act as a trusted, centralized ledger. This reduces costs and saves time. Imagine if you didn’t have to go to the DMV any more.
What is a block?
As its name implies, a blockchain is a collection of blocks. Each block contains:
- some data
- the hash of the block
- the hash of the previous block.
The data stored in the block varies on what the blockchain is being used for. In monetary transactions, this data could be information such as sender, receiver and amount of coins. The hash is unique and is the block’s fingerprint. It is created based on the data inside so changing any of the data will cause a different hash to be created. This is useful to detect if a block has changed. Since the block also has the hash of the previous block it allows a chain to be built.
What is a hash function?
Its an algorithm that takes a set of input data and generates an unique output that is of fixed size. This allows you to identify the data without needing to see the original data.
Try it out below. As you enter data, regardless of what it is, the hash generated is the same length but different (even if a single comma is different):
This is useful because changing a block causes it’s hash to change. This then means all following blocks no longer are connected to that block and are invalidated.
Now, without getting into all the details, when a new block is added to the chain it takes about 10 minutes (and a bunch of computing power) to get the right hash and add it. Folks who do this validation are called miners. A miner gets a reward if they are the one who successfully validates and adds a block to a chain. It is relatively quick to confirm if a new block is correct but takes a while to create (or mine) it. This is called Proof of Work. Due to the fact it takes a lot of computational power and time, it makes it hard for a bad actor to create fake validations. Now, if a bad actor changes data in a previous block, they would not only have perform this proof of work for that block but also for all subsequent blocks. It just wouldn’t be worth it.
Now, it is important to remember that you need more than 50% of the nodes to agree. But what if the majority are bad actors? Well, this is where you still need that element of trust. Trust in that the majority of participants in your blockchain are honest and trustworthy. The more nodes, the harder it becomes to game the system.
What about Bitcoin
You will often hear Bitcoin and blockchain mentioned together. It is important not to conflate the two. Bitcoin is a digital currency whose purpose is to bypass government currency controls and simplify online transactions by removing the need for a trusted third party. As explained above, this is exactly what blockchain brings to the table. Bitcoin uses blockchain technology to achieve its aims.
Blockchain Use Cases
We are just starting to see Blockchain gain traction. There are many scenarios it potentially could be used for.
Think about any scenarios where there is a business network and assets are being traded. Removing the need for a trusted third party could greatly reduce overhead and also introduce greater transparency and validity.
So here are some interesting use cases currently being explored (beyond cryptocurrencies) :
Fake news detection - being able to validate that the news article you see, or the video you watch are the genuine thing.
Supply chain management - using blockchain to track products as they move through a supply chain.
Improving travel planning - making sure all aspects of your trip are what you want and planned.
Healthcare - tracking medical records, payments and many other areas.
Do I Need a Blockchain
Often, blockchain is touted as the hammer for all nails. But this is more hype than anything else. Not everything will be able to, or should, use blockchain. A study by Deloitte found that 92% of blockchain projects that started 2 years ago are now defunct.