2 marks
------------------------------
1. What is Consensus Mechanism?
A consensus mechanism is a protocol used in blockchain networks to achieve agreement among
nodes on the validity of transactions, ensuring security and decentralization. Examples include Proof
of Work (PoW) and Proof of Stake (PoS).
2. State the Proof-of-Burn Consensus Mechanism.
Proof-of-Burn (PoB) is a consensus mechanism where miners "burn" (permanently destroy)
cryptocurrency tokens to gain mining rights. Burning tokens reduces supply and grants miners a
chance to validate blocks based on the amount burned.
3. What is Proof of Elapsed Time (PoET)?
Proof of Elapsed Time (PoET) is a consensus mechanism where nodes wait for a randomly assigned
time period before validating a block. The first node to complete the waiting time gets to create the
next block, ensuring fairness and energy efficiency.
4. Define Hyperledger Fabric in Brief.
Hyperledger Fabric is an open-source, permissioned blockchain framework for enterprise use. It
supports modular architecture, smart contracts (chaincode), and private transactions, making it
suitable for business applications requiring privacy and scalability.
5. What is the Main Purpose of Ethereum?
The main purpose of Ethereum is to serve as a decentralized platform for executing smart contracts
and building decentralized applications (DApps), enabling programmable transactions without
intermediaries.
6. Differentiate Proof of Work and Proof of Elapsed Time.
| Proof of Work (PoW) | Proof of Elapsed Time (PoET) |
|-------------------------|----------------------------------|
| Uses computational puzzles to validate blocks. | Uses a random waiting time for block validation. |
| Energy-intensive (e.g., Bitcoin). | Energy-efficient (used in permissioned blockchains). |
| Requires high mining power. | Requires trusted execution environments (TEE). |
7. What is Hashcash PoW?
Hashcash PoW is a proof-of-work system used to prevent email spam and denial-of-service attacks. It
was later adapted by Bitcoin, requiring miners to solve complex cryptographic puzzles to validate
transactions and create new blocks.
8. List Out the Features of Ethereum.
- Supports smart contracts and DApps.
- Uses Ethereum Virtual Machine (EVM) for execution.
- Native cryptocurrency: Ether (ETH).
- Enables decentralized finance (DeFi) & NFTs.
- Transitioning from PoW to PoS (Ethereum 2.0).
9. Define Solidity.
Solidity is a high-level, statically typed programming language designed for writing smart contracts
on Ethereum and other blockchain platforms. It is influenced by JavaScript, C++, and Python.
---------------------------------------------------------------------------------------------------------------------
PART B & C
6b(set-1) & 8b(set-2)
Bitcoin Miner: Explanation and Technical Working (15 Marks)
Bitcoin mining is the process by which new Bitcoins are created, and transactions are verified and
added to the blockchain. Miners play a crucial role in maintaining the security and decentralization of
the Bitcoin network.
1. What is a Bitcoin Miner?
A Bitcoin miner is a participant in the Bitcoin network who:
- Solves complex cryptographic puzzles (Proof of Work - PoW).
- Validates transactions and groups them into blocks.
- Secures the blockchain against attacks (e.g., double-spending).
- Earns rewards (newly minted BTC + transaction fees).
Miners can be:
- Individuals (using GPUs/ASICs).
- Mining pools (collaborative groups sharing rewards).
- Industrial mining farms (large-scale operations).
2. How Bitcoin Mining Works (Technical Level)
Step 1: Transaction Collection & Verification
- Miners collect pending transactions from the mempool (memory pool).
- They verify each transaction:
- Checks digital signatures.
- Ensures no double-spending.
- Validates inputs/outputs.
Step 2: Creating a Candidate Block
- The miner assembles verified transactions into a block template .
- The block includes:
- Block header (metadata).
- List of transactions (usually 1,000–3,000 per block).
- Coinbase transaction (miner’s reward).
Step 3: Solving the Proof-of-Work Puzzle (Hashing)
- Miners compete to find a nonce (a random number) that, when hashed with the block data,
produces a hash below the target difficulty .
- The hash function used is SHA-256 (double hashed).
- The mining process involves:
- Incremental nonce trials (0, 1, 2, ...).
- Adjusting the Merkle root if transactions change.
- Repeating until a valid hash is found .
Example of Mining Difficulty:
- Bitcoin adjusts difficulty every 2016 blocks (~2 weeks).
- A valid hash must start with a certain number of zeros (e.g., `0000000000000000000a1b2c3d...`).
Step 4: Broadcasting the Solved Block
- The first miner to find a valid nonce broadcasts the block to the network.
- Other nodes verify the hash and transactions.
- If accepted, the block is added to the blockchain.
Step 5: Block Reward & Incentives
- The successful miner receives:
- Block subsidy (currently 3.125 BTC , halves every 210,000 blocks).
- Transaction fees (paid by users for faster processing).
- If two miners solve a block simultaneously, the network follows the longest chain rule .
3. Mining Hardware & Energy Consumption
Evolution of Mining Hardware:
1. CPU Mining (2009-2010) – Slow, inefficient.
2. GPU Mining (2010-2013) – Faster, but power-hungry.
3. FPGA Mining (2013) – More efficient than GPUs.
4. ASIC Mining (2013-Present) – Specialized chips (e.g., Bitmain Antminer).
Energy Consumption Concerns:
- Bitcoin mining consumes ~150 TWh/year (comparable to some countries).
- Solutions: Renewable energy, more efficient ASICs, alternative consensus (PoS).
4. Security & Attack Resistance
- 51% Attack Risk: If a miner controls >50% hash rate, they can:
- Reverse transactions.
- Double-spend coins.
- Censor transactions.
- Defenses:
- High decentralization (no single entity dominates).
- Economic disincentives (attack costs > rewards).
5. Conclusion (1 Mark)
Bitcoin mining is a computationally intensive, decentralized process that ensures blockchain
security, validates transactions, and introduces new Bitcoins into circulation. While energy-intensive,
it remains the backbone of Bitcoin’s trustless system.
----------------------------------------------------------------------------------------------------------------------------
8a(set-1) & 7b(set-2)
Ethereum Virtual Machine (EVM) – Detailed Explanation (15 Marks)
The Ethereum Virtual Machine (EVM) is the runtime environment for executing smart contracts on
the Ethereum blockchain. It is a Turing-complete , sandboxed virtual machine that ensures
decentralized, deterministic, and secure execution of code across all Ethereum nodes.
1. Overview of EVM (2 Marks)
- Purpose: Executes smart contracts in a decentralized manner.
- Key Features:
- Turing-complete (can perform any computation given enough resources).
- Isolated environment (prevents attacks on the host system).
- Deterministic execution (same input → same output on all nodes).
- Gas-based execution (prevents infinite loops & spam).
2. EVM Architecture & Key Components (5 Marks)
(A) Stack-Based Machine
- The EVM uses a last-in-first-out (LIFO) stack with a 1024-item depth limit .
- Operands are pushed/popped for computations (e.g., arithmetic, logic).
(B) Memory & Storage
1. Memory (Volatile, Short-term)
- Temporary data storage (erased between transactions).
- Expands dynamically (paid via gas).
2. Storage (Persistent, Long-term)
- Permanently stored on-chain (costs more gas).
- Accessed via smart contract state variables.
(C) Execution Environment
- Smart Contract Bytecode: Compiled from high-level languages (Solidity, Vyper).
- Opcode Instructions: Low-level commands (e.g., `ADD`, `JUMP`, `SSTORE`).
(D) Gas Mechanism
- Every operation consumes gas (e.g., `ADD` = 3 gas, `SSTORE` = 20,000 gas).
- Prevents infinite loops & denial-of-service (DoS) attacks.
- Gas price (Gwei) set by users; miners prioritize high-fee transactions.
(E) Accounts in EVM
1. Externally Owned Accounts (EOAs)
- Controlled by private keys (users).
- Can send transactions but cannot execute code .
2. Contract Accounts
- No private key; controlled by code.
- Can hold ETH, execute functions, and call other contracts.
3. Smart Contract Execution Flow (4 Marks)
Step 1: Deployment
1. A developer writes a smart contract in Solidity/Vyper .
2. The code is compiled into EVM bytecode .
3. A transaction deploys the bytecode to the blockchain (creates a contract account ).
Step 2: Transaction Execution
1. A user sends a transaction to the contract address.
2. The EVM:
- Loads contract bytecode.
- Initializes memory & storage .
- Executes instructions step-by-step.
3. Gas is deducted for each operation.
4. If gas runs out → reverts (no state changes).
Step 3: State Update
- Successful execution updates the world state (storage).
- Failed execution refunds unused gas but charges for computation done .
4. Security & Limitations of EVM (2 Marks)
Security Features:
✔ Sandboxed Execution (No access to host system).
✔ Gas Limits (Prevents infinite loops).
✔ Deterministic Execution (No randomness unless via oracles).
Limitations:
❌ Gas Costs (Complex computations are expensive).
❌ No Parallel Execution (Single-threaded EVM).
❌ Reentrancy Attacks (Exploited in DAO hack).
5. EVM vs. Traditional VMs (2 Marks)
| Feature | EVM | Traditional VM (e.g., JVM) |
|------------------|----------------------------|-------------------------------|
| Environment | Decentralized blockchain | Centralized server |
| Execution | Gas-based, deterministic | Free, non-deterministic |
| Security | Sandboxed, immutable | Depends on OS permissions |
| Use Case | Smart contracts | General-purpose computing |
6. Conclusion (1 Mark)
The EVM is the core of Ethereum’s smart contract execution, enabling trustless, decentralized
applications (DApps) . While powerful, it faces challenges like scalability (addressed in Ethereum
2.0) and gas costs .
------------------------------------------------------------------------------------------------------------------------
7a(set-1)
Describe the architecture and key components of Hyperledger Fabric
Answer:
Hyperledger Fabric is a permissioned blockchain platform designed for enterprise use. It allows
organizations to create and manage their own blockchain networks with greater privacy, scalability,
and security compared to public blockchains like Bitcoin or Ethereum.
Architecture and Key Components:
1. Membership Service Provider (MSP):
o It manages user identities and ensures only authorized participants can join the
network.
o Provides certificates and authentication.
2. Peer Nodes:
o They maintain the ledger and run chaincode (smart contracts).
o Types of Peers:
Endorsing Peer: Simulates and endorses transaction proposals.
Committing Peer: Commits transactions to the ledger.
3. Orderer (Ordering Service):
o Orders the transactions into blocks and delivers them to peers.
o Ensures the sequence of transactions across the network.
o Supports consensus mechanisms like Solo, Kafka, and Raft.
4. Ledger:
o Consists of two parts:
World State: A database storing the latest values of all assets.
Blockchain: An immutable log of all transaction records.
5. Chaincode (Smart Contracts):
o Programs that define the business logic.
o They are installed on peers and invoked by applications to modify the ledger.
6. Channel:
o Private communication pathways between specific network members.
o Each channel has its own ledger, ensuring confidentiality.
7. Client Application:
o Interfaces used by users to interact with the blockchain.
o They create transaction proposals and send them to endorsing peers.
8. Consensus:
o Fabric separates transaction endorsement (by peers) and transaction ordering (by
orderers), which provides flexibility.
o Different consensus protocols can be plugged in depending on network needs.
Transaction Flow in Hyperledger Fabric:
1. Client sends a transaction proposal to endorsing peers.
2. Endorsers simulate the transaction and sign a response.
3. Client collects endorsements and sends to the ordering service.
4. Ordering service batches transactions into blocks and broadcasts to committing peers.
5. Peers validate and commit the transactions to the ledger.
Summary:
Hyperledger Fabric is highly modular, supports pluggable components, and is designed for industrial
blockchain applications where privacy, scalability, and flexibility are critical.
+----------------------+
| Client Application |
+----------+------------+
+----------------------+
| Membership Service |
| Provider (MSP) |
+----------+------------+
|
+---------------+----------------+
| |
v v
+--------+ +--------+
| Endorsing Peer(s) | Committing Peer(s)
| (Simulate & endorse) | (Validate & commit)
+--------+ +--------+
| |
+------------+ +-----------------+
| |
v v
+----------------+
| Ledger |
| (Blockchain + |
| World State) |
+----------------+
+-------------------+
| Ordering Service |
| (Order transactions|
| into blocks) |
+-------------------+
----------------------------------------------------------------------------------------------------------------------------
6A(set-2)
a) i) Explain Proof of Work in detail. (6marks)
ii) List the Attacks on PoW. (7marks)
a) i) Explain Proof of Work (PoW) in Detail (6 marks)
Proof of Work (PoW) is a consensus mechanism used in blockchain networks to validate
transactions and secure the network by requiring miners to solve complex computational puzzles. It
ensures decentralization and prevents double-spending.
Key Components of PoW:
1. Mining Process:
- Miners compete to solve a cryptographic puzzle (hash computation).
- The puzzle involves finding a nonce (a random number) that, when hashed with transaction data,
produces a hash below a target difficulty level.
- Example: Bitcoin uses SHA-256 for hashing.
2. Block Validation & Addition:
- The first miner to solve the puzzle broadcasts the block to the network.
- Other nodes verify the solution before adding the block to the blockchain.
- The winning miner receives a block reward (newly minted coins + transaction fees).
3. Difficulty Adjustment:
- The network adjusts puzzle difficulty periodically to maintain a consistent block time (e.g., Bitcoin
targets 10 minutes per block ).
- Ensures stability despite changes in mining power.
4. Security & Decentralization:
- PoW makes attacks expensive (high energy & hardware costs).
- Requires majority control (51% attack) to manipulate the blockchain.
Advantages of PoW:
✔ Highly secure against attacks.
✔ Decentralized (no single entity controls mining).
✔ Proven reliability (used by Bitcoin, Ethereum 1.0).
Disadvantages of PoW:
❌ High energy consumption (environmental concerns).
❌ Slow transaction speeds (scalability issues).
❌ Requires expensive hardware (ASICs, GPUs).
a) ii) List the Attacks on PoW (7 marks)
PoW is secure but still vulnerable to certain attacks:
1. 51% Attack (Majority Attack)
- If a single miner/group controls >50% of the network’s hash rate, they can:
- Double-spend coins (reverse transactions).
- Exclude or modify transactions .
- Example: Bitcoin Gold (2018) suffered a 51% attack.
2. Selfish Mining Attack
- A miner keeps newly mined blocks private to create a longer private chain.
- Later releases it to invalidate honest miners' blocks, gaining unfair rewards.
3. Sybil Attack
- An attacker creates multiple fake nodes to disrupt consensus.
- Less effective in PoW due to high computational costs.
4. Eclipse Attack
- Isolates a node by flooding it with fake connections, controlling its view of the blockchain.
- Can lead to double-spending or fake transactions.
5. Nothing-at-Stake Attack
- Miners can theoretically mine multiple chains without penalty (though PoW makes this costly).
6. Finney Attack
- A miner pre-mines a block but delays broadcasting it, allowing double-spending in a small
window.
7. Timejacking Attack
- Manipulates a node’s timestamp to trick it into accepting an alternative blockchain.
Mitigations Against PoW Attacks:
- Higher network hash rate (makes 51% attacks expensive).
- Checkpointing (trusted blocks prevent chain reorganization).
- Strong peer-to-peer validation (prevents Sybil/Eclipse attacks).
These attacks highlight the trade-offs in PoW: while highly secure, it is not immune to manipulation.