You are on page 1of 20

Blockchain

Dr Sanjay Mansabdar
Financial Markets and Fintech
School of Management, Mahindra University
Agenda
• Motivation & History
• Understanding Blockchain technology
• Understanding how Blockchain works and the role of cryptography
• Understanding Miners and the Consensus mechanism
• Blockchain and Smart Contracts
• Pros and Cons of Blockchain
• Applications of Blockchain
The Motivation & History

The times in which Bitcoin


was launched is meaningful

2008: GFC
-Financial Institutions going
under
- WaMu, Bear Stearns, AIG,
ML
- “Is my money safe”

A significant trust deficit of


the formal financial system
What is Blockchain
• Decentralized Ledger Technology [DLT]
• Data stored in parallel across multiple computers [nodes]
• Computers are in sync with respect to data
• Data is immutable – cannot be changed
• Key advantages:
• Multiple computers need to be hacked to amend data
• No single point of failure
• No central authority
• Privacy
Key Ideas
• Blocks
• Chain
• Network/Nodes
• Cryptography
• Mining
• Consensus
Demos: Hashes & SHA256
• https://demoblockchain.org/hash
• The hash is a digital fingerprint of data
• SHA 256: Secure Hash Algorithm developed by the NSA
• One-way functions: cannot recover the underlying data
• The same data will always generate the same hash
• Unique – changing even a single element of the data will change the
hash
Demo: Blocks and Block Hashing
• https://demoblockchain.org/block
• Block Number
• Nonce [Number used once]: 72608/71850
• Data
• Hash
• Difficulty Level – set so that its takes about 10mins to solve
• Block Number + Nonce + Data + Difficulty Level = valid Hash
Demo: Nodes and Immutability
• https://demoblockchain.org/distributed
• Blocks
• Ordered
• With Data
• Valid
• Linked
• Changing data in any one block invalidates
• Block
• All downstream blocks
• Trying to fix even one chain is difficult
• Consensus mechanisms require a majority of chains to be amended
Demo: Transparency in Blockchain
• www.blockchain.com
• Each block on the bitcoin blockchain has
• Hash
• Nonce
• Difficulty Level
• Reward
• Transaction Fee
• Transaction Details
Consensus and Mining
• Consensus: How to make sure that cryptography for a block is validated and the
block replicated and in sync across all nodes
• Mining: The process of adding new blocks to the blockchain
• Bitcoin received as reward/fees
• Proof of Work
• Find the Nonce and the correct Hash
• Reward + Fees
• Proof of Stake
• Something valuable is committed
• Not a good initial mechanism
• Ethereum 2.0 & “The Merge”
• Only Fees
• Miners are the entities that compete to find the hash
Proof of Work - a toy example
• Aditi, Ram and Anika compete every 10 minutes
• Solve a puzzle
• Winner gets Rs 100
• Anika solves it first
• Publishes her solution
• Ram and Aditi validate her solution
• Store her solution because it matters for the next puzzle
• Anika gets rewarded
• If Shyam joins the competition later and changes the chain
• Aditi, Ram and Anika reject his chain because it doesn’t match theirs
Proof of Stake: A toy example
• Aditi, Ram and Shyam compete for a piece of work
• Each stakes one coin
• This sets the probability of being allocated the right to work = 1/3 for all
• Ram decides that he would like to have the work
• He stakes two coins so his probability increases to ½
• If Ram is allocated the work and gets it wrong
• He loses two coins
• If he gets it right
• He gets his coins back
• He gets a transaction fee for doing the work
Mining
• There needs to be a reward
• 6.25 bitcoins for adding a block
• Transaction Fees
• 6.25 bitcoins is worth a lot! USD34K per btc.
• Massive investment into mining
• Mining hardware with specific chips – rigs
• Groups of miners operate together to share rewards
• Competition may be based on the the transaction fees generated by a
block
• Halving limits the total bitcoin in circulation
Proof of Work versus Proof of Stake
Parameter PoW PoS

Probability of Quantity of Computational Work Done Quantity of Crypto staked


Mining
Competition Competitive Non Competitive

Reward Block Reward + Fees Only Fees

Security Hackers need 51% of computational power Hackers need 51% of outstanding crypto
on blockchain
Energy Energy Inefficient Energy Efficient

Computational Specialized hardware called mining rigs Standard Server is sufficient


Hardware
Notes

• Faster transactions is a relative


term. It does take time to verify
transactions and get onto the
blockchain
• Transaction fee specified
matters

• Immutability can be looked at two


ways – what if a mistake was
made earlier?
Notes

- Private or hybrid blockchains bring


more centralization

- This defeats some of the motivations


of blockchain

- May as well go back to the old way of


doing things?
Blockchain - Applications
Smart Contracts
Programmable Blockchain
• Blocks can also contain code + supporting data
• Blockchains listen to “oracles” that record events
• If a relevant event is registered
• Code is submitted to an Ethereum Virtual Machine
• EVM executes the code and submits results
• All nodes on the blockchain run the code and submit results
• Result consensus is arrived at
• Downstream actions are performed
• Must be programmed in specific languages. E.g. Solidity on Ethereum
Net Effect: No centralized system is needed
Pros of Smart Contracts
• Fast Execution and settlement
• No Lawyers needed beyond initial
drafting
• Human error minimized
• Transparency
• Security

Cons
• Specialized software
• Privacy is a challenge in public
blockchains
• External triggers needed
• Many components need high
security eg oracles

You might also like