Q1]
a) What is Blockchain?
Defini on:
Blockchain is a distributed, decentralized digital ledger that records transac ons in a secure,
transparent, and immutable manner.
Key Features:
Decentraliza on – No central authority controls the network.
Immutability – Once data is added, it cannot be altered.
Transparency – Transac ons are visible to par cipants.
Security – Uses cryptographic hashing and digital signatures.
Working:
Transac ons are grouped into blocks.
Each block contains the hash of the previous block.
Blocks are linked together forming a chain → Blockchain.
b) Types of Blockchain
1. Public Blockchain
Open to everyone.
Anyone can join, read, write, and validate transac ons.
Highly decentralized.
Example: Bitcoin, Ethereum
Advantage: High transparency
Disadvantage: Slower transac on speed
2. Private Blockchain
Controlled by a single organiza on.
Permission required to join.
Faster than public blockchain.
Example: Hyperledger
Advantage: Be er performance
Disadvantage: Less decentraliza on
3. Consor um (Federated) Blockchain
Controlled by a group of organiza ons.
Par ally decentralized.
Used in banking and enterprise systems.
Advantage: Balanced control and efficiency
Disadvantage: Requires coordina on among members
c) Architecture of Blockchain
1. Block Structure
Each block contains:
Block Header
Previous Block Hash
Merkle Root
Timestamp
Nonce
Block Body
List of transac ons
2. Chain Structure
Block 1 → Block 2 → Block 3 → Block 4
|||
Hash Hash Hash
Each block stores the previous block’s hash, ensuring tamper detec on.
3. Layers of Blockchain Architecture
Data Layer – Blocks, transac ons, Merkle tree
Network Layer – Peer-to-peer communica on
Consensus Layer – PoW, PoS, etc.
Applica on Layer – Smart contracts & DApps
Conclusion
Blockchain is a decentralized digital ledger technology that ensures secure, transparent, and
immutable transac on recording. It can be public, private, or consor um-based, and its
architecture consists of blocks linked using cryptographic hashes and validated using consensus
mechanisms.
Q2] Explain Centralized Network, Decentralized Network and Distributed Network
1. Centralized Network
Defini on:
A centralized network is a network in which all nodes are connected to a single central authority
or server that controls the en re system.
Structure:
All communica on passes through the central node.
Client
|
Client — Server — Client
|
Client
Characteris cs:
Single point of control
Easy management
Single point of failure
Example: Banking system, tradi onal client-server architecture.
2. Decentralized Network
Defini on:
A decentralized network is a network where control is distributed among mul ple central
nodes, but not completely equal.
Structure:
Mul ple hubs manage different groups of nodes.
Hub1 Hub2
/\/\
NNNN
Characteris cs:
Reduced dependency on one node
Be er fault tolerance than centralized
Par al distribu on of control
Example: Consor um-based systems, mul -branch organiza ons.
3. Distributed Network
Defini on:
A distributed network is a network in which all nodes are equal and there is no central
authority.
Structure:
Each node is connected to mul ple other nodes.
N —— N —— N
|\|/|
N —— N —— N
Characteris cs:
No single point of failure
High fault tolerance
Fully peer-to-peer
Example: Peer-to-peer systems like BitTorrent.
Conclusion
Centralized → One central authority
Decentralized → Mul ple controlling nodes
Distributed → No central authority, fully peer-to-peer
Q3]
a) What is Consensus?
Defini on:
Consensus is the process by which all nodes in a distributed network agree on a single version
of truth, i.e., the validity of transac ons and the state of the ledger.
In distributed systems, since there is no central authority, consensus ensures that:
All honest nodes agree on the same data.
Invalid or malicious transac ons are rejected.
Double spending is prevented.
Need for Consensus:
To maintain trust in a decentralized system.
To ensure data consistency across nodes.
To achieve fault tolerance (handle malicious or failed nodes).
b) Types of Consensus Mechanisms
1. Proof of Work (PoW)
Nodes (miners) solve complex mathema cal puzzles.
The first to solve the puzzle adds the block.
Requires high computa onal power.
Example: Bitcoin
Advantage: High security
Disadvantage: High energy consump on
2. Proof of Stake (PoS)
Validators are selected based on the amount of cryptocurrency they stake.
No heavy computa on required.
Example: Ethereum
Advantage: Energy efficient
Disadvantage: Wealth concentra on risk
3. Delegated Proof of Stake (DPoS)
Token holders vote for delegates.
Selected delegates validate transac ons.
Advantage: Faster transac ons
Disadvantage: Less decentraliza on
4. Prac cal Byzan ne Fault Tolerance (PBFT)
Nodes vote to reach agreement.
Works well in permissioned networks.
Requires 2/3 majority agreement.
Advantage: Fast confirma on
Disadvantage: Not scalable for large networks
Conclusion
Consensus mechanisms ensure agreement among distributed nodes. Different mechanisms like
PoW, PoS, DPoS, and PBFT are used depending on security, scalability, and energy requirements.
Q4] Bitcoin
a) Process of Bitcoin Mining
Defini on:
Bitcoin mining is the process of verifying transac ons and adding them to the blockchain by
solving a cryptographic puzzle.
Steps in Bitcoin Mining:
Transac on Collec on
Miners collect pending transac ons from the network.
Block Crea on
Transac ons are grouped into a block.
Hash Calcula on (Proof of Work)
Miner finds a nonce such that the block hash sa sfies the difficulty target.
Hash func on used: SHA-256.
Block Valida on
Other nodes verify the solu on.
Block Addi on & Reward
Valid block is added to blockchain.
Miner receives Bitcoin reward.
Example: Bitcoin
b) Genesis Block
Defini on:
The Genesis Block is the first block of the Bitcoin blockchain.
Key Points:
Created by Satoshi Nakamoto in 2009.
Also called Block 0.
It does not have a previous block hash.
It marks the beginning of the blockchain.
c) Merkle Tree
Defini on:
A Merkle Tree is a binary hash tree used to organize and verify transac ons efficiently.
Working:
Each transac on is hashed.
Pairs of transac on hashes are combined and hashed again.
Process con nues un l a single top hash is obtained.
Diagram (Structure):
Merkle Root
/ \
Hash12 Hash34
/ \ / \
Tx1 Tx2 Tx3 Tx4
Advantage:
Efficient and secure transac on verifica on.
Reduces data required for verifica on.
d) Merkle Root
Defini on:
Merkle Root is the top hash of the Merkle Tree.
Key Points:
Stored in the block header.
Represents all transac ons in that block.
If any transac on changes, the Merkle Root changes.
Conclusion
Bitcoin uses mining (Proof of Work) to validate transac ons. The Genesis Block started the
blockchain. Merkle Tree organizes transac ons securely, and the Merkle Root ensures data
integrity within each block.
Q5]
a) UTXO Model (Unspent Transac on Output Model)
Defini on:
UTXO model is a transac on model where cryptocurrency transac ons consume previous
outputs and create new outputs.
Working:
Every transac on has:
Inputs → Reference to previous unspent outputs
Outputs → New UTXOs created
A user’s balance = Sum of all unspent outputs.
Key Points:
No account balance stored directly.
Each UTXO can be spent only once.
Prevents double spending.
Example: Bitcoin
b) Smart Contracts
Defini on:
A Smart Contract is a self-execu ng program stored on a blockchain that runs automa cally
when predefined condi ons are met.
Features:
Automa c execu on
Immutable once deployed
Transparent
No intermediary required
Example Use Cases:
Digital payments
Vo ng systems
Supply chain management
Pla orm Example: Ethereum
c) Ethereum Structure
Ethereum consists of the following components:
1. Accounts
Externally Owned Accounts (EOA) → Controlled by users
Contract Accounts → Controlled by smart contracts
2. Transac ons
Used to transfer Ether or interact with smart contracts.
3. Gas
Fee required to execute transac ons.
Prevents misuse of network resources.
4. Blocks
Store transac ons and smart contract execu ons.
d) EVM (Ethereum Virtual Machine)
Defini on:
EVM is the run me environment that executes smart contracts in Ethereum.
Func ons:
Executes contract code
Maintains network state
Ensures secure and isolated execu on
Key Points:
Turing-complete virtual machine
Runs the same code on all nodes
Ensures consensus in contract execu on
Conclusion
UTXO Model manages transac ons securely.
Smart Contracts automate agreements.
Ethereum Structure includes accounts, gas, and transac ons.
EVM executes smart contracts across the network.
Q6] Security & Distributed System Problems
a) Byzan ne Generals Problem
Defini on:
The Byzan ne Generals Problem is a problem in distributed systems that describes the difficulty
of achieving agreement among distributed nodes when some nodes may be malicious or
unreliable.
Explana on:
Several generals must agree on a common plan (a ack or retreat).
Some generals may be traitors and send false informa on.
The system must ensure:
All loyal generals agree on the same decision.
A small number of traitors cannot break the agreement.
Importance:
Forms the founda on of modern consensus algorithms.
Explains trust issues in decentralized networks.
b) Byzan ne Fault Tolerance (BFT)
Defini on:
Byzan ne Fault Tolerance is the ability of a distributed system to func on correctly even if some
nodes behave maliciously or send incorrect informa on.
Key Condi on:
To tolerate f faulty nodes, the system requires at least:
n ≥ 3f + 1
Where:
n = total nodes
f = faulty nodes
At least 2/3 majority agreement is required.
Features:
Handles malicious behavior.
Ensures agreement among honest nodes.
Used in permissioned blockchains.
c) Double Spending Problem
Defini on:
Double spending is a problem in digital currency where the same digital coin is spent more than
once.
Why It Happens:
Digital data can be copied easily.
Without a central authority, verifica on is challenging.
Solu on in Blockchain:
Transac ons are verified through consensus.
Once a block is confirmed, transac ons become immutable.
Prevented in systems like Bitcoin using Proof of Work.
Conclusion
Byzan ne Generals Problem explains trust issues in distributed systems.
BFT ensures system reliability despite malicious nodes.
Double Spending is prevented using blockchain consensus mechanisms.
Q7] Transac on Structure
Defini on:
A blockchain transac on is a data structure that represents the transfer of value between
par cipants in the network.
In cryptocurrencies, a transac on records the movement of digital assets from one user to
another.
Basic Components of a Transac on
1. Transac on ID (TxID)
Unique iden fier of the transac on.
Generated using a cryptographic hash func on.
2. Inputs
Reference to previous transac on outputs.
Proves the sender has sufficient balance.
Contains:
Previous Transac on Hash
Output Index
Digital Signature
3. Outputs
Specifies:
Recipient’s address
Amount to be transferred
Creates new UTXOs (Unspent Transac on Outputs).
4. Digital Signature
Created using sender’s private key.
Ensures:
Authen ca on
Integrity
Non-repudia on
Transac on Structure Diagram
Transac on
|
|-- TxID
|-- Inputs → Previous Tx Reference + Signature
|-- Outputs → Receiver Address + Amount
Working of a Transac on
Sender creates transac on.
Signs it with private key.
Broadcasts to network.
Nodes verify signature and balance.
Added to block a er consensus.
Example: Used in cryptocurrency systems like Bitcoin.
Conclusion
A transac on structure consists of inputs, outputs, transac on ID, and digital signatures. It
ensures secure and verifiable transfer of digital assets in a blockchain network.