Blockchain and bitcoin explained with practical examples

Block chain  is going to be a disruptive technology in the coming years. Blockchain being a mystery for even tech-savvy crowd, let me make a try to explain it as simple as possible.   To know the concept of blockchain , we need to get some understanding and basic concepts about SHA2 , hash, distributed network etc. I know these might sound a bit technical, but stay with me for a while.

Hash
Hash is nothing but a digital fingerprint of information created with SHA2 algorithm. As name mention, each and every character, word or sentence will have a unique hash code. So if i put ‘my name is Girish’ , it spit out a unique hash code and it will be always unique. Now forget about the above sentence and if you have a huge article written, again there will be unique hash for it. It is very interesting that even if it is a single character or a huge library of information, hash code will be of same length.

hash

Sha256(Girish) = 8903bf5e68765fb51b77b84d125497450c1f2b5e94ee44e5c84a1810e84ae432

Hash is a digital fingerprint, it is unique for every combination of chars.

Now hope you got an idea about hash ,lets see what a block is .

Block
Block is collection of data, my name is Girish is a data in our earlier example.  In BLOCK,  data along with a unique signing key together will generate a hash which will be unique for this combination. It essentially means if any one (ie. data of signing key) changes then hash will change.

block

As mentioned above , here I added an additional G in the end, now  hash also get changed and mark it as unsigned or un-certified or invalid.

invalid block

Now to get the certified or signed hash, the option is to remove that additional “G” from the box or replace “114290” which is the earlier signing key and guess a new signing key which will certify this data with a new hash.

Mining

Now i programmatically tried from 1 till i get a signed hash, and the magic number was 31615 in this case. As you see the box turns green to show it is valid. In a simple term, this is known as mining. We will get into this in detail soon.

new signed block

Block is collection of data along with a signing key, combination of data and signing key creates a unique hash.

Lets look at what a blockchain is,

Blockchain

Blockchain is a continues chain of blocks and,  interestingly it points to a block previous to it. Consider this as a array of data & signkey combination. Ideally it is a chain of blocks which are certified or valid.

block chain

Assume any one of the block in this chain got altered , as you see all the chain after it get invalidated. In the example second block is altered with an additional information “+ faked data” an we can see block 2 and 3 got invalid.

invalid blockchain

Does it ring a bell in your mind ? Yeah that is how the integrity of a blockchain is maintained without a third party or a trustee.

 

Lets see the complications involved if someone try to validate any single block in this entire chain, to achieve this he has to go and fix entire chain by guessing the right signing key which is such a big resource intense activity which is practically impossible. That is why we say data written to a block chain is immutable.

 

Now lets see what a distributed block chain is.

Distributed Blockchain
In the above example , the entire blockchain from the node where it got a fraud entry become invalid, but as we discussed these nodes can be signed with a new key and make it valid again. Even though it is resource intense it can be done on a relatively smaller chain, see below, all the signing key and hence the hash got changed but chain become valid again.

revalid blockchain
Distributed blockchain is as good as having the entire chain of blocks distributed to everyone in the network. This help to make things a bit for difficult to corrupt the system, now we have copies of certified blocks with thousands or millions of people in the network. Blockchain system can now easily validate and identify which of the chains are faked or corrupted and so ignore it. Rule of majority works here.
Now we know the basic concept of blockchain, lets see the practical implementation of blockchain which is bitcoin. Many people confuse bitcoin with blockchain and vise versa. Blockchain is a concept and Bitcoin is a practical application build on top of blockchain concept.  There are many other applications which are being build which may revolutionize banking & financial industry.

When we talked about hash , remember the data area , it was just a block of text data, now instead of just text we will have a set of transactions recorded and maintain a public ledger. Lets see how it looks like.

token

You can now easily relate the importance of immutability in this practical implementation. As i mentioned earlier irrespective of the length of data, it will have a unique hash for all the set of transactions.   There are more to be discussed about bitcoin implementation on how is the opening balance and closing balance maintained etc, which will be discussed in another tutorial. Hope this helps you to understand the blockchain and bitcoin implementation better.

 

Please watch this video which explains the above in an explainer video format.

Reference and tool from anders dot com