Consensus Algorithm
Consensus Algorithm
Consensus in Blockchain
• Consensus algorithms are a set of rules or protocols that enable
nodes in a blockchain network to agree on a shared state of the
network.
• A consensus algorithm is responsible for maintaining the integrity of
the blockchain by ensuring that no single node or group of nodes can
manipulate the network.
Need for Consensus
• Provide security by preventing malicious actors from taking control of the network,
ensuring valid transactions and smooth network operation.
• Pelp achieve decentralization by ensuring all nodes come to a consensus on transaction
validity, preventing centralization.
• Promote transparency by making all transactions visible on the blockchain, making it easy
to track and prevent fraudulent activities.
• Improve efficiency by allowing nodes to quickly agree on transaction validity and add
new blocks to the blockchain in a timely manner.
Types
• Proof of Work (PoW)
• Proof of Stake (PoS)
• Delegated Proof of Stake (DPoS)
• Leased Proof of Stake (DPoS)
• Proof of Authority (PoA)
• Byzantine Fault Tolerance (BFT)
• Practical Byzantine Fault Tolerance (PBFT)
• Directed Acyclic Graph (DAG)
• Proof of Capacity (PoC)
• Proof of Burn (PoB)
• Proof of Identity (PoI)
• Proof of Activity (PoA)
• Proof of Elapsed Time (PoET)
• Proof of Importance(PoI)
•
Proof of Work (PoW)
• lead to a rich-get-richer situation, where validators with the largest stake continue
to earn more cryptocurrency, making it more difficult for smaller validators to
participate in the network.
• random selection of validators
• limiting the amount of cryptocurrency that a single validator can hold.
Delegated Proof of Stake (DPoS)
Relies on a smaller group of validators, known as delegates or witnesses, to validate
transactions and add new blocks to the chain.
• This waiting period is determined using a trusted execution environment (TEE) provided by Intel’s
hardware, which ensures that the wait time is random and cannot be influenced by participants.
• Software Guard Extensions (SGX)
Pros & Cons
• Less energy consumption
• More secure
• Leader selection is random
Since tokens are being destroyed rather than created, the overall supply of tokens decreases,
which can help stabilize the value of the cryptocurrency.
Byzantine Fault Tolerance
Byzantine General’s Problem •The messenger might get captured while delivering the
decision.
•
What if an imposter altered the message received.
•
How can a general make sure if he received the message
from the expected general?
•
What if other generals become traitors and they send the
message to attack, but they actually retreat.
Byzantine General’s Problem in real time
Byzantine Fault Tolerance (BFT)
• To ensure the success of the generals’ team, they need an algorithm that could
adhere to the following conditions:
• All the troop generals need to agree on the next action of the plan.
• The generals should be trustworthy and loyal to the system.
• Generals must not get influenced to become network traitors.
• They need to follow the algorithm of the system.
• The group of generals needs to reach a consensus or decision, irrespective of the
traitors’ actions.
• Upto ‘f’general may behave maliciously. So we need 3f+1 generals in total to
tolerate f malicious nodes. (i.e <1/3 may be malicious)
• Byzantine Fault Tolerance (BFT) is a consensus approach that resists a system to get into the Byzantine
Generals’ problem. It also means the system should stay intact even if one of the nodes (or general)
fails. In addition, BFT aims to reduce the effect of malicious byzantine nodes (or general) on the network.
Practical Byzantine Fault Tolerance (PBFT)
• To overcome the Byzantine problems, Barbara Liskov and Miguel Castro
introduced a Practical Byzantine Fault Tolerance (pBFT) consensus
algorithm in 1999
• Ensures a group of computers can agree on something even if some of
them are trying to cheat and disrupt the process.
• How?? – PBFT works by replicated state machine approach.
• Every node has a copy of same state machine and follows same set of instructions.
• When a new value need to be agreed upon a node(leader) proposes a value.
• Every other node(Back-up) with their state machine runs the same instruction and
gets the same value.
• A multi-step voting process will be carried out to ensure majority of the nodes agree
upon the proposed value.
• Every node must respond to the leader node with a response.
Once a sufficient vote is received the state machine is updated with new value and the
process repeats for each new value.
PBFT
Byzantine General’s Problem
• Game theory problem that provides a description of the extent to which decentralized
parties experience difficulties in reaching consensus without any trusted central parties.
• The Byzantine army is divided into many battalions with each division led by a general.
• The generals connect via messenger to agree to a joint plan of action in order to achieve
success.
• Probable that traitors will try to sabotage their plan by intercepting or changing the
messages.
• The purpose of this challenge is for all of the faithful commanders to reach an agreement
without the imposters tampering with their plans.
Online Shopping
• In other words, the Byzantine Agreement is a consensus algorithm that enables nodes in a
distributed network to reach a consensus despite the presence of faulty nodes that may
behave maliciously or send incorrect information to other nodes.
• In these systems, it is important to reach consensus among all nodes, even in the presence
of nodes that may behave incorrectly.
BFT
• Byzantine Fault Tolerance(BFT) is the feature of a distributed network to reach
consensus(agreement on the same value) even when some of the nodes in the network fail
to respond or respond with incorrect information.
• The objective of a BFT mechanism is to safeguard against the system failures by
employing collective decision
BFT
• Byzantine Fault Tolerance is one of the core characteristics of developing trustworthy
blockchain rules or features is tolerance.
• When two-thirds of the network can agree or reach a consensus and the system still
continues to operate properly, it is said to have BFT.
• Blockchain networks’ most popular consensus protocols, such as proof-of-work, proof-of-
stake, and proof-of-authority, all have some BFT characteristics.