100% found this document useful (1 vote)
142 views37 pages

Blockchain Architecture Design Unit 2 Easy Notes

The document discusses consensus in blockchain, explaining its importance in ensuring agreement among nodes on data integrity. It outlines various consensus mechanisms, such as Proof of Work and Proof of Stake, and their requirements for effectiveness, including agreement, validity, and fault tolerance. Additionally, it addresses scalability challenges in blockchain and approaches to improve it, such as Layer 2 solutions and sharding, while also distinguishing between permissioned and public blockchains.

Uploaded by

Udit Shrivastava
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
100% found this document useful (1 vote)
142 views37 pages

Blockchain Architecture Design Unit 2 Easy Notes

The document discusses consensus in blockchain, explaining its importance in ensuring agreement among nodes on data integrity. It outlines various consensus mechanisms, such as Proof of Work and Proof of Stake, and their requirements for effectiveness, including agreement, validity, and fault tolerance. Additionally, it addresses scalability challenges in blockchain and approaches to improve it, such as Layer 2 solutions and sharding, while also distinguishing between permissioned and public blockchains.

Uploaded by

Udit Shrivastava
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
You are on page 1/ 37

Blockchain Design (BCS063)

Unit-2 Consensus

Edushine Classes

Follow Us
Download Notes : https://rzp.io/rzp/3GAooFts
https://telegram.me/rrsimtclasses/
Blockchain Design (BCS063)

✅ What is Consensus in Blockchain? (AKTU 2019-20)


Consensus means agreement.
In blockchain, consensus is the process by which all nodes (computers) in the network
agree on the same data—like the correct version of a blockchain.
➡️ Imagine a group of friends keeping a shared notebook. If someone writes a new
entry, all friends must agree it's valid before it's accepted. That’s consensus.
✅ What is a Consensus Mechanism?
A consensus mechanism is a rule or method used by the blockchain to reach agreement
among all the nodes in a secure and fair way.
It helps to:
• Prevent fraud
• Keep all copies of the blockchain the same
• Make sure only valid transactions are added
- - Download Notes : https://rzp.io/rzp/3GAooFts
Blockchain Design (BCS063)

Some popular consensus mechanisms:


i. Proof of Work (PoW) (used in Bitcoin)
ii. Proof of Stake (PoS)
iii. Practical Byzantine Fault Tolerance (PBFT)

✅ Requirements for a Good Consensus Mechanism


To work properly, a consensus mechanism must meet some important requirements:
1. Agreement
All honest nodes must agree on the same block of data (no two nodes should
believe in different versions of the truth).
💡 Example: All nodes must agree that block #100 is the same for everyone.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

2. Termination (Finality)
The consensus process must eventually end and produce a result (you can’t keep waiting
forever).
💡 A block must get confirmed within some time.
3. Validity (Correctness)
Only valid transactions and valid blocks should be accepted. Invalid data should be rejected.
💡 No double spending, no fake transactions allowed.
4. Fault Tolerance
It must work properly even if some nodes fail or act maliciously (this is known as Byzantine
Fault Tolerance).
💡 If 1 or 2 nodes are hacked or offline, the system still works.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

5. Security
It should be resistant to attacks like:
• 51% attack (controlling the majority of the network)
• Sybil attack (creating fake identities).
6. Efficiency
The mechanism should not be too slow or waste too much energy (like PoW does).
7. Scalability
It should be able to handle many users and transactions as the network grows.

- Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

✅ What is Proof of Work (PoW)?


• Proof of Work is a consensus mechanism used in blockchains (like Bitcoin) to decide
who can add the next block to the chain.
• Proof of Work means showing that you did some hard work (computing work) to get
a reward.
👉 It is a method used in blockchain (like in Bitcoin) to:
• Decide who will add the next block (group of transactions)
• Make sure no one cheats
• Keep the system safe and secure
• It requires participants (called miners) to solve a difficult mathematical puzzle using
computing power. The first one to solve it gets to add the block and receive a reward
(like Bitcoin).

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

🔍 Real Life Example:


Imagine a teacher says:
• "Whoever solves this very hard math puzzle first will get a chocolate."
• Everyone starts trying. After some time, one student solves it and shows the answer.
The teacher checks and says, "Yes, correct! Here’s your chocolate."
This is just like Proof of Work.
In Blockchain Terms:
• The teacher is like the blockchain network
• The students are the miners
• The puzzle is a complex math problem
• The chocolate is the reward (like Bitcoin)
• The answer is called a "proof"

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

 How Proof of Work Works in Blockchain (Working)


Let’s say someone sends Bitcoin (A sends 1 BTC to B). Here’s what happens:
1.All transactions go to a block
Think of a block like a digital container where we keep a group of transactions.
2. Miners compete to solve a puzzle
• Each miner has a powerful computer.
• They try to solve a puzzle.
• Puzzle means: Find a special number (called nonce) so that when combined with
the block data and passed through a hash function, it gives a result that starts with
some zeros like: 0000001akd89d7ad...
👉 This is very hard to guess, so they try again and again.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

3. One miner finds the answer first


• That miner sends the solution to everyone.
• Other miners verify if the answer is correct.
4. If correct, block is added to the blockchain
• The new block is added.
• That miner gets a reward in cryptocurrency (like 6.25 BTC in Bitcoin).
5.Process repeats for next block
That’s how the chain keeps growing.

RRSIMT CLASSES WHATSAPP - 9795358008 Follow Us


Blockchain Design (BCS063)

RRSIMT CLASSES WHATSAPP - 9795358008 Follow Us


Blockchain Design (BCS063)

RRSIMT CLASSES WHATSAPP - 9795358008 Follow Us


Blockchain Design (BCS063)

-
Blockchain Design (BCS063)

✅ What is Scalability in Blockchain? (AKTU 2019-20)


Scalability means :
 "How well a blockchain can handle more users, more transactions, and more data
without slowing down or crashing.“
s the number of users grows, the blockchain must stay fast and efficient — this
ability is called scalability.
🚫 Why is Scalability a Problem in Blockchain?
• Blockchain is secure and decentralized, but:
• When more users join,
• And more transactions happen,
• The blockchain often becomes slow and expensive.
This is a big challenge.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

 Role of Consensus Protocols in Scalability


Consensus protocols (like Proof of Work, Proof of Stake) decide:
• Who will add the next block?
• How fast blocks get added?
• How many nodes must verify?
If the protocol is slow, the whole blockchain becomes slow, which affects scalability.
🔍 Important Scalability Aspects of Consensus Protocols:
1. Transaction Throughput
• How many transactions can be processed per second?
• Example: Bitcoin = 7 transactions/sec
Visa = 24,000 transactions/sec

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

2. 🕒 Latency
• How much time does it take to confirm a transaction?
• PoW has high latency, PoS has low latency.
3. 💻 Computational Power
• PoW needs high energy (to solve puzzles), which makes it slow.
• PoS and others use less power → more scalable.
4. 🌐 Network Size
• More nodes = more time to reach agreement.
• Bigger network = more secure, but also slower.
5. ⚖️ Security vs Speed Trade-off
• If we want more speed, sometimes we need to reduce security or decentralization.
• Good consensus protocols balance speed, security, and decentralization.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

✅ Approaches for Improving the Scalability of Blockchain Consensus


Protocols :
🔍 What is the Problem?
Most blockchains (like Bitcoin and Ethereum) have slow transactions and high
fees because their consensus protocols (like Proof of Work) are not scalable.
So researchers and developers have created some approaches to improve
scalability.
✅ Main Approaches to Improve Scalability:
1. Layer 2 Solutions
Layer 2 = A separate layer built on top of the main blockchain.
✅ Examples:
• Lightning Network (for Bitcoin)
• Polygon (for Ethereum)

- Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

🔸 Simple Example:
Socho ki blockchain ek highway hai. Agar traffic zyada ho gaya, to hum ek flyover
(Layer 2) bana dete hain jahan se fast vehicles jaa sakein. Fir sirf final result highway
pe aata hai.
🔸 Fayda:
• Fast transaction
• Kam fees
• Main blockchain pe load kam
2. Sharding
• The blockchain is divided into smaller parts called shards.
• Each shard handles its own data and transactions.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

🔸 Example:
Socho ek school me ek hi teacher 100 students ko padha raha ho (slow hoga). Ab 10
teachers laga diye, har teacher 10-10 students ko padhaye. Speed badh gayi. Yehi
sharding ka idea hai.
🔸 Fayda:
• Saare shards parallel me kaam karte hain → fast processing
• Zyada log use kar sakte hain
3. Changing Consensus Mechanism
Switching from slow protocols like Proof of Work (PoW) to faster ones like:
 Proof of Stake (PoS)
 Delegated Proof of Stake (DPoS)
 Byzantine Fault Tolerance (BFT)

- Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

🔸 Simple Language:
Socho ek kaam karne ka tareeka slow hai (manual typing), to hum uska automatic
system laga dete hain (voice typing) – kaam wahi, speed zyada!
4. Sidechains
A sidechain is a separate blockchain connected to the main blockchain.
✅ How it helps:
 Heavy work is shifted to the sidechain
 Main chain becomes less busy
 Better performance
🔸 Example:
Socho ek school me ek extra classroom bana diya jisme students shift ho gaye. Ab
main class me bheed kam ho gayi. Yehi sidechain ka kaam hai.

- Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

5.Increasing Block Size or Block Time


Block size means: how much data a block can hold
Block time means: how fast new blocks are added
✅ How it helps:
• Bigger or faster blocks = more transactions = better scalability
• Example: Bitcoin Cash increased block size from 1MB to 8MB

🔸 Simple socho:
Ek train ke dabbe (block) me zyada log baith sakein ya train fast chale – to sab
destination pe jaldi pahuchenge.

- - Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

6. Using DAG (Directed Acyclic Graph)


DAG is a new structure used in projects like IOTA and Nano.
It doesn’t use traditional blocks. Every transaction helps confirm previous
transactions.
✅ How it helps:
• No miners needed
• Fast and scalable
• Great for IoT devices
• Traditional blockchain line by line blocks me kaam karta hai. DAG me har
transaction ek dusre ko confirm karti hai, blocks ki zarurat nahi hoti.
• Blockchain me har kaam queue me hota hai (line). DAG me log parallel me
kaam kar rahe hain – jaldi ho raha hai!

- Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

📘 What is a Permissioned Blockchain?


A Permissioned Blockchain is a type of blockchain where only selected participants
(like organizations or trusted users) are allowed to read, write, or validate
transactions.
🔑 It is not open for everyone, unlike public blockchains like Bitcoin or Ethereum.
🔹 Real-Life Example:
Socho ki ek private classroom group bana hai jisme sirf college ke students aur
teachers hi enter kar sakte hain. Bahar wale log allowed nahi hain.
Yehi idea hota hai permissioned blockchain ka.
Example platforms:
o Hyperledger Fabric (by IBM)
o R3 Corda
o Quorum (by J.P. Morgan)

- Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

📌 Characteristics of Permissioned Blockchain:

- Download
DownloadNotes
Notes: :https://rzp.io/rzp/3GAooFts
https://rzp.io/rzp/3GAooFts
Blockchain Design (BCS063)

✅ Advantages of Permissioned Blockchain:


1. 🔐 Better Privacy and Security
Only trusted people are involved → less chance of hacking.
2. ⚡ High Performance and Scalability
Fewer nodes = faster consensus = fast transactions.
3. 🛠️ Customizable
Rules, roles, and access can be adjusted as per business need.
4. 📊 Regulatory Friendly
Easier to comply with government and company regulations.
5. 📛 Known Participants
No anonymity. Easier to track and control bad actions.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

❌ Disadvantages of Permissioned Blockchain:


1. 🏛️ Less Decentralization
Controlled by few parties → trust needed in them.
2. 🚪 No Open Participation
Not everyone can join, limits innovation and community support.
3. 👨💼 Central Authority Risk
If central organization fails or misuses power, system can suffer.
4. 🔍 Less Transparency
Not everyone can see the data, unlike public blockchains.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

 Difference between Public (Permissionless) Blockchain and permissioned


Blockchain :

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

🎯 Design Goals of Permissioned Blockchain


Permissioned blockchain ka design is tarah se banaya jata hai ki wo secure,
fast, reliable, aur private ho — especially for organizations, businesses, or
government systems.
Here is key Goals Given below :
1. 🔐 Access Control
 Goal:
Only selected participants (authorized users) can read/write/validate
data.
 Why:
To prevent unauthorized access and keep data safe.
Example:
Bank employees can access transaction data, but outsiders cannot.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

2. 👨💼 Identity Management
 Goal:
All users are identified and verified before joining the network.
 Why:
No anonymous users = easy to track actions = more trust.
Example:
In supply chain, each company has a verified identity on the blockchain.
3. ⚡ High Performance and Scalability
 Goal:
Achieve fast transactions and good scalability with few trusted nodes.
 Why:
In private networks, you don’t need to wait for thousands of users to
approve.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

Example:
Faster settlement of payments between banks using blockchain.
4. 🛡️ Data Privacy
 Goal:
Ensure confidentiality of data among selected participants.
 Why:
Businesses don't want to expose sensitive data to outsiders.
Example:
Patient data in a healthcare blockchain is visible only to doctors and hospitals.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

5. 🏛️ Governance and Compliance


 Goal:
Allow organizations to control, manage, and monitor the blockchain.
 Why:
So that the system works according to legal, business, and regulatory rules.
Example:
In a government blockchain, permissions and policies are set by the authority.
 6. 🔄 Efficient Consensus Mechanism
 Goal:
Use lightweight and fast consensus protocols instead of heavy ones like Proof of
Work.
 Why:
In private blockchains, there is no need for energy-hungry mining.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

Example:
Use of Practical Byzantine Fault Tolerance (PBFT) or Raft.
7. ️ Customizability and Flexibility
 Goal:
Allow changes in rules, roles, and smart contracts as per business need.
 Why:
Organizations need control to update policies when required.
Example:
Role-based access: Manager can approve, employee can only view.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

✅ Consensus Protocols in Permissioned Blockchain


Permissioned blockchains mein public mining jaise heavy consensus ki zarurat nahi
hoti. Yahaan few known members hotay hain jo trustworthy hote hain, isliye
lightweight aur fast protocols use kiye jaate hain.
1. Practical Byzantine Fault Tolerance (PBFT)
Nodes (participants) communicate with each other and vote to agree on the next
block.
Even if some nodes try to cheat, the rest can detect and ignore them.
 Used when:
Participants are known and limited, like in banks or government networks.
 Pros:
• Fast and energy-efficient
• Works even if few nodes fail or act maliciously

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

 Cons:
Communication becomes slow if number of nodes becomes large
Example:
Digital currency systems in banks using blockchain.
🔸 Simple Example:
Socho ek classroom mein 10 students hain. Teacher nahi aayi hai,
lekin students milke decide karte hain ki kaunsa topic padhein. Agar
2-3 students jhooth bol bhi dein, baaki 7-8 log agar agree kar lein, to
woh topic final ho jata hai.
Yahi hai PBFT — jisme group milke vote karta hai aur majority ka
decision final hota hai.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

2. 👥 Raft Consensus Algorithm


How it works:
One leader is selected, and that leader decides the next block.
Other nodes just follow and approve it.
Used when:
There is trust between participants and less need for complex voting.
🔸 Simple Example:
Socho ek cricket team hai. Har baar ek captain hota hai. Captain hi batata hai kis order
mein batting karni hai. Baaki players uski baat maante hain. Agar captain hurt ho jaye,
to naye captain ka chayan hota hai.
✅ Use: Jab ek leader decide kare aur baaki follow karein.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

3. 🎯 Proof of Authority (PoA)


How it works:
Only selected and verified nodes (called authorities) can validate blocks.
No mining, no energy usage.
Used when:
Participants are trusted and fixed — like government or organization employees.
🔸 Simple Example:
Socho sirf principal aur vice principal hi school mein decision le sakte hain. Unka
decision sabko maana padta hai. Yeh dono log trusted hain, isliye koi voting ya jhagda
nahi hota.
✅ Use: Jab fixed authorities ho jo decision le sakein quickly.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

4. 🗳️ Istanbul Byzantine Fault Tolerance (IBFT)


How it works:
A fixed group of validators take turns proposing and validating blocks.
Block is added only if majority agrees.
Used when:
High security and instant finality (block cannot be reversed) is needed.
🔸 Simple Example:
Socho ek panel of judges hai jo ek competition judge kar raha hai. Har baar ek judge
proposal deta hai (jaise winner ka naam), baaki vote karte hain. Agar majority agree
karein to decision lock ho jata hai.
✅ Use: Jab few known log milke decision lein with high security.

Download Notes : https://rzp.io/rzp/3GAooFts


Blockchain Design (BCS063)

Thank You…

- Download Notes : https://rzp.io/rzp/ DtpXaWbv

You might also like