ABC of Blockchain
What is Blockchain
Before I try to answer, what is Blockchain? Lets first look at what Blockchain is not.
- Blockchain is not Bitcoin, infact Bitcoin is an application of Blockchain.
- Blockchain is not just about financial data.
- Blockchain is not a product, instead Blockchain is a base fabric on which a variety of usefull applications can be developed.
- Blockchain is neither a replacement for traditional transaction processing systems nor a replacement for distributed database systems. In-fact for many simple transaction processing systems, using Blockchain is an overkill.
- Blockchain is not a replacement for secure messaging system.
So what is it?
In simple words, It is a distributed database/ledger of transactions' data, with the following properties:
- It's Shared. The data is open to every one and can be seen by everyone.
- It's Distributed. Everyone who has it, can add to it.
- It's Immutable. No one is allowed to change and delete any data in it.
The transactions in Blockchain don't have to be financial transactions only, infact it can be any thing of value and involving business network, for instance Online voting system can use Blockchain to represent voters and votes.
In technical terms, It is a list of connected records called Blocks which are linked together using cryptography, metaphorically forming a Chain, hence the analogy "Block-Chain".
What is it used for?
Let us take a business case to understand this.
If 2 persons or companies wants to do business with each other they first need a middle man or a mutually trusted 3rd party. For example, if I am doing business with someone and I want to transfer some money to him, I need a trusted 3rd party, which in this case would be a bank. The primary job of a bank is to take money from me and hand it over to the intended person in a secure manner with complete tracking of the transactions. In case if any dispute arise, as a business, legally I've the proof in the form of records of banking channel transactions that I've sent money to Mr. X and he has received it in his account.
On the surface this seems very efficient and some what, it is proven to be the only way we have been doing business for a while now. However as they say, the devil is in the details, there are many issues associated with this 3rd party approach.
- Bank's or the Trusted 3rd parties charges heavy fees from the involved parties for providing transaction management services.
- Trusted 3rd party have control over these transactions, they can apply certain policies on the transactions, they can even deny the transaction based on some set policies and on legal grounds.
- The whole process involving a 3rd party is time consuming. Normally in most cases an intra-bank transaction with in the same region takes place in 2 to 3 days. In today's fast paced and connected world this is a-lot.
- This is just one 3rd party involvement, consider an example of a complex transaction such as purchase of Real State, where you have to pass through a layer of 3rd party mediators. Each layer will add their own charges, time and policies for processing a transaction through them.
Block chain is attempting to solve the issues from above business scenario by:
- Allowing to carry out the business transactions at Peer to Peer (P2P) level, without any 3rd party intervention.
- Do them at a cheaper cost.
- Do them in less time or almost immediately.
So how it does that? this is what I'll attempt to explain below by briefing one concept at a time. I'll try to make it as simple as possible so that a beginner of Blockchain can understand the ideas.
Open/Public Distributed Ledger
One of the functions of the 3rd party like banks is to maintain the records of the transactions that is being carried out throug them in the form of a Journal. In accounting terms this is called Ledger. Since the idea of Blockchain is to eliminate any 3rd party, the big question is that how and where the records of the transactions will be maintained? The answer is Open/Public Ledger.
Open Ledger is a Decentralized/Distributed public financial platform. The properties of the Open/Public Ledger are:
- Ledger is not stored at a centralized location but distributed to every node in the network.
- Everyone on the network can see and validate the transactions.
- Everyone can add transactions to Ledger.
- It's virtually impossible to change data which is already recorded to this ledger.
- Transactions are maintained in containers called blocks.
- Blocks are metaphorically linked with each others and forms a chain.
Let us understand it through an example.
Given a hypothetical simple situation, there are 4 person involved in business, Person A, Person B, Person C and Person D.
- A, started by having 500$ with him. This is called Genesis, which is the first entry in the chain.
- A, then wants to sent 150$ to B.
- B, wants to send $30 to C.
- C, wants to send $10 to D.
As dipicted in the picture above, all these transactions got recorded in the Public Ledger as blocks, chained to each other (To make it simple I'll not discuss the implementation details of block here) and all of them will be available to every member. What it gives us is that, every one on the network can see:
It's also virtually impossible for A to manipulate the ledger by changing old entries because:
However, considering the Speed of computation available these days, hash alone is not enough to prevent tampering, since anyone with enough computational power can temper a block, rehash the block and all the proceeding blocks in the chain and can add them all again to the chain. Hence, along with hashing we need another mechanism called "Proof of Work (PoW).
- Where the money is.
- How much money each of them have.
- Everyone can decide whether a transaction is valid or not.
It's also virtually impossible for A to manipulate the ledger by changing old entries because:
- Copies of the ledger are distributed in the network.
- As I've mentioned earlier that each block of transactions are stored in Blockchain in the form of a block, with a cryptographic reference to previous block (Every block stores the hash of it's predecessor block and the hash of it's own which is calculated based on the value from predecessor's block hash).
- It's also virtually impossible for someone to tempered a block since changing a block will invalidate the hash of all the following blocks in the chain and every block then needs to rehash it self.
However, considering the Speed of computation available these days, hash alone is not enough to prevent tampering, since anyone with enough computational power can temper a block, rehash the block and all the proceeding blocks in the chain and can add them all again to the chain. Hence, along with hashing we need another mechanism called "Proof of Work (PoW).
Proof of Work (PoW)
Proof of Work is a computational puzzle/challenges which needs to be solved by special nodes in the Network called Miners. These puzzle requires special computations and requires at-least a minimum computation time before it can be solved. In contrast, the validation of the PoWs are very straight forward.
In order to be added to the chain every block needs to present it's hash plus a Proof of Work. Only after which they can be added to network. This is a mechanism which slows down the addition of new blocks to a Blockchain. For instance, in case of Bitcoin it takes roughly about 10 minutes to calculate the required Proof of Work for a block. This prevent a user from tempering a block, rehashing them and than immediately adds them to the chain. No, hash is not enough, they also need to present a PoW.
Now let us assume that someone decides to temper a block which is some X number of blocks down the line in the chain, they first have to change and rehash the block they changed, then they not just have to rehash all the following blocks, they also have to calculate the Proof of Work for all these blocks. All of these operations needs to be completed and added to the chain before any other new blocks could be added to the chain. In a large Blockchain with many transactions this is impossible as of now.
This brings us to our next concept: Miners.
Who are Miners
Solving a computational puzzle such as Proof of Work is called Mining. Miners are special nodes on a Blockchain network which competes with each other in order to add a block to a Blockchain. Why they compete? Well as I've mentioned that hashing and Proof of Work are heavy computational challenges and probably requires Grid computing called Mining Farm, without some rewards you can't attracts investors to invest in this business. Hence, if a Miner is able to solve the computational puzzle before others, that can enable them to add blocks on Blockchain. Being able to add blocks on the Blockchain gets financial rewards for Miners.Proof Of Stake (PoS)
To cope with the issues of PoW and to allow everyone a chance to compete, in 2011 a new mechanism is introduced, called Proof of Stake (PoS). PoS is the selection criteria for, who can Mine a block? It's a distributed consensus algorithm to decide who can mine Next. In PoS terminology miners are called Validators and instead on the term Mining, Minting or Forging is used.PoS uses an election process to randomly (to some extent) select a Validators node which can validate the next block. However, to be eligible for selection, Validators has to deposit a certain amount of rewards to the network as a Stake. The stake can be think of as a security deposit. The size of the Stake is directly propotional with the chances of a Validators to be chosen to forge the next block. It means the more Stake you have, the more chances you can get to forge and the more wealth you can attain. Validators will still get the reward which is associated with validating the block, the Validators can loose the Stake (Security Deposit) as well if they start approving fraudulent transactions.
Although it doesn't sound equally fair, but it's comparatively fairer than PoW.
Smart Contracts
Smart Contracts are small programs that lives on the Blockchain and can perform actions when certain conditions are met. Since the data on a Blockchain is very hard to temper with and integrity is almost certain, we can take decision about the data without human intervention. Examples of smart contracts are Insurance Claims, Payment on Delivery mechanism in B2C, B2B or even C2C where if delivery is made according to a defined contract the payments will be released otherwise payment will go back. Another application is Bank Loans Automatic payments. One of the examples of the Blockchain which supports Smart Contracts is Ehereum.
What does Blockchain offers
Humans created the Mutually Trusted 3rd Party model to do transactions between 2 parties in order to perform business. Presently and In the future we have to instantly transact with not just businesses but smart devices, machines, intelligent systems, humans etc etc. Hence the Mutually Trusted 3rd Party model with delays, controls and high fees are not practical anymore, we need the ability to Transact at a P2P level. However, doing P2P level transactions involves concerns such as Trust. The most generic and valid answer to what does Blockchain offers? is that, "It offers the solution to the Problems of Trust". I would recommend to watch the following TEDx on Blockchain.Blockchain: Massively Simplified
The Convergence of Blockchain, ML & Cloud
To make it even simpler we can develop 3 types of applications using Blockchain, we call it 3C's.
Currency, applicatinos which involves money, like Satoshi Nakamoto did in the form of Bitcoin.
Contracts, applications that enforces clauses of a contract.
Claims, applications that establishes ownerships of something.
Although I've tried my best to keep it as simple as possible while still briefing most of the areas of the technology, this write-up has already become a bit lengthy, hence I'll conclude here. More details in some later write-ups. Please don't hesitate to provide your feedback, point to any gaps, incorrect info or required updates.
Comments
Post a Comment