BLOCKCHAIN Mumbai University 2022 Question Paper

Q.1. Define Blockchain? Compare Different Types of blockchain.
Ans :- What is Blockchain?
Blockchain is a decentralized digital ledger that securely records transactions in a tamper-proof chain of blocks. It ensures transparency, security, and trust without needing a central authority.
Example: Bitcoin uses blockchain to record transactions, making them secure and unchangeable.
[ Blockchain is like a digital notebook that keeps records of transactions in a secure and unchangeable way. Imagine writing in a diary where you cannot erase or change anything once it is written. This makes blockchain a trusted way to store and share information without needing a middleman like a bank. It is widely used for cryptocurrencies like Bitcoin, but it can also be used for many other things, such as tracking supply chains, secure voting, and digital contracts. ]
Types of Blockchain and Their Differences
There are four main types of blockchain, each designed for different purposes:
- Public Blockchain
- Open for everyone to join and use.
- Anyone can add and verify transactions.
- Example: Bitcoin, Ethereum.
- Use Case: Buying and selling cryptocurrency, secure global transactions.
- Private Blockchain
- Restricted access, only selected users can join.
- Controlled by a single organization.
- Example: Hyperledger, Corda.
- Use Case: Used by businesses for secure internal record-keeping.
- Consortium Blockchain
- A mix of public and private blockchains.
- Multiple organizations share control.
- Example: R3 Corda, Quorum.
- Use Case: Used in banking and supply chain management.
- Hybrid Blockchain (Optional)
- Combines the best features of public and private blockchains.
- Some data is public, while sensitive data remains private.
- Example: Dragonchain.
- Use Case: Used in healthcare and government systems for security and transparency.
Q.2 what is a smart contract? how crowdfunding platform can be managed using smart contarct?
What is a Smart Contract?
A smart contract is a self-executing digital agreement written in code and stored on a blockchain. It automatically enforces terms and conditions when predefined conditions are met, eliminating the need for intermediaries. These contracts ensure transparency, security, and efficiency in various transactions.
Example:
Imagine a vending machine. You insert money, select a product, and the machine automatically delivers it—no human intervention needed. Similarly, smart contracts work by executing agreements without requiring third parties.
Also Read : Understanding Smart Contracts in Blockchain 2025
How Can a Crowdfunding Platform Be Managed Using Smart Contracts?
Crowdfunding platforms, like Kickstarter or GoFundMe, can be made more secure and transparent using smart contracts on a blockchain. Here’s how:
- Automatic Fund Collection:
- A smart contract is created with a funding goal and deadline.
- Contributors send funds (cryptocurrency) to the contract’s address.
- Fund Release Based on Conditions:
- If the goal is met by the deadline, the funds are automatically sent to the project owner.
- If the goal is not reached, the contract refunds contributors without any manual intervention.
- Eliminates Middlemen:
- Traditional crowdfunding platforms charge fees, but blockchain-based smart contracts remove the need for a central authority, reducing costs.
- Enhanced Security & Trust:
- The contract’s code is publicly visible, ensuring fairness.
- No one can alter or manipulate the contract once deployed.
- Real-Time Transparency:
- Contributors can track how much has been raised in real time.
- Funds cannot be misused as they are locked in the contract.
Example:
A startup launches a blockchain-based crowdfunding campaign with a $50,000 goal. Investors send funds via a smart contract. If the amount reaches $50,000 within the deadline, the smart contract releases funds to the startup. If not, all investors receive an automatic refund, ensuring fairness.
Q. 3 What is Backup in Practical Byzantine Fault Tolerance (PBFT) algorithm?
In the Practical Byzantine Fault Tolerance (PBFT) algorithm, a backup is a replica node that helps in achieving consensus and maintaining the reliability of the system. The backup nodes work alongside the primary node to validate and confirm transactions while ensuring that the system remains operational even if some nodes fail or act maliciously.
Here are five key points explaining the role of backups in PBFT:
- Supporting Consensus Process:
- Backup nodes participate in the consensus protocol by verifying transactions and relaying messages.
- They assist the primary node in processing client requests efficiently.
- Failure Recovery:
- If the primary node becomes faulty or unresponsive, a backup node takes over as the new primary.
- This ensures system continuity and prevents disruptions.
- Preventing Byzantine Faults:
- PBFT can tolerate up to (n-1)/3 malicious nodes in a system with n total nodes.
- Backup nodes help detect inconsistencies and prevent fraudulent activities.
- Maintaining Redundancy:
- Backups store a copy of the ledger and transaction history.
- This redundancy helps in quick data recovery and system reliability.
- Voting and Agreement:
- In each consensus round, backup nodes validate transactions and vote on the correct state of the system.
- Their agreement ensures that only legitimate transactions are added to the blockchain.
Example:
Imagine a distributed banking system using PBFT. If the main transaction processor (primary node) crashes, a backup node seamlessly takes over, ensuring that customer transactions continue without interruption.
Q.4 What is a Merkle Tree? explain the structure of a Merkle Tree.
What is a Merkle Tree?
A Merkle Tree is a data structure used in blockchain to organize and verify large sets of transactions efficiently. It helps ensure data integrity, security, and quick verification without storing the entire dataset. This structure is named after Ralph Merkle, who introduced it to improve cryptographic proofs.
Structure of a Merkle Tree
A Merkle Tree is a hierarchical structure made up of hashes that summarize large amounts of data. It follows a binary tree format, meaning each parent node is derived from the hash of its child nodes.
Here’s how a Merkle Tree is structured:
- Leaf Nodes (Bottom Level):
- These contain hashed values of individual transactions.
- Each transaction is converted into a unique cryptographic hash (e.g., SHA-256).
- Intermediate Nodes (Middle Level):
- Each pair of leaf nodes is combined and hashed to form a parent node.
- This process continues upward, reducing the number of nodes at each level.
- Root Node (Top Level):
- The final single hash at the top is called the Merkle Root.
- It represents all transactions in a compact form.
- Even a small change in any transaction alters the entire tree structure.
Five Key Points :
- Efficient Data Verification:
- Merkle Trees allow quick verification of large datasets without downloading the entire blockchain.
- Compact and Secure Storage:
- Instead of storing every transaction, only the Merkle Root is needed to verify data integrity.
- Tamper-Proof Transactions:
- If any transaction is altered, the hash changes, affecting the entire tree, making fraud detection easy.
- Faster Blockchain Synchronization:
- Nodes in a blockchain network can verify transactions efficiently by comparing only the Merkle Root.
- Used in Bitcoin and Ethereum:
- Merkle Trees are widely used in blockchain networks to validate transactions securely and improve scalability.
Example:
In Bitcoin, a block contains thousands of transactions. Instead of verifying each one, nodes only check the Merkle Root, making the process faster and more efficient.
Q.5 Write a program in solidity to check whether a number is prime or not.
Here is a Solidity program to check whether a given number is prime or not. The contract takes a number as input and returns true
if it is prime and false
otherwise.
Solidity Program: Prime Number Check
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.0;
contract PrimeChecker {
// Function to check if a number is prime
function isPrime(uint256 num) public pure returns (bool) {
if (num < 2) {
return false; // Numbers less than 2 are not prime
}
for (uint256 i = 2; i * i <= num; i++) {
if (num % i == 0) {
return false; // If divisible by any number, it's not prime
}
}
return true; // Prime number
}
}
Explanation :
- Function Definition (
isPrime
)- The function takes an unsigned integer (
num
) as input. - It returns a
boolean
value (true
for prime,false
otherwise).
- The function takes an unsigned integer (
- Handling Special Cases
- If
num < 2
, it immediately returnsfalse
since numbers less than 2 are not prime.
- If
- Checking for Factors
- The loop runs from
2
to√num
(i.e.,i * i <= num
). - If
num
is divisible by anyi
, it is not a prime number.
- The loop runs from
- Efficient Computation
- Instead of looping till
num-1
, we optimize by checking only till the square root. - This reduces gas usage in Solidity smart contracts.
- Instead of looping till
- Practical Example Usage
- Deploy the contract and call
isPrime(7)
, which returnstrue
. - Calling
isPrime(10)
returnsfalse
, as 10 is not prime.
- Deploy the contract and call
Introduction to Solidity Programming 2025
Thank you for taking the time to read this! If you found this helpful, don’t forget to give it a thumbs up. ….. Want to learn more about blockchain ? Keep exploring our notes for more insights. If you have any thoughts, questions, or suggestions, feel free to drop a comment below—we’d love to hear from you!