Application of Blockchain

If you are not familiar with the blockchain key concepts i would suggest this previous article.

Blockchain is a technology that enables us to move resources on the provided decentralize database. Now those resources could be anything that provides us value. Its is transparent among the parties or nodes that are involved which makes it more trusted system.

Concept of Blockchain:

The concept of blockchain was introduced in 1991 by a group of scientists who proposed  to timestamp documents digitally in order to validate them. Once a document was timestamp a hash of the complete document was calculated. This hash was used to validate the document. Any tiny change in the document will change the hash and it will invalidate the document. But unfortunately it was not practiced that much until 2009 by Satoshe Nakamoto.  He created the crypto currency Bitcoin using blockchain technology.  

concept of bc

Now that a very important point here about a very general and common misconception  between Bitcoin and blockchain that they’re one of the same things but they’re not.  Bitcoin is a digital currency where as blockchain is a technology used by the bitcoin. 

 

Case study:

In this case study we’re going to discuss a very basic example of money transfer.  The Scenario is where we  want to transfer money from one point to another. Lets say A is in Sweden and wants to transfer 5 dollars to B in Pakistan. As there is no direct line so A will have to use a third party service. The 5 dollars will be transferred via the third party who will transfer the money to B in  Pakistan. Lets say the third party charge some fee and the transfer is done in 2 days.  Now during those two days you don’t have any transparency on what the third part is doing with your money or is the money transferred or not.

case study 1

 

So we have three general problems here that we want to discuss the fee, the time that the third party took and transparency of the third party process. Now lets address these problem in more detail by consider another example. 

 

Long transaction time:

So we have three person A, B and C.  In the very beginning we say that A has 10 dollars. We are going to maintain this in a record which will be our open ledger.. The very first block of the blockchain is called the genesis block.  B has 7 dollars and C has 5 dollars.  Lets say A wants to transfer 7 dollars to B. The address of A B and C are basically the public keys on which the money is transferred. This will be added as a transaction to the ledger and the transaction is performed. B want to transfer 5 dollars to C which will also be added to the ledger and so will our last transaction which is C transfer 5 dollars to A. Now if you see this open ledger is actually the transfer which is done instantly. This open ledger here is called the blockchain  So we have fixed the problem with the long transaction time by instantly maintaining the record in an open ledger but our solution is still like the third party where our ledger is hosted an one place which could be a single point of failure.

 

Transparency:

To address this problem we will distribute the ledger to each node that is involved in the network.  So now we have a distributed block chain. By doing that we eliminated the problem of trust less ledger in fact now its more visible to all the parties and they can validate the ledger at any time. As we have solved the problem by distributing blockchain. we have now another problem of synchronizing the ledger so that is updated on each node on the network. The problem here is that A can say that C transferred 10 dollars to A and add it to its block chain so how will the other nodes know that it was an invalid transaction. 

To understand this part of the system where we will have to look at another example. Lets say this is our network and this the block chain for that network. Lets say A wants to transfer 2 dollars to C. When the transaction occurs a block in created but not yet validated. The difference between creation and validation of block is that anyone can create a block but it has to be validated before it could enter to all the blockchain.  When the block is created it will distributed to these special nodes in the network that will perform validation. These special nodes are called miner. Miner are just ordinary nodes except that have provided high computation speed to compute the validation of the block. Once they validate a block they are rewarded with a small amount. 

validation

For our block we have to calculate the hash of the block which some could say is a really quick operation so why this high computational power is needed. Usually there are some blockchain rules that are enforced on the block validation that the hash of the block should start with 5 zero. This is called the difficulty of the block. I will discuss these topics in detail in my later videos. Lets get back to our block so once our intended block is published to the nodes all the miners will pick up the block and start computing the hash the block. Let say B was able to generate the hash before D so B will add the key that it used to generate the hash, add it to its local block chain and broadcast it to the network.  When A receives the block it will validate the hash by using the same key in the block and once validated A will add the block to its block chain and wait for the next block. 

 

The reward system for the miners is very complex and very important part of the block because it contributes to your currency. I hope you all understand the concept. We touched these concept which I will explain in more detail in my later lectures.