What is a blockchain?
Many people have heard the word “blockchain” – it seems to be the financial buzzword of the year.
But, when you ask people “What is a blockchain?” then other than knowing it is the underlying technology behind cryptocurrencies, most people have no idea what a blockchain is or why its important.
The simplest way to describe what a blockchain truly is, is to call it a “decentralized public ledger.”
Before we can get into the nuance of how a blockchain applies this in a technical sense and what the advantages are, let’s get on the same page about what these terms mean.
Let’s start off by stripping away the “decentralized” part, and focusing on what a “public ledger” is.
If English is your first language, you probably feel you have a decent grasp of that concept just from the two words alone. “Public” accessible to everyone. “Ledger”, a book or record of financial information. But, I’d still ask that you follow along with our analogy below, because there is important nuance we’ll unpack when applying this concept to the blockchain.
What is a public ledger?
To better understand what we mean by a “public ledger” I’m going to take you through a story that I’ve shared with my students over the years to help them understand the blockchain.
The Village Ledger
I want you to imagine a little tropical island village.
A lush paradise with a series of huts, surrounding one large middle structure.
This tropical island paradise is home to five different families. For simplicity sake, we’ll simply refer to them by number such as “Family #1.”
Our society lives in a pre-modern civilization. They are a simple farming community. They can read and write, and have iron tools – but, they don’t have electricity, and haven’t even begun to use things like oil or coal for fuel.
This simple farming community spends their year harvesting coconuts. They tend to them throughout the spring, harvest them in the summer and then in Autumn, they trade the coconuts with a more advanced society on the mainland in exchange for supplies to get through the winter.
The Island Problem
Early on in this societies existence, they realized they had a problem. The families small huts couldn’t act as storage for all the coconuts that each family had harvested.
They needed a better place to store the coconuts, so the families came together and built a large structure at the centre of the village where all the coconuts would be stored. And, at the end of the season, the community would just trade all the coconuts at once.
Since certain families were larger than others, they both contributed more coconuts to the collection, and needed a larger share of the supplies to get through the winter, and so they needed to come up with a way to track contributions for each family.
The Island Ledger
To solve their problem of tracking how many coconuts each family contributed, the inhabitants of our island decided to create a ledger book and put it on a shelf outside the coconut storage hut.
On the front page of this ledger was a list of each family’s name, and the amount of coconuts they owned in the storage unit:
“Family #1 — 100 Coconuts
Family #2 — 85 Coconuts
Family #3 — 115 Coconuts
Family #4 — 125 Coconuts
Family #5 — 75 Coconuts”
On the internal pages of the ledger, there were a series of transactions, at first these were just families adding coconuts:
“Family #1 added 3 Coconuts – June 22nd”
“Family #2 added 4 Coconuts – June 25th”
But, the families then realized something else. They now had the ability to trade among one another without physically exchanging coconuts. They could instead just update the ledger. So now we have transactions that read:
“Family #1 traded Family #3 5 Coconuts for 2 quarts of milk”
Then “Family #1” would lower their balance of coconuts from 100 down to 95, and “Family #3” would raise their count of coconuts from 115 to 120.
This public ledger allowed the families to know if individuals truly had the money without seeing it. It also allowed them to trade assets between them without having the items in physical proximity, and it created very rudimentary forms of debt and credit (as technically a family could be negative in coconuts and owing to another family.)
This system works fairly well except for one caveat – trust.
The Trust Problem
Our islanders have known one another for generations, and the five families trust one another. They know that the information in the book is updated by people they trust, and so they don’t need to ask for proof when looking at the numbers.
However, one day, a new family moves to the island and sets up a home. The islanders are quick to welcome “Family #6” and teach them their ways. A few of the families even donate a couple of coconuts to the new family to help them get started and they update the ledger to read:
“Family #6 – 20 Coconuts”
The next morning “Family #6” goes to “Family #1” and offers to buy their cow. “Family #6” says they are willing to pay 300 coconuts for it. In disbelief, “Family #1” goes to consult the ledger and see how many coconuts the new “Family #6” has.
When they look at the ledger they see a transaction from last night that reads:
“Family #6 added 700 coconuts – June 28th”
And the balance of at the front of the book now shows:
“Family #6 – 720 Coconuts”
Now the Island ledger system is broken, because the community has one “bad-actor” that they can no longer trust.
Back to the Blockchain
Ledger systems have been around for a long time, but, they require “trust”. We either trust all the individuals in the system, like our island community did or we have to trust middlemen like banks, who often charge large fees.
This becomes a huge challenge, especially in the digital space. This is why there is an important difference between a ‘public ledger’ and a ‘blockchain’.
It’s a weird concept to wrap your head around, but everything on the internet is essentially a file on a computer. Like a .jpeg picture file that you might have sitting on your desktop. (Yes, this is an oversimplification, but, for the non-technical among us, it is accurate enough to understand the concepts at hand.)
If I have a picture on my desktop and I send it to you, there is no way for me to know what you do with it. Even if you send me the picture back, you could have duplicated the file and still have a copy. To send you a digital file, I require either the ability to:
- Trust that you will handle the file to my specifications.
- Or, not care about what you do with the file as it will have no negative impact to me.
If I can’t trust what you will do with a file, how can I trust you to report the right amount of money (or coconuts!) to me?
Creating Internet Money
In the early 90s, when the internet was fairly new, there was a lot of discussion on how to use the web for payment systems.
There were even multiple attempts of people creating an “internet currency.”
These services all faced a number of challenges.
Challenge #1 – Centralization Cost and Adoption:
Some of these services that popped up required you to pay huge transaction fees. If I wanted to send $100 to my friend across the globe, they might only receive $80 by the time all the fees are taken.
To make matters worse, my friend already had to have signed-up for an account with this service in order for me to send them money.
Challenge #2 – Centralization Trust and Existence:
Furthermore, if I was using a centralized service, I had to both trust the service was reporting the real amount of money (and not going to steal my money) – but I also had to trust that the service was going to be around for a while.
Many of these services operated like an early PayPal. But, because they were transacting in non-federally regulated currencies they weren’t insured or held to any standard. If I had bought $100 worth of e-Gold in order to transfer it to my friend, and the e-Gold service shut down, then I lost my $100 and there was nothing more that I could do.
Challenge #3 – Decentralized Trust:
Around the time of these scammy services, there was a lot of discussion of if you could create a “decentralized” service in which there was no central server, or administrator. The responsibility of the service would be shared by the community – much like our Island Ledger.
Every attempt to create such as system was met with the same challenge. No matter how much they screened their members, eventually a bad actor got into the system and greed took over ruining it for everyone else.
The Advent of the Blockchain
The internet had failed on a few occasions to bring us a public ledger system that could operate without us needing to trust all of the participants. That was until the 24th of May 2009, when a mysterious individual named Satoshi Nakamoto posted an academic paper called “Bitcoin: A peer-to-peer electronic cash system”
Not a lot is known about Satoshi Nakamoto, in fact, to this day no one is sure of his real identity. No one has ever met him, and in 2010 he left the Bitcoin project and stopped communicating with anyone through his online handles. Since then his fortune of over 1M Bitcoins (at their peak worth $20B) has remained untouched.
No one knows who Satoshi Nakamoto is/was, or if it was even a single person. What we do know is the Bitcoin “whitepaper” introduces the first concept of a digital blockchain aimed at allowing a decentralized public ledger system that is “trustless.”
The basics of Bitcoin’s blockchain
Since Bitcoin was the first blockchain ever created/implemented, we’re going to talk about a number of the features in terms of Bitcoin’s blockchain.
It’s important to remember that while blockchain’s differ in features, the core of what makes it a blockchain is that it is some sort of “trustless” “decentralized public ledger.”
We’ll start with a high-level overview of Bitcoin’s blockchain, which may sound very technical, but after that we’ll break down each part so it is easier to understand.
Bitcoin’s Blockchain – A high-level overview
Bitcoin’s blockchain is very similar to our public island ledger. “The Blockchain” itself is a public record of balances and transactions that exist between users.
Instead of tracking the exchange of coconuts however, this blockchain tracks the balances of Bitcoin.
Instead of a ledger having listings for each family like “Family #1” each user has a “wallet.”
Wallets are given their own unique “public key” and “private key” that are used to manage the wallet and allow the user to send transactions.
The ledger is used to keep track of how many “Bitcoins” each wallet has. (Although just like in our coconut example, bitcoins never actually move to different wallets, they only update the numbers in the ledger.)
The ledger (the blockchain) is a big data list of transactions, balances and events, that are split into small chunks called “blocks” and copies of it are stored on thousands of computers around the world.
Whenever a wallet makes a transaction the decide the amount to send “sign the transaction” with their private key and send it to the network.
Then every computer that is connected to the Bitcoin blockchain by “mining” checks their local copy of the ledger and validates if the user has the balance, if their “private key signature” matches the public key, and if they’ve signed the transaction. If they have the “node” (mining computer) validates the transaction with a “Yes” vote.
As long as more than 51% of computers agree that the transaction matches with their record, then the transaction is approved and takes place, because they have reached “consensus”.
All the computers who were “mining” split up the transaction fee as a reward.
Where is the ledger stored?
Unlike in our island ledger example, the ledger is actually not one physical ledger. It exists as copies across thousands of computers around the world. These “Bitcoin Blockchain Nodes” store the entire history of the ledger. Anyone can download a copy of the blockchain (ledger) and become a node.
How is information stored in the ledger?
All the transactions and balances of a blockchain are stored in data chunks called “blocks”.
If we were on our island ledger, this would be the equivalent of one page in the ledger. We fill up a ledger page with transactions and then move to the next page.
In Bitcoin, one block is produced every 10 minutes, and it is filled with the latest transactions. That information is sent out to all the computers connected to the network.
What are wallets?
Instead of having line items in the ledger for each family, users instead have “wallets” which are their entry in the ledger to store their Bitcoin.
These wallets are identified by a “public key” which is also known as their “Bitcoin Address”
What is a public key?
A public key is a bit like an address, if I want to send you a letter, I need to know an address where you live.
In Bitcoin, wallet addresses are random strings of letters and numbers. For example:
“1A1zP1eP5QGefi2DMPTfTL5SLmv7DivfNa” this address was the first one ever created (referred to as “The Genesis Address”) and is owned by Satoshi Nakamoto.
Public keys/addresses aren’t very user friendly when presented as random strings, but, it’s actually very important that these strings exist because they interact with private keys.
What is a private key?
A private key is kind of like a password for accessing and controlling your wallet. It’s something that only you know, and you can’t ever share.
Unlike passwords, private keys cannot be changed.
The public key and private key are actually linked together through a complicated mathematical function that creates both of them.
When you have a private key you can use it along with the math function to produce the public key, but it is mathematically impossible to use the public key to figure out the private key.
This is what allows us to “sign” transactions. Using our private key our wallet creates an encoded string (such as turning “ABC” into “123”). This string, when created by the private key, can be decoded by the public key (although the encoding/decoding can’t work the other way around).
This allows us to prove “this transaction was indeed signed by the person who owns this public address” even though we don’t know the key.
The equivalent for our island ledger would kind of be like each family having a wax seal to stamp their transactions with. Perhaps each stamp had a very unique feature that only that family knew how to create. This means that even though you didn’t see them apply the stamp to the paper, you know it must have been them who stamped the page.
Private keys are complicated stamps, that are impossible to duplicate or trick and will always match the public key.
What is a node?
A node is any computer system connected to the blockchain network. Nodes monitor and help to validate transactions through a process called “consensus”.
What is Consensus?
Each node has the ability to vote on a transaction. In blockchain technology there are a number of methods of counting votes and deciding how nodes agree on transactions. These are called “consensus mechanisms” – essentially “how do the computers reach consensus” or “how do we decide when enough of us are in agreement.”
On our island ledger, this would be like letting each family vote on whether they believe the transactions to be real/true, and only counting the transaction if enough of the families voted yes.
The main point of consensus mechanism is to decide three things:
- How do we decide who gets a vote?
- How many votes do they get?
- How many votes minimum are required to approve/deny a transaction?
If we look at our island example this might break down something like:
- Do all members of the village get individual votes or do only the families get to vote?
- Should family get more votes if they have more family members? Should their vote hold more weight if they contribute more coconuts?
- Is a transaction real if 3/5 families agree? Or do 5/5 families have to agree?
For the Bitcoin blockchain the model they use is called “Proof-of-Work.”
What is Proof-of-Work?
Proof-of-Work is the consensus mechanism for the Bitcoin blockchain.
Some people advocated that each “wallet” should simply have one vote on a blockchain. The challenge with this becomes it costs nothing to make a wallet, and it costs no resources to run a wallet.
If I was a bad-actor, I could simply make 1M fake wallets, tell the blockchain I was sending a big transaction and have all my fake wallets say it was true. Then your wallet would believe I had sent you the bitcoin, even if I didn’t have any to send.
To solve this problem Satoshi Nakamoto suggested the method of Proof-of-Work, in which computers must partake in “mining” in order to have a vote in the network. Because of the way mining works, its resource intensive and you can only have one mining program open on one computer.
This creates an economic cost for voting, and proves some level of identity, making it so that people can’t cheat the voting system.
What is mining?
Mining is basically using your computer to solve a complicated math problem. A random number and a “hashed” encryption string of letters and numbers is also generated.
Your computer needs to randomly generate numbers until it finds one that, when combined with the other number the blockchain gave us, that it produces a matching hash string. (Hashed strings are when you take any letter and number combination and change it based on a set of rules. Very similar to secret codes or “decoder rings” that you might have had as a child – except these rules are complicated algorithms)
This description is a bit confusing, so here is a simple example. Imagine I give you the letters:
And the encoded string:
You don’t know the method I used to encode the string, all you know is that you have to randomly guess three numbers. When you have a guess you can ask me if is right and I will say “Yes” or “No”.
You have to keep guessing until I say “yes.”
In our simple example, the method of encoding might be “-1”
So I may take the numbers 3, 4, 5 and subtract one from each of them, so they become 2, 3, and 4.
Then I may take the letters A, B, C and subtract one (or move one letter back in the alphabet for each) and have them become Z, A, B.
As we know, your computer needs to guess a string to put in front of “ABC”. In this case we need “345” so that when it is combined with “ABC” it becomes “345ABC”. When we pass it through our “hashing function” of “-1” it becomes the encoded string “234ZAB”.
This is a super simplified version of how the computers are randomly guessing numbers to check against a secretly encoded string.
What is the purpose of mining?
Actually, nothing. It’s pointless. The numbers are entirely random and not used for anything.
The only goal of mining is for it to take time and be hard. You essentially get more voting power on the blockchain the more guesses per second your computer can produce.
While mining, these nodes also verify transactions by checking that someone’s “signed transaction” matches with their “public key” but this process is trivial for computers and takes fractions of a millisecond.
In our island ledger concept, this would be similar to the process of the family creating their unique wax seal. It is something tedious and challenging that ensures the work is genuine because the effort required to try and cheat the system outweighs the benefit of tricking the system.
Why do people mine?
Mining is a common method of distributing cryptocurrency like Bitcoin. Since you need to provide an economic incentive for people to use their computers resources in mining, they are rewarded with Bitcoin.
In the beginning of Bitcoin, Satoshi Nakamoto decided that there would be 21M Bitcoin produced. To help randomly and fairly distribute them, they would be awarded to users who find the solution to the next block puzzle when mining.
Each 10 minute block consists of the “block prize” and the total transaction fees from users who sent transactions during that 10 minute time window.
The first set of blocks yielded 50 Bitcoins each as a block prize, and that amount gets lower over a set time period (roughly every 4 years). The goal is eventually that, once all 21M coins are mined, that the fees earned from transactions will be enough that miners will continue to mine for Bitcoin and help secure the network.
What does it mean to say a blockchain is “trustless”?
“Trustless” or “Trustlessness” are new concepts. Right now, we think of systems, communities, groups of people and individuals as “thing we trust” and “things we do not trust”.
It is ultimately a scale between 0% – 100%. I can 100% my bank, or I can 30% trust my bank (which ultimately means I don’t really trust them.)
Trustlessness, or trustless systems, are (usually economic) systems which exist without the need for trust. I don’t need to trust or not trust other nodes on the blockchain. It is literally impossible for them to successfully lie to me or manipulate my transaction. If I own some Bitcoin, no other person in the world can take that away from me. It’s not like a bank or PayPal who can freeze my funds. I have trustless access to those funds, and trustless control over them.
What does it mean to say a blockchain is “decentralized?”
A decentralized system is one that has no central point of failure or control.
For example, PayPal is a single corporate entity in the United States. If PayPal Inc, goes out of business, you will no longer be able to use PayPal to hold or transfer your funds. If PayPal inc, decides to freeze your assets, you no longer have any opportunity to reclaim them except through interacting with PayPal.
A blockchain, however, is decentralized. There is no “Bitcoin Inc” or any other company that runs Bitcoin. Bitcoin cannot be shut down or destroyed.
The public ledger is decentralized because copies of it exist on tens of thousands of computers all over the world. If I turn off my computer, it doesn’t shut down the Bitcoin blockchain. The blockchain keeps progressing and in the morning when I turn on my computer again, it will just catch up with the ledger by downloading the latest blocks.
Blockchain vs Public Ledger
So we now understand that the key differences between our classic “public ledger” system and a blockchain boil down to:
- Decentralization: Everyone has a copy of the ledger.
- Trustlessness: Impossible to fake validation methods (private/public keys) mean that the data we see in the ledger must be true.
- Consensus: Everyone in the system gets a vote when it comes to validating the data.
Bringing it Back to the Island
So if our island was to implement many of these features we would now have a system where:
- Each family earns votes based on how many coconuts they produce.
- Each family stamps transactions they are part of with a special wax seal that only they can make.
- Each family votes to decide if they believe the stamps to be real and genuine in each transaction and at least 51% of the families must agree or the transaction is removed from the ledger.
- Each family keeps their own copy of the ledger, and updates it by asking other families for the latest updates and only recording the transactions if more than 51% of families agree on the transactions.
- In exchange for helping to validate transactions, each of the families are rewarded with a small cut of the transaction as a fee.
That’s it. That’s essentially a blockchain without electricity, without the internet, without any technology at all. Blockchains seem big and scary, but, when we think of them on our little tropical island it’s pretty straight forward.