FBC Unit-3
FBC Unit-3
Essentials of Blockchain
Source: https://www.investopedia.com/terms/c/consensus-mechanism-cryptocurrency.asp
Consensus mechanisms in
Blockchain
• There is no central authority present to validate and verify the
transactions, yet every transaction in the Blockchain is considered to
be completely secured and verified.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
• A consensus algorithm is a process through which all the peers of the
Blockchain network reach a common agreement about the present
state of the distributed ledger.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
• The Blockchain consensus protocol consists of some specific
objectives such as coming to an agreement, collaboration,
cooperation, equal rights to every node, and mandatory participation
of each node in the consensus process.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Consensus mechanisms
Various consensus algorithms/mechanisms:
1. Proof of Work (PoW):
• This consensus algorithm is used to select a miner for the next block generation.
• Bitcoin uses this PoW consensus algorithm.
• The central idea behind this algorithm is to solve a complex mathematical puzzle
and easily give out a solution.
• This mathematical puzzle requires a lot of computational power and thus, the
node who solves the puzzle as soon as possible gets to mine the next block.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
• Proof-of-Work (PoW) in the blockchain is a consensus mechanism that
allows miners to add a new block to the network based on
calculations made to find the perfect hash. Network participants
verify the transactions added by the new block.
• The work(ers) Proof-of-work blockchains are supported through a
network of decentralized computers called nodes.
• These nodes are also called miners because they spend computing
power and resources in return for the network’s underlying
cryptocurrency.
• Miners win the reward when they guess a hash that falls below the
threshold provided by the network. Once a miner finds the valid block
hash, it broadcasts this information to other miners who can quickly
validate and add the new block to their blockchain copies.
• The successful miner receives the block rewards and associated
transaction fees.
Advantages of Proof-of-Work
• A hard-to-find solution. Still, easy verification.
• PoW does not need initial stakes of coins before mining. One can start with
0 coins and it will only be positive.
• Ease of implementation compared to other blockchain consensus
mechanisms.
• It is fault tolerant. It means that the failure of one component will not shut
down the entire blockchain network.
• Give miners the opportunity to earn by adding a block.
• PoW is the oldest, most trusted, and most popular consensus protocol
Limitations of Proof-of-Work
• A lot of energy is wasted because only one miner can finally add their
block.
• It requires a lot of computing power and, therefore, massive
consumption of resources and energy.
• 51% risk of network attack. A controlling person can get 51% to
control the network.
• Spread environmental hazards with attachment machines.
• Pow is a time and energy wipe-out process.
• It required a lot of hardware costs.
Consensus mechanisms
2. Proof of Stake (PoS):
• This is the most common alternative to PoW.
• Ethereum has shifted from PoW to PoS consensus.
• In this type of consensus algorithm, instead of investing in
expensive hardware to solve a complex puzzle, validators
invest in the coins of the system by locking up some of their
coins as stakes.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Consensus mechanisms
• Validators will validate blocks by placing a bet on them if they
discover a block that they think can be added to the chain.
• Based on the actual blocks added in the Blockchain, all the validators
get a reward proportionate to their bets, and their stake increase
accordingly.
• In the end, a validator is chosen to generate a new block based on its
economic stake in the network.
• Thus, PoS encourages validators through an incentive mechanism to
reach to an agreement.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Consensus mechanisms
3. Delegated Proof Of Stake (DPoS):
• This type of consensus mechanism depends on the
basis of the delegation of votes.
• The users delegate their votes to other users.
• Whichever user then mines the block will distribute
the rewards to the users who delegated to that
particular vote.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Consensus mechanisms
4. Proof of Burn (PoB):
• Validators ‘burn’ coins by sending them to an address from where
they are irretrievable.
• By committing the coins to an unreachable address, validators earn
the privilege to mine on the system based on a random selection
process. Thus, burning coins here means that validators have a long-
term commitment in exchange for their short-term loss.
• The more coins they burn, the better their chances of being selected
to mine the next block.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Consensus mechanisms
5. Proof of Capacity:
• The more hard drive space validators have, the better their
chances of getting selected for mining the next block and earning
the block reward.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Consensus mechanisms
6. Proof of Elapsed Time:
• Every validator on the network gets a fair chance to create their own
block.
• All the nodes do so by waiting for a random amount of time, adding
proof of their wait in the block.
• The winner is the validator which has the least timer value in the
proof part.
• There are additional checks in the algorithm to stop nodes from
always winning the election, and stop nodes from generating the
lowest timer value.
Source: https://www.geeksforgeeks.org/consensus-algorithms-in-blockchain/
Difference: PoS vs PoW
Proof of Stake Proof of Work
Block creators are called validators Block creators are called miners
Participants must own coins or tokens to Participants must buy equipment and
become validators energy to become a miner
Source: https://www.investopedia.com/terms/p/proof-stake-pos.asp
Alternative of proof of work
Proof-Of Stake
• In PoW, miners exchange energy for cryptocurrency, which
causes PoW mining to use as much energy as some small
countries.
• Ethereum's transition from PoW to PoS reduced the
blockchain's energy consumption by 99.84%.
Proof of Stake
• In PoS, there doesn't need to be as much computational
work done.
• The owners offer their coins as collateral—staking—for the
chance to validate blocks and earn rewards.
• Ex. Ethereum
Source: https://www.bitpanda.com/academy/en/lessons/what-does-mining-difficulty-mean/
Mining difficulty
• Mining difficulty measures how difficult it is to solve the complex
cryptographic puzzles used in the mining process.
• The difficulty of mining new units increases or decreases over time,
depending on the number of miners in the network
• Increases in difficulty are necessary in order to maintain the target
block time.
Confirmation and finality
• A confirmation represents the acceptance of a new block
(containing several transactions) by the blockchain network.
• Once a miner has successfully added a new block to the
blockchain, one 'confirmation' has occurred.
Source: https://www.bitcoin.com/get-started/what-is-a-confirmation/
Finality in Blockchain
• Finality in blockchain means reaching a point where a
transaction is permanent and irreversible.
• Once a transaction achieves finality, it’s locked in and cannot
be altered or undone.
• This is crucial in maintaining trust in blockchain systems, as it
guarantees that transactions are secure and records remain
immutable.
Source: https://www.ledger.com/academy/glossary/finality/
Finality in Blockchain
• Different blockchains achieve this through different consensus
mechanisms, such as proof-of-work (PoW) and proof-of-stake (PoS).
Types of Block Finality
• Probabilistic finality : Transactions or blocks become final as more
and more blocks or transactions are confirmed. For example, a Bitcoin
transaction becomes practically immutable and irreversible after 6
confirmations (60 minutes).
Source: https://www.ledger.com/academy/glossary/finality/
Finality in Blockchain
• Deterministic/ Instant finality: when a transaction achieves near-
instant finality, i.e., the transaction becomes irreversible immediately
after it is confirmed and recorded on the blockchain.
Source: https://www.bnbchain.org/en/blog/what-is-finality-in-blockchain?ref=bnbchain.ghost.io
Forks in Blockchain
• Many times, the nodes in the network can’t come in a unanimous
consensus regarding the future state of the blockchain.
• This event leads to forks, meaning that point in which the ideal
‘single’ chain of blocks is split into two or more chains which are all
valid.
• Forks in blockchain means copying the code and modifying it to create
a new software or product.