When I first read about “Blockchain”, back in 2015, I could not understand most of it. I am sure that has happened to many of us when we tried to understand it for the first time. When I looked it up online, I found a lot of people/websites/blogs describing blockchain as distributed ledger. Well, that was even more confusing for me. Here’s why — the buzz is that blockchain is going to replace a lot of things and, on the other hand, they are described just as distributed ledgers. How can a ledger replace all the not-so-cool things we have today — banks, middlemen, brokers, agencies?
I did some digging, read the Bitcoin white-paper (which popularized blockchain), read a few more blogs which explained things in a way I could understand them and finally gained some understanding.
Distributed Ledger, is that it?
It is true that one of the most important characteristics of blockchain is storing cryptographically secure data in distributed servers (nodes). And that’s why the term distributed ledger is used for describing blockchain. It focusses on this capability of storing data in several distributed servers. But that’s not all what blockchain is. Blockchain technology, in general, has some other characteristics which make it more than just a distributed database.
Let me explain.
First, let me try to generalize the very definition of blockchain (according to my understanding),
Blockchain is a protocol to reach an agreement between different (known or unknown) parties without the need of trusted middlemen.
To achieve an agreement without middlemen or trusted parties, we need to make sure that the data is shared with and verified by all the involved parties. This is when the need for cryptographically secure, peer-to-peer database comes in and hence we call it a distributed ledger. A ledger that is distributed (shared) across multiple parties.
Beyond distributed ledgers - the incentives layer
Now, the next question that comes up is - what do the validating nodes/parties get in return? If the data is being maintained and validated by some parties for consumption by others then what is the motivation for these validators to keep going? This is when blockchain technology does not remain just a multi-master, peer-to-peer store of data. To make sure that the validating nodes are doing their job without being compromised, there are incentives in place. These incentives are, in general, based on the number of transactions (actions to update state of the ledger) validated by the validators.
The incentives layer is the most important layer which is generally overlooked when we try to understand the concepts around blockchain. Until and unless there are incentives, there will not be a public blockchain network. Without these incentives, we are essentially left with just a cryptographically secured, peer-to-peer database.
The blockchain innovation is more about this incentive layer and less about the multi-master database.
Let’s explore some of the other characteristics of blockchain,
Decentralization and Immutability
Two main aspects of blockchain, which make it different from conventional distributed systems, are decentralization and immutability.
Decentralization: It simply means that the system does not have a centralized point of control. All participating parties/nodes have full access to the data and hence they need not trust (or even know) each other. No one is in control and everyone is in control. It’s like a pure democracy where the nodes, after validation, vote on the state of data and the majority wins and sets the new state. This means, the data cannot be controlled (and corrupted) by a single entity, while in conventional distributed systems it can easily be done. For example: Try calling a delete on a Redis master or dropDatabase() on a Mongo DB cluster. :)
Immutability: It means that the data that has been already written, validated, voted and agreed upon in the past, cannot be tampered with or changed. There is no delete in the blockchain world. The data can only be appended upon. Immutability comes from how the cryptographic hashing algorithms are used for validating blocks of data. If the data changes, the hash changes and hashes are already recorded and validated. So, there is no way to delete/change history.
Decentralization and immutability together play a very important role in the overall usability of blockchain systems. They are needed because the parties/nodes need a way to make sure that they can trust the state of data even if they cannot trust each other.
How does it work?
So, now we know, using blockchains people or systems can agree with each other without the need of middlemen. That’s a hard problem to solve. So, how do blockchains do it? The answer is reliable timestamps and cryptographic instruments — primarily just two of them — hashing and public-key cryptography. In short, each of the parties (or nodes) need to verify:
- The state of data at a particular time
- The identity of the user who changed the last state to bring the data in the current state
All the nodes can then reach an agreement based on that verification. To verify the state of data in blockchains, we use hashing and public-key cryptography. The most important point is, to validate and verify the state of data, all nodes should have access to the data. That, in turn, makes blockchains transparent and collectively trusted.
There is a lot of material on the internet on how blockchains work, so I will not go into the details here (and I am still learning). Here are a few good resources which can help understand the working of blockchains,
- An Introduction to Blockchain with Mark Russinovich — Great video for beginners to understand the basic idea around how blockchains work.
- Cryptocurrency 101 — A detailed blog post on the background of Bitcoin and blockchains.
- Three Blockchain Benefits— This post helps understand the characteristics and benefits of blockchain as a technology as compared to conventional distributed systems.
- Some Blockchain Reading — This post contains a lot of links to blockchain resources but most of that is advanced (geek) level material.
- The Bitcoin White-paper