0% found this document useful (0 votes)
2 views18 pages

Blockchain Unit4 Notes

The document serves as a comprehensive study guide on decentralized network consensus, covering various consensus algorithms such as Proof of Work (PoW), Proof of Stake (PoS), and Practical Byzantine Fault Tolerance (pBFT). It explains the Byzantine Generals Problem, the importance of native currency incentives, and the objectives of consensus mechanisms. Additionally, it includes important exam questions and a comparison of different consensus algorithms based on energy usage and resource requirements.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
2 views18 pages

Blockchain Unit4 Notes

The document serves as a comprehensive study guide on decentralized network consensus, covering various consensus algorithms such as Proof of Work (PoW), Proof of Stake (PoS), and Practical Byzantine Fault Tolerance (pBFT). It explains the Byzantine Generals Problem, the importance of native currency incentives, and the objectives of consensus mechanisms. Additionally, it includes important exam questions and a comparison of different consensus algorithms based on energy usage and resource requirements.
Copyright
© All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd

BLOCKCHAIN AND ITS

APPLICATIONS
Discipline Specific Elective Sem VIII (NEP UGCF
2022)

UNIT 4: DECENTRALIZED NETWORK CONSENSUS

A Comprehensive, Exam-Oriented Study Guide


PoW, PoS, PoC, PoB, pBFT, PoET, and Consensus Algorithms

Page 1 of 18
Table of Contents

1. Introduction to Decentralized Networks

2. The Byzantine Generals Problem

3. Native Currency and Incentives

4. What is Consensus?

5. Proof of Work (PoW)

6. Proof of Stake (PoS)

7. Proof of Capacity (PoC)

8. Proof of Burn (PoB)

9. Practical Byzantine Fault Tolerance (pBFT)

10. Proof of Elapsed Time (PoET)

11. Comparison of Consensus Algorithms

12. Important Exam Questions (2, 5, and 10 Marks)

13. MCQs and Viva Questions

14. Quick Revision Cheat Sheet

Page 2 of 18
1. Introduction to Decentralized Networks

The Core Problem:


In a centralized system like a bank, if you send $100 to your friend, the bank acts as the
ultimate judge. It checks your balance, deducts $100, and adds $100 to your friend. But
in a decentralized network (Blockchain), there is no bank. There is no central judge. If
millions of strangers are maintaining the ledger, how do they all agree on exactly who
has how much money without trusting each other?

A decentralized network relies on independent, distributed nodes (computers) that


communicate peer-to-peer. The primary challenge in such a network is achieving
agreement (consensus) on the true state of the data, especially when some nodes might be
faulty, disconnected, or actively malicious (hackers trying to double-spend).

Page 3 of 18
2. The Byzantine Generals Problem

To understand consensus, you MUST understand the famous "Byzantine Generals Problem,"
a classic concept in distributed computing.

The Scenario:

Imagine several generals of the Byzantine army surrounding an enemy city. They must
agree on a coordinated plan: either ATTACK or RETREAT. If they all attack, they win. If
they all retreat, they survive. But if some attack and some retreat, the army is destroyed.

• The generals can only communicate by sending messengers.

• The Complication: Some generals might be traitors who intentionally send conflicting
messages (e.g., telling General A to "Attack" and General B to "Retreat").

• Messengers might also be captured or killed on the way.

THE BYZANTINE GENERALS PROBLEM

[General 1] --------- [General 2 (Traitor)]


| |
| |
[General 3] --------- [General 4]

Goal: How can the loyal generals reach a common agreement


despite the presence of traitors and unreliable communication?

Relevance to Blockchain: In a blockchain network, the nodes are the generals. The "Attack/
Retreat" decision is whether a block of transactions is valid or invalid. The "Traitors" are
malicious nodes trying to hack the system. A blockchain consensus algorithm is essentially
a solution to the Byzantine Generals Problem, allowing nodes to reach a Byzantine Fault
Tolerance (BFT).

Page 4 of 18
3. Native Currency and Incentives

Why would a random person in the world spend thousands of dollars on electricity and
computer hardware to help process your transaction? The answer is Incentives provided
by Native Currencies.

• Native Currency: The built-in cryptocurrency of a specific blockchain network (e.g.,


Bitcoin for the Bitcoin network, Ether for the Ethereum network).

• The Game Theory: Consensus algorithms use native currencies to reward good
behavior and punish bad behavior.
◦ If a node successfully verifies transactions and adds a valid block, it receives a
reward in the native currency.

◦ If a node tries to cheat or approve invalid transactions, it wastes its resources


(electricity/staked coins) and gets absolutely nothing.

Page 5 of 18
4. What is Consensus?

Consensus is the dynamic process of reaching an agreement in a group. In blockchain, a


consensus mechanism is a fault-tolerant protocol used by computer systems to achieve
agreement on a single data value or a single state of the network.

Objectives of Consensus Mechanisms:

1. Agreement: Bringing all nodes to a common understanding.

2. Collaboration: All nodes must work together for the greater good of the network.

3. Egalitarianism: Every node's vote should have a fair weight.

4. Inclusivity: As many nodes as possible should be able to participate.

5. Participation: Active participation is incentivized.

Over the years, various consensus algorithms have been invented to solve the Byzantine
Generals Problem. The syllabus focuses on six major ones.

Page 6 of 18
5. Proof of Work (PoW)

The original consensus mechanism, introduced by Satoshi Nakamoto for Bitcoin.

How it Works:

In PoW, nodes (called Miners) compete against each other to solve an extremely difficult,
arbitrary mathematical puzzle (finding a hash that meets a specific difficulty target using a
Nonce). This requires massive amounts of computational power (CPU/GPU/ASIC) and
electricity.

• The first miner to solve the puzzle gets the right to add the new block to the blockchain.

• Other nodes quickly verify the solution (verifying is easy, finding the solution is hard).

• The winning miner receives the Native Currency (Block Reward + Transaction Fees).

Advantages:

• Highly secure and battle-tested (Bitcoin has never been hacked).

• Makes the 51% attack economically unfeasible for large networks.

Disadvantages:

• Massive Energy Consumption: It requires astronomical amounts of electricity, leading


to environmental concerns.

• Low Throughput: Very slow (Bitcoin processes ~7 TPS).

• Centralization of Mining: favors massive mining farms over individual users.

Page 7 of 18
6. Proof of Stake (PoS)

Created as an energy-efficient alternative to Proof of Work. Currently used by Ethereum 2.0,


Cardano, and Polkadot.

How it Works:

There are no "miners" and no mathematical puzzles. Instead, there are Validators. To
become a validator, a user must "stake" (lock up) a certain amount of the network's native
cryptocurrency as collateral.

• The algorithm randomly selects a validator to propose the next block. The chance of
being chosen is directly proportional to the amount of coins staked. (If you own 5% of
all staked coins, you will be chosen to validate 5% of the blocks).

• If the chosen validator proposes a valid block, they earn transaction fees.

• Slashing: If the validator acts maliciously or goes offline, a portion of their staked coins
is destroyed ("slashed"). This replaces the electricity cost of PoW with a direct financial
penalty.

Advantages:

• 99% More Energy Efficient: No heavy computing power required. You can run a
validator node on a standard laptop.

• Faster: Generally enables faster transaction processing.

• High Penalty for Cheaters: A 51% attack would require buying 51% of all coins, which
would drive the price up astronomically, and if the attacker cheats, their massive stake
is destroyed.

Disadvantages:

• "Nothing at Stake" Problem: Early theoretical issue where validators could vote on
multiple chain forks simultaneously because it costs no electricity to do so (mostly
solved by slashing rules today).

• The "Rich Get Richer": Those with the most money can stake the most coins and
therefore earn the most rewards, leading to wealth centralization.

Page 8 of 18
7. Proof of Capacity (PoC)

Also known as Proof of Space. Examples: Chia Network, Burstcoin.

How it Works:

Instead of burning electricity (CPU power) like PoW, or locking up money like PoS, PoC
utilizes your computer's available Hard Drive Space.

• Plotting: Before mining begins, the algorithm generates a massive list of possible hash
solutions and stores them on your hard drive. This is called creating "plots."

• Mining/Farming: When a new block needs to be forged, the network gives a puzzle.
Miners check their hard drives. Whoever has the closest pre-stored hash solution on
their hard drive wins the right to forge the block.

• The more hard drive space you have, the more solutions you can store, and the higher
your chance of winning.

Advantages:

• Highly energy-efficient compared to PoW.

• Uses standard equipment (Hard Drives/SSDs) making it accessible to average users


without needing specialized ASICs.

Disadvantages:

• Can lead to massive e-waste as intense plotting wears out Solid State Drives (SSDs)
quickly.

• Risk of hard drive hoarding leading to shortages.

Page 9 of 18
8. Proof of Burn (PoB)

Often referred to as a "virtual mining rig." Used by Slimcoin.

How it Works:

To earn the right to mine a new block, a user must "burn" (destroy) their cryptocurrency.
They do this by sending coins to an unspendable address (an "eater address").

• The more coins you burn, the higher your chances of being selected to mine the next
block and earn the reward.

• It simulates PoW: instead of spending money on electricity and mining hardware, you
spend money directly by burning coins.

• The "virtual mining rig" (your burnt coins) decays over time, forcing miners to
continually burn more coins to maintain their mining power.

Advantages:

• Zero energy consumption.

• Reduces the circulating supply of the cryptocurrency, creating deflationary pressure


which increases the value of the remaining coins.

Disadvantages:

• "Rich get richer" dynamic.

• It is essentially destroying value to create value, which some economists criticize.

Page 10 of 18
9. Practical Byzantine Fault Tolerance
(pBFT)

A highly efficient consensus mechanism primarily used in Private/Permissioned


Blockchains (e.g., Hyperledger Fabric, Zilliqa).

How it Works:

pBFT does not require any mining, computing power, or staking. It relies on a known, fixed
set of participants (nodes) passing messages to each other.

• One node is elected as the "Primary" (Leader), and the others are "Backups" (Replicas).

• When a client sends a request, the Leader broadcasts it to the Replicas.

• The Replicas process the request and reply.

• Consensus is reached if a minimum number of nodes agree on the exact same result.

• The Mathematical Rule: pBFT can guarantee consensus as long as the number of
malicious/faulty nodes is strictly less than 1/3 of the total nodes.
Formula: Number of required nodes = $3f + 1$, where $f$ is the number of faulty
nodes.

Advantages:

• No mining, so zero energy waste.

• Instant Finality: Once a block is approved, it is final. There are no chain forks.

• Extremely high transaction throughput (thousands of TPS).

Disadvantages:

• Not Scalable for Public Networks: Because every node must talk to every other node,
the network gets congested if there are too many nodes. It works best with a small
number of known nodes (e.g., 20-50 bank servers).

Page 11 of 18
10. Proof of Elapsed Time (PoET)

Developed by Intel Corporation. Used heavily in Hyperledger Sawtooth.

How it Works:

PoET is designed to emulate Proof of Work without the massive energy consumption. It acts
as a fair, completely randomized lottery system.

• Every node in the network requests a random "Wait Time" (e.g., 10 seconds, 45 seconds,
5 minutes).

• The node goes to "sleep" for that exact amount of time.

• The node that wakes up first (i.e., the one that was randomly assigned the shortest wait
time) wins the right to forge the new block.

• The Catch: How do we know a node isn't cheating by just waking up instantly? PoET
uses Trusted Execution Environments (TEEs), specifically Intel's SGX (Software
Guard Extensions). This hardware-level security guarantees that the random timer was
generated fairly and that the node actually waited the required time.

Advantages:

• Highly energy efficient (nodes literally go to sleep).

• Highly egalitarian: Everyone has an equal chance to win, regardless of how much
money or computing power they have.

Disadvantages:

• Hardware Dependency: It requires specialized hardware (Intel SGX), creating a


reliance on a single corporate manufacturer, which hurts true decentralization.

Page 12 of 18
11. Comparison of Consensus Algorithms

Energy Example Use


Algorithm Core Concept Resource Used
Usage Case

Solve complex math CPU/GPU/ASIC


PoW Very High Bitcoin, Litecoin
puzzles Power

Lock up coins as Native Ethereum 2.0,


PoS Very Low
collateral Cryptocurrency Cardano

Pre-store hash
PoC Hard Drive Space Low Chia Network
solutions

Destroy coins for Burnt


PoB Zero Slimcoin
privileges Cryptocurrency

Message passing/ Network Hyperledger


pBFT Zero
voting Bandwidth Fabric

Randomized sleep Intel SGX (TEE) Hyperledger


PoET Very Low
lottery Timer Sawtooth

MEMORY TRICK: The 6 Consensus Algorithms


We Saw Cats Burning Plastic Eggs
(Work, Stake, Capacity, Burn, pBFT, Elapsed Time)

Page 13 of 18
12. Important Exam Questions

Most Important 2 Marks Questions (Short Answer)

1. Define Consensus in Blockchain.


Ans: Consensus is a fault-tolerant mechanism through which all nodes in a distributed,
decentralized network agree on a single state of the network and validate transactions.

2. What is the main idea behind Proof of Stake (PoS)?


Ans: Instead of using computing power, validators "stake" (lock up) their
cryptocurrency as collateral. The network randomly selects a validator to forge the
next block based on the size of their stake.

3. What hardware is required for Proof of Elapsed Time (PoET)?


Ans: PoET requires a Trusted Execution Environment (TEE), specifically Intel SGX, to
ensure that the randomized wait time is generated and executed fairly.

4. What is "Slashing" in PoS?


Ans: Slashing is a penalty mechanism where a validator loses a portion of their staked
cryptocurrency if they attempt to approve fraudulent transactions or go offline.

5. What is the tolerance limit of malicious nodes in pBFT?


Ans: Practical Byzantine Fault Tolerance (pBFT) can function correctly as long as the
number of malicious or faulty nodes is less than one-third (1/3) of the total nodes.

Most Important 5 Marks Questions (Medium Answer)

1. Explain the Byzantine Generals Problem and its relevance to Blockchain.


Hint: Describe the analogy of generals trying to coordinate an attack with traitors
among them. Relate it to blockchain nodes trying to agree on a valid block while
hackers (traitors) send false data. The consensus algorithm is the solution to this
problem.

2. Differentiate between Proof of Work (PoW) and Proof of Stake (PoS).


Hint: Create a table. Compare them based on Resource used (Computing power vs
Staked coins), Energy Consumption (High vs Low), Equipment needed (ASICs vs
standard computers), and security methodology (Cost of electricity vs Risk of losing
stake).

Page 14 of 18
3. How does Proof of Capacity (PoC) work? What are its pros and cons?
Hint: Explain "plotting" and "mining". It uses hard drive space instead of CPU power to
store pre-computed hashes. Pros: Energy efficient, uses standard hard drives. Cons:
Causes e-waste by wearing out SSDs, hoarding of storage equipment.

Most Important 10 Marks Questions (Long Answer)

1. Discuss the various Consensus Algorithms used in Blockchain networks. Evaluate


PoW, PoS, PoB, and PoET based on their working principles, energy efficiency, and
use cases.
Hint: Provide an introduction to consensus. Detail PoW (math puzzles, high energy,
Bitcoin). Detail PoS (staking coins, low energy, Ethereum). Detail PoB (destroying coins
to get a virtual rig). Detail PoET (Intel SGX lottery sleep timer). Conclude with a
comparison.

2. What is Practical Byzantine Fault Tolerance (pBFT)? How does it achieve


consensus without mining? Why is it suited for Permissioned Blockchains rather
than Public ones?
Hint: Explain the Leader/Replica messaging system. Mention the formula $3f+1$ (less
than 1/3 can be faulty). Explain that since it requires intense message passing between
every single node, it does not scale well to millions of nodes (public chains) but is
incredibly fast for a known group of 50 banks (permissioned chains like Hyperledger).

Page 15 of 18
13. MCQs and Viva Questions

Multiple Choice Questions (MCQs)

1. Which consensus mechanism requires users to send their cryptocurrency to an


unspendable address?
a) Proof of Stake
b) Proof of Capacity
c) Proof of Burn
d) Proof of Elapsed Time

2. In a pBFT network with 10 total nodes, what is the maximum number of malicious
nodes the system can tolerate and still reach consensus?
a) 1
b) 2
c) 3
d) 4

3. Which algorithm was developed by Intel and uses a randomized "sleep" timer?
a) PoS
b) pBFT
c) PoET
d) PoC

4. The penalty of confiscating a validator's locked coins in Proof of Stake for bad
behavior is called:
a) Slashing
b) Burning
c) Forging
d) Plotting

5. Which consensus algorithm relies heavily on available Hard Drive storage space?
a) Proof of Work
b) Proof of Burn
c) Proof of Capacity
d) Proof of Elapsed Time

Page 16 of 18
Viva Voce Questions (Oral Exam)

Q: Professor: "Why did Ethereum move away from Proof of Work to Proof of Stake?"

A: Student: "Ethereum moved to PoS to drastically reduce its energy consumption by over
99%. PoS also allows for higher scalability, enables better economic finality, and lowers the
barrier to entry since users don't need to buy expensive, noisy ASIC mining hardware to
secure the network."

Q: Professor: "In Proof of Elapsed Time (PoET), if the nodes just go to sleep, what stops
a hacker from writing a script to wake their node up instantly and win every block?"

A: Student: "PoET relies on Trusted Execution Environments (TEEs) like Intel's SGX. This is a
secure enclave in the hardware processor itself. The network checks the cryptographic
attestation from the SGX chip to guarantee the node genuinely waited the assigned time.
Software hacks cannot bypass this hardware-level security."

Q: Professor: "What is the 'Nothing at Stake' problem in early Proof of Stake?"

A: Student: "In PoW, if there is a fork, mining on both chains costs double the electricity, so
miners must choose one. In early PoS, voting costs nothing. Validators could vote for both
forks simultaneously to ensure they win regardless of which chain succeeds. Modern PoS
solves this by introducing 'Slashing'—penalizing validators financially if they vote on
multiple conflicting chains."

Page 17 of 18
14. Quick Revision Cheat Sheet

⚡ ONE MINUTE REVISION ⚡

• Byzantine Generals Problem: How do nodes agree when some nodes are traitors/
hackers? Consensus algorithms solve this.

• PoW (Work): Solve math puzzles. Burns electricity. Uses ASICs. Highly secure.
(Bitcoin).

• PoS (Stake): Lock up coins. No electricity waste. Cheaters get "Slashed" (coins
confiscated). (Ethereum).

• PoC (Capacity/Space): Plotting and Farming. Uses Hard Drive space to store
hashes. (Chia).

• PoB (Burn): Destroy coins by sending them to a dead address to get a "virtual
mining rig".

• pBFT (Practical Byzantine Fault Tolerance): No mining. Nodes vote via


messages. Can survive if less than 1/3 nodes are malicious. Used in Private chains.

• PoET (Elapsed Time): Fair lottery. Nodes get a random sleep timer. Shortest sleep
wins. Uses Intel SGX hardware to prevent cheating.

• Native Currency: The reward given to nodes to incentivize honest behavior (e.g.,
BTC, ETH).

Page 18 of 18

You might also like