0% found this document useful (0 votes)
5 views

Foundations of Blockchain Technology Basics (1)

The document outlines foundational concepts of blockchain technology, including P2P systems, cryptography, and parallel processing. It explains the structure of a blockchain, the function of digital signatures, and the significance of Bitcoin as a decentralized currency. Additionally, it addresses the double spending problem and how blockchain technology prevents it, emphasizing the importance of security and trust in transactions.

Uploaded by

akshaya180612
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
5 views

Foundations of Blockchain Technology Basics (1)

The document outlines foundational concepts of blockchain technology, including P2P systems, cryptography, and parallel processing. It explains the structure of a blockchain, the function of digital signatures, and the significance of Bitcoin as a decentralized currency. Additionally, it addresses the double spending problem and how blockchain technology prevents it, emphasizing the importance of security and trust in transactions.

Uploaded by

akshaya180612
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 100

FOUNDATIONS OF BLOCKCHAIN TECHNOLOGY

Mr. Ismankhan Y M
Assistant Professor(OG),
SREC, Coimbatore
CONCEPTS NEEDED FOR
BLOCKCHAIN
TECHNOLOGY

• P2P systems – distributed vs parallel processing


• Cryptography
• Public key cryptography
• Hashing
• Merkle hash trees
• Digital signatures
PARALLEL
PROCESSING
 Von-neuman architecture – ALU, CPU , memory
 Moore’s law states that the transistor density doubles
every 1.5 years but reduces the space between the
components – power dissipation increased by squared
of speed (52%)- 1986 to 2002
 parallel computing paradigm using multiple cores –
multiple processors on same chip sharing memory
 Analogy to puzzle solving and queues
PARALLEL PROCESSING OF
STUDENT RECORDS

Will time be reduced? How?


How do these processors communicate?
COMMUNICATION BETWEEN
PROCESSORS

Shared memory Systems ( UMA)


Shared memory Systems
• Memory is used for communication
• All processors access memory
at same time – UMA Each segment of memory is
accessed by processors with
* different latencies - NUMA
Distributed Memory Systems
• each node works
independently
• communicate using
networks
• scalable
DISTRIBUTED
 Driving force:SYSTEMS
growth of networking technology
 Internet is a distributed system
 multiple independent autonomous systems (players)
that communicate and coordinate actions (goal) in
order to appear as a single coherent system (game) to
the end-user.
 no shared memory and no common physical clock
SECURI
TY– Convert readable text to
 Through Cryptography
unreadable format. This improves confidentiality (exam
results)
 Example Caesar Cipher
 Plain text and Cipher text
 Cryptographic Algorithms – Hashing, Encryption and DSA

KHOOR

HELLO HELLO
CRYPTOGRAPHY
 Authentication:FUNCTIONS
act of validating that users (passwords)
or proving one’s identity (ID card)
 Authorisation: giving the user permission to
accessa specific resource (eg file)
Keys authenticate user to enter the house. But you may not
have permission to ransack your sibling’s cupboard.
 Encryption: readable not
text into format (symbols) – understandable
to transfer information securely
/confidentiality
 Non-repudiation: provesthe sender really sent this
message
(e-commerce)
 Integrity: ensures message is not altered during transit
(download)
 Trust – belief on the participants ( e g parent gives you
their car )
PUBLIC-KEY CRYPTOSYSTEMS

Authentication: Only A can Secrecy: Only B can Decrypt


generate the encrypted message the message
HASHING
•  To preserve integrity
•  Transforms text of arbitrary length to a fixed length
•  SHA -3, SHA-256 (32 bytes ) , Keccak
•  A slightdifference in input data produces a different
• output (avalanche effect)
•  Hash function properties
• should be a one-way function and
• should be collision free,
•  One way hash ensures that we do not get the original text
• Analogous to getting batter from cooked dosa
•  Collision free property ensures Unique hash value
• Account no / ID should be unique
• SHA 256 – 2 ˄256possible combinations of values ( 10
˄77)
DIGITAL SIGNATURES
 Ensure authentication, integrity and non-repudiation

Double S
HA256

ECC
 The user first hashes the transaction / message data
using a hash function (double-SHA256) for later
verification of data integrity.
 The hashed data is then encrypted using the user’s
private key to provide user authentication and the
encrypted output is known as the digital signature of
that transaction.
 The transaction data and the signature are broadcasted
to network.
 At the receiver end, the digital signature is decrypted
using public key of sender to obtain message digest.
 Message digest is calculated from the received data
 This is this checked to see if it is the same as MD
decrypted from the digital signature
KEY PAIR
GENERATION
 Private key : d
in range 1
to (n-1)
 P is a point on the
curve
 Public key Q = d
*
G(x,y)
 G(x,y) base point
 GF(p) prime field
 integers modulo p;
 y² = x³ + ax + b. over
a prime field
modulo 23.
 Hash of the message is found h(m)
 Random value k is found
 d is private key; Q(x,y) public key
 Signature needs r & s
(x1,y1) = k x G(x,y) mod p
r = x1 mod n
s = (k-1 (h(m) + d * r) mod n
r & s should be non zero. Else k has to be
regenrated
Encryption
‘m’ is message to be sent , represented by M o
n the curve. Randomly select ‘k’ from [1 – (n-1
)]. C1 & C2 are 2 cipher texts
C1 = k*G(x,y)
C2 = h(m) + k*Q
C1 and C2 will
be send.

Decryption
h(m) = C2 – d *
C1

w=s-1 mod n
u1 = (h(m) * w) mod n
u2 = (r * w) mod n (x2, y2) = (u1 × G(x, y) + u2 × Q(x, y)) mod
n x2 is equal to r verifies message integrity
P2P NETWORK
 Web 3.0 – devices are connected in decentralized manner – better
connected, secure, private, user centric dApps, no
central authority, data flow
BLOCKCHAIN STRUCTURE
STRUCTURE OF A
BLOCK Contents of a block
Contents of a Header description
size field
block
4 Version A version number to
size field Description bytes track software/ protocol
upgrades
4 Block Size Block size
bytes in bytes, 32 Previous A reference to the hash
following bytes Block Hash of the previous (parent)
this field block in the chain
80 Block Header Several 32 Merkle A hash of the root of the
bytes fields bytes Root merkle tree of this block’s
form the
block header transactions

1-9 Transactio How many 4 Timestamp The approx creation time


bytes n Counter transactio bytes of this block
ns follow 4 Difficulty The proof-of-work
bytes Target algorithm difficulty
varia Transactions The Bits field target for this block
b le transactio
ns 4 Nonce A counter used for the
recorded bytes proof- of-work algorithm
in this
block
BLOCK
DETAILS

https://blockchair.com/bitcoin/block/639190
BLOCK 0
GENESIS
BLOCK
HOW IS HASH OF A BLOCK COMPUTED

The primary identifier of a block is its cryptographic hash, a digital fingerprint,


made by hashing the block header twice
through the SHA256 algorithm.

Block_header =
Version(4)+hash(PrevBlock(32))+

Hash(MerkleRoot(32))
+Time(4)+Bits(4)+Nonce(4)

Block Hash = Sha256(Sha256(Block_header)


HOW IS HASH OF A BLOCK
COMPUTED

Steps: (Check Block with Height 607,067 to verify the computations)

1) VERSION: The block version is a decimal number denoted by 4 bytes. Translate the ver
sion into a little-endian hex.
#Big endian encoding:
0x3fffc000 #Little endian
encoding: 0x00c0ff3f
2) PREVIOUS BLOCK HASH: Translate the previous block hash to a little endian hex.

#Big endian :
0x0000000000000000000556bf387e8eb38206dd9cc2021d4f9ad4fde
fc0fc73fd #Little endian:
0xfd73fcc0effdd49a4f1d02c29cdd0682b38e7e38bf56050000000000
HOW IS HASH OF A BLOCK
COMPUTED
3) MERKLE ROOT: Translate the merkle root to a little endian hex.
Hash pointer = value of prev block + digest of cur value
#Big
endian :0x79db64466f31628f75241e4688eb678aa7cd7d23a8ae54a820d681
73f1d96c41 #Little endian:
0x416cd9f17381d620a854aea8237dcda78a67eb884
61e24758f62316f4664db79

4) TIMESTAMP: Time is a decimal value. Translate it into a little


en dian hex.

#Decimal value : 1575731866


#Hex values : 0x5DEBC29A

#Little endian encoding : 0x9AC2EB5D

https://www.unixtimestamp.com/
HOW IS HASH OF A BLOCK
COMPUTED

5) DIFFICULTY (BITS) : Convert the difficulty bits into a little-endi


an hex.
#Hex Value : 0x1715dbd2
#Little endian encoding : 0xd2db1517

6) NONCE: Convert the nonce into a little-endian


hex.
#Hex Value : 0x49c77cee
#Little endian encoding : 0xee7cc749

https:/
/www.rapidtables.com/convert/number/decimal-to-hex.ht
ml
HOW IS HASH OF A BLOCK
COMPUTED
7) Append all the parameters together.

00c0ff3ffd73fcc0effdd49a4f1d02c29cdd0682b38e7e38bf560500000000000000000041
6cd9f1
7381d620a854aea8237dcda78a67eb88461e24758f62316f4664db799AC2EB5Dd2db15
17ee7cc7 49

8) Perform double SHA256 algorithm to compute the resulting 32 byte block


hash.

0x00000000000000000008dc07079dc7649636a1a6e127f422a7b617edc15dfd90
To understand the power of blockchain systems we need
to differentiate between bitcoin currency (Bitcoin
app), the specific blockchain that underpins it (Bitcoin
network) and the idea of blockchains in general
(blockchain technology)

Blockchain is to Bitcoin, what the internet is to email


What is
Bitcoin?
● Bitcoin is a completely decentralized, peer-to-peer, permissionless
cryptocurrency put forth in 2009 by “Satoshi Nakamoto” a
pseudonym claimed to be 37 year old (Japanese)
− Completely decentralized: no central party for ordering or
recor ding 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
− Uses flooding algorithm – Gossip Protocol – Epidemic
protocol

* 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 = 89 Lakhs (04th Feb 2025)

The Bitcoin blockchain size as of 04th Feb 2025 is approximately 620 GB.

Blockchain Size Bitcoin Price

Source: Statistica
BANK VS BITCOIN TRANSACTION
Bank
 Do not physically transfer money
 providers need to facilitate the actual transfer between them
Centralised authority
 Bob sends Rs100 to Alice using his mobile banking app,
Alice’s
account could be credited instantly by her bank based on the
trust that Bob’s bank will settle this payment later.
Bitcoin
 its ability to virtually move the money over a digital medium and settle the
payment almost immediately – Pseudonymity.
 without the need for a central body (P2P consensus).
 If Bob sends 100 BTC to Alice, she receives the amount in her wallet
straightway. There will be no institutional involvement and no need for a
further settlement process
 Key mgt. – Availability, Security and Convenience – Taint Analysis (relation
b/w 2 addresses) Eg: Wikileaks
 Bitcoin is a digital cash system.
 It allows for people to move bitcoins, the currency unit of
Bitcoin, between each other without using a bank or any other
trusted third party.
 No government or company controls Bitcoin. Instead, thousands
of computers around the globe—the Bitcoin network
Security
Minting new coins
Processing payments – verifies and confirms payments
It is permissionless
• BIPS (Bitcoin Improvement Protocols)
• Bitcoin foundation – 2012 – funding and
“voice of bitcoin” in US
DOUBLE SPENDING PROBLEM
 We send digital money as if sending an image or an email
 Technically OK but how many times the same money is sent?
 Physical currency cannot be counterfeited
 Digital currency allows a person to spend the same money more than
once. Chuck makes copy of money before spending

Nakamoto solved the double-spe


nding problem using the
blockchain and successfully
started transferring money over
a digital medium without the
presence of a central entity;

Bitcoin, the world’s first


cryptocurrency, was born 2009
WHAT IS DOUBLE SPENDING?

5
9
DOUBLE SPENDING
Suppose Alice makes a transaction of 0.15 BTC towards Bob for a

● coffee and duplicates the same payment towards herself.


Bob gives the coffee to Alice without confirmation of payment.

1
2
DOUBLE SPENDING

Suppose Alice makes a transaction of 0.15 BTC towards Bob for a coffee and duplic

ates the same payment towards herself.

Bob gives the coffee to Alice without confirmation of payment.

Now, the payment made towards Alice is the confirmed payment and the pay
ment to Bob fails. Hence, Alice receives the coffee without paying for it.

0.15 BTC
1
3
HOW DOUBLE SPENDING IS PREVENTED IN BITCOINS

Both the transactions are initially stored in the unspent


transaction pool.

Theoretically possible via 51% ATTACK: Alice needs to have 51% of


the total computi ng power to create a fork.

Bob must wait for atleast 6 new blocks in the blockchain before
confirming payment.

1
4
BITCOIN NETWORK AND ECOSYSTEM
USER
S
 End users—People using Bitcoin for their day-to-day
needs, such as savings, shopping, speculation, or
salaries
 Corporate users—Companies using Bitcoin to solve
their business needs, such as paying wages
internationally
 Merchants—For example, a restaurant or a bookstore accepting
Bitcoin
payments
 Bitcoin services—Companies providing Bitcoin-related
services to customers, such as topping up mobile phones,
anonymization services, remittance services, or tipping
services
 Exchanges—Commercial services people can use to exchange
their
local currency to and from bitcoins
 Protocols on top—Systems that operate “on top” of Bitcoin to
perform certain tasks, such as payment network protocols,
specialized tokens, and decentralized exchanges
RECAP - BITCOIN
 Bitcoin, Bitcoin network, blockchain
 decentralised, permissionless, P2P
 cost is Rs 15 lakhs as on July 3, 2022; Block size 324
GB
 vs Bank - physical transfer, no intermediaries,
ownership, decentralised
 double spending
 ecosystem - corporate, users, merchants, exchanges,
protocol services, developers
 max of 21 million BTC… max 2041
WHAT IS
MINING?
PROCEDURE - VALIDATION AND CONSENSUS

 Validation: Mining is a decentralized security mechanism by


which transactions are validated and cleared.

 Miners verifies and validates the block by checking the


 correctness of block hash,
 block height and size values,
 previous block hash values,
 the validity of all transactions in the block
 the block timestamp values

 Miners receive two types of rewards in return for mining:


 New coins created with each new block,
 Transaction fees from all the transactions included in the block.
CONTD

 CONSENSUS:

 Miners compete to solve a BTC per block Year


difficult mathematical problem
Work
called based Proof
on ofa cryptographic hash
50 2009
algorithm
25 2012
 Bitcoin’s money supply is created 12.5 2016
through mining
6.25 2020
 By 2140, all bitcoin (~21 million) will
....
have been issued & no new bitcoin will
be issued. 0 2140
BLOCK VALIDATION AND VERIFICATION
WALLETS
 A wallet in a blockchain is similar to that
of the account passbook given for a user of
a bank that is unique for an account
 Cryptocurrency operates on top
of
money
blockchain and– it isdecentralized and
described as virtual
cryptographically secured
 A blockchain network can function with or
without cryptocurrency depending on the
type of the blockchain. Typically private
blockchain doesn’t focus on
cryptocurrency or token based systems.
 Wallet comprises of Addresses – Hash of
the Public key
 Keep track of coins, manage details of keys
with UI.
 Encoding keys - Base 58 or QR Code
 Vanity Address – Address starts with some
meaningful text.
WALLETS
 Program that Users (Alice and Bob) use to interact with
the bitcoin
network. It can be installed in mobile or desktop
 A typical Bitcoin wallet will
 Manage keys (private keys)
 Watch incoming/outgoing bitcoins
 Send bitcoins
 To send bitcoins, digital signature is created
using private keys from wallet and verified on the
other side using public keys
 Eg. Jaxx, Zebpay
 Basic Categorization
 Hot Wallets/Storage – private keys are stored online,
no need
to download, fast but less secure
 Cold Wallets/Storage - entire Blockchain is downloaded
on the system and every transaction is signed offline,
 Online hot wallets
 Web wallet
 Mobile wallet
 Bitcoin clients : Bitcoin Clients are wallets specific for
Bitcoin transfers. Process bit coin transactions

 Offline cold wallets


 Desktop wallet
 Physical wallet: keys are printed and maintained
 Hardware Wallets - directly transfer Bitcoins from
the hardware to another Bitcoin account when it is
connected to the internet. Wallets themselves
contain an interface to enter the recipient’s details
and the amount to be transferred
 Brain wallet – Controls access to bitcoins using a
passphrase
 Deriving private key from passphrase is termed
as key stretching
WALLET ADDRESS GENERATION

 From ECC public key


hash twice
 From script hash twice
 20 byte hash
 add leading character -
1 /3
 Add checksum – first
4 bytes of double
SHA 256 hash
 Convert from base
256 to base 58
FORKS

 In blockchain, a fork is defined variously as:

 "what happens when a blockchain diverges into two


potential paths
forward"
 "a change in protocol" or

 a situation that "occurs when two or more blocks have the

same block height“


 Cause sometimes due to execution of 51% Attack
HARD AND SOFT FORKS
 A hard fork is a rule change such that the software validating
according to the old rules will see the blocks produced according to
the new rules as invalid. In case of a hard fork, all nodes meant to
work in accordance with the new rules need to upgrade their
software.
 If one group of nodes continues to use the old software while the
other nodes use the new software, a permanent split can occur. For
example, Ethereum has hard-forked to "make whole" the investors
in The DAO, which had been hacked by exploiting a vulnerability in
its code. In this case, the fork resulted in a split
creating Ethereum and Ethereum Classic chains.
 A soft fork or a soft-forking change is described as a fork in the
blockchain which can occur when old network nodes do not follow a
rule followed by the newly upgraded nodes.
DAO

 The DAO was an organization created by developers to


automate
decisions and facilitate cryptocurrency transactions.
 The developers of the DAO believed they could eliminate
human error or manipulation of investor funds by placing
decision-making power into the hands of an automated system
and a crowdsourced process
 In June 2016, due to programming errors and attack vectors,
hackers attacked the DAO, accessing 3.6 million ETH, worth
about $50 million at the time, arise Ethereum and Ethereum
Classic.
 Digital
exchange currencies de-listed the DAO token in
September 2016.
SOFT FORK

 New transaction types can often be added as soft forks, requiring only that the participants (e.g.
sender and receiver) and miners understand the new transaction type. This is done by having the
new transaction appear to older clients as a "pay-to-anybody" transaction (of a special form) and
getting the miners to agree to reject blocks including these transactions unless the transaction
validates under the new rules. This is how pay-to-script hash (P2SH) was added to bitcoin.
 P2SH or Pay-to-Script-Hash addresses are a special type of address in Bitcoin,
which
allows you to create addresses that can receive or send transactions in which
a series of
instructions must be fulfilled in order to unlock the balances that these
addresses
contain.
 This kind of fork requires only a majority of the miners upgrading to enforce the new rules, as
opposed to a hard fork that requires all nodes to upgrade and agree on the new version.
Fork
Resolution
1 2

3 4
 Wallet
 Submits transactions to bitcoin
network
 Transactions Validated by other
nodes
 Validated transactions are pooled
 Miner forms the block using PoW
 Broadcasts to other nodes
 Other nodes validate the blocks
 Blocks are added to local chain
 Darkcoin (11 diff. hash alg.) – difficulty high
 Proof of useful work - Primecoin, permacoin (proof of storage –

verify integrity of the file)


 Pos, proof of deposit – verify the legal source

 Virtual mining
 Overlay currency - investor outsourcing currency risk
management to a specialist firm, known as the overlay manager.
Buy/sell assets in a foreign currency.
 Colored coins - colored coin is a denomination of a
cryptocurrency, often Bitcoin, that is repurposed by marking it
with metadata - allowing the creation of tokens that serve to
represent other currencies or assets of interest on blockchain.
Consensu
s
Two Types of Consensus Mechanisms
● Lottery Based : A lottery draw or a lucky draw elects the leader or
validator, who gets the privilege to propose and add the next block
of transactions. Example : Proof of work, Proof of stake
● Voting Based : They work based on voting mechanisms.

Example : Practical Byzantine Fault Tolerance(PBFT)


CONSENSUS
 Consensus maintains a consistent transaction log across
every computer in the system  Goal of consensus
 The replicated state machine (RSM)must continually
accept new transactions into this log to “provide a
useful service”.
 Issues faced by the RSM:
 Computers may be faulty
 The network may not reliable; messages may fail /
delayed or out of order.
 No global clock to help determine the order of
events.
 An algorithm achieves consensus if it satisfies the conditions:
 Agreement: All non-faulty nodes decide on the same output
value.
 Termination: All non-faulty nodes eventually decide on
some output value.
 There are three types of actors in a system:
 Proposers, often called leaders or coordinators.
 Acceptors, processes that listen to requests from proposers
and respond with values.
 Learners, other processes in the system which learn the
final values that are decided upon.
CONSENSUS PROCESS / STEPS
1) Elect
 Nodes elect a single leader process to make
decisions.
 The leader proposes the next valid output value.

0
2) Vote
 The non-faulty processes listen to the value being proposed by the
leader, validate it, and propose it as the next valid value.
3) Decide
 The non-faulty processes must come to a consensus on a
single correct output value. If it receives a threshold number
of identical votes which satisfy some criteria, then the
processes will decide on that value commit
 Otherwise, the steps start over.
I) CONSENSUS - POW
 Every miner tries to solve a puzzle
 computing a hash value of block header < target

 Puzzle is solved using SHA256 Hash algorithm whose output


is always 256 bits long, regardless of the input size
 If the hash is not less than the target, the miner will modify

the nonce and try again


 At the current difficulty in the bitcoin network, miners have
to try quadrillions of times before finding a suitable nonce

{0,1 SHA 256 {0,1}


}* 256
EXAMPLE
 Challenge Target: find a phrase that produces a hexadecimal hash that starts with a zero

 Add different nonces – Bernoulli Trial – adding diff. nonces to solve the puzzle
 I am Satoshi Nakamoto0 => a80a81401765c8eddee25df36728d732...
 I am Satoshi Nakamoto1 => f7bc9a6304a4647bb41241a677b5345f..
 am Satoshi Nakamoto6 => 4a2fd48e3be420d0d28e202360cfbaba...
 I am Satoshi Nakamoto7 => 790b5a1349a5f2b909bf74d0d166b17a...
 I am Satoshi Nakamoto8 => 702c45e5b15aa54b625d68dd947f1597...
 I am Satoshi Nakamoto9 => 7007cf7dd40f5e933cd89f f f5b791ff0...
 I am Satoshi Nakamoto10 => c2f38c81992f4614206a21537bd634a...
 I am Satoshi Nakamoto11 => 7045da6ed8a914690f087690e1e8d66...
 I am Satoshi Nakamoto12 => 60f01db30c1a0d4cbce2b4b22e88b9b...

“I am Satoshi Nakamoto" SHA25 5d7c7ba21cbbcd75d14800b100252d5b428e5b1213d27c385bc141ca6b47989


6 e

I am Satoshi Nakamoto13 => 0ebc56d59a34f5082aaef3d66b37a66...


EXAMPLE: BLOCK WITH HEIGHT 608,174

First compute block header:

Block_header = Version(4)+hashPrevBlock(32)+hashMerkleRoot(32)+Time(4)+Bits(4)

Compute double SHA256 of header and nonce

Block Hash = Sha256(Sha256(Block_header||n


once)
VERIFYING POW
7) Compute Target threshold:
Target bit: 0x17 15dbd2
exp coefficient

T = coefficient * 2^(8-(exp-3))
= 1432530 * 2^160 (Decimal)
= 00000000000000000015DBD2000000000000000000000000000000000
0000000
18 zeros

8) Perform double SHA256 algorithm with nonce value 1: (Hex – 64 chars)

Hash =
49810A64972C55C19AAAF1420B6C5CB50D941D755855848CA7D210E0D36D685B

9) Perform double SHA256 algorithm with nonce value 2: (Hex – 64 chars)

Hash = 0CB81BE5B4081E187A8CA4839390AE08DCF239CABB2F0A9E04D178F5955CA084

10) Perform double SHA256 algorithm with nonce value : (Hex – 64 chars)
Hash =
00000000000000000006412b5dc298916fb5d148e9eca74d89a
II) CONSENSUS - POS
III) CONSENSUS - DPOS
 An iteration of the concept known as Delegated Proof of Stake
(DPoS) works similarly, but features a voting and delegation
mechanism that makes the process more democratic.
 A limited number of delegates (most protocols choose between 20
and 100) are chosen for each new block, so the delegates of one
block might not be the delegates of the next.
 The first iteration of DPoS was developed in 2014 by former EOS
Chief Technology Officer (CTO) Dan Larimer. Larimer first
implemented the consensus algorithm on decentralized crypto
exchange platform BitShares in 2015. Today, a number of
blockchains, including Cardano, EOS, and TRON, use DPoS.
 This concept has shown immense promise for increasing the
efficiency, transaction speed, and throughput of blockchain
protocols, which is necessary for more enterprise uses as the
industry grows and looks to disrupt more complex and larger
markets.
OTHER CONSENSUS MECHANISMS
Proof of Work (PoW)
protocol
● In general terms, ‘proof of work’ is a piece of data that :
○ Satisfies certain requirements
○ Hard to produce
○ Easy to verify

● In our case, the ‘proof’ is a cryptographic puzzle.


● PoW protocol uses ‘proof of work’ for block creation & to reach a
consensus in the network.
PoW protocol – Key
steps
● Independent verification of transactions - by every
nodes
● Independent creation of blocks - by mining nodes
● Independent verification of blocks - by every
nodes
● Independent selection of chain (fork resolution) -
by every nodes
Key steps – Independent verification of
transactions
● Every node which receives a transaction, verifies it
● If transaction is verified, it is added to the ‘memory pool’, or ‘mempool’, and also
forwarded to the peers
● If verification fails, the transaction is discarded

1 2
Key steps – Independent Creation of
blocks
● Every mining node collects some transactions from its mempool and
creates candidate blocks
● Miners then try to solve the ‘proof of work’ puzzle.
● Once a miner solves the puzzle, they publish their candidate block
to the network.
● If a miner receives a valid block from a different miner, they will stop the
mining for current height and starts mining for the next height.
3 4
Proof-of
work
● Popular implementations: Bitcoin, Litecoin, Dogecoin
etc.
● Pros: We know it works (decentralized, internet scale
consensus)
● Cons: Slow throughput; 51% attack
Proof of
Stake
Proof-of-
Stake
● Using an election process, one node is randomly chosen to validate the
next block
● Miners –> Validators
● Mining –> Minting / Forging / Proposing
● A node has to deposit a certain amount(Stake) of coins into the network.
● The size of stake determine the chances of a validator to be chosen to
forge the next block.
● Chance & stake has a linear correlation
Proof-of-
Stake
● After a validator is chosen it will check all the transactions within
a block.

● If everything seems okay, validator node signs the block and


add it to the blockchain.

● And the validator gets rewarded, which is the transaction fees


of all the transactions in the validated block.
The Byzantine Generals Problem

Coordinated attack leading to victory Uncoordinated attack leading to defeat


Byzantine Fault
Tolerance
● Byzantine Generals Problem(1982 Lamport, Shostak and Peace)
● For a network of 1 or 2 nodes the problem is trivial.
● For a distributed network with 3 nodes there is no solution for the
problem.
n:= number of generals
Let us consider n = 3, with 1
traitor Commander gives
correct action Lieutenants
follow orders
● Let’s see why.
Byzantine Fault
Tolerance
Distinguishing Fault
Categories
Assumptions :

● Simple Fail Stop Fault Tolerance : Nodes can crash, not return
values , crash detectable by other nodes.

● Byzantine Fault Tolerance : Nodes can do all of the above


and send incorrect/corrupted values, corruption or
manipulation harder to detect.
Byzantine Fault
Tolerance(BFT)
● BFT is achieved if the distributed system functions as desired and reach
consensus, despite Byzantine/malicious nodes failing or propagating incorrect
information to other peers.

● The aim is to prevent severe system failures by removing the influence of


malicious nodes on the correct function of the network. Also to make sure that the
right consensus is reached by the honest nodes in the system.

● Examples of systems that require BFT include :


○ an aircraft,
○ air traffic control systems
Byzantine Fault Tolerance in
Blockchain

Source : https://rustie.xyz/
IV) CONSENSUS - PBFT

You might also like