Over the last couple of years, Blockchain has been one of the most popular and essential technologies in the market. From the banking sector to the healthcare sector to the mobile app industry, everyone is going crazy over it. And as it slowly sophisticates, we see more and more opportunities arise prime reason being, Blockchain is what the world needs right now. From high-end software developers to multi-billion dollar worth companies, they are all starting to see what the Blockchain technology has to offer and are focusing more and more resources in adopting it in their infrastructures. Furthermore, not only can Blockchain hold its own in a pool of new technologies, but can work to enhance their reach as well. IoT, AI, AR, Machine Learning, Android and iOS app, they all can benefit from Blockchain.
So today, we will take a brief tour in the exciting realm of Blockchain and learn, what it is and how it works. And in the end, we will take some time to know more about some of the vital consensus process and know how they work.
So let’s get started!
A Brief History of Blockchain
Blockchain was not introduced to the world as a standalone technology. But instead, it was an integral portion of an entirely different technology and later on, found its way into the market on its own. In 2009, Satoshi Nakamoto- the unknown creator of Bitcoin created the world’s first ever, peer-to-peer money transfer system.
He envisioned Bitcoin to be free of any sort of bureaucracy, and so using the Blockchain technology, he created a decentralized electronic currency which had no central authority figure. It shook the financial world to its roots; never before a currency had flowed directly between two involved parties, without the intervention of a third governing party.
Ever since its inception, many Cryptocurrencies like Bitcoin have emerged and are slowly starting to surpass it. Now, the reason why Bitcoin made such a big splash in the world was that it was decentralized, and this was something no one had ever been able to do before. But Nakamoto and his team did it, and it shouldn’t come as a surprise to anyone that the way they did it, actually became more prominent than Bitcoin itself.
Over the years, as the novelty of Bitcoin wore off, Blockchain is continually getting more and more popular, and for valid reasons too, as we will discuss later on.
What is Blockchain?
A blockchain is basically a growing list of data records which are referred to as Blocks, and are linked to each other using advanced cryptographic schemes. Each block carries a cryptographic hash of the previous block, a timestamp, and a block of data. Because of its design, a blockchain is immune to data modifications.
A Blockchain network is unsupervised; i.e., there is no third party governing it, it just contains Peer nodes working on the same set of data(known as a Distribute Ledger) with mutual consensus.
Advantages of Blockchain
It is immune to any third party interference. And also, a single point of failure can never bring the whole system down.
Blockchain network consists of user-nodes- also known as peer nodes- working on the same level, without the influence of a third party.
- Data Security
Because of robust cryptographic schemes, Blockchain has unbreachable security.
- Data transparency
Since blockchain is a distributed ledger of data, all the participants have a copy of the latest transactions.
- Data traceability
Blockchain makes it easier for companies to trace their products and transactions since every piece of data leaves a trail in the network.
- Fast and efficient
Blockchain makes transactions and deals easier since record keeping is done in a public ledger and can very easily be automated.
Some crucial definitions related to a Blockchain network
Before we move on to learn the process of operation behind blockchain, we need to know about a couple of terms which are frequently used in blockchain-lingo.
To understand the function of miners, you need to first understand what mining is. Simply put, mining is the process of adding new blocks of data in a blockchain. And those who are responsible for that, the peer-nodes involved in the network, are called miners. Miners validate a new block of data and record it on the global ledger(another term for Blockchain). How they do it, we will learn later on.
A transaction is a term you will often hear when someone is talking about cryptocurrencies. It is basically a contract between two parties involved in the exchange of the digital currency. A typical transaction is equivalent to this sentence: A promises to pay X amount of money to B. In a cryptocurrency blockchain, these transactions are the data which goes in each block.
Validation is the process of announcing to the network that a particular transaction is legal. For this, users of a blockchain all across the world publish their transactions and miners gather them and try to put them in new blocks of data, or validate them, using various processes, which we will learn about in some time.
Since there is no governing party involved in a blockchain network, it falls on the peer-nodes to make decisions about a few crucial matters. Now how do they do it? Because every node in the network is anonymous, how can one node trust others? This happens through consensus algorithms. Now a network expects that only a certain number of nodes will respond to a consensus request. So the decision is based on the result that has been submitted by at least 51% of the nodes who responded.
The working process
Now that the that is out of the way, we can begin learning about the working process of the blockchain.
All of it starts from a transaction request or a new data entry from a blockchain user. As soon as this new piece of data comes to the network, miners start competing with each other to validate that piece of data. They try to solve a complex math problem based on a Hash algorithm. This math problem is extremely hard to solve and takes up a lot of the mining node’s processing power, and its result is called Proof-of-Work. The miner who solves the problem the quickest is able to add this new block of data in the blockchain and validate it. For his effort, that miner is provided with a reward (In the case of bitcoin, he or she gets some bitcoins for every transaction he or she validates.)
Once the block is validated, it is attached to the existing blockchain. It is done in a manner that each new block is linked with the previous one with its hash(A Hash is a function that transforms a series of letters and numbers into an output of fixed length). This way each new block is linked to its predecessor in the blockchain logically.
This particular process is what makes blockchain so secure and immune to changes. Because if a malicious node tampers with the data in any of the blocks, then the Hash will be changed. And since all those who are involved in the network have the recent copy of the entire ledger, they will very well be able to detect the exposure and mutation of the data in the block.
This is the basic skeleton of the entire process, there are some smaller processes, like creating candidate nodes and waiting transactions, which we will cover in other articles.
Various Consensus Methods
- There are many blockchain architectures in the market right now; there are multiple ways to perform the entire process. Bitcoin makes use of a complex mathematical problem developed using the SHA256 algorithm to make mining nodes provide the proof of their efforts by solving it. But there are many other consensus methods in the market, too. Let’s have a look at some of them.
- Proof of Work
As we already know, this algorithm is used to confirm transactions and produce new blocks to the chain. In PoW, mining nodes compete with each other to complete transactions on the network and get rewarded.
- Proof of Stake
In PoS, the creator of the next block is chosen by numerous combinations of random selection and wealth/age (also referred to as the stake).
- Delegated Proof of Stake
Delegated proof of stake makes use of real-time voting along with a social system of reputation to achieve consensus. It is the least centralized consensus protocol as it is the most inclusive. Every token holder has a degree of influence on what happens on the network.
- Proof of Burn
The idea behind PoB is that miners should show the evidence of their work by burning some coins(it means that they send these coins to a verifiable and unspendable address). PoB is costly, but it takes no resources other than the burned coins. Till this date, all proof of burn cryptocurrencies, work by burning the coins that have been earned using proof-of-work. This makes sure that the final source of scarcity remains the proof-of-work-mined “fuel.”
- Practical Byzantine Fault tolerance mechanism
Before we understand this consensus method, it is crucial for us to realize what Byzantine Generals’ Problem is.
It was first described by Leslie Lamport, Robert Shostak, and Marshall Pease in their 1982 paper, “The Byzantine Generals’ Problem.” It was used to demonstrate one of the most significant problems a distributed network can run into using a fictional scenario, and it goes something like this-
Byzantine army has sieged a city they intend to take. The army is big, and it has multiple battalions commanded by various generals, and the only way they can communicate with each other is by sending messengers back and forth between camps. Now the strategy is simple, the entire army needs to land on one of two choices, either they are all going to attack, or they are all going to retreat. If the sieged city is not attacked with the entire force of the Byzantine army, then they will fail and meet a brutal end. So it is necessary that all the generals reach on a single decision.
Now the problem is since there is no central authority which can send orders to all of those battalions, they rely on internal communication between them which is highly vulnerable to corruption. It might be that one the generals vote for attacking but the messenger is a traitor, and he tells the other general that the first general proposed to retreat. Or it might be that the general himself is a traitor and he spreads about the news that he votes to retreat but instead leads his company to an attack. This way, because the entire network is infected by traitors, it is impossible for any general to know if the information that they have is legal or valid in any way.
This is the same problem that is faced by the most distributed network and especially by a blockchain network. Since all the nodes involved in the network are anonymous, how do they trust each other and trust that the information that they have is valid? This is the whole base of the consensus process, to eradicate trust issues in a network. If 51% of all the nodes that responded to a request, in the same manner, that means that the data is valid.
The PBFT model focuses on providing a practical Byzantine state machine facsimile that sustains Byzantine faults (malicious nodes) by an assumption that there are node failures and corrupted messages spread across by individual nodes. The method is designed to work on asynchronous systems and is perfected to create high-performance quotients with an amazing runtime and only a faint increase in delay.