Sunteți pe pagina 1din 26

BLOCKCHAINS

ARCHITECTURE, DESIGN AND USE CASES


PRAVEEN JAYACHANDRAN
SANDIP CHAKRABORTY IBM RESEARCH,
COMPUTER SCIENCE AND ENGINEERING, INDIA
IIT KHARAGPUR

1
Image courtesy: http://beetfusion.com/

A HISTORICAL PERSPECTIVE
2
The Fundamentals
• Cryptographically Secured Hash Functions

– Hash Functions: Map any sized data to a fixed size; Example H(x) = x % n, where x
and n are integers and % is the modular (remainder after division by n) operations. x
can be of any arbitrary length, but H(x) is within the range [0,n-1].

– Cryptographically Secured:
• One way, given a x, we can compute H(x), but given a H(x), no deterministic algorithm can
compute x
• For two different x1 and x2, H(x1) and H(x2) should be different
Cryptographic Hash Functions
• Examples: MD5, SHA256

• X is called the message and H(X)


is called the message digest

• A small change in the data results


in a significant change in the
output – called the avalanche
effect
Image source: Wikipedia
Cryptographically Secured Chain of Blocks

• The first use - time-stamp a digital document H1=Hash(0,C1,TS1,H0)


(Harber and Stornetta, 1991)
– A sequence of timestamps [TS1, TS2, TS3, …] denoting H2=Hash(1,C2,TS2,H1)
when the document is created or edited.
– Whenever a client access a document, construct a block
H3=Hash(2,C3,TS3,H2)
consisting of the sequence number of access, client ID,
timestamp, a hash value from the previous request; and
the entire thing is hashed to connect it to the previous H4=Hash(3,C4,TS4,H3)
blocks.
Haber, Stuart; Stornetta, W. Scott (January 1991). "How to time-stamp a digital document". Journal
of Cryptology. 3 (2): 99–111
Merkle Trees (Ralph Merkle, 1979)
• Also known as hash Root Hash
Hroot=Hash(H0+H1)
tree
– every leaf node is
labelled with the hash L1 Hash L1 Hash
of a data block H0= Hash(H00+H01) H1=Hash(H10+H11)
– every non-leaf node is
labelled with the L2 Hash
L2 Hash L2 Hash L2 Hash
cryptographic hash of H10=Hash(D3) H11=Hash(D4)
H00=Hash(D1) H01=Hash(D2)
the labels of its child
nodes D1 D2 D3 D4
Use of Merkle Trees
• Bayer, Harber and Stornetta used Merkle Tree in 1992 for timestamping
and verifying a digital document - improved the efficiency by combining
timestamping of several documents into one block

• Other uses of Merkle Tree


– Peer to Peer Networks: Data blocks received in undamaged and unaltered; other
peers do not lie about a block
– Bitcoin implementation – shared information are unaltered; no one can lie about a
transaction
Bitcoin and Blockchain
What is Bitcoin?

Bitcoin is a completely decentralized, peer-to-peer, permissionless
cryptocurrency put forth in 2009
 Completely decentralized: no central party for ordering or recording anything
 Peer-to-peer: software that runs on machines of all stakeholders to form the
system
 Permissionless: no identity; no need to signup anywhere to use; no access control
– anyone can participate in any role

* Nakamoto, Satoshi. "Bitcoin: A peer-to-peer electronic cash system." (2008)


(https://bitcoin.org/bitcoin.pdf)
Bitcoin Value Proposition

The last few years have seen a lot of interest in Bitcoin and cryptocurrencies in
general.

Used as a cross-country, untraceable currency which is not under the control of any
government and hence free from regulation

Current BTC price 1 BTC = $8069.00 (as of 15 th March, 2018 at 10:00 pm)

The Bitcoin blockchain size as of December 2017 is approximately 149 GB.
Blockchain Size Bitcoin Price

Source: Statistica
The Technology behind Bitcoin – The Blockchain
A = ₹100 A = ₹100
 ₹ 50
A -> B ₹50 A -> B ₹50

B -> J ₹30 B -> J ₹30


Bob
Alice
 ₹ 100  ₹ 30

A = ₹100 A = ₹100

A -> B ₹50 Note: A block may A -> B ₹50


contain multiple
B -> J ₹30 Eve transactions Jane B -> J ₹30
The Bitcoin Transaction Life Cycle – The Sender

Alice opens her Provides the address of Bob and


Bitcoin Wallet the amount to transfer, and sends
The Bitcoin Transaction Life Cycle – The Network

The network
The wallet nodes validate the
transactions The miners
constructs the
based on the include the
transactions, sign
existing transaction to the
using Alice’s private
Blockchain, and next block to be
key, and broadcasts
propagate the mined
it to the network
transaction to the
miners
The Bitcoin Transaction Life Cycle – The Miners

Miners construct a new Once the mining is


block and tries to over and the hash is
The miners collect obtained, the block is
all the transactions connect it with the
existing blockchain, included in the
for the a time existing blockchain.
duration, say for 10 through a cryptographic
hash computation The updated
Minutes blockchain is
-
The Mining Procedure propagated in the
network
The Bitcoin Transaction Life Cycle – The Receiver

Bob opens his


Bitcoin Wallet and The transaction reflects
refreshes, the at Bob’s wallet
blockchain gets
updated
Blockchain 2.0

Interested by the Bitcoin revolution, mainstream companies are trying to
use the central blockchain idea and build alternative systems around it for
use in industry, manufacturing, supply chain, finance, governance, IoT etc


This movement of academia, industry, startups is termed Blockchain 2.0.

Indian
Indian Institute
Institute of
of Technology
Technology Kharagpur
Kharagpur
Blockchain 2.0 and Smart Contracts
• Blockchain is a powerful technology – capable of going much further than financial
transactions

• A decentralized platform – can be utilized to avoid intermediates (the middleman)

• Smart Contracts: An automated computerized protocol used for digitally


facilitating, verifying or enforcing the negotiation or performance of a legal contract
by avoiding intermediates and directly validating the contract over a decentralized
platform – faster, cheaper and more secure
Smart Contracts
• The term was coined by Nick Szabo, a computer scientist and
cryptographer, in 1996

• Szabo claimed that smart contracts can be realized with the help of a
public ledger

• Blockchain can be a pioneering technology to realize smart contracts


Contracts in a Centralized Platform – Crowdfunding
1. You have an interesting
project, but do not have
sufficient money to execute
the project

3. Multiple supporters 4. The platform ensures


commit to support the that you get the complete 2. Submit the project in a
project with small funds money if the project is crowdfunding platform
successful
The Crowdfunding Platform
• Both the product team and the supporters need to trust the
crowdfunding platform

• The product team expects the money to be get paid based


on the project progress

• The supporters expect the money to go to the project

• However, the crowdfunding platform, the middleman, takes


significant charge to manage the entire process
Crowdfunding Platform using Smart Contracts

• The contract is written in a code which is available to all the stakeholders –


the supporters and the product team – Do you see an application of
Blockchain here?
Crowdfunding Platform using Smart Contracts

• If certain goals of the project are reached, then the code automatically
transfers the money from supporters to the production team
Crowdfunding Platform using Smart Contracts

• If the project goals (contracts) fail, then the code can transfer the money
back to the supporters
Smart Contracts – The Advantage
• Immutable: No party will be able to change the contract once it is fixed and
written to the public ledger (the Blockchain)

• Distributed: All the steps of the contract can be validated by every participating
party – no one can claim later that the contract was not validated

• Why Blockchain?
– The blocks are immutable
– The information is open – everyone can check and validate
Smart Contract Platforms
26

S-ar putea să vă placă și