What is Bitcoin and Blockchain Technology (30,000 foot view)

Few months back my friend introduced me to Bitcoin protocol & blockchain database , initially most of the words sounds jargon to me. After reading few articles , I have decided to learn this new tech by buying cryptocurrency. As a first step I had created an account in Coinbase and bought bitcoin for 10$'s. Coinbase is one of the platform for buying BTC with USD. First I have noticed this new thing called as Address which is used to send and receive BTC.

BTC Address - 1BoatSLRHtKNngkdXEeobR76b53LETtpyT

  1. begins with 1 or 3 , it is 26-35 alphanumeric characters 
  2. Treat BTC address as your email ID , which you can share it with other BTC users who can send BTC in fractions or whole (Ex 2 btc, .05 btc, 1.1 btc).
  3. address can be generated using Bitcoin client software which most exchanges use and you can run one in your machine. 

BTC Transaction

After a while I tried sending my BTC from coinbase to my poloniex account. Poloniex is one of the cryptocurrency Exchange where one can buy other Cryptocurrencies like Ethereum, Litecoin, Monero (Treat each cryptocurrency as a software ).

All the bitcoin transaction are public and it is store in Public ledger , so that anyone can check online about the status of that transaction. I took the Transaction ID and searched in Block explorer.  

When a user initiate a BTC transaction , it actually get broadcasted to Bitcoin Network as shown in this image. A Bitcoin network is peer to peer architecture running on top of Internet. Peer-to-Peer (P2P) network is created when two or more computers are connected and share resources. 

Why we need Cryptocurrency and what it is solveing? 

In any Bank transaction , your transaction is send electronically to a centralized Bank server. Bank server is responsible for keeping our money safe, ensure that money is not double spend, etc. Unfortunately Bank transaction & its servers have some drawbacks, 

  1. Longer transaction time and higher Transaction fee
  2. Bank servers are likely go down , hacked (single point of failure)
  3. Few more economical & political reasons which you can hear from my favorite speakers , Andreas Antonopoulos, Roger Ver, Vitalik Buterin, Max Keiser. 

Here in Bitcoin software those banks responsibilities are DISTRIBUTED to its Peers and above drawbacks are addressed by the law of mathematics (Cryptography) besides law of human. 

There are 2 key players who represent a Bitcoin Peer and keep the Bitcoin itself alive ,

  1. Nodes (also called Full Node)
  2. Miners

Node is a computer which runs a Bitcoin software and its role is to , 

  1. keep a copy of all the users transaction in a Public Ledger. 
  2. Nodes listen for new transaction and propagate any incoming transaction to its peers
  3. nodes listen for blocks (Highlevel block is nothing but a group of transaction linked to previous transactions)
  4. nodes validate and fulfills any transaction using Bitcoin's protocol consensus rules
  5.  If a Node try to manipulate any transaction/public ledger which is not part of consensus rules, then that node will automatically thrown out of the network for 24 hours.
  6. Block Explorer is one of the Node, which provides a GUI to its users to query & view the Bitcoin network.

Anyone with good configuration PC and internet can become a Node  and join the BTC n/w, be part of this Bitcoin revolution. 

Miners are responsible for finding the candidate block , that process comprises of finding hash for all the current & previous transactions and finding the Nonce. The outcome of this process gives birth to two key elements  ,

  • Candidate Block 
    • it comprises of merkle root (Grouped transactions) and Nonce
  • Bitcoin 
    • Miners Reward 
      • 50 btc / block - year 2009
      • 25 btc / block - year 2013
      • 12.5 btc / block  - year 2017

How Mining works ?

Every miner start hashing the transaction as soon as they receive from the full node and try to find the Nonce.  Nonce is  computationally an expensive task were a miner have to finds a random number and it take lot of trial and error. Miners who have larger hashing power will find the Nonce faster. 

Once the Miner find the Candidate block , that block gets broadcasted to other nodes. Again Nodes will ensure that the candidate block follows all the bitcoin censuses rule and update its  peers. 

The outcome of the whole mining process generates a brand new Bitcoin and the same is rewarded to that Miner who finds a valid candidate block.

As shown in the diagram , each block is having a reference to its previous block and next block hence it is named a BlockChain database

Every crypto currency has it own Block Explorer -  refer to the transaction column where we can find how many Bitcoin transaction are part of that block.

Candidate Block Details - Here we can find the hash reference to the previous block (Hence the name Blockchain). Hash with preceding zeros tell the how difficult it is to find the Nonce

All the Transaction in that block.

How Bitcoin network is more secured ?

We know in Math function each input passed into a function has a single output , example


Input Function Output
2 f(x) = (x * x + 10) (2 * 2 + 10) = 14
10 f(x) = (x * x + 10) (10 * 10 + 10) = 110

In Bitcoin software each transaction is represented as a hash (of length 32-byte) , it uses SHA-256 Hashing algorithm to generate the hash. There are few other hashing used by other crypto currencies. Another example of hashing is , in traditional database all our passwords (facebook , gmail)  are hashed before storing it in the database. Primary reason for hashing is , if someone hack their database or whoever have access to their database should not read our password as pain text.

Hashing is irreversible.

In bitcoin world if any one of the peer try to modify any transaction or block , that node will be black listed forever.

If one bit in the input is modified then its respective hash output is going to be different, you can see the hash of the string 'User1 send 2.0 Btc to User2' , and the chain have to be recreated and broadcasted. Luckily the bitcoin consensus rule will  find the tampered block or transaction and reject it. This is how the integrity of public ledger is handled (Hence more secured). 

Transaction Data Sha 256 Hash
User1 send 2.0 Btc to User2 db49271e5695924de1b0bbaf451fb630b8e928391a74da9a435cb27ff9c1e409
User1 send 600 Btc to Hacker2 3e56f51e5a898c198bc58cca5f478f1396694152aaeb972496b5c3906738a73e

Crypto Algorithm used by other Blockchain Apps


Please share your comments if my understanding is wrong.

H2
H3
H4
3 columns
2 columns
1 column
Join the conversation now