SlideShare une entreprise Scribd logo
1  sur  12
Blockchain Consensus
Algorithms
Anurag Dashputre
Agenda
● What is a Consensus Algorithm?
● Why we need them in Blockchain?
● Few popular consensus algorithms
● Consensus Algorithms - Comparative study
What is a Consensus Algorithm?
Consensus: A generally accepted opinion or decision among a group of people.
Algorithm: A set of rules for accomplishing a task in a certain number of steps.
Combining the two, you get: a set of rules and number of steps for accomplishing a generally accepted decision
among a group of people.
Why we need them in Blockchain?
Consensus algorithms are put in place to ensure a group of people agree that all transactions are validated and
authentic.
Consensus algorithms ensure a network of random people can achieve consensus about transactions in the
network. People have to cooperate and grow accustomed to these new decentralized networks that have no
central authority, unlike the governments, institutions, and businesses we are used to.
Consensus mechanisms secure a blockchain’s transactions by preventing the double-spending problem. At its
very basic, double-spending is much like sending a photo to someone digitally. You do not send the original
picture, but a copy and now two people have the same picture.
Imagine if someone could do this with cryptocurrencies.
Few popular consensus algorithms
Algorithm Description
PoW A Proof of Work is a piece of data which is difficult (costly, time-consuming) to produce but easy for others to
verify and which satisfies certain requirements. Producing a proof of work can be a random process with low
probability so that a lot of trial and error is required on average before a valid proof of work is generated.
PoS Proof of Stake (PoS) concept states that a person can mine or validate block transactions according to how
many coins he or she holds. This means that the more Bitcoin or altcoin owned by a miner, the more mining
power he or she has.
PoA Proof of Authority consensus protocols are used when participants are known to each other and there is a level
of trust between them.
PBFT Practical Byzantine Fault Tolerance (pBFT) is a specific case and the optimization of the Byzantine Fault
Tolerance network ability. Byzantine Fault Tolerance is the ability of a network to unmistakably reach a
consensus despite malicious nodes’ attempts to propagate false data to other peers.
IBFT Byzantine Fault Tolerant (leader is not trusted). Each block requires multiple rounds of voting
RAFT Raft is a consensus algorithm for managing a replicated log. It is CFT consensus, as opposed to BFT because in
Raft the leader is assumed to always act correctly (honestly).
RAFT
RAFT is a CFT (crash fault tolerant) consensus algorithm which relies on a trusted leader to form consensus and apply changes to
ledger. Node can be in 1 of 3 states: Follower, Candidate or Leader.
And has these processes
1. Leader Election - All nodes start in the follower state. If followers don't hear from a leader then they can become a candidate. The
candidate then requests votes from other nodes. The candidate becomes the leader if it gets votes from a majority of nodes.
Leader election process: Follower ⇒ Election Timeout happens ⇒ Become Candidate ⇒ Get Majority Votes ⇒ Become Leader,
send heartbeat messages ⇒ After Heartbeat Timeout ⇒ Become Follower (other follower goes to same cycle to become Leader)
2. Log Replication - All changes to the system now go through the leader. Each change is added as an entry in the node's log, which
is uncommitted at the moment. To commit the entry the node first replicates it to the follower nodes in next heartbeat and waits
until a majority of nodes have written the entry. The entry is now committed on the leader node and notifies it to follower about
the successful commit.
POA
• PoA relies on a set of trusted nodes called Authorities that use a simplified messaging algorithm to achieve better performance
• Each block signed by only one signature – that of the proposer’s.
• Forking will happen in a network with more than 4 authorities.
PBFT
• The PBFT model primarily focuses on providing a practical Byzantine state machine replication that tolerates "f" Byzantine faults
(malicious nodes) in system with "3f +1" nodes. E.g if f =1, total nodes = 4, faulty node = 1.
• Essentially, all of the nodes in the PBFT model are ordered in a sequence with one node being the primary node (leader) and the
others referred to as the backup nodes. Leader is selected on round robin basis (or few other protocols).
• The amount of malicious nodes in the network cannot simultaneously equal or exceed ⅓ of the overall nodes in the system
• The algorithm effectively provides both liveness and safety as long as at most (n-⅓), where n represents total nodes, are malicious or
faulty at the same time.
• Each round of PBFT consensus (called views) comes down to 4 phases. This model follows more of a “Commander and Lieutenant”
format than a pure Byzantine Generals’ Problem, where all generals are equal, due to the presence of a leader node. The phases are
below.
1. A client sends a request to the leader node to invoke a service operation.
2. The leader node multicasts the request to the backup nodes.
3. The nodes execute the request and then send a reply to the client.
4. The client awaits f + 1 (f represents the maximum number of nodes that may be faulty) replies from different nodes with the
same result. This result is the result of the operation.
PBFT (Continued)
Sequence of steps
1. Request - From Client to Leader node
2. Follows 3 phase protocol
a. Pre-Prepare - Leader sends Pre-Prepare
message to all. Nodes accept message if it is
valid node.
b. Prepare - If node accepts Pre-Prepare
message, it sends Prepare message to
everyone else and accepted if nodes are valid.
c. Commit - Nodes sent commit to messages to
all nodes.
3. Reply - From all nodes to Client
IBFT
The IBFT consensus mechanism comprises the following components:
● A PBFT inspired group consensus model.
● A process by which members can be added/removed from the validating group.
Its ideal if nodes belong to your fiercest competitors, or may be susceptible to compromises.
Its is one of the many flavours of PoA and provides the following benefits:
● Immediate block finality. There’s only 1 block proposed at a given chain height. The single chain thus removes forking, uncle
blocks, and the risk that a transaction may be “undone” once on the chain at a later time.
● Reduced time between blocks. The effort needed to construct and validate blocks is significantly reduced (in particular with
respect to PoW), greatly increasing the throughput of the chain.
● High data integrity and fault tolerance. IBFT uses a group of validators to ensure the integrity of each block being proposed. A
super-majority (~66%) of these validators are required to sign the block prior to insertion to the chain, making block forgery
very difficult. The ‘leadership’ of the group also rotates over time — ensuring a faulty node cannot exert long term influence
over the chain.
● Operationally flexible. The group of validators can be modified in time, ensuring the group contains only full-trusted nodes.
IBFT - Consensus Model
IBFT uses a pool of validating nodes (Validators) operating on an Ethereum network to determine if a proposed block is suitable for
addition to the chain.
One node of the Validators is arbitrarily selected as the Proposer and is responsible for constructing a block at the block-interval and
sharing said block with the group. If a super-majority of the Validators deem the block to be valid it is added to the blockchain.
At the completion of the consensus round, the Validators may select a new Proposer which will be responsible for providing the
candidate Block at the next block interval.
The members of the validation group may change over time through a voting mechanism. Members can be added or removed through
a majority ((N/2) + 1) vote.
Consensus Algorithms - Comparative study
Algorithm Public/
Private/
Both
No. of
Validators
Finality Malicious /
Malfunctioning Nodes
Trust Level Energy
Usage
PoW Public Many Probabilistic <50% Trustless Huge
PoS Public Many Probabilistic <50% Trustless Low
PBFT Private Many, with
periodic leader
rotation OR vote
based election
Instant (N-1)/3 Some trust Low
IBFT Private Many, with
periodic leader
rotation
Instant (N-1)/3 Some trust Low
POA (Clique) Both 1 Probabilistic
(within (N/2)+1 blocks)
None All trusted
nodes
Low
RAFT Private 1 Instant None All trusted
nodes
Low

Contenu connexe

Tendances

PoW vs. PoS - Key Differences
PoW vs. PoS - Key DifferencesPoW vs. PoS - Key Differences
PoW vs. PoS - Key Differences
101 Blockchains
 
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
Simplilearn
 

Tendances (20)

Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
 
Solidity
SoliditySolidity
Solidity
 
Blockchain
BlockchainBlockchain
Blockchain
 
Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum) Ethereum-Cryptocurrency (All about Ethereum)
Ethereum-Cryptocurrency (All about Ethereum)
 
Ppt on blockchain technology
Ppt on blockchain technologyPpt on blockchain technology
Ppt on blockchain technology
 
PoW vs. PoS - Key Differences
PoW vs. PoS - Key DifferencesPoW vs. PoS - Key Differences
PoW vs. PoS - Key Differences
 
Ethereum
EthereumEthereum
Ethereum
 
Blockchain and Decentralization
Blockchain and DecentralizationBlockchain and Decentralization
Blockchain and Decentralization
 
Introduction to Bitcoin's Scripting Language
Introduction to Bitcoin's Scripting LanguageIntroduction to Bitcoin's Scripting Language
Introduction to Bitcoin's Scripting Language
 
Blockchain 101 by imran bashir
Blockchain 101  by imran bashirBlockchain 101  by imran bashir
Blockchain 101 by imran bashir
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
 
Understanding Blockchain Security
Understanding Blockchain SecurityUnderstanding Blockchain Security
Understanding Blockchain Security
 
Consensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & AnalysisConsensus Algorithms: An Introduction & Analysis
Consensus Algorithms: An Introduction & Analysis
 
Blockchain Presentation
Blockchain PresentationBlockchain Presentation
Blockchain Presentation
 
Blockchain Technology
Blockchain TechnologyBlockchain Technology
Blockchain Technology
 
Understanding Blockchain: Distributed Ledger Technology
Understanding Blockchain: Distributed Ledger TechnologyUnderstanding Blockchain: Distributed Ledger Technology
Understanding Blockchain: Distributed Ledger Technology
 
Layer 2 Scaling Solutions
Layer 2 Scaling SolutionsLayer 2 Scaling Solutions
Layer 2 Scaling Solutions
 
Blockchain
BlockchainBlockchain
Blockchain
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
 
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
What is A Smart Contract? | Smart Contracts Tutorial | Smart Contracts in Blo...
 

Similaire à Blockchain consensus algorithms

BlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptxBlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptx
RajChauhan226834
 
Encode polkadot club event 3, technical deepdive
Encode polkadot club   event 3, technical deepdiveEncode polkadot club   event 3, technical deepdive
Encode polkadot club event 3, technical deepdive
Vanessa Lošić
 
trestor-whitepaper-voting
trestor-whitepaper-votingtrestor-whitepaper-voting
trestor-whitepaper-voting
Kunal Dixit
 

Similaire à Blockchain consensus algorithms (20)

Hyperledger Consensus Algorithms
Hyperledger Consensus AlgorithmsHyperledger Consensus Algorithms
Hyperledger Consensus Algorithms
 
unit3consesence.pptx
unit3consesence.pptxunit3consesence.pptx
unit3consesence.pptx
 
BlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptxBlockChain_Chap3_RP _Consensus.pptx
BlockChain_Chap3_RP _Consensus.pptx
 
pBFT.pptx
pBFT.pptxpBFT.pptx
pBFT.pptx
 
Hyperchains
HyperchainsHyperchains
Hyperchains
 
Unit 1.pptx
Unit 1.pptxUnit 1.pptx
Unit 1.pptx
 
Ripple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout WhitepaperRipple - XRP we know how XRP blockchain throughout Whitepaper
Ripple - XRP we know how XRP blockchain throughout Whitepaper
 
20MCE22 - BLOCKCHAIN TECHNOLOGY_NOTES.pdf
20MCE22 - BLOCKCHAIN TECHNOLOGY_NOTES.pdf20MCE22 - BLOCKCHAIN TECHNOLOGY_NOTES.pdf
20MCE22 - BLOCKCHAIN TECHNOLOGY_NOTES.pdf
 
Reputation-Based Consensus for Blockchain Technology in Smart Grid
Reputation-Based Consensus for Blockchain Technology in Smart GridReputation-Based Consensus for Blockchain Technology in Smart Grid
Reputation-Based Consensus for Blockchain Technology in Smart Grid
 
Vilnius blockchain club 20170413 consensus
Vilnius blockchain club 20170413 consensusVilnius blockchain club 20170413 consensus
Vilnius blockchain club 20170413 consensus
 
UNIT IV DIS.pptx
UNIT IV DIS.pptxUNIT IV DIS.pptx
UNIT IV DIS.pptx
 
Maintaining data consistency in
Maintaining data consistency inMaintaining data consistency in
Maintaining data consistency in
 
Encode polkadot club event 3, technical deepdive
Encode polkadot club   event 3, technical deepdiveEncode polkadot club   event 3, technical deepdive
Encode polkadot club event 3, technical deepdive
 
How to create a permissioned blockchain.pdf
How to create a permissioned blockchain.pdfHow to create a permissioned blockchain.pdf
How to create a permissioned blockchain.pdf
 
blockchain technology -unit-3-notes.pdf for engineering students
blockchain technology -unit-3-notes.pdf for engineering studentsblockchain technology -unit-3-notes.pdf for engineering students
blockchain technology -unit-3-notes.pdf for engineering students
 
190221 masterclass blockchain
190221 masterclass blockchain190221 masterclass blockchain
190221 masterclass blockchain
 
PROOF-OF-REPUTATION: AN ALTERNATIVE CONSENSUS MECHANISM FOR BLOCKCHAIN SYSTEMS
PROOF-OF-REPUTATION: AN ALTERNATIVE CONSENSUS MECHANISM FOR BLOCKCHAIN SYSTEMSPROOF-OF-REPUTATION: AN ALTERNATIVE CONSENSUS MECHANISM FOR BLOCKCHAIN SYSTEMS
PROOF-OF-REPUTATION: AN ALTERNATIVE CONSENSUS MECHANISM FOR BLOCKCHAIN SYSTEMS
 
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
Melanie Rieback, Klaus Kursawe - Blockchain Security: Melting the "Silver Bul...
 
trestor-whitepaper-voting
trestor-whitepaper-votingtrestor-whitepaper-voting
trestor-whitepaper-voting
 
Introduction to blockchain & cryptocurrencies
Introduction to blockchain & cryptocurrenciesIntroduction to blockchain & cryptocurrencies
Introduction to blockchain & cryptocurrencies
 

Dernier

Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
WSO2
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Victor Rentea
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
panagenda
 

Dernier (20)

Ransomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdfRansomware_Q4_2023. The report. [EN].pdf
Ransomware_Q4_2023. The report. [EN].pdf
 
Architecting Cloud Native Applications
Architecting Cloud Native ApplicationsArchitecting Cloud Native Applications
Architecting Cloud Native Applications
 
Exploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with MilvusExploring Multimodal Embeddings with Milvus
Exploring Multimodal Embeddings with Milvus
 
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemkeProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
ProductAnonymous-April2024-WinProductDiscovery-MelissaKlemke
 
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
 
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024Finding Java's Hidden Performance Traps @ DevoxxUK 2024
Finding Java's Hidden Performance Traps @ DevoxxUK 2024
 
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...
 
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...
 
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
 
Why Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire businessWhy Teams call analytics are critical to your entire business
Why Teams call analytics are critical to your entire business
 
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data DiscoveryTrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
TrustArc Webinar - Unlock the Power of AI-Driven Data Discovery
 
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot TakeoffStrategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
Strategize a Smooth Tenant-to-tenant Migration and Copilot Takeoff
 
Artificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : UncertaintyArtificial Intelligence Chap.5 : Uncertainty
Artificial Intelligence Chap.5 : Uncertainty
 
Boost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdfBoost Fertility New Invention Ups Success Rates.pdf
Boost Fertility New Invention Ups Success Rates.pdf
 
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWEREMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
EMPOWERMENT TECHNOLOGY GRADE 11 QUARTER 2 REVIEWER
 
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
Apidays New York 2024 - Accelerating FinTech Innovation by Vasa Krishnan, Fin...
 
AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024AXA XL - Insurer Innovation Award Americas 2024
AXA XL - Insurer Innovation Award Americas 2024
 
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ..."I see eyes in my soup": How Delivery Hero implemented the safety system for ...
"I see eyes in my soup": How Delivery Hero implemented the safety system for ...
 
presentation ICT roal in 21st century education
presentation ICT roal in 21st century educationpresentation ICT roal in 21st century education
presentation ICT roal in 21st century education
 
MS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectorsMS Copilot expands with MS Graph connectors
MS Copilot expands with MS Graph connectors
 

Blockchain consensus algorithms

  • 2. Agenda ● What is a Consensus Algorithm? ● Why we need them in Blockchain? ● Few popular consensus algorithms ● Consensus Algorithms - Comparative study
  • 3. What is a Consensus Algorithm? Consensus: A generally accepted opinion or decision among a group of people. Algorithm: A set of rules for accomplishing a task in a certain number of steps. Combining the two, you get: a set of rules and number of steps for accomplishing a generally accepted decision among a group of people.
  • 4. Why we need them in Blockchain? Consensus algorithms are put in place to ensure a group of people agree that all transactions are validated and authentic. Consensus algorithms ensure a network of random people can achieve consensus about transactions in the network. People have to cooperate and grow accustomed to these new decentralized networks that have no central authority, unlike the governments, institutions, and businesses we are used to. Consensus mechanisms secure a blockchain’s transactions by preventing the double-spending problem. At its very basic, double-spending is much like sending a photo to someone digitally. You do not send the original picture, but a copy and now two people have the same picture. Imagine if someone could do this with cryptocurrencies.
  • 5. Few popular consensus algorithms Algorithm Description PoW A Proof of Work is a piece of data which is difficult (costly, time-consuming) to produce but easy for others to verify and which satisfies certain requirements. Producing a proof of work can be a random process with low probability so that a lot of trial and error is required on average before a valid proof of work is generated. PoS Proof of Stake (PoS) concept states that a person can mine or validate block transactions according to how many coins he or she holds. This means that the more Bitcoin or altcoin owned by a miner, the more mining power he or she has. PoA Proof of Authority consensus protocols are used when participants are known to each other and there is a level of trust between them. PBFT Practical Byzantine Fault Tolerance (pBFT) is a specific case and the optimization of the Byzantine Fault Tolerance network ability. Byzantine Fault Tolerance is the ability of a network to unmistakably reach a consensus despite malicious nodes’ attempts to propagate false data to other peers. IBFT Byzantine Fault Tolerant (leader is not trusted). Each block requires multiple rounds of voting RAFT Raft is a consensus algorithm for managing a replicated log. It is CFT consensus, as opposed to BFT because in Raft the leader is assumed to always act correctly (honestly).
  • 6. RAFT RAFT is a CFT (crash fault tolerant) consensus algorithm which relies on a trusted leader to form consensus and apply changes to ledger. Node can be in 1 of 3 states: Follower, Candidate or Leader. And has these processes 1. Leader Election - All nodes start in the follower state. If followers don't hear from a leader then they can become a candidate. The candidate then requests votes from other nodes. The candidate becomes the leader if it gets votes from a majority of nodes. Leader election process: Follower ⇒ Election Timeout happens ⇒ Become Candidate ⇒ Get Majority Votes ⇒ Become Leader, send heartbeat messages ⇒ After Heartbeat Timeout ⇒ Become Follower (other follower goes to same cycle to become Leader) 2. Log Replication - All changes to the system now go through the leader. Each change is added as an entry in the node's log, which is uncommitted at the moment. To commit the entry the node first replicates it to the follower nodes in next heartbeat and waits until a majority of nodes have written the entry. The entry is now committed on the leader node and notifies it to follower about the successful commit.
  • 7. POA • PoA relies on a set of trusted nodes called Authorities that use a simplified messaging algorithm to achieve better performance • Each block signed by only one signature – that of the proposer’s. • Forking will happen in a network with more than 4 authorities.
  • 8. PBFT • The PBFT model primarily focuses on providing a practical Byzantine state machine replication that tolerates "f" Byzantine faults (malicious nodes) in system with "3f +1" nodes. E.g if f =1, total nodes = 4, faulty node = 1. • Essentially, all of the nodes in the PBFT model are ordered in a sequence with one node being the primary node (leader) and the others referred to as the backup nodes. Leader is selected on round robin basis (or few other protocols). • The amount of malicious nodes in the network cannot simultaneously equal or exceed ⅓ of the overall nodes in the system • The algorithm effectively provides both liveness and safety as long as at most (n-⅓), where n represents total nodes, are malicious or faulty at the same time. • Each round of PBFT consensus (called views) comes down to 4 phases. This model follows more of a “Commander and Lieutenant” format than a pure Byzantine Generals’ Problem, where all generals are equal, due to the presence of a leader node. The phases are below. 1. A client sends a request to the leader node to invoke a service operation. 2. The leader node multicasts the request to the backup nodes. 3. The nodes execute the request and then send a reply to the client. 4. The client awaits f + 1 (f represents the maximum number of nodes that may be faulty) replies from different nodes with the same result. This result is the result of the operation.
  • 9. PBFT (Continued) Sequence of steps 1. Request - From Client to Leader node 2. Follows 3 phase protocol a. Pre-Prepare - Leader sends Pre-Prepare message to all. Nodes accept message if it is valid node. b. Prepare - If node accepts Pre-Prepare message, it sends Prepare message to everyone else and accepted if nodes are valid. c. Commit - Nodes sent commit to messages to all nodes. 3. Reply - From all nodes to Client
  • 10. IBFT The IBFT consensus mechanism comprises the following components: ● A PBFT inspired group consensus model. ● A process by which members can be added/removed from the validating group. Its ideal if nodes belong to your fiercest competitors, or may be susceptible to compromises. Its is one of the many flavours of PoA and provides the following benefits: ● Immediate block finality. There’s only 1 block proposed at a given chain height. The single chain thus removes forking, uncle blocks, and the risk that a transaction may be “undone” once on the chain at a later time. ● Reduced time between blocks. The effort needed to construct and validate blocks is significantly reduced (in particular with respect to PoW), greatly increasing the throughput of the chain. ● High data integrity and fault tolerance. IBFT uses a group of validators to ensure the integrity of each block being proposed. A super-majority (~66%) of these validators are required to sign the block prior to insertion to the chain, making block forgery very difficult. The ‘leadership’ of the group also rotates over time — ensuring a faulty node cannot exert long term influence over the chain. ● Operationally flexible. The group of validators can be modified in time, ensuring the group contains only full-trusted nodes.
  • 11. IBFT - Consensus Model IBFT uses a pool of validating nodes (Validators) operating on an Ethereum network to determine if a proposed block is suitable for addition to the chain. One node of the Validators is arbitrarily selected as the Proposer and is responsible for constructing a block at the block-interval and sharing said block with the group. If a super-majority of the Validators deem the block to be valid it is added to the blockchain. At the completion of the consensus round, the Validators may select a new Proposer which will be responsible for providing the candidate Block at the next block interval. The members of the validation group may change over time through a voting mechanism. Members can be added or removed through a majority ((N/2) + 1) vote.
  • 12. Consensus Algorithms - Comparative study Algorithm Public/ Private/ Both No. of Validators Finality Malicious / Malfunctioning Nodes Trust Level Energy Usage PoW Public Many Probabilistic <50% Trustless Huge PoS Public Many Probabilistic <50% Trustless Low PBFT Private Many, with periodic leader rotation OR vote based election Instant (N-1)/3 Some trust Low IBFT Private Many, with periodic leader rotation Instant (N-1)/3 Some trust Low POA (Clique) Both 1 Probabilistic (within (N/2)+1 blocks) None All trusted nodes Low RAFT Private 1 Instant None All trusted nodes Low

Notes de l'éditeur

  1. https://medium.com/@bertcmiller/blockchains-healthcare-and-platform-neutrality-5baa353c9a2a
  2. https://github.com/ethereum/EIPs/issues/650 - IBFT http://pmg.csail.mit.edu/papers/osdi99.pdf - PBFT Paper https://blockonomi.com/practical-byzantine-fault-tolerance/ https://media.consensys.net/scaling-consensus-for-enterprise-explaining-the-ibft-algorithm-ba86182ea668 https://raft.github.io/raft.pdf http://thesecretlivesofdata.com/raft/
  3. http://thesecretlivesofdata.com/raft/ Leader Election: 2 timeout settings which control election. First is "Election Timeout" - The election timeout is the amount of time a follower waits until becoming a candidate. It is randomized between 150ms and 300ms. After the election timeout the follower becomes a candidate and starts a new election term. It votes for itself and send vote request to all nodes. If the receiving node hasn't voted yet in this term then it votes for the candidate and the node resets its election timeout. Once a candidate has a majority of votes it becomes leader. Leader now starts sending messages intervals specified by the heartbeat timeout. Follower will respond to this messages. This election term will continue until a follower stops receiving heartbeats and becomes a candidate. If two nodes become candidates at the same time then a split vote can occur. So each candidate may receive equal votes in such a case, re-election will occur.
  4. https://www.youtube.com/watch?v=IafgKJN3nwU Each round of pBFT consensus (called views) comes down to 4 phases. This model follows more of a “Commander and Lieutenant” format than a pure Byzantine Generals’ Problem, where all generals are equal, due to the presence of a leader node. The phases are below. A client sends a request to the leader node to invoke a service operation. The leader node multicasts the request to the backup nodes. The nodes execute the request and then send a reply to the client. The client awaits f + 1 (f represents the maximum number of nodes that may be faulty) replies from different nodes with the same result. This result is the result of the operation.
  5. https://www.youtube.com/watch?v=IafgKJN3nwU
  6. https://media.consensys.net/scaling-consensus-for-enterprise-explaining-the-ibft-algorithm-ba86182ea668
  7. https://en.bitcoinwiki.org/wiki/PBFT https://docs.pantheon.pegasys.tech/en/stable/Consensus-Protocols/Comparing-PoA/ https://kaleido.io/consensus-algorithms-poa-ibft-or-raft/