SlideShare a Scribd company logo
1 of 85
CS-3511
Blockchain Technology
Chapter 2
How Blockchain works?
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Step 1
New transactions are
broadcast to all nodes
Transactions generation
Nodes
Step 2 Step 3
Step 4
Step 5
Step 6
Transaction Pool
Miners
New Block
Blockchain
Each miner adds
transactions to block and
work on puzzle of PoW
The miner who
solves puzzle
first, broadcast his
block
Nodes accept the block only if
transactions in it are valid and not
already spent
New block is added to
the blockchain
How does a Blockchain work?
Transactions
Transaction and UTXOs
Sumedh 🡪 Me 0.1 BTC
Pallavi 🡪 Me 0.3 BTC
Sharvil 🡪 Me 0.6 BTC
Aarvi 🡪 Me 0.7 BTC
UTXOs
I want to buy a bicycle for 0.5 BTC
Input :
0.6 BTC from Sharvil
Output : 0.5 BTC to Shop Owner
0.1 BTC back to myself
UTXO for Shop
Owner
UTXO for Me
Transaction and UTXOs
Sumedh 🡪 Me0.1 BTC
Pallavi 🡪 Me 0.3 BTC
Sharvil 🡪 Me 0.6 BTC
Aarvi 🡪 Me 0.7 BTC
Me 🡪 Me 0.1 BTC
UTXOs
I want to buy a bicycle for 0.5 BTC
Input :
0.6 BTC from Sharvil
Output : 0.5 BTC to Shop Owner
0.1 BTC back to myself
UTXO for Shop
Owner
UTXO for Me
Transaction and UTXOs
Sumedh 🡪 Me 0.1 BTC
Pallavi 🡪 Me 0.3 BTC
Aarvi 🡪 Me 0.7 BTC
Me 🡪 Me 0.1 BTC
UTXOs
I want to buy one more bicycle for 1.1 BTC
Input :
0.3 BTC from Pallavi
0.7 BTC from Aarvi
0.1 BTC from Me
Output : 1.1 BTC to Shop Owner
Transactions
UTXO for Shop
Owner
Transaction and UTXOs
Sumedh 🡪 Me 0.1 BTC
UTXOs
Cryptography
● It is the science of keeping things confidential using
encryption techniques.
● It has been around for more than two thousand
years
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Uses of Cryptography
● Confidentiality.
Only the intended or authorized recipient can understand the message.
referred to as privacy or secrecy
● Data Integrity
data can not be forged or modified by an adversary intentionally or by
unintended/accidental errors
Though data integrity cannot prevent the alteration of data, it can provide a means
of detecting whether the data was modified
● Authentication
The authenticity of the sender is assured and verifiable by the receiver
● Non-repudiation
The sender, after sending a message, cannot deny later that they sent the message.
This means that an entity (a person or a system) cannot refuse the ownership of a
previous commitment or an action.
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
How Cryptography works
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Stream ciphers
• Convert one symbol of plaintext into one symbol of ciphertext.
• This means that the encryption is carried out one bit or byte of plaintext at a time.
Block cipher
• The plaintext is divided into relatively larger blocks of fixed-length groups of bits
• Encoding each of the blocks separately using the same key
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Transmit cipher
text on network
C= E(k,m) m= D(k,c)
SENDER RECEIVER
Cryptography
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Types of Cryptography
Cryptography
Symmetric
Cryptography
Asymmetric
Cryptography
Private key Cryptography
Public key Cryptography
Nobody should know the key other than
sender and receiver Public key is known to everyone
Private key is secret
DES 3DES AES
DES : Data Encryption Standard
56 bits 192 bits 128,192,
256 bits
AES : Advanced Encryption Standard
RSA DSA Elliptic
Curve
Hash Function
RSA : Ron Rivest, Adi Shamir, and Leonard Adleman
DSA : Digital Signature Algorithm
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
3DES (Data Encryption Standard)
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Transmit cipher
text on network
C= E(k,m) m= D(k,c)
SENDER RECEIVER
Symmetric Cryptography
Same value
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Alice—the Sender:
• Encrypt the plaintext message m using encryption
algorithm E and key k to prepare the ciphertext c
• c = E(k, m)
• Send the ciphertext c to Bob
Bob—the Receiver:
• Decrypt the ciphertext c using decryption algorithm D
and the same key k to get the plaintext m
• m = D( k, c )
Symmetric cryptography
If the same key is used for both encryption and decryption, it is called symmetric key cryptography
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Transmit cipher
text on network
C= E(k,m) m= D(k,c)
SENDER RECEIVER
Asymmetric Cryptography
Different
value
Public
key
Private
key
Public
key
Private
key
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Properties of Good Encryption Algorithms
Unconditionally secure
Computationally secure
If attacker is not able to convert the cipher text to plain-text
Cost : Cost spent on converting cipher-text to plain-text is more than plain-text
Time : Time spent is more then the life of the plain-text
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Hashing
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Features of Hashing
Nonreversible
Fixed length Output
From hash value can not get back the plain-text
For any length of plain-text, fixed-length hash value is generated
Common hash value should not be generated for two different messages, though
the change is very small.
No collision
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Qualities of Hash Function
Unique Hash Value
Fast Computation
Avalanche Effect
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Hashes
Represents data as a short string of text
One-way trip
A message digest
Impossible to recover the original message from the digest
Verify the downloaded document
- Hashes may be provided on the site
- Compare the downloaded file hash with the posted hash value
Integrity
Used for the purpose of confidentiality- storing password
-instead of password store the hash
-compare hashes during authentication process
Authentication, non-repudiation and integrity
Digital Signature
Confidentiality
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
A Hash Example
https://andersbrownworth.com/blockchain
OR
https://demoblockchain.org/hash
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
(Secured Hash Algorithm) SHA 256
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
(Secured Hash Algorithm) SHA 256
•1990, Ron Rivest invented the hash function MD4
•1992,improved MD4 to MD5.
•1993, the National Security Agency published a hash function very
similar to MD5, called SHA (Secure Hash Algorithm)
In SHA 256,
256 bits = 64 hexadecimal characters
4 bits = 1 hex char 24= 16 4 * 64= 256
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Traditional
Approach
Blockchain
Immutable
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Traditional
Approach
Blockchain
Immutable
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Traditional
Approach
Blockchain
Immutable
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Traditional
Approach
Blockchain
Immutable
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Distributed P2P Network
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
How mining works?
Consensus
Protocol
Hash and
Cryptography
Immutable
Ledger
Distributed
P2P N/w
Mining
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
How mining works?
Consensus
Protocol
Hash and
Cryptography
Immutable
Ledger
Distributed
P2P N/w
Mining
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
How mining works?
Consensus
Protocol
Hash and
Cryptography
Immutable
Ledger
Distributed
P2P N/w
Mining
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
How mining works?
Consensus
Protocol
Hash and
Cryptography
Immutable
Ledger
Distributed
P2P N/w
Mining
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
How mining works?
Consensus
Protocol
Hash and
Cryptography
Immutable
Ledger
Distributed
P2P N/w
Mining
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash 810a5b3cd380ec16
Nonce
Nonce : Number used Once
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash 3872ba6900cd24ef
Nonce 18
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash 5f3411b0396e76ac
Nonce 19
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash a42b7fa254e01356
Avalanche Effect
Nonce 20
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash 02491cb4f56ad773
Nonce 203
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash 60ce3401ae8fb11e
Nonce 5041
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Block # 14
Data:
Sharvil  Sumedh 10 BTC
Nikhil  Priya 7 BTC
Meera  Pranil 6.35 BTC
Prev Hash 00003a269f1ac9d78
Hash 000096ae4cb320f1
Nonce 17037
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
A Hash is a hexadecimal number of length 64
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
= 102987336249554097029535212322581322789799900648198034993379397001
0000000000001c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855
= 45123607475580366783032544195595415913018526238690539071518805
00000000000000000000f4c89f42012427ae41e4649b934ca495991b785fe987
= 91584447803184859755650041578548187721957014927042951
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
A Hash is a hexadecimal number of length 64
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934c
a495991b7852b855
=
1029873362495540970295352123225813227897999006
48198034993379397001
0000000000001c149afbf4c8996fb92427ae41e4649b934c
a495991b7852b855
=4512360747558036678303254419559541591301852623
8690539071518805
00000000000000000000f4c89f42012427ae41e4649b934c
a495991b785fe987
=915844478031848597556500415785481877219570149
27042951
All Hashes
LARGEST
SMALLEST
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
A Hash is a hexadecimal number of length 64
e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934c
a495991b7852b855
0000000000001c149afbf4c8996fb92427ae41e4649b934c
a495991b7852b855
00000000000000000000f4c89f42012427ae41e4649b934c
a495991b785fe987
All Hashes
LARGEST
SMALLEST
TARGET(0000)
Nonce = 203
Nonce = 18
Nonce = 19
Nonce = 5041
Nonce = 20
Nonce = 17037
Brute force method
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Byzantine General Problem
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Consensus Protocol
Consensus Algorithm
Proof of Work Proof of Stake Other
PoA PoET PoC
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Work
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Work
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Work
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Work
Competing chains
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Work
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Longest Chain
Proof of Work
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Longest Chain
Orphaned
Block
Proof of Work
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Stake
Brief History
Proof of work was not the first consensus algorithm proposed
Many researchers had proposed variations of consensus algorithms
based on financial stake, now called proof of stake (PoS).
Proof of work was invented as an alternative to proof of stake
After success of Bitcoin, many blockchains have emulated proof of work.
Ethereum’s planned PoS algorithm is called Casper
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Why to use Proof of Stake
According to the University of Cambridge's Bitcoin Electricity Consumption
Index, Bitcoin consumers about 119.87 terawatt-hours per year
It is more than countries like the United Arab Emirates and the
Netherlands consume annually.
To pay the electricity bill, miners would usually sell their bitcoin reward
for fiat money
This reduces the price of the cryptocurrency.
Proof of Stake
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Stake
Miner/
Validator
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Stake
Stake
Miners can mine or validate block transactions based on the amount of coins a
miner holds.
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Stake
Stake
Miners can mine or validate block transactions based on the amount of coins a
miner holds.
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Proof of Stake
Stake
A validator risks losing their deposit if the block they staked on is rejected by majority
of validators.
Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
Thank
you!!!

More Related Content

More from RanjanaShevkar (11)

Chapter 7.pptx
Chapter 7.pptxChapter 7.pptx
Chapter 7.pptx
 
Chapter 6.pptx
Chapter 6.pptxChapter 6.pptx
Chapter 6.pptx
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 
Chapter 7.pptx
Chapter 7.pptxChapter 7.pptx
Chapter 7.pptx
 
Chapter 6.pptx
Chapter 6.pptxChapter 6.pptx
Chapter 6.pptx
 
Chapter 5.pptx
Chapter 5.pptxChapter 5.pptx
Chapter 5.pptx
 
Chapter 4.pptx
Chapter 4.pptxChapter 4.pptx
Chapter 4.pptx
 
Chapter 3.pptx
Chapter 3.pptxChapter 3.pptx
Chapter 3.pptx
 
Ch 2 Names scopes and bindings.pptx
Ch 2 Names scopes and bindings.pptxCh 2 Names scopes and bindings.pptx
Ch 2 Names scopes and bindings.pptx
 
Paradigms of Programming Languages CH1-Introduction.pptx
Paradigms of Programming Languages CH1-Introduction.pptxParadigms of Programming Languages CH1-Introduction.pptx
Paradigms of Programming Languages CH1-Introduction.pptx
 

Recently uploaded

+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
?#DUbAI#??##{{(☎️+971_581248768%)**%*]'#abortion pills for sale in dubai@
 

Recently uploaded (20)

Simplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptxSimplifying Mobile A11y Presentation.pptx
Simplifying Mobile A11y Presentation.pptx
 
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
Navigating the Deluge_ Dubai Floods and the Resilience of Dubai International...
 
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost SavingRepurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
Repurposing LNG terminals for Hydrogen Ammonia: Feasibility and Cost Saving
 
Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..Understanding the FAA Part 107 License ..
Understanding the FAA Part 107 License ..
 
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
WSO2 Micro Integrator for Enterprise Integration in a Decentralized, Microser...
 
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
Connector Corner: Accelerate revenue generation using UiPath API-centric busi...
 
AWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of TerraformAWS Community Day CPH - Three problems of Terraform
AWS Community Day CPH - Three problems of Terraform
 
MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024MINDCTI Revenue Release Quarter One 2024
MINDCTI Revenue Release Quarter One 2024
 
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
+971581248768>> SAFE AND ORIGINAL ABORTION PILLS FOR SALE IN DUBAI AND ABUDHA...
 
Platformless Horizons for Digital Adaptability
Platformless Horizons for Digital AdaptabilityPlatformless Horizons for Digital Adaptability
Platformless Horizons for Digital Adaptability
 
JohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptxJohnPollard-hybrid-app-RailsConf2024.pptx
JohnPollard-hybrid-app-RailsConf2024.pptx
 
WSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering DevelopersWSO2's API Vision: Unifying Control, Empowering Developers
WSO2's API Vision: Unifying Control, Empowering Developers
 
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
AI+A11Y 11MAY2024 HYDERBAD GAAD 2024 - HelloA11Y (11 May 2024)
 
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...Stronger Together: Developing an Organizational Strategy for Accessible Desig...
Stronger Together: Developing an Organizational Strategy for Accessible Desig...
 
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
Web Form Automation for Bonterra Impact Management (fka Social Solutions Apri...
 
CNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In PakistanCNIC Information System with Pakdata Cf In Pakistan
CNIC Information System with Pakdata Cf In Pakistan
 
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 AmsterdamDEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
DEV meet-up UiPath Document Understanding May 7 2024 Amsterdam
 
Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)Introduction to Multilingual Retrieval Augmented Generation (RAG)
Introduction to Multilingual Retrieval Augmented Generation (RAG)
 
Vector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptxVector Search -An Introduction in Oracle Database 23ai.pptx
Vector Search -An Introduction in Oracle Database 23ai.pptx
 
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin WoodPolkadot JAM Slides - Token2049 - By Dr. Gavin Wood
Polkadot JAM Slides - Token2049 - By Dr. Gavin Wood
 

Ch2 how blockchain works

  • 1. CS-3511 Blockchain Technology Chapter 2 How Blockchain works? Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 2. Step 1 New transactions are broadcast to all nodes Transactions generation Nodes Step 2 Step 3 Step 4 Step 5 Step 6 Transaction Pool Miners New Block Blockchain Each miner adds transactions to block and work on puzzle of PoW The miner who solves puzzle first, broadcast his block Nodes accept the block only if transactions in it are valid and not already spent New block is added to the blockchain How does a Blockchain work?
  • 4. Transaction and UTXOs Sumedh 🡪 Me 0.1 BTC Pallavi 🡪 Me 0.3 BTC Sharvil 🡪 Me 0.6 BTC Aarvi 🡪 Me 0.7 BTC UTXOs I want to buy a bicycle for 0.5 BTC Input : 0.6 BTC from Sharvil Output : 0.5 BTC to Shop Owner 0.1 BTC back to myself UTXO for Shop Owner UTXO for Me
  • 5. Transaction and UTXOs Sumedh 🡪 Me0.1 BTC Pallavi 🡪 Me 0.3 BTC Sharvil 🡪 Me 0.6 BTC Aarvi 🡪 Me 0.7 BTC Me 🡪 Me 0.1 BTC UTXOs I want to buy a bicycle for 0.5 BTC Input : 0.6 BTC from Sharvil Output : 0.5 BTC to Shop Owner 0.1 BTC back to myself UTXO for Shop Owner UTXO for Me
  • 6. Transaction and UTXOs Sumedh 🡪 Me 0.1 BTC Pallavi 🡪 Me 0.3 BTC Aarvi 🡪 Me 0.7 BTC Me 🡪 Me 0.1 BTC UTXOs I want to buy one more bicycle for 1.1 BTC Input : 0.3 BTC from Pallavi 0.7 BTC from Aarvi 0.1 BTC from Me Output : 1.1 BTC to Shop Owner Transactions UTXO for Shop Owner
  • 7. Transaction and UTXOs Sumedh 🡪 Me 0.1 BTC UTXOs
  • 8. Cryptography ● It is the science of keeping things confidential using encryption techniques. ● It has been around for more than two thousand years Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 9. Uses of Cryptography ● Confidentiality. Only the intended or authorized recipient can understand the message. referred to as privacy or secrecy ● Data Integrity data can not be forged or modified by an adversary intentionally or by unintended/accidental errors Though data integrity cannot prevent the alteration of data, it can provide a means of detecting whether the data was modified ● Authentication The authenticity of the sender is assured and verifiable by the receiver ● Non-repudiation The sender, after sending a message, cannot deny later that they sent the message. This means that an entity (a person or a system) cannot refuse the ownership of a previous commitment or an action. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 10. How Cryptography works Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 11. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 12. Stream ciphers • Convert one symbol of plaintext into one symbol of ciphertext. • This means that the encryption is carried out one bit or byte of plaintext at a time. Block cipher • The plaintext is divided into relatively larger blocks of fixed-length groups of bits • Encoding each of the blocks separately using the same key Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 13. Transmit cipher text on network C= E(k,m) m= D(k,c) SENDER RECEIVER Cryptography Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 14. Types of Cryptography Cryptography Symmetric Cryptography Asymmetric Cryptography Private key Cryptography Public key Cryptography Nobody should know the key other than sender and receiver Public key is known to everyone Private key is secret DES 3DES AES DES : Data Encryption Standard 56 bits 192 bits 128,192, 256 bits AES : Advanced Encryption Standard RSA DSA Elliptic Curve Hash Function RSA : Ron Rivest, Adi Shamir, and Leonard Adleman DSA : Digital Signature Algorithm Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 15. 3DES (Data Encryption Standard) Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 16. Transmit cipher text on network C= E(k,m) m= D(k,c) SENDER RECEIVER Symmetric Cryptography Same value Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 17. Alice—the Sender: • Encrypt the plaintext message m using encryption algorithm E and key k to prepare the ciphertext c • c = E(k, m) • Send the ciphertext c to Bob Bob—the Receiver: • Decrypt the ciphertext c using decryption algorithm D and the same key k to get the plaintext m • m = D( k, c ) Symmetric cryptography If the same key is used for both encryption and decryption, it is called symmetric key cryptography Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 18. Transmit cipher text on network C= E(k,m) m= D(k,c) SENDER RECEIVER Asymmetric Cryptography Different value Public key Private key Public key Private key
  • 19. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 20. Properties of Good Encryption Algorithms Unconditionally secure Computationally secure If attacker is not able to convert the cipher text to plain-text Cost : Cost spent on converting cipher-text to plain-text is more than plain-text Time : Time spent is more then the life of the plain-text Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 21. Hashing Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 22. Features of Hashing Nonreversible Fixed length Output From hash value can not get back the plain-text For any length of plain-text, fixed-length hash value is generated Common hash value should not be generated for two different messages, though the change is very small. No collision Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 23. Qualities of Hash Function Unique Hash Value Fast Computation Avalanche Effect Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 24. Hashes Represents data as a short string of text One-way trip A message digest Impossible to recover the original message from the digest Verify the downloaded document - Hashes may be provided on the site - Compare the downloaded file hash with the posted hash value Integrity Used for the purpose of confidentiality- storing password -instead of password store the hash -compare hashes during authentication process Authentication, non-repudiation and integrity Digital Signature Confidentiality Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 25. A Hash Example https://andersbrownworth.com/blockchain OR https://demoblockchain.org/hash Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 26. (Secured Hash Algorithm) SHA 256 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 27. (Secured Hash Algorithm) SHA 256 •1990, Ron Rivest invented the hash function MD4 •1992,improved MD4 to MD5. •1993, the National Security Agency published a hash function very similar to MD5, called SHA (Secure Hash Algorithm) In SHA 256, 256 bits = 64 hexadecimal characters 4 bits = 1 hex char 24= 16 4 * 64= 256 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 28. Traditional Approach Blockchain Immutable Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 29. Traditional Approach Blockchain Immutable Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 30. Traditional Approach Blockchain Immutable Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 31. Traditional Approach Blockchain Immutable Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 32. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 33. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 34. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 35. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 36. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 37. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 38. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 39. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 40. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 41. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 42. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 43. Distributed P2P Network Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 44. How mining works? Consensus Protocol Hash and Cryptography Immutable Ledger Distributed P2P N/w Mining Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 45. How mining works? Consensus Protocol Hash and Cryptography Immutable Ledger Distributed P2P N/w Mining Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 46. How mining works? Consensus Protocol Hash and Cryptography Immutable Ledger Distributed P2P N/w Mining Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 47. How mining works? Consensus Protocol Hash and Cryptography Immutable Ledger Distributed P2P N/w Mining Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 48. How mining works? Consensus Protocol Hash and Cryptography Immutable Ledger Distributed P2P N/w Mining Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 49. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash 810a5b3cd380ec16 Nonce Nonce : Number used Once Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 50. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash 3872ba6900cd24ef Nonce 18 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 51. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash 5f3411b0396e76ac Nonce 19 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 52. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash a42b7fa254e01356 Avalanche Effect Nonce 20 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 53. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash 02491cb4f56ad773 Nonce 203 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 54. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash 60ce3401ae8fb11e Nonce 5041 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 55. Block # 14 Data: Sharvil  Sumedh 10 BTC Nikhil  Priya 7 BTC Meera  Pranil 6.35 BTC Prev Hash 00003a269f1ac9d78 Hash 000096ae4cb320f1 Nonce 17037 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 56. A Hash is a hexadecimal number of length 64 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 = 102987336249554097029535212322581322789799900648198034993379397001 0000000000001c149afbf4c8996fb92427ae41e4649b934ca495991b7852b855 = 45123607475580366783032544195595415913018526238690539071518805 00000000000000000000f4c89f42012427ae41e4649b934ca495991b785fe987 = 91584447803184859755650041578548187721957014927042951 Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 57. A Hash is a hexadecimal number of length 64 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934c a495991b7852b855 = 1029873362495540970295352123225813227897999006 48198034993379397001 0000000000001c149afbf4c8996fb92427ae41e4649b934c a495991b7852b855 =4512360747558036678303254419559541591301852623 8690539071518805 00000000000000000000f4c89f42012427ae41e4649b934c a495991b785fe987 =915844478031848597556500415785481877219570149 27042951 All Hashes LARGEST SMALLEST Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 58. A Hash is a hexadecimal number of length 64 e3b0c44298fc1c149afbf4c8996fb92427ae41e4649b934c a495991b7852b855 0000000000001c149afbf4c8996fb92427ae41e4649b934c a495991b7852b855 00000000000000000000f4c89f42012427ae41e4649b934c a495991b785fe987 All Hashes LARGEST SMALLEST TARGET(0000) Nonce = 203 Nonce = 18 Nonce = 19 Nonce = 5041 Nonce = 20 Nonce = 17037 Brute force method Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 59. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 60. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 61. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 62. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 63. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 64. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 65. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 66. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 67. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 68. Byzantine General Problem Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 69. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 70. Consensus Protocol Consensus Algorithm Proof of Work Proof of Stake Other PoA PoET PoC Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 71. Proof of Work Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 72. Proof of Work Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 73. Proof of Work Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 74. Proof of Work Competing chains Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 75. Proof of Work Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 76. Longest Chain Proof of Work Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 77. Longest Chain Orphaned Block Proof of Work Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 78. Proof of Stake Brief History Proof of work was not the first consensus algorithm proposed Many researchers had proposed variations of consensus algorithms based on financial stake, now called proof of stake (PoS). Proof of work was invented as an alternative to proof of stake After success of Bitcoin, many blockchains have emulated proof of work. Ethereum’s planned PoS algorithm is called Casper Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 79. Why to use Proof of Stake According to the University of Cambridge's Bitcoin Electricity Consumption Index, Bitcoin consumers about 119.87 terawatt-hours per year It is more than countries like the United Arab Emirates and the Netherlands consume annually. To pay the electricity bill, miners would usually sell their bitcoin reward for fiat money This reduces the price of the cryptocurrency.
  • 80. Proof of Stake Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 81. Proof of Stake Miner/ Validator Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 82. Proof of Stake Stake Miners can mine or validate block transactions based on the amount of coins a miner holds. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 83. Proof of Stake Stake Miners can mine or validate block transactions based on the amount of coins a miner holds. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune
  • 84. Proof of Stake Stake A validator risks losing their deposit if the block they staked on is rejected by majority of validators. Assistant Professor Ranjana Shevkar, Modern College of Arts, science & Commerce, Ganeshkhind, Pune