4. Blockchain
A blockchain is a distributed database
that maintains a continuously growing
list of records called blocks secured from
tampering and revision. Each block
contains a timestamp and a link to a
previous block.
4
6. Ethereum
A blockchain-based distributed
computing platform, featuring smart
contract functionality. It provides a
decentralized virtual machine that
can execute peer-to-peer contracts
using a cryptocurrency called ether.
6
7. Blockchain : Bitcoin : Ethereum
Core
Tech
Gen 1: Special
Purpose Apps
Next Gen:
Platform for Apps
7
12. New block sent out on network.
Other nodes validate.
Connects new block to previous
block.
Thus forming a chain of blocks.
12
13. BTC shows up in Bobâs wallet.
No central, controlling, approving authority was involved.
13
14. Anticipated Questions
â Why use Blockchain?
â Can Alice send a copy of the same coins to Chanakya?
â The double-spend problem.
â What if two miners create a block at the same time.
â Who wins?
â What if the miners cheat?
â Byzantine Generals problem
14
16. Current Issues
â Trust is centralized
â Centralized ledger
â Power and abuse at the center
â Deniability with alteration
â Long Time for Transactions
â Hefty charges
â Non-resilient
â Cost of maintaining software
â Security breaches on âone truthâ
16
17. With Blockchain
â Trust without a central figure
â Decentralized ledger
â Transact with anybody on the network
â Confirms: spender has the money
â Confirms: Not a fraudulent transaction
â Immutability
â Resilient
â Works with intermittent connectivity
â Fast
â Cheap
â Micro-transactions
17
18. Bitcoin: A Peer-to-Peer Electronic Cash System
âWe propose a solution to the double-spending problem using
a peer-to-peer network. The network timestamps transactions
by hashing them into an ongoing chain of hash-based
proof-of-work, forming a record that cannot be changed
without redoing the proof-of-work. The longest chain not only
serves as proof of the sequence of events witnessed, but
proof that it came from the largest pool of CPU power... The
network itself requires minimal structure.â
bitcoin.org/bitcoin.pdf - Satoshi Nakomoto 18
19. âOn the Shoulders of Giantsâ
â Distributed Systems
â Peer-Peer Networks
â Hashing Functions
â Cryptography
The astonishing innovation
was in bringing it all
together in a way that it
works. 19
22. BitTorrent Protocol
â Distributed
â Resilient
â Owned by no one person
â BitTorrent client required
â Once started, lives on its
own
â Uses computing
resources
22
23. A Database & A Linked List
A database is an organized collection of data.
1 2 3
A Singly Linked List can be traversed in one direction.
23
27. Hash Function
â Used to map data of arbitrary size to
data of fixed size
â Used in data structures like
hashtable/dictionary/map
27
28. Cryptographic Hash
â Fixed length output
â Must be fast
â Pre-image resistance: it should be
computationally hard to reverse a
hash function
â Second Pre-Image Resistance: given
an input and its hash, it should be hard
to find a different input with the same
hash
â Collision Resistance: it should be hard
to find two different inputs of any
length that result in the same hash.
blockchain
the competition
creating new
blocks is known
as mining
a blockchain consists of
blocks that hold
batches of valid
transactions. each
block includes the hash
of the prior block in the
blockchain, linking the
two. the linked blocks
form a chain. variants of
this format were used
previously, for example
in git, and it is not by
itself sufficient to qualify
as a blockchain.
CMPDLDIBJO
UIF DPNQFUJUJPO
DSFBUJOH OFX
CMPDLT JT LOPXO
BT NJOJOH
B CMPDLDIBJO
DPOTJTUT PG CMPDLT
UIBU IPME CBUDIFT PG
WBMJE
USBOTBDUJPOT. FBDI
CMPDL JODMVEFT UIF
IBTI PG UIF QSJPS
CMPDL JO UIF
CMPDLDIBJO, MJOLJOH
UIF UXP. UIF MJOLFE
CMPDLT GPSN B DIBJO.
WBSJBOUT PG UIJT
GPSNBU XFSF VTFE
QSFWJPVTMZ, GPS
FYBNQMF JO HJU, BOE
JU JT OPU CZ JUTFMG
TVGGJDJFOU UP
RVBMJGZ BT B
CMPDLDIBJO.
9184ae16
8e347c28
a3a928ee
source Simple Cipher Crypto Hash
28
blockchaim CMPDLDIBJN a598fc4b9
29. Block with Transactions
Field Purpose Updated When ... Bytes Example
version Block Version No. s/w upgrade 4 02000000
Prev Block # 256bit # of prev block header A new block arrives 32 c12959edab
Merkle Root # 256bit # of all Txns in Block A Txn is accepted 32 d3f4bac86b2
Timestamp Current Timestamp Block Creation 4 358a2903
Bits Current Difficulty Target Difficulty is adjusted 4 f3591e20
Nonce 32bit number Proof of Work Nonce 4 537629132
Txn Count Count of Txns Each Block 63
Coinbase Txn, User Txn 1, User Txn 2, User Txn ...
# Entire Block 29
30. Block 23
Block 24
Block 25
Merkle Tree
â Each transaction is hashed
â Hash values are combined
and hashed
â Final hash added to block
header
â If any transaction is tampered
with, final header hash will
not match
Txn α Txn ÎČ Txn Îł Txn ÎŽ
#α #ÎČ #Îł #ÎŽ
#αÎČ #γΎ
Prev Block
25
#αÎČγΎ
Timestamp
+ Nonce
Current Block 26
30
36. Consensus?
â No central authority to verify
â Then who verifies?
â Everybody?
â Maybe, but how many nodes are there?
â A few specific nodes?
â Maybe, but will they abuse power?
â Sybil attack?
â Reputation system subverted by forged identities.
36
37. Byzantine Generals Problem
â Generals of army surround enemy city
â Action in unison required to win
â Some generals may be traitors
â Prevents loyal generals from reaching
agreement
â Sabotages the collective action with
misinformation
â Fail to act
â Distributed systems must cope with
failure/sabotage of its constituents
37
38. Proof of Work
â Effort is Investment
â In exams, directly giving final
answer could be fraudulent
â must give long proof
â Uses computer cycle time to
validate transactions
â Costly - hardware, energy
wastage
38
39. Proof of Stake
â Personal Stake is
Investment
â Parents â Children; Shares
â CEO
39
41. Mining Process
â Free software. Run it. Get Bitcoins!!
â Not really.
â #(Rand No. + Prev Block#) < 0x00012
â Because # is unpredictable, only way
to generate fitting value is to keep
trying in a loop for Rand No. (nonce)
â Consumes huge amount of processing
power - hardware + electricity
41
43. Mining âDifficultyâ Value
â Measure of difficulty in finding hash
value below target value (256 bit
number)
â Mining Difficulty α1/Target Value
â Average mining time is about 10min
per block
43
44. Resolving Multiple Chains
â Mine on âlongestâ chain
â I.e. add block to the longest valid chain
â Other chains have to kept for a while
â Significant resources/time goes into each block
â Tampering with transactions will require
rebuilding many blocks again before others add
new block
â Hence immutable
â Each added block is a âconfirmationâ that Txn is
accepted
â Wait multiple confirmations if Txn is large
44
45. Mining Payout
â Every 210k blocks BTC
reward halves
â Started with 50 BTC/block
â Today: 12.5 BTC/block
â Fees for txns adds up with
more txns
fees
btc reward
45
47. RBI Report
â December 2013: RBI warns investors about volatility
â Not specifically regulated as of now
â But they are keeping an eye on it
â Could/Will be regulated eventually
â Have to follow contract laws, pay income or capital gains
taxes, only do legal activities as per other laws
47
48. Trading Can I trade cryptocurrency like
stock and currency?
48
53. Blockchain is a storage technology.
(with multiple benefits: tamper-proof, forward growing, resilient, etc.)
Bitcoin is one application of it in the area of currencies. It can also be used in
insurance, banking, retail, logistics, owner identification, authenticity validation,
medical records, etc.
There will be platforms (like Ethereum) that you can use to build your own apps.
Unmasking the Blockchain
53