Blockchain for beginners — BitCoin

(1) Introduction

“The distributed ledger (blockchain) technology underlying payment systems like bitcoin is a significant innovation

Bank of England (Quarterly Bulletin, Q3, 2014)

Brynjolfsson and McAfee, in their book The Second Machine, made an interesting reference on how productivity improvement due to advent of electric motors didn’t arrive for another 30 years after it’s first introduction. This was because during early years, the steam engine (only source of drive for all machines in a factory) was replaced with a single electric motor, but the overall layout of the factory stayed same. It took 3 decades to realize that smaller motors could be placed on individual machines & thereby the factory layout could be optimized for material workflow efficiency (rather than stringent layout dictated by the need to utlise a single source drive). This actually unlocked true potential of electric motor & enabled to reap significant productivity improvement & benefits.

In the world of finance, a number of basic elements like currencies, assets & capital market instruments are issued, tracked & transacted through a well known double entry book keeping method. Institutions play a pivotal role as central trusted entities by recording ownership & facilitating transactions (also ensure no double spend) by maintaining various central ledgers. With the advent of computers, very little changed to these centuries (at least 500 years) old practice of central book keeping & the role of these institutions. When the financial systems were computerized, all these system of record were converted from paper to electronic format to bring in speed of transaction & reduce operational risk. But this is much like the early days when electric motor replaced the steam engine without fundamental structural changes for significant efficiency & benefits.

Recently, in 2009, in the wake of global financial crisis, motivated to bring in an alternative/simple financial model, a very bold experiment: Bitcoin was conceived. Bitcoin, is a peer to peer, digital currency system that operates without any trusted intermediary. Ownership & transactions are verified & recorded in a distributed ledger (or blockchain) by other peers on the network. To know more about Bitcoin: www.bitcoin.org

The technology underpinning Bitcoin, distributed ledger/blockchain is seen as the golden-key to unlock true potential of computers & internet to build new efficient structures/models & reap huge benefits. This technology is very nascent & will take at least a few years to mature before it can significantly disrupt some of the computerized version of centuries old model.

This article will provide a techno-functional overview for beginners on the basic elements of the Blockchain/distributed ledger technology & a simple model of it’s working.

(2) Key Elements of Blockchain technology

Blockchain or distributed ledger is defined as “a decentralized, consensus-based tamper-proof data structure that provides a public ledger open to all”.

Blockchain, at fundamental level, is a combination of a number of established technologies that existed for years. It was not until a pressing need to innovate a system like Bitcoin in 2009, these elements were brought together to create a technology we refer as blockchain.

(2.1) Blockchain data structure

The blockchain data structure is a time stamped, non-repudiable data store of the entire system history. Each participant node (user) have a local copy of this blockchain enabling a distributed ledger. A clever cryptographic hash function based linked-list structure ensures a tamper proof mechanism for data in the system. The consensus protocol keeps the data in sync across all nodes/users.

(2.1.a) Cryptographic Hash Function

A cryptographic hash function with above listed properties make the blockchain data structure functionally powerful. The contents of a text (say a transaction) is hidden [irreversible property], as the hash value is stored & referred. At the same time it ensures no one modify the contents of the original transaction enabling data integrity [commitment property]. This is also a method to digest large messages, say a block of transactions & generate a summary in the form of hash value, which can be efficiently remembered & recovered.[collision free & message digest property]

The Bitcoin system uses a standard SHA-256 hash algorithm which generates a 256 bit hash value.

(2.1.b) Data structure of a simple blockchain

The above is a structure of a simple blockchain data store. This is a linked list built with hash pointers to record all transactions (to be precise, group of transactions in blocks). New block, as agreed per the consensus protocol by participating peer nodes are committed to end of the chain. Once a block is added to the chain, it becomes a permanent record & data in that block is never modified.

Given the structure of this data store it is not possible for an adversary to tamper data in any block without getting detected. For example, say if an attacker wants to tamper one of the transaction :”Txn3.2” in Block 3. Any change in contents of Block 3 will make the hash of this block (Hash 4 — saved in block 4) invalid. Therefore an attacker has to modify Hash 4 which in turn changes the contents of Block 4. This means the root hash pointer H() is no longer valid & cannot be tampered without getting noticed by peers on the network. This shows how infeasible it is for someone to maliciously modify the data on this structure, thereby resulting in a self enforcing tamper proof log.

(2.2) Cryptographic Token

A token is a cryptographically secured unit of value in the system. This could represent a virtual currency or an asset like stock or bond. The cryptographic token ownership information & transaction history are recorded in the distributed ledger in a blockchain data structure format.

(2.3) Peer to Peer Network

(2.3.a) Peer to Peer network setup

Individual nodes/users of the system are interconnected in a peer to peer network. This is a decentralized system with no single point of control or vulnerability.

With no intermediaries & a direct transaction between payer & payee (seller & buyer in case of an asset), credit & liquidity risk are eliminated. Individual nodes can leave & join the network anytime & with multiple nodes running at any point in time the distributed blockchain based solution is more resilient to operational risk.

(2.3.b) Digital Signature in peer to peer model

In a peer to peer system there is a need for fool-proof way to verify if a transaction is initiated only by the token’s rightful owner. This is achieved with the help of digital signature mechanism as show:

The owner of a transaction would digitally sign a document & publish these to the network (1) a plain text version of transaction (2) the digitally signed encrypted version of the same transaction (3) public key.

Any of the peer node could validate this transaction by decrypting (with public key) the signed version of the transaction to check if it matches the plain copy.

In the absence of a central entity identity management is another key function that had to be taken in a peer to peer setting. The public keys are utilized as addresses for identity.

(2.4) Consensus protocol

The consensus algorithm is the basis for a group of peer nodes to verify, validate & facilitate the transaction. In blockchain terms this the method used to agree on who has verified (mined) a block successfully.

Bitcoin uses a consensus protocol called “Proof of Work” which is a clever Cryptographic puzzle which is hard to solve but easy to verify. This ensures work is expend in mining a valid block before committing to the chain. Either a new cryptographic token or part of the transfer is given as reward to user of the node successfully validated the block. This incentive is one of the primary motive for a bunch of users to commit necessary resources on their node to facilitate transactions on the network.

(2.5) Virtual Machine

The virtual machine in a blockchain context is different from the one referred in a traditional IT setting. Here the virtual machine refers to a system collectively running on a number of decentralized peer to peer nodes.

In case of Bitcoin, the virtual machine is a single virtual computer on top of thousands of nodes across the globe.

(3) Blockchain Protocol — A simplified workflow model

A simplified workflow to demonstrate how blockchain based system works:

  1. User1 wants to transfer a Cryptographic token owned by him to User52. This ownership is recorded in one of the previous transaction in one of the earlier block.
  2. User1 initiates a transaction message by signing his private key. The recipient is identified with public key of User52.
  3. The transaction message (Txn 5.1) is verified by peer nodes with the help of corresponding User1’s public key.
  4. Valid transaction (Txn 5.1) is added to a block along with transactions initiated by other users on the network.
  5. The hash pointer of the last block in the current blockchain is also added to the top of the block.
  6. A group of users on the network validate & verify the block as per the system’s consensus protocol (in case of Bitcoin this is a Proof of Work algorithm)
  7. Once there is an agreement that this block is mined, then it is distributed to all the nodes in the network. There is a reward as per predefined rule to the user of node that has mined the block.
  8. All the nodes in the network verify the new mined block & if found satisfied it adds the latest block to end of the chain.
  9. All transactions in a block are complete as soon as the block ends up part of the longest chain on the blockchain structure.
  10. At this point in time the transfer of Cryptographic token ownership is recorded & complete.

(4) Summary

The objective of this article is to demystify what is a blockchain & provide a simplified workflow. One of the biggest potential of this technology (in financial services industry) is for the end user to own & transact value/assets without any trusted intermediate entities/infrastructure like banks, stock markets, settlement/clearing houses etc…[Bitcoin, a decentralized digital currency, is single biggest working proof of this possibility.]

The possibilities & resulting benefits in terms of efficiency & cost savings are enormous. But at the same time it is prudent to be aware of risks with any new technology & it will be at least a few years before it matures to support wider use cases with minimal risk. And equally the end users will need time to understand & accept these new model of value exchange & shift to the new paradigm when comfortable.

First Published by Natarajan Chandrasekhar

Like what you read? Give Rahul G a round of applause.

From a quick cheer to a standing ovation, clap to show how much you enjoyed this story.