Blockchain
Blockchain
contract Crowdfunding {
constructor(uint _goal) {
owner = [Link];
goal = _goal;
deadline = [Link] + 30 days;
}
// Donate Ether
function donate() public payable {
donations[[Link]] += [Link];
totalAmount += [Link];
}
payable(owner).transfer(totalAmount);
}
payable([Link]).transfer(amount);
}
}
Working of the Contract (2 Marks)
If the funding goal is reached, the owner can withdraw funds using withdraw().
If the goal is not reached after 30 days, contributors can get their money back using refund().
The process is automatic, transparent, and does not require any intermediary.
b) Analyze and compare the architectural frameworks of the Ethereum Mainnet and Hyperledger Fabric by
deconstructing their core components and design philosophies.
Core Components
Hyperledger Fabric is a permissioned enterprise blockchain designed for business applications requiring
privacy and controlled access.
Core Components
Design Philosophy
● Identity-based participation.
● High performance and scalability.
● Fine-grained privacy controls.
● Consortium governance for enterprise collaboration.
// Create Asset
async CreateAsset(ctx, assetId, owner) {
const asset = {
assetId,
owner
};
await [Link](
assetId,
[Link]([Link](asset))
);
return "Asset Created";
}
// Read Asset
async ReadAsset(ctx, assetId) {
const asset = await [Link](assetId);
return [Link]();
}
// Transfer Asset
async TransferAsset(ctx, assetId, newOwner) {
const assetBytes =
await [Link](assetId);
const asset =
[Link]([Link]());
[Link] = newOwner;
await [Link](
assetId,
[Link]([Link](asset))
);
return "Asset Transferred";
}
}
[Link] = AssetContract;
Phase 2: Decentralized Deployment Workflow: Systematically outline the exact operational steps with
commands required by network administrators to deploy this chaincode onto the network peers in
accordance with the Fabric v2.x/v3.x lifecycle governance model. Detail the sequence of executing the
four critical CLI steps: Packaging the chaincode into a .[Link] archive, Installing the package on specific
endorsing peers to generate a Package ID, Approving the chaincode definition by separate organizations
to meet the channel's lifecycle endorsement policy, and finally, Committing the chaincode definition to
the channel. Conclude by designing a validation test case using the peer chaincode invoke command to
prove that the deployed smart contract successfully interacts with the ledger across the distributed peer
topology.
The successful query from any authorized peer proves that the chaincode has been deployed correctly
and that ledger updates are synchronized across the distributed Hyperledger Fabric network.
2)
a) A mining pool secretly keeps its discovered blocks hidden to build a private chain, and
then releases them all at once to cancel out the blocks found by honest miners, analyze
how this "selfish mining" strategy works and its impact on the network.
Address the following points:
i) Explain step-by-step what happens to both the public chain and the attacker’s private
chain when a block is found.
Selfish mining is a strategy where a mining pool withholds newly discovered blocks instead of immediately
broadcasting them to the network.
B0 → A1
● While honest miners work on the public chain, the attacker continues mining on the hidden
chain.
● If another block is found by the attacker, the private chain grows.
Public Chain : B0
Private Chain: B0 → A1 → A2
B0 → A1 → A2
Accepted Chain:
B0 → A1 → A2
ii) Explain the minimum percentage of network computing power a pool needs to possess
for this trick to actually earn them more rewards than honest mining.
α > 25%
● With favorable network propagation delays, profitability may begin around 25–30%.
● Above 33% hash power, selfish mining consistently earns higher rewards than honest mining.
iii) Evaluate how this behavior hurts the blockchain network in the long run and what defense
mechanism can be taken to avoid this attack.
Effects
b) An independent journalist receives donations via a public Bitcoin address published on their blog. As
Bitcoin relies on pseudo-anonymity, all transactions are linked to a single public key address. A hostile actor is
attempting to trace the journalist's real-world identity by analyzing the public ledger. Interpret the various
transaction analysis techniques the hostile actor could use to de-anonymize the journalist. For each technique,
describe a practical step the journalist could implement within their blockchain operations to mitigate the risk
and protect their privacy.
Bitcoin provides pseudo-anonymity, where users are identified by public addresses rather than real
names. However, because all transactions are publicly visible on the blockchain, a hostile actor can
analyze transaction patterns to link a user's address to their real-world identity.
Advanced privacy techniques such as Ring Signatures, Stealth Addresses, and
Zero-Knowledge Proofs (ZKPs) can significantly reduce this risk.
Transaction The attacker traces the flow of funds Ring Signatures hide the true
Graph Analysis between addresses to identify sender among a group of possible
ownership patterns. signers, making transaction tracing
difficult.
Input Ownership Multiple inputs used in a transaction Ring Signatures obscure which
Analysis suggest common ownership of input actually authorized the
addresses. transaction.
Signatures
Stealth Addresses
c) An IoT smart meter transmits real-time consumption data to a blockchain to manage appliance states and
automate micro-payments, this analysis must assess the overall system architecture by critiquing the contract-
level state machine (Idle, Active, Suspended) to determine if locking device activation to a verified prepaid
balance securely prevents unauthorized access. Develop a smart contract for this scenario and appraise the
real-time data ingestion pipeline and judge whether an automated, intermediary-free micro-transaction
function can reliably execute an instantaneous device shutdown when the balance hits zero without triggering
network latency. Outline a machine-to-machine (M2M) cryptographic identity framework to establish trust,
validate the integrated system against data-tampering threats and justify the selection of distinct architectural
data layers to separate high-frequency usage tracking from final financial settlements.
Contract-Level State Machine Analysis (2 Marks)
The smart meter operates using three states:
Recharge
| Balance = 0 Suspended
| Recharge Active
Security Assessment
// SPDX-License-Identifier: MIT
pragma solidity ^0.8.20;
contract SmartMeter {
constructor() {
currentState = [Link];
}
if(balance > 0)
currentState = [Link];
}
require(
currentState == [Link],
"Device inactive"
);
if(balance == 0) {
currentState = [Link];
}
}
function getState()
public view returns(State)
{
return currentState;
}
}
IoT Gateway
MQTT Broker
Blockchain Oracle/API
Smart Contract
Blockchain Ledger
Evaluation
Payment Function
directly.
Reasons:
Recommended Solution
Financial Settlement
Thus, shutdown should occur locally while blockchain records payment settlement.
Digital Certificate
Authentication Process
Architecture
Operational Layer
↓ Aggregated Data
Ledger) Justification
1. Identification (1 Mark)
● Target DLT: Consortium (or Federated) Blockchain.
● Core Definition: A semi-private, multi-party ledger where the consensus process is controlled by a pre-
defined set of nodes (the 15 hospitals and 5 firms).
b. A Fintech company is launching a 'Sovereign Wealth' app. They have decided to use a blockchain
wallet. To ensure user privacy, the app must generate a unique Base58 Bitcoin Address for every
transaction without requiring the user to perform multiple backups. Analyze the steps involved in
generating a wallet address from a private key. Compare and contrast the different types of wallets
available.
1. Analysis: Steps to Generate a Bitcoin Address (4 Marks)
Generating a Base58 address from a private key involves a series of cryptographic one-way functions:
Step 1: Private Key to Public Key The process begins with a 256-bit random number (Private Key). This is
transformed into a Public Key using Elliptic Curve Cryptography (ECC), specifically the secp256k1 curve.
Step 2: Double Hashing To create a shorter, secure identifier, the Public Key undergoes two rounds of
hashing: first with SHA-256, and then the result is hashed with RIPEMD-160. This produces a 160-bit "Public
Key Hash."
Step 3: Adding Version Byte & Checksum A network version byte (e.g., 0x00 for Bitcoin Mainnet) is added
to the front. A checksum is then calculated by hashing this string twice with SHA-256 and taking the first 4
bytes of the result to prevent typing errors.
Step 4: Base58Check Encoding The version, hash, and checksum are converted into a Base58 string. This
format excludes visually ambiguous characters (like 0, O, I, and l) to ensure the address is user-friendly and
error-resistant.
Comparison (3 Marks)
Hot Wallets Online/Software based. High convenience for daily app use but
higher risk of being hacked.
c. A blockchain is a multi-layered architecture designed to create 'Trust without a Central Authority.' Analyze the
core functions of this architecture by answering the following:
i. Define a Full Client and a Lightweight (SPV) Client. Which one provides the highest level of security, and which
one is more practical for a shop counter? (3Marks)
ii. Describe the role and structure of the Block Header and Merkle tree. Explain how the inclusion of the Previous
Block Hash and the Merkle Root ensures that once data is written, it is both immutable and easy to
verify. (3 Marks)
iii. Discuss the process of Mining within a Distributed P2P Network. Interpret the various elements of the Contract
layer with suitable examples. (4 Marks)
● Full Client: A node that downloads and stores the entire history of the blockchain (every block and
transaction) and independently validates all rules of the network.
● Lightweight (SPV) Client: Simplified Payment Verification clients that do not store the whole chain;
they only download Block Headers and use Merkle proofs to verify that a transaction is included in a
block.
● Security & Practicality:
○ Highest Security: The Full Client provides the highest security because it does not rely on third
parties for verification.
○ Shop Counter Practicality: The Lightweight (SPV) Client is more practical for a shop counter
because it requires significantly less storage and bandwidth, allowing it to run on mobile devices
or tablets for quick transaction checks.
● Block Header: Contains metadata about the block, including the version, Previous Block Hash,
Merkle Root, Timestamp, Difficulty Target, and Nonce.
● Merkle Tree: A binary tree of hashes where each leaf node is a transaction hash and every non-leaf
node is the hash of its children.
● Immutability and Verification:
○ Previous Block Hash: By including the hash of the preceding block, blocks are
cryptographically linked in a chain. Changing data in Block A changes its hash, which breaks the
link in Block B, making tampering immediately evident.
○ Merkle Root: This single hash represents all transactions in a block. It allows for easy
verification because a user only needs a small "Merkle Path" to prove a transaction's existence
without downloading the entire block data.
The Contract Layer handles the rules of the system through three main elements:
● Definition: A soft fork is a software upgrade that is backward-compatible, meaning the new rules are
more restrictive than the old rules.
● Backward Compatibility: It is considered backward-compatible because blocks created by upgraded
nodes (following the new, tighter rules) are still seen as valid by non-upgraded nodes. For example, if
the 'Block Size' decreases from 2MB to 1MB, a 1MB block is valid under both the old and new
software.
● Effect on Non-Upgraded Nodes:
○ Nodes that do not upgrade immediately will still stay on the same chain and accept new blocks.
○ However, if a non-upgraded node tries to mine a block that violates the new, tighter rules (e.g., a
1.5MB block), the upgraded majority of the network will reject it.
○ This encourages non-upgraded nodes to eventually update to avoid wasting computational power
on rejected blocks.
● Definition: A hard fork is a software update that is not backward-compatible because it introduces
fundamental changes, such as a new signature algorithm.
● Permanent Divergence: It results in a permanent split because the new rules are so different that blocks
produced by upgraded nodes are considered invalid by old software, and vice versa. The blockchain
splits into two separate paths: the original chain and the new chain.
● Fate of 'Legacy' (Old) Nodes:
○ Legacy nodes continue to follow the old set of rules, completely ignoring the new chain.
○ Unless all nodes upgrade (a "planned" hard fork), the network permanently splits into two
independent blockchains with their own transaction histories and potentially their own tokens
(e.g., Bitcoin vs. Bitcoin Cash).
○ Legacy nodes cannot see or verify transactions happening on the new chain, and new nodes
cannot verify transactions on the legacy chain.
b. A private college consortium wants to move away from the high electricity costs of Bitcoin's Proof of
Work. They decided to implement Proof of Elapsed Time (PoET) using Intel SGX (Software Guard
Extensions). Analyze the technical workflow of this system. Also, explain how the 'Trusted Execution
Environment' (Enclave) inside the processor ensures that a node cannot cheat the random timer.
1. Technical Workflow of PoET (5 Marks)
The workflow of PoET replaces the energy-intensive "mining" of Bitcoin with a randomized waiting system:
● Step 1: Joining the Network: Every participating node in the college consortium must initialize a
Trusted Execution Environment (TEE) using Intel SGX to prove they are running legitimate code.
● Step 2: Requesting a Wait Time: When a new block needs to be created, each node requests a random
wait time from its local "Enclave".
● Step 3: The Waiting Phase: Each node goes into a sleep/wait state for the specific duration assigned to
it (e.g., Node A waits 5 minutes, Node B waits 2 minutes).
● Step 4: Block Generation: The first node to wake up (the one with the shortest random wait time)
creates the block and broadcasts it to the network.
● Step 5: Validation: Other nodes verify that the winner actually waited for the assigned time by
checking a signed certificate generated by the Enclave.
The Intel SGX Enclave is a hardware-secured area of the processor that ensures no node can "cheat" the timer:
● Isolation: The Enclave is an isolated memory region that is invisible to the rest of the Operating System
or even a user with "root" access. This prevents the node owner from manually changing the timer value.
● Secure Randomness: The random wait time is generated inside the Enclave using a hardware-based
random number generator. Since the code is sealed, the node cannot "request" a shorter time or
repeatedly request times until it gets a low one.
● Attestation: Once the timer expires, the Enclave produces an Attestation Report (a digital signature).
This serves as cryptographic proof to the rest of the consortium that the node waited for the correct
amount of time and did not bypass the protocol.
c. AlphaChain uses a 10-digit hashing system (0-9). The "Target" adjusts every 100 blocks to maintain a
5-minute block time. Propose solutions for given problems.
i) On average, how many nonces must be tested to find a hash starting with a single 0? If the requirement
changes from one to three zeros, by what factor has the difficulty increased? Describe the use of a nonce
in PoW. (3 marks)
ii) The total hash range is 0–5,000. Target X: 2,500, Target Y: 25. Which Target is harder to solve?
Illustrate with an example (2 marks)
iii) If a transaction in Block 50 is altered, what happens to its hash? Explain why the attacker must then
re-mine Block 50 ,51, 52, etc. to maintain a valid chain. Demonstrate this
scenario. (3marks) iv) If new
high-speed miners cause blocks to be found every 30 seconds (instead of 5 minutes): Does the network
move the Target number Up or Down? Explain the logic of this adjustment. (2
marks)
Explain the advantages and disadvantages of Proof of work ,proof of stake , and PBFT consensus
algorithms.
Based on your comparison, which consensus algorithm would you choose for your blockchain network,
and why?
Comparison of Proof of Work (PoW), Proof of Stake (PoS), and PBFT Consensus Algorithms
1. Proof of Work (PoW)
What is PoW?
Proof of Work is a consensus mechanism where miners solve complex mathematical puzzles to validate
transactions and create new blocks. The first miner to solve the puzzle gets the right to add the block to the
blockchain and receives a reward. It is used in cryptocurrencies like Bitcoin.
Advantages of PoW
1. High Security
• PoW makes it extremely difficult for attackers to manipulate the blockchain.
• An attacker must control more than 50% of the network's computing power.
• This requirement provides strong protection against fraud and double-spending.
2. Decentralization
• Anyone with mining hardware can participate in the consensus process.
• No central authority controls transaction validation.
• This promotes fairness and trust among network participants.
3. Proven Reliability
• PoW has been successfully used for many years in blockchain networks.
• It has demonstrated strong resistance to attacks.
• Its reliability makes it one of the most trusted consensus mechanisms.
Disadvantages of PoW
1. High Energy Consumption
• Mining requires powerful computers that consume large amounts of electricity.
• This increases operational costs for miners.
• It also raises environmental concerns.
2. Slow Transaction Processing
• Solving cryptographic puzzles takes time.
• Transactions may require several confirmations before becoming final.
• This reduces the overall transaction speed of the network.
3. Expensive Hardware Requirements
• Specialized mining devices are often needed.
• Small participants may struggle to compete with large mining farms.
• This can lead to mining centralization.
2. Proof of Stake (PoS)
What is PoS?
Proof of Stake selects validators based on the amount of cryptocurrency they lock or "stake" in the network.
Validators confirm transactions and create new blocks according to their stake. It is a more energy-efficient
alternative to PoW.
Advantages of PoS
1. Energy Efficient
• PoS does not require solving computational puzzles.
• Validators only need to keep their systems online.
• This significantly reduces electricity consumption.
2. Faster Transactions
• Block validation occurs more quickly than in PoW.
• The network can process a larger number of transactions.
• Users experience faster confirmation times.
3. Lower Operational Costs
• Expensive mining equipment is not required.
• Participation is possible with standard computing devices.
• This reduces maintenance and infrastructure costs.
Disadvantages of PoS
1. Wealth Concentration
• Participants with larger stakes have greater influence.
• Rich validators may receive more rewards over time.
• This can create unequal power distribution.
2. Security Concerns
• Validators may attempt to validate multiple competing chains.
• Additional mechanisms are needed to discourage dishonest behavior.
• Improper implementation can affect security.
3. Dependency on Token Ownership
• Consensus power depends on the amount of cryptocurrency owned.
• New users may find it difficult to gain influence.
• Large stakeholders can dominate decision-making.
3. Practical Byzantine Fault Tolerance (PBFT)
What is PBFT?
Practical Byzantine Fault Tolerance is a consensus algorithm designed to handle faulty or malicious nodes in a
distributed system. Nodes communicate with each other and vote on the validity of transactions. It is commonly
used in permissioned blockchain networks.
Advantages of PBFT
1. Instant Finality
• Once a transaction is approved, it becomes permanent immediately.
• No additional confirmations are required.
• This eliminates the possibility of transaction reversal.
2. High Transaction Speed
• PBFT processes transactions much faster than PoW and PoS.
• Consensus is achieved through communication among nodes.
• It is suitable for applications requiring real-time processing.
3. Low Energy Consumption
• PBFT does not involve mining or staking.
• Nodes only exchange messages to reach consensus.
• This makes it highly energy-efficient.
Disadvantages of PBFT
1. Limited Scalability
• Communication between nodes increases rapidly as the network grows.
• Performance decreases with a large number of participants.
• It is not suitable for very large public blockchains.
2. Complex Communication
• Nodes must exchange multiple messages during consensus.
• Network management becomes more complicated.
• Increased communication overhead can affect efficiency.
3. Requires Trusted Participants
• PBFT works best in permissioned environments.
• Participants are usually known and verified.
• It is less suitable for completely open public networks.
Comparison Table
Feature PoW PoS PBFT
Security Very High High High
Energy Consumption Very High Low Very Low
Transaction Speed Slow Fast Very Fast
Scalability Moderate Good Limited
Cost High Low Low
Finality Delayed Faster Instant
Best For Public Blockchains Modern Public Blockchains Private/Permissioned Blockchains
Question
ii) If V1 goes offline, what is the minimum number of validators needed to keep the network running?
Given
• V2 = 30
• V3 = 20
• V4 = 10
• Required = 61
Content
If V1 is offline, the remaining validators have:
30+20+10=6030 + 20 + 10 = 6030+20+10=60
The network requires 61 coins for validation, but only 60 coins remain available. Therefore, even if all three
remaining validators work together, they cannot reach the required threshold.
As a result, the network cannot continue validating blocks until V1 comes back online or the validation
threshold is changed.
PoET Question 1
Question
In PoET, every node requests a wait time from its secure hardware. The node with the shortest wait time wins
the right to forge the next block.
Imagine a network with 100 nodes.
• Node A is a massive supercomputer with 128 CPU cores.
• Node B is a simple laptop with a single 4-core processor.
• Both nodes have the same Intel SGX security hardware.
i) Does Node A have a higher statistical chance of winning the next block than Node B?
Given
• Node A = 128 CPU cores
• Node B = 4 CPU cores
• Both use the same Intel SGX hardware
Content
No, Node A does not have a higher chance of winning than Node B. In PoET, block selection is based on a
randomly generated waiting time provided by the Trusted Execution Environment (TEE), such as Intel SGX.
The number of CPU cores or processing power does not affect the waiting time. Since both nodes use the same
trusted hardware, they have an equal probability of receiving the shortest wait time. Therefore, both nodes have
the same statistical chance of creating the next block.
Question
ii) If Node A tries to "speed up" its internal clock to make 10 seconds pass in only 5 seconds, why will the
rest of the network reject its block?
Given
• Assigned wait time = 10 seconds
• Node A attempts to finish in 5 seconds
Content
The network will reject the block because the waiting time is monitored and verified by Intel SGX. The Trusted
Execution Environment generates a certificate proving that the assigned waiting period was actually completed.
Even if Node A manipulates its local clock, the SGX hardware records the true elapsed time. When other nodes
verify the certificate, they will detect that the required waiting period was not completed correctly. As a result,
the certificate becomes invalid and the block is rejected.
PoET Question 2
Question
When a node's timer expires, the secure hardware generates a Certificate proving the time actually elapsed.
An attacker discovers a way to pause their secure hardware right before the timer ends. They wait until the
network is at a very high traffic moment, unpause it, and immediately broadcast a winning certificate they
generated for a block that was supposed to be mined 30 minutes ago.
i) Why must a PoET certificate be tied to a specific Block Hash (the most recent block)?
Given
• Certificate generated earlier
• Blockchain state changes continuously
Content
A PoET certificate must be tied to a specific block hash to ensure that it can only be used for the current state of
the blockchain. Every new block changes the blockchain's history and creates a new block hash. If certificates
were not linked to the latest block hash, attackers could store old certificates and reuse them later. By binding
the certificate to the most recent block hash, the network ensures that old certificates become invalid whenever
the blockchain advances.
Question
ii) If the attacker provides a valid certificate showing they waited 10 seconds, but that certificate was
generated based on the Previous Block Hash from an hour ago, will the network accept it? Why or why
not?
Given
• Certificate proves 10-second wait
• Certificate linked to block hash from one hour ago
Content
No, the network will not accept the certificate. Although the certificate proves that the node waited for the
required amount of time, it is tied to an outdated block hash. Since the blockchain has already produced many
new blocks, the current block hash is different from the one stored in the certificate. During verification, nodes
compare the certificate's block hash with the latest blockchain state. Because they do not match, the certificate
is considered invalid and the block is rejected.
PoET Question 3
Question
PoET is highly efficient, but it has one major Achilles' heel: it requires specific hardware such as Intel SGX to
create the Trusted Execution Environment (TEE).
i) If the network requires every node to update their hardware microcode to fix a security flaw, but 30%
of the miners are using older chips that cannot be updated, what happens to decentralization if those
30% are kicked off?
Given
• 30% of nodes removed
• Only updated nodes remain
Content
The network becomes less decentralized. Decentralization means that control is distributed among many
independent participants. When 30% of the validators are removed, fewer participants remain to validate
transactions and produce blocks. This increases the influence of the remaining validators and concentrates
power among a smaller group. As a result, the blockchain becomes more centralized and more vulnerable to
control by a few organizations.
Question
ii) In Proof of Work, anyone can build an ASIC. In Proof of Stake, anyone can buy coins. In PoET, you
must buy hardware from a specific company. If that company secretly hardcodes a rule into its chips that
gives its own nodes a slightly shorter timer, how would the blockchain ever find out?
Given
• Hardware manufacturer controls the TEE
• Secret advantage built into chips
Content
Detecting such manipulation would be extremely difficult because PoET relies on trusting the hardware
manufacturer. The internal operations of Intel SGX are not fully visible to the blockchain network. If the
company secretly gives its own devices slightly shorter waiting times, the network may only notice unusual
patterns, such as certain nodes winning blocks much more frequently than expected. However, proving that the
hardware contains a hidden advantage would require independent security audits and hardware analysis. This
dependence on a specific manufacturer is one of the major criticisms of PoET because it introduces a level of
trust that does not exist in PoW or PoS.
PoB Question 1
Question
In Proof of Burn, your mining power isn't permanent. Most PoB systems use a Decay Function where Effective
Burn Power drops by 50% every year.
• Miner A burns 100 coins on January 1st, 2026.
• Miner B burns 60 coins on January 1st, 2027.
i) On January 1st, 2027 (exactly one year later), which miner has more power in the network?
Given
• Miner A burned 100 coins in 2026
• Burn power decays by 50% per year
• Miner B burned 60 coins in 2027
Content
After one year, Miner A's effective burn power decreases by 50%.
100×0.5=50100 \times 0.5 = 50100×0.5=50
Therefore, Miner A now has 50 units of effective burn power.
Miner B has just burned 60 coins, so their effective burn power is 60.
Since:
60>5060 > 5060>50
Miner B has more mining power than Miner A on January 1st, 2027. Even though Miner A burned more coins
initially, the decay function reduces their influence over time.
Question
ii) Why is this decay necessary to prevent the Early Adopter Monopoly?
Given
• Burn power decreases by 50% every year
Content
The decay mechanism prevents early participants from controlling the network forever. Without decay, a user
who burned a large number of coins in the early stages would permanently maintain the highest mining power.
New participants would have little chance of competing. By gradually reducing burn power over time, the
network allows new users to gain influence and participate fairly in block creation. This helps maintain
decentralization and prevents long-term monopolies.
PoB Question 2
Question
PoB is often used to transition from an old blockchain to a new blockchain.
To receive coins on Chain B, users must send their Chain A coins to a Burn Address.
i) If the Burn Address is just a public wallet where the private key has been deleted, how does Chain B
know that you actually burned the coins?
Given
• Coins sent to Burn Address
• Burn transaction recorded on blockchain
Content
Chain B verifies the burn by checking the blockchain records of Chain A. Every transaction on a blockchain is
public and permanent. When a user sends coins to the burn address, the transaction becomes part of the
blockchain history. The software on Chain B scans Chain A and verifies that the coins were transferred to the
designated burn address. Once verified, Chain B rewards the user with new coins according to the migration
rules.
Question
ii) If an attacker finds the private key to the Burn Address 5 years later, does the Proof of Burn security
break?
Given
• Coins were already burned
• Burn transaction permanently recorded
Content
No, the Proof of Burn process does not break. The important factor is not whether the coins physically
disappear, but whether the network accepted the burn transaction as proof of commitment. Once the burn
transaction is recorded and verified on the blockchain, the participant has already received the associated
benefits. Even if someone later gains access to the burn address, it does not change the historical record that the
coins were originally burned. The blockchain's proof remains valid because the evidence of burning is
permanently stored.
PoB Question 3
Question
PoB is often compared to PoW.
Scenario PoW
You spend $1000 on electricity to mine 1 Bitcoin.
Scenario PoB
You burn $1000 worth of Coin X to mine 1 Bitcoin.
i) In a market crash where Coin X loses 90% of its value, which miner is in a worse position?
Given
• Coin X drops by 90%
• PoW miner spent electricity
• PoB miner burned Coin X
Content
The PoB miner is in a worse position. The PoW miner spent money on electricity, and that cost is already fixed
and completed. However, the PoB miner permanently destroyed valuable coins. If Coin X later experiences a
dramatic price increase or recovery, the burned coins can never be recovered. The miner loses both the original
investment and any future value those coins might have gained. Therefore, the financial risk is greater for the
PoB miner.
Question
ii) Why is PoB considered greener than PoW, but riskier for the miner's personal balance sheet?
Given
• PoW uses electricity
• PoB destroys cryptocurrency
Content
PoB is considered greener because it does not require massive computational power, mining farms, or
continuous electricity consumption. Instead of solving complex mathematical puzzles, participants prove
commitment by destroying coins. This significantly reduces energy usage and environmental impact.
However, PoB is riskier for the miner because the sacrificed coins are permanently lost. If the value of those
coins increases in the future, the miner cannot recover them. In PoW, electricity costs are consumed
immediately, but in PoB, valuable assets are intentionally destroyed. Therefore, while PoB is environmentally
friendly, it exposes participants to greater financial risk.
require(
bids[[Link]].hash ==
keccak256([Link](_value, _secret)),
"Wrong Reveal"
);
approved[txId][[Link]] = true;
transactions[txId].confirmations++;
if(
transactions[txId].confirmations
>= required
){
transactions[txId].executed = true;
}
}
Answer
The Multi-Signature Wallet increases security by requiring multiple approvals before a transaction can be
executed. When a user submits a transaction, the contract stores the transaction details such as recipient address,
transfer amount, execution status, and confirmation count.
Each owner can approve a transaction only once because the approval mapping records which owner has
already signed a specific transaction. Every approval increases the confirmation counter.
The transaction remains in a pending state until the required number of confirmations is reached. Once the
confirmation count becomes equal to or greater than the required threshold, the contract automatically marks the
transaction as executed. This prevents a single owner from having complete control over corporate funds.
What to Verify
• Transaction submitted successfully.
• After first approval → confirmations = 1.
• After second approval → confirmations = 2 and still pending.
• After third approval → executed becomes true.
• Transaction status changes from Pending to Executed.
3. Time-Locked Vesting Contract
Question
Automate employee token release over a 4-year period with a 1-year cliff.
Given
• [Link]
• Cliff period
• Vesting duration
• Release function
Release Function
function release() public {
require(
[Link] >= start + cliff,
"Cliff not reached"
);
uint vested =
(totalAmount *
([Link] - start))
/ duration;
uint unreleased =
vested - released;
released += unreleased;
payable(beneficiary)
.transfer(unreleased);
}
Answer
The vesting contract releases funds gradually to a beneficiary over time. When the contract is deployed, the
deployment timestamp becomes the starting point of the vesting schedule. The beneficiary cannot withdraw any
funds before the cliff period ends.
The release function first checks whether the current block timestamp has passed the cliff period. If the cliff has
not been reached, the transaction reverts with the message "Cliff not reached".
Once the cliff period expires, the contract calculates the vested amount using the proportion of elapsed time
compared to the total vesting duration. The beneficiary can then withdraw only the vested portion while the
remaining balance stays locked. This ensures controlled and gradual distribution of funds.
What to Verify
• Release before cliff produces revert error.
• "Cliff not reached" message displayed.
• Release after cliff succeeds.
• Correct vested amount calculated.
• Released amount increases after withdrawal.
4. Decentralized Supply Chain with Role-Based Access
Question
Track a product from Manufacturer → Distributor → Retailer using role-based access control.
Given
• Manufacturer role
• Retailer role
• Access control restrictions
• shipItem() function
Manufacturer Check
modifier onlyManufacturer() {
require(
[Link] == manufacturer,
"Not Manufacturer"
);
_;
}
Ship Item
function shipItem()
public
onlyManufacturer
{
status = "Shipped";
}
Answer
The supply chain system uses role-based access control to restrict which users can perform specific operations.
Different blockchain addresses are assigned different roles such as Manufacturer, Distributor, and Retailer.
The Manufacturer is responsible for creating products and shipping them through the supply chain. Before
executing functions such as shipItem(), the contract checks whether the caller has the required role.
If a Retailer attempts to execute a function reserved for the Manufacturer, the contract rejects the transaction
immediately. This prevents unauthorized modifications to product records and ensures that each stage of the
supply chain is handled only by authorized participants. The blockchain maintains a transparent and immutable
record of all product movements.
What to Verify
• Manufacturer role assigned successfully.
• Manufacturer calls shipItem() successfully.
• Retailer role assigned.
• Retailer attempts shipItem().
• Transaction rejected due to insufficient permissions.
5. Trustless NFT Swap (Escrow)
Question
Allow two parties to exchange digital assets without requiring a trusted third party.
Given
• Party A
• Party B
• Escrow Contract
• depositA()
• depositB()
• swap()
Deposit A
function depositA() public {
require(
[Link] == partyA,
"Not Party A"
);
depositedA = true;
}
Deposit B
function depositB() public {
require(
[Link] == partyB,
"Not Party B"
);
depositedB = true;
}
Swap
function swap() public {
require(
depositedA &&
depositedB,
"Both parties must deposit"
);
depositedA = false;
depositedB = false;
}
Answer
The escrow contract enables a trustless exchange between two parties. Initially, Party A and Party B must both
deposit their respective assets into the contract. The contract tracks these deposits using the boolean variables
depositedA and depositedB.
The swap function cannot execute until both parties have successfully deposited their assets. This is enforced
through the condition require(depositedA && depositedB).
Once both deposits are confirmed, the contract performs the swap operation and resets the deposit flags. This
ensures that neither participant can receive the other asset unless both parties have fulfilled their obligations.
The escrow mechanism removes the need for a middleman and guarantees fairness during the exchange process.
What to Verify
• Party A deposit successful.
• Party B deposit successful.
• Contract records both deposits as true.
• Swap function executes successfully.
• Deposit flags reset after swap.
• Asset ownership transferred correctly.
1(a) Explain the features, working mechanism, and applications of Ethereum and Discuss the
architecture and consensus mechanism of Solana. (8 Marks)
Ethereum
Introduction
Ethereum is an open-source blockchain platform introduced by Vitalik Buterin in 2015. It was designed to
support not only cryptocurrency transactions but also smart contracts and decentralized applications (DApps).
Ethereum enables developers to create programmable applications that operate without intermediaries. It
provides a secure, transparent, and decentralized environment for executing digital transactions and agreements.
Features of Ethereum
Ethereum offers several unique features that make it one of the most widely used blockchain platforms. Its
primary feature is the support for smart contracts, which are self-executing programs that automatically perform
actions when predefined conditions are met. Ethereum also supports decentralized applications (DApps),
allowing developers to build applications without relying on centralized servers. The platform uses the
Ethereum Virtual Machine (EVM), which executes smart contracts consistently across all nodes in the network.
In addition, Ethereum provides transparency, immutability, and strong security through cryptographic
mechanisms.
Features
• Smart Contracts
• Decentralized Applications (DApps)
• Ethereum Virtual Machine (EVM)
• Native Cryptocurrency (Ether - ETH)
• Transparency and Immutability
• Decentralized Network
• High Security
Working Mechanism of Ethereum
Ethereum operates through a distributed network of nodes that maintain a shared copy of the blockchain ledger.
When a user initiates a transaction, it is broadcast to the network and verified by validators. If the transaction
contains a smart contract, the Ethereum Virtual Machine executes the contract code. After successful
verification, transactions are grouped into blocks and permanently added to the blockchain. Every node updates
its ledger copy, ensuring consistency and transparency across the network.
Steps Involved
Step 1: Transaction Creation
A user creates a transaction using an Ethereum wallet and signs it digitally using a private key. The transaction
may involve transferring Ether or interacting with a smart contract.
Step 2: Broadcasting the Transaction
The transaction is sent to the Ethereum network, where it becomes visible to validators waiting to verify
pending transactions.
Step 3: Validation
Validators check the transaction details, verify the digital signature, and ensure that the sender has sufficient
balance to perform the transaction.
Step 4: Smart Contract Execution
If the transaction contains a smart contract, the Ethereum Virtual Machine executes the contract instructions and
produces the corresponding output.
Step 5: Block Creation
Validated transactions are grouped together into a block. The block is then approved through the consensus
mechanism.
Step 6: Blockchain Update
The approved block is added to the blockchain, and every node updates its local copy of the ledger. The
transaction becomes permanent and immutable.
Applications of Ethereum
Ethereum has become the foundation for numerous blockchain-based applications across various industries. Its
programmability allows developers to create innovative decentralized solutions that improve transparency,
automation, and security.
Decentralized Finance (DeFi)
Ethereum enables financial services such as lending, borrowing, staking, and trading without the need for
traditional banks. Smart contracts automate these processes and reduce operational costs.
Non-Fungible Tokens (NFTs)
Ethereum is widely used for creating and trading NFTs. These digital assets represent ownership of unique
items such as artwork, music, gaming assets, and collectibles.
Supply Chain Management
Ethereum helps organizations track products throughout the supply chain. Every transaction is recorded on the
blockchain, improving transparency and reducing fraud.
Healthcare
Patient records can be securely stored and shared using Ethereum-based systems. This improves data integrity,
privacy, and accessibility.
Voting Systems
Ethereum can be used to build secure electronic voting systems where votes are recorded immutably, preventing
manipulation and increasing trust.
Digital Identity Management
Ethereum enables users to maintain self-sovereign digital identities without depending on centralized
authorities.
Solana
Introduction
Solana is a high-performance blockchain platform developed to address scalability and transaction speed issues
found in traditional blockchains. It is designed to support decentralized applications and cryptocurrency
transactions with very low fees and high throughput. Solana achieves this by combining Proof of History (PoH)
with Proof of Stake (PoS), allowing thousands of transactions to be processed per second.
Architecture of Solana
Solana's architecture consists of several innovative technologies that work together to provide high-speed and
scalable blockchain operations. Unlike traditional blockchains, Solana uses a cryptographic clock known as
Proof of History to improve transaction ordering and reduce consensus delays.
Proof of History (PoH)
Proof of History is a cryptographic timestamping mechanism that records the sequence of events before
consensus occurs. It acts as a decentralized clock, allowing validators to verify transaction order efficiently.
This significantly improves transaction speed and reduces communication overhead.
Validators
Validators are responsible for verifying transactions, maintaining the blockchain ledger, and participating in the
consensus process. They stake SOL tokens and help secure the network.
Turbine Protocol
Turbine is a block propagation protocol that divides large blocks into smaller packets and distributes them
efficiently across the network. This reduces bandwidth requirements and improves scalability.
Gulf Stream
Gulf Stream forwards transactions to validators before block production begins. This minimizes transaction
confirmation delays and improves network efficiency.
Sealevel
Sealevel is Solana's parallel smart contract execution engine. It allows multiple transactions to be processed
simultaneously, greatly increasing throughput.
Pipelining
Pipelining optimizes transaction processing by assigning different hardware components to specific tasks,
enabling continuous and efficient execution.
Cloudbreak
Cloudbreak is Solana's data storage mechanism that supports parallel reading and writing operations, improving
database performance.
Consensus Mechanism of Solana
Solana uses a hybrid consensus mechanism that combines Proof of History (PoH) and Proof of Stake (PoS).
This combination allows the network to achieve both speed and security.
Proof of History (PoH)
Proof of History generates verifiable timestamps that establish the order of transactions before they are
validated. This eliminates the need for validators to spend time agreeing on transaction order, thereby increasing
efficiency.
Proof of Stake (PoS)
Validators stake SOL tokens to participate in consensus. Validators who behave honestly receive rewards, while
malicious validators may lose a portion of their stake. This mechanism ensures network security and encourages
honest participation.
Benefits of Solana Consensus
The combination of PoH and PoS provides several advantages. It enables very high transaction throughput, low
transaction fees, rapid confirmation times, and efficient scalability. Solana can process thousands of transactions
per second while maintaining decentralization and security.
Benefits
• High transaction speed
• Low transaction cost
• Fast block confirmation
• Improved scalability
• Energy efficient
• Secure consensus process
1(b) Explain the advantages and disadvantages of Proof of Work, Proof of Stake, and PBFT consensus
algorithms. Based on your comparison, which consensus algorithm would you choose for your blockchain
network, and why? (7 Marks)
Introduction
Consensus algorithms are the core components of blockchain technology that help all nodes in the network
agree on a single version of the ledger. They ensure transaction validity, prevent fraud, and maintain network
security without relying on a central authority. Different consensus mechanisms provide different levels of
security, scalability, decentralization, and performance. The most widely used consensus algorithms are Proof
of Work (PoW), Proof of Stake (PoS), and Practical Byzantine Fault Tolerance (PBFT).
Proof of Work (PoW)
Proof of Work is the first and most popular blockchain consensus mechanism, introduced by Bitcoin. In PoW,
miners compete to solve complex mathematical puzzles using computational power. The first miner to solve the
puzzle earns the right to add the next block to the blockchain and receives a reward. This process secures the
network and prevents malicious activities.
Advantages of Proof of Work
Proof of Work provides a very high level of security because attackers would need enormous computational
resources to alter blockchain data. It is highly decentralized since anyone with mining hardware can participate
in the network. PoW has been tested for many years through Bitcoin and has proven to be reliable and resistant
to attacks. It also effectively prevents double-spending by requiring significant computational effort before
transactions are confirmed.
Advantages
• High security
• Strong decentralization
• Prevents double spending
• Proven and reliable technology
• Resistant to network attacks
Disadvantages of Proof of Work
Despite its security benefits, PoW consumes a large amount of electricity because miners continuously perform
computational work. Specialized hardware such as ASIC miners is often required, making participation
expensive. Transaction processing is relatively slow, and scalability becomes a challenge as the network grows.
These issues increase operational costs and raise environmental concerns.
Disadvantages
• Very high energy consumption
• Expensive mining hardware
• Slow transaction speed
• Limited scalability
• Environmental impact
Proof of Stake (PoS)
Proof of Stake is a consensus mechanism where validators are selected based on the amount of cryptocurrency
they stake in the network. Instead of solving mathematical puzzles, validators are chosen to create and validate
blocks according to their stake. This significantly reduces energy consumption while maintaining network
security.
Advantages of Proof of Stake
Proof of Stake is much more energy-efficient than PoW because it does not require intensive computational
work. It supports faster transaction processing and better scalability. Since expensive mining hardware is
unnecessary, participation becomes more accessible. PoS also reduces operational costs while maintaining a
secure and decentralized environment.
Advantages
• Energy efficient
• Faster transactions
• Better scalability
• Lower hardware requirements
• Reduced operational costs
Disadvantages of Proof of Stake
One major concern with PoS is that validators with large stakes may gain greater influence over the network.
This can potentially lead to centralization. Wealthier participants may continue accumulating rewards,
increasing their dominance over time. Additionally, new users may face difficulty participating if the staking
requirements are high.
Disadvantages
• Risk of wealth concentration
• Potential centralization
• High staking requirements
• Rich-get-richer problem
• Dependence on token ownership
Practical Byzantine Fault Tolerance (PBFT)
Practical Byzantine Fault Tolerance (PBFT) is a consensus mechanism designed to tolerate malicious or faulty
nodes while maintaining agreement among honest nodes. It is commonly used in permissioned blockchain
networks such as Hyperledger Fabric. PBFT achieves consensus through communication and voting among
nodes rather than mining.
Advantages of PBFT
PBFT provides instant transaction finality, meaning that once a transaction is confirmed, it cannot be reversed.
It consumes very little energy because no mining process is involved. The algorithm can tolerate malicious
behavior from a portion of participating nodes and still maintain network integrity. PBFT is highly suitable for
enterprise and consortium blockchain environments.
Advantages
• Instant finality
• Energy efficient
• High transaction speed
• Byzantine fault tolerance
• Suitable for enterprise applications
Disadvantages of PBFT
PBFT requires extensive communication among nodes during the consensus process. As the number of nodes
increases, communication overhead grows rapidly, reducing efficiency. This limits scalability and makes PBFT
less suitable for large public blockchain networks. The consensus process can also become complex to manage
in very large systems.
Disadvantages
• High communication overhead
• Limited scalability
• Complex implementation
• Performance decreases with many nodes
• Less suitable for public blockchains
Comparison of PoW, PoS, and PBFT
Feature PoW PoS PBFT
Security Very High High High
Energy Consumption Very High Low Very Low
Transaction Speed Slow Fast Very Fast
Scalability Limited Good Limited
Hardware Requirement High Low Low
Finality Probabilistic Faster Finality Instant Finality
Suitable For Public Networks Public Networks Permissioned Networks
Preferred Consensus Algorithm
For my blockchain network, I would choose Proof of Stake (PoS) because it provides the best balance between
security, scalability, and energy efficiency. Unlike Proof of Work, it does not require expensive mining
hardware or excessive electricity consumption. Compared to PBFT, it can support large public blockchain
networks without suffering from communication bottlenecks.
PoS enables faster transaction processing, lower operational costs, and improved scalability while maintaining
strong network security. It is also environmentally friendly and suitable for modern blockchain applications
such as decentralized finance, NFTs, supply chain management, and digital identity systems. Therefore, PoS is
the most practical and sustainable consensus mechanism for building a modern blockchain network.
Introduction
Traditional scholarship management systems often face challenges such as lack of transparency, delayed fund
distribution, manual verification processes, and risks of fraud or record manipulation. Sponsors frequently have
limited visibility into how their contributions are utilized, while students experience delays in receiving
financial aid. Blockchain technology can overcome these issues by providing a decentralized, transparent, and
tamper-proof platform where every transaction is securely recorded and easily traceable. The proposed
blockchain-based scholarship management platform ensures accountability, trust, and efficient distribution of
scholarship funds.
Selection of Blockchain Framework
For this scholarship management platform, Hyperledger Fabric is the most suitable blockchain framework.
Hyperledger Fabric is a permissioned blockchain that allows only authorized participants to access the network.
Since scholarship information contains sensitive student and financial data, privacy and controlled access are
important requirements.
Hyperledger Fabric provides high transaction throughput, strong security, access control mechanisms, and
support for smart contracts known as chaincode. It also allows educational institutions, sponsors, and
administrators to collaborate within a trusted environment while maintaining data confidentiality.
Reasons for Selecting Hyperledger Fabric
• Permissioned network
• High scalability
• Better privacy protection
• Faster transaction processing
• Supports smart contracts
• Suitable for educational institutions
Participating Entities
Sponsors
Sponsors are organizations, government agencies, charities, or individuals who provide scholarship funds. They
contribute money to the scholarship pool and can monitor the utilization of funds through the blockchain
network. Sponsors gain complete visibility into scholarship allocation and can verify that funds are distributed
only to eligible students.
Students
Students are the primary beneficiaries of the scholarship program. They register on the platform, submit
scholarship applications, and receive financial assistance through secure digital wallets. Students can also track
the status of their applications in real time.
Educational Institutions
Educational institutions act as trusted verification authorities. They verify student eligibility, academic
performance, attendance records, and supporting documents. Their verification results are recorded permanently
on the blockchain, ensuring authenticity and transparency.
Blockchain Nodes
Blockchain nodes maintain copies of the distributed ledger and validate transactions. These nodes are operated
by sponsors, universities, scholarship boards, and administrative authorities. Every validated transaction is
replicated across all nodes, ensuring consistency and fault tolerance.
Smart Contracts
Smart contracts automate scholarship-related operations such as application submission, eligibility verification,
approval, fund allocation, and fund disbursement. This reduces manual intervention and ensures fair decision-
making.
Network Topology
The platform follows a consortium blockchain model where multiple trusted organizations participate in
maintaining the network. Sponsors, universities, and scholarship authorities operate blockchain nodes connected
through a secure peer-to-peer network.
Each participant maintains a synchronized copy of the ledger. Transactions generated by students, institutions,
and sponsors are validated through the consensus mechanism before being permanently recorded on the
blockchain.
Network Components
• Sponsor Nodes
• University Nodes
• Scholarship Authority Nodes
• Smart Contract Layer
• Distributed Ledger
• Student Wallets
Consensus Mechanism
The platform uses Practical Byzantine Fault Tolerance (PBFT) as its consensus mechanism. PBFT enables
participating nodes to agree on transactions even when some nodes behave incorrectly or maliciously. Since the
network consists of trusted organizations, PBFT provides fast and energy-efficient consensus without requiring
mining.
PBFT ensures immediate transaction finality, meaning once a scholarship transaction is approved, it cannot be
reversed or altered. This improves reliability and prevents disputes regarding scholarship distribution.
Benefits of PBFT
• Fast transaction confirmation
• Energy efficient
• Fault tolerant
• Immediate finality
• Suitable for permissioned networks
Smart Contract Automation
Scholarship Application Submission
Students submit scholarship applications through a smart contract. The application includes personal
information, academic records, income certificates, and supporting documents. Once submitted, the information
is recorded on the blockchain and cannot be altered.
Eligibility Verification
The educational institution reviews and verifies student information. Smart contracts automatically compare the
submitted data against predefined eligibility criteria such as minimum grades, attendance requirements, and
financial need. Verification results are stored on the blockchain.
Scholarship Approval
After successful verification, the smart contract evaluates whether the student satisfies all scholarship
requirements. Eligible applications are automatically approved and forwarded to sponsors for final
authorization.
Fund Allocation
Once approved, the smart contract calculates the scholarship amount according to predefined rules. The
allocated amount is reserved for the selected student and recorded transparently on the blockchain.
Fund Disbursement
The smart contract automatically transfers the scholarship amount to the student's digital wallet. Every
transaction is recorded permanently, allowing sponsors and institutions to verify successful fund delivery.
Security Features
Transparency
All scholarship transactions are visible to authorized participants, ensuring complete transparency throughout
the funding process.
Immutability
Once scholarship records are stored on the blockchain, they cannot be modified or deleted. This prevents fraud
and unauthorized changes.
Accountability
Every action performed on the platform is associated with a specific participant. This creates a clear audit trail
and improves accountability.
Data Integrity
Cryptographic hashing ensures that stored records remain accurate and untampered.
Fraud Prevention
Duplicate applications, fake student records, and unauthorized fund transfers are prevented through smart
contract validation and blockchain verification.
Workflow of the Scholarship Management Platform
Step 1: Student Registration
The student creates an account and uploads academic and personal information to the platform.
Step 2: Scholarship Application
The student submits a scholarship application through a smart contract.
Step 3: Verification
Educational institutions verify academic performance and eligibility criteria.
Step 4: Smart Contract Validation
The smart contract automatically checks whether the student meets scholarship requirements.
Step 5: Approval
Eligible applications are approved by sponsors and scholarship authorities.
Step 6: Fund Allocation
The smart contract allocates the scholarship amount to the approved student.
Step 7: Fund Disbursement
The scholarship amount is transferred to the student's digital wallet.
Step 8: Audit and Monitoring
Sponsors monitor transactions and verify scholarship utilization through the blockchain ledger.
Architecture Diagram
Sponsors
|
v
------------------
| Smart Contract |
------------------
/ \
/ \
v v
Educational Students
Institutions
|
v
-----------------------
| Blockchain Network |
| (Hyperledger |
| Fabric) |
-----------------------
|
v
Student Wallets
Advantages of the Proposed System
The blockchain-based scholarship management platform improves transparency by allowing sponsors to track
every contribution and fund transfer. Smart contracts automate verification and approval processes, reducing
administrative workload and processing time. Immutable blockchain records prevent fraud and ensure
accountability among all participants. The use of digital wallets enables secure and efficient fund distribution
directly to students. The platform also enhances trust among sponsors, educational institutions, and
beneficiaries.
Advantages
• Transparent fund tracking
• Faster scholarship processing
• Secure digital wallets
• Reduced fraud and corruption
• Automated verification process
• Immutable transaction records
• Improved accountability
• Real-time monitoring
2(a) A blockchain platform operating with the Delegated Proof of Stake (DPoS) consensus protocol
encounters several challenges, including biased delegate election, limited participation from token
holders, concentration of authority among a small group of validators, and inefficiencies in block
confirmation times.
Design an enhanced voting and incentive framework for the DPoS network that addresses these
limitations. Propose a delegate election mechanism that promotes equitable representation, transparency,
security, and timely block generation. Explain how the proposed approach mitigates centralization risks,
encourages greater stakeholder involvement, strengthens network resilience, and improves overall
transaction processing performance when compared with conventional DPoS-based blockchain systems.
(8 Marks)
Introduction
Delegated Proof of Stake (DPoS) is a consensus mechanism in which token holders vote for a small group of
delegates who are responsible for validating transactions and producing blocks. Although DPoS offers faster
transaction processing and lower energy consumption compared to Proof of Work, it faces challenges such as
validator centralization, low voter participation, biased delegate selection, and concentration of power among a
few delegates. To overcome these limitations, an enhanced voting and incentive framework can be implemented
to improve fairness, transparency, security, and network efficiency.
Existing Problems in Traditional DPoS
Biased Delegate Election
In conventional DPoS systems, wealthy token holders possess significant voting power because votes are
proportional to stake ownership. As a result, a small number of powerful stakeholders can repeatedly elect the
same delegates, reducing fairness and diversity within the validator set.
Limited Participation
Many token holders do not actively participate in voting because they receive little benefit from the election
process. This voter apathy reduces community involvement and allows a small group of voters to control
network decisions.
Validator Centralization
Over time, the same delegates continue receiving votes and remain in power. This creates centralization and
increases the risk of collusion among validators, potentially threatening network security.
Slow Confirmation Efficiency
Although DPoS is generally faster than PoW, inefficient delegate scheduling and repeated election cycles can
affect block confirmation efficiency and transaction throughput.
Proposed Enhanced Voting Framework
Weighted Reputation-Based Voting
Instead of relying solely on token ownership, voting power should be calculated using both stake and delegate
reputation. Reputation scores can be based on validator performance, uptime, honesty, and successful block
production history.
This approach prevents wealthy stakeholders from completely controlling elections and encourages delegates to
maintain high-quality performance to retain voter trust.
Benefits
• Fair delegate selection
• Reduced dominance of wealthy voters
• Increased accountability
• Better validator performance
Quadratic Voting Mechanism
Quadratic voting reduces the influence of large stakeholders by making additional votes progressively more
expensive. This ensures that small token holders also have meaningful participation in the election process.
The voting system becomes more democratic because influence is distributed across a larger portion of the
community rather than concentrated among a few wealthy participants.
Benefits
• Greater fairness
• Improved representation
• Reduced voting monopolies
• Enhanced decentralization
Continuous Election System
Rather than conducting elections only at fixed intervals, voting should remain active continuously. Token
holders can change their votes at any time if delegates perform poorly or act maliciously.
This creates constant accountability and motivates delegates to maintain good performance and network
reliability.
Benefits
• Real-time governance
• Increased accountability
• Faster removal of malicious delegates
• Improved network trust
Enhanced Incentive Framework
Voter Reward Mechanism
To encourage active participation, token holders who vote regularly should receive a portion of validator
rewards. This motivates stakeholders to participate in governance and helps increase voter turnout.
Higher participation results in more representative elections and stronger decentralization.
Benefits
• Increased voter engagement
• Better governance participation
• Stronger community involvement
• Improved election legitimacy
Performance-Based Validator Rewards
Delegates should receive rewards based on their actual network performance rather than simply holding a
validator position. Metrics such as uptime, transaction processing speed, and successful block production can be
used to calculate rewards.
Validators who fail to perform efficiently receive reduced rewards, encouraging better service quality.
Benefits
• Encourages honest behavior
• Improves network reliability
• Enhances validator efficiency
• Promotes healthy competition
Slashing Mechanism
A slashing mechanism penalizes validators who engage in malicious activities such as double-signing blocks,
censorship, or prolonged downtime. A portion of the validator's stake is deducted as punishment.
This discourages attacks and strengthens network security.
Benefits
• Prevents malicious activities
• Improves security
• Protects network integrity
• Encourages responsible behavior
Improved Delegate Election Mechanism
The enhanced delegate election mechanism combines stake-based voting, reputation scores, continuous
elections, and performance monitoring. Delegates are ranked using a combined score derived from stake
support and reputation metrics.
The highest-ranked delegates become active validators, while backup delegates remain ready to replace
underperforming validators immediately. This ensures fair representation and continuous availability of
validators.
Election Formula
Delegate Score =
Stake Support + Reputation Score + Performance Rating
This multi-factor approach produces a more balanced and transparent election process compared to traditional
DPoS systems.
Security and Transparency Enhancements
Transparent Voting Records
All voting activities are recorded on the blockchain, allowing participants to verify election results
independently. This eliminates hidden manipulations and improves trust.
Public Delegate Performance Metrics
Validator performance statistics such as uptime, missed blocks, and transaction throughput are publicly
available. Voters can make informed decisions based on actual performance.
Decentralized Governance
Community members actively participate in governance decisions, reducing dependence on a small group of
stakeholders.
Network Resilience Improvements
The proposed framework strengthens network resilience by maintaining a diverse validator set and rapidly
replacing underperforming delegates. Backup validators ensure uninterrupted block production even if active
validators become unavailable.
Continuous monitoring and dynamic elections allow the network to adapt quickly to failures or attacks,
improving overall stability.
Benefits
• Fault tolerance
• Improved availability
• Faster recovery from failures
• Greater network stability
Improved Transaction Processing Performance
The proposed framework improves transaction processing performance through better validator selection and
optimized block production scheduling. High-performing delegates are prioritized, ensuring faster transaction
validation and lower confirmation times.
Efficient validator management reduces network bottlenecks and increases throughput while maintaining
security and decentralization.
Performance Improvements
• Faster block generation
• Reduced transaction delays
• Higher throughput
• Better scalability
• Lower confirmation times
Comparison with Traditional DPoS
Feature Traditional DPoS Enhanced DPoS
Delegate Selection Stake Based Stake + Reputation
Voting Participation Low High
Centralization Risk High Reduced
Validator Accountability Limited Continuous
Security Moderate High
Transaction Speed Fast Faster
Governance Limited Community Driven
2(b) I
In PoET, every node requests a wait time from its secure hardware. The node with the shortest wait time
wins the right to forge the next block. Imagine a network with 100 nodes.
• Node A is a massive supercomputer with 128 CPU cores.
• Node B is a simple laptop with a single 4-core processor.
• Both nodes have the same Intel SGX security hardware.
i) Does Node A have a higher statistical chance of winning the next block than Node B?
Introduction
Proof of Elapsed Time (PoET) is a consensus mechanism designed to achieve fairness without requiring
intensive computational power. Instead of competing through mining, every node receives a randomly
generated waiting time from a Trusted Execution Environment (TEE), such as Intel SGX. The node with the
shortest waiting time gets the right to create the next block.
Answer
No, Node A does not have a higher statistical chance of winning the next block than Node B.
In PoET, block selection is not based on CPU power, memory size, or hardware performance. The waiting time
is generated randomly by Intel SGX, which acts as a trusted and secure environment. Since both Node A and
Node B use the same Intel SGX hardware, both nodes have an equal probability of receiving the shortest
waiting time.
Even though Node A has 128 CPU cores and Node B has only 4 CPU cores, the additional processing power
does not provide any advantage during leader selection. The consensus mechanism intentionally removes
hardware competition to ensure fairness among participants.
This approach is very different from Proof of Work, where more computational power directly increases the
probability of mining a block. In PoET, fairness is achieved because all nodes depend on randomly assigned
waiting periods rather than processing capability.
Key Points
• CPU power does not affect block selection.
• Intel SGX generates random wait times.
• Both nodes have equal winning probability.
• PoET ensures fairness among participants.
• Supercomputers do not gain mining advantages.
ii) If Node A tries to "speed up" its internal clock to make 10 seconds pass in only 5 seconds, why will the
rest of the network reject its block?
Introduction
One of the main security features of PoET is the use of Intel SGX, which generates cryptographic certificates
proving that the assigned waiting period was actually completed. This prevents participants from cheating by
manipulating local system clocks.
Answer
The network will reject Node A's block because PoET requires a valid certificate generated by Intel SGX
proving that the assigned waiting time has fully elapsed. The secure hardware independently tracks the waiting
period and cannot be fooled by modifications to the system clock.
If Node A attempts to make 10 seconds appear as 5 seconds by changing its local clock, the Intel SGX
environment will still record the actual elapsed time. When the block is broadcast to the network, other nodes
verify the certificate attached to the block.
Since the certificate will show that the required 10-second waiting period was not completed, the proof becomes
invalid. As a result, the network identifies the block as fraudulent and rejects it immediately.
This mechanism ensures that every validator follows the assigned waiting period honestly and prevents unfair
advantages.
Key Points
• Intel SGX monitors actual elapsed time.
• Local clock manipulation cannot fool SGX.
• Certificate proves waiting period completion.
• Invalid certificate causes block rejection.
• Prevents cheating and maintains fairness.
2(b) II
When a node's timer expires, the secure hardware generates a Certificate proving the time actually
elapsed. An attacker discovers a way to "pause" their secure hardware right before the timer ends. They
wait until the network is at a very high traffic moment, "unpause" it, and immediately broadcast a
winning certificate they generated for a block that was supposed to be mined 30 minutes ago.
i) Why must a PoET certificate be tied to a specific Block Hash (the most recent block)?
Introduction
In blockchain systems, every block depends on the previous block through cryptographic hashing. This creates
a chain of blocks and ensures that transactions remain in the correct order. PoET certificates must therefore be
linked to a specific blockchain state.
Answer
A PoET certificate must be tied to the most recent block hash because the blockchain continuously changes
whenever a new block is added. The block hash uniquely identifies the current state of the blockchain at a
particular moment.
If certificates were not linked to a specific block hash, attackers could generate certificates in advance and reuse
them later when conditions become favorable. This would allow them to gain unfair advantages and potentially
manipulate transaction ordering.
By binding the certificate to the latest block hash, the certificate becomes valid only for that specific blockchain
state. As soon as a new block is created, the previous certificate becomes useless because the block hash has
changed.
This mechanism prevents replay attacks and ensures that every certificate corresponds to the current blockchain
condition.
Key Points
• Block hash represents current blockchain state.
• Prevents reuse of old certificates.
• Protects against replay attacks.
• Ensures fairness in block creation.
• Maintains transaction order integrity.
ii) If the attacker provides a valid certificate showing they waited 10 seconds, but that certificate was
generated based on the "Previous Block Hash" from an hour ago, will the network accept it? Why or
why not?
Introduction
Blockchain consensus mechanisms require validators to work with the most recent version of the ledger. Any
information generated using outdated blockchain data becomes invalid because the network state has already
changed.
Answer
No, the network will not accept the certificate.
Although the certificate correctly proves that the validator waited for 10 seconds, it was generated using an
outdated block hash from one hour earlier. During that hour, many new blocks would have been added to the
blockchain, changing the current network state.
When other nodes verify the certificate, they compare the block hash embedded in the certificate with the latest
block hash stored on the blockchain. Since the two hashes do not match, the certificate is considered stale and
invalid.
The network rejects the certificate because accepting it would allow attackers to reuse old waiting proofs and
gain unfair advantages. By rejecting outdated certificates, PoET ensures that only validators participating in the
current blockchain state can create new blocks.
Key Points
• Certificate is linked to an old block hash.
• Blockchain state has changed.
• Hash mismatch occurs during verification.
• Certificate becomes invalid.
• Network rejects outdated proofs.
3(a) Two participants on the Ethereum blockchain intend to exchange Non-Fungible Tokens (NFTs) and
ERC-20 tokens directly through a smart contract, eliminating the need for a trusted intermediary. To
facilitate the transaction, an escrow-based smart contract is deployed to securely lock the assets of both
parties until all exchange conditions are satisfied.
Design and evaluate a trustless asset-swapping smart contract that enables the atomic and secure
exchange of NFTs and ERC-20 tokens. Describe the contract architecture, transaction workflow, and
escrow mechanism involved in the swap process. Analyze how the proposed solution ensures fairness,
prevents fraudulent behavior, and guarantees that either both asset transfers are completed successfully
or neither transfer occurs. (8 Marks)
Introduction
In traditional digital asset trading, users often depend on centralized exchanges or trusted third parties to
facilitate transactions. This introduces risks such as fraud, asset theft, platform failures, and high transaction
fees. Blockchain technology enables trustless asset exchange through smart contracts, allowing participants to
trade directly without intermediaries. An escrow-based smart contract securely holds the assets of both parties
and ensures that the exchange occurs only when all predefined conditions are satisfied.
Overview of Trustless Asset Swapping
A trustless asset swap allows two users to exchange assets without relying on a middleman. In this scenario, one
participant owns an NFT while the other participant owns ERC-20 tokens. Instead of trusting each other, both
parties trust the smart contract. The smart contract acts as an automated escrow agent that temporarily stores the
assets until the exchange conditions are fulfilled.
This approach eliminates counterparty risk because neither participant can cheat or withdraw the other's asset
without completing their own obligation.
Contract Architecture
The trustless asset-swapping system consists of several important components that work together to perform a
secure exchange.
Party A
Party A is the owner of the NFT. This participant wishes to exchange the NFT for a specific amount of ERC-20
tokens.
The NFT remains under Party A's ownership until it is deposited into the escrow contract. Once deposited, the
NFT is securely locked and cannot be accessed by Party A.
Party B
Party B is the owner of the ERC-20 tokens. This participant agrees to transfer a specified number of tokens in
exchange for the NFT.
The ERC-20 tokens are deposited into the escrow contract and remain locked until the swap conditions are
satisfied.
Escrow Smart Contract
The escrow smart contract acts as the trusted intermediary. It stores both assets temporarily and verifies whether
each participant has deposited the required asset.
The contract contains functions for asset deposit, verification, swap execution, and transaction cancellation if
necessary. Since the contract operates automatically according to predefined rules, human intervention is not
required.
NFT Contract
The NFT contract manages ownership and transfer of the Non-Fungible Token. The escrow contract interacts
with the NFT contract to receive and transfer NFT ownership securely.
ERC-20 Token Contract
The ERC-20 token contract manages token balances and transfers. The escrow contract communicates with this
contract to receive token deposits and transfer tokens after successful swap completion.
Escrow Mechanism
The escrow mechanism is the core component of the trustless swap system. It ensures that both assets are
locked before any transfer occurs.
When Party A deposits the NFT, the contract records that the NFT has been received. Similarly, when Party B
deposits the ERC-20 tokens, the contract records the token deposit.
The contract continuously checks whether both assets have been successfully deposited. If either asset is
missing, the swap cannot proceed. This guarantees that neither party can receive an asset without contributing
their own asset.
Transaction Workflow
Step 1: Swap Initialization
The smart contract is deployed with details of both participants, the NFT identifier, and the required ERC-20
token amount.
The contract stores the addresses of Party A and Party B and defines the conditions required for a successful
exchange.
Step 2: NFT Deposit
Party A transfers the NFT to the escrow smart contract.
The contract verifies ownership and confirms that the NFT has been received. The NFT remains locked within
the contract until the swap process is completed.
Step 3: ERC-20 Token Deposit
Party B transfers the agreed number of ERC-20 tokens to the escrow contract.
The contract verifies the token deposit and records that Party B has fulfilled their obligation.
Step 4: Deposit Verification
The smart contract checks whether both deposits have been successfully received.
Only when both conditions are satisfied does the contract allow the swap process to continue.
Step 5: Atomic Swap Execution
The smart contract simultaneously transfers the NFT to Party B and the ERC-20 tokens to Party A.
Both transfers occur within a single blockchain transaction. If any part of the transaction fails, the entire
transaction is reversed automatically.
Step 6: Completion
After successful execution, ownership records are updated and the transaction is permanently recorded on the
blockchain.
Both participants receive their new assets and the escrow contract no longer holds any assets.
Atomic Swap Concept
Atomicity is one of the most important features of this system. An atomic transaction means that either all
operations succeed or none of them occur.
In the asset-swapping process, both transfers are executed together. If the NFT transfer fails, the token transfer
also fails automatically. Similarly, if the token transfer fails, the NFT remains with the escrow contract.
This eliminates the possibility of partial completion and protects both participants from fraud.
Benefits of Atomic Swaps
• No partial transactions
• Eliminates counterparty risk
• Fair asset exchange
• Automatic rollback on failure
• Strong transaction integrity
Security Features
Fraud Prevention
The smart contract ensures that assets remain locked until both participants fulfill their obligations. This
prevents one party from receiving assets without providing their own.
Transparency
All transactions are recorded on the blockchain and can be verified by anyone. This creates a transparent and
auditable transaction history.
Immutability
Once the swap transaction is recorded, it cannot be altered or deleted. This ensures permanent proof of asset
ownership transfer.
Decentralization
No centralized authority or intermediary controls the transaction. The smart contract independently manages the
entire exchange process.
Secure Ownership Verification
The contract verifies NFT ownership and ERC-20 balances before accepting deposits. This prevents
unauthorized asset transfers.
Prevention of Fraudulent Behavior
The escrow mechanism prevents fraudulent behavior by ensuring that neither participant can access the other's
asset until both deposits are confirmed.
Since the smart contract automatically enforces the exchange rules, there is no opportunity for either party to
manipulate the transaction. Even if one participant attempts to cancel the process after depositing assets, the
contract follows predefined conditions and executes only valid operations.
This significantly reduces the risk of scams, disputes, and malicious behavior.
Architectural Diagram
Party A
(NFT Owner)
|
| NFT Deposit
v
--------------------------------
| Escrow Smart Contract |
--------------------------------
^
|
| ERC-20 Deposit
|
Party B
(Token Owner)
|
v
Verification of Deposits
|
v
Atomic Swap Execution
|
----------------------------
| |
v v
NFT transferred to B ERC-20 transferred to A
Advantages
The proposed trustless asset-swapping system eliminates the need for trusted intermediaries and significantly
reduces transaction risk. The escrow mechanism ensures fairness by requiring both parties to deposit assets
before the exchange occurs. Atomic transactions prevent partial execution and guarantee that both transfers
succeed together. The system also provides transparency, immutability, security, and reduced transaction costs
compared to traditional exchange methods.
Advantages
• Trustless asset exchange
• No intermediaries required
• Atomic transaction execution
• Strong security
• Fraud prevention
• Transparent transactions
• Reduced transaction costs
• Decentralized operation
3(b) Analyze the design of a decentralized blind auction system that uses Commit and Reveal phases to
hide bid values until the auction ends. Explain how hashed bid commitments and bid revelation ensure
fairness, prevent bid sniping, and determine the winning bidder. (7 Marks)
Introduction
A Blind Auction is a type of auction in which bidders keep their bid amounts hidden until the bidding period
ends. Unlike traditional auctions where participants can see competing bids and continuously increase their
offers, a blind auction prevents bidders from knowing the values submitted by others. This improves fairness
and prevents manipulative practices such as bid sniping. Blockchain technology further enhances blind auctions
by using smart contracts to securely manage bids, verify participants, and automatically determine the winner.
Decentralized Blind Auction
A decentralized blind auction operates on a blockchain network using smart contracts instead of a central
auctioneer. The smart contract manages the entire auction process, including bid submission, bid verification,
winner selection, and fund refunds.
Since all auction rules are encoded into the smart contract, no participant can manipulate the auction process.
Every action is recorded on the blockchain, ensuring transparency, security, and trust among participants.
Commit Phase
The Commit Phase is the first stage of the blind auction process. During this phase, bidders do not reveal their
actual bid amounts. Instead, they generate a cryptographic hash using their bid value and a secret password or
random number.
The generated hash is submitted to the smart contract and stored on the blockchain. Since only the hash is
visible, no one can determine the actual bid amount. This keeps all bids confidential during the auction period.
Purpose of Commit Phase
• Hides actual bid values
• Protects bidder privacy
• Prevents competitors from viewing bids
• Secures bid information using cryptographic hashing
Example
Bid Amount = 100 ETH
Secret = "ABC123"
Hash = H(100 + ABC123)
Only the hash is stored on the blockchain.
Hashed Bid Commitments
Hashed bid commitments are the foundation of the blind auction mechanism. A hash function converts bid
information into a fixed-length encrypted value. Even a small change in the bid amount produces a completely
different hash.
Because cryptographic hash functions are one-way functions, it is practically impossible to determine the
original bid value from the stored hash. This ensures that bid information remains confidential until the reveal
phase begins.
Benefits of Hash Commitments
• Bid secrecy
• Tamper resistance
• Data integrity
• Strong security
• Protection against bid manipulation
Reveal Phase
After the bidding deadline expires, the auction enters the Reveal Phase. During this stage, bidders submit their
original bid amount along with the secret value used during hash generation.
The smart contract recalculates the hash using the revealed information and compares it with the previously
stored hash. If both hashes match, the bid is accepted as valid.
This process proves that the bidder is revealing the same bid that was originally committed during the Commit
Phase.
Purpose of Reveal Phase
• Validates original bids
• Prevents bid alteration
• Confirms bidder authenticity
• Enables winner selection
Bid Verification Process
The smart contract performs automatic verification of each revealed bid. It compares the newly generated hash
with the stored commitment hash.
If:
Generated Hash = Stored Hash
The bid is accepted.
If:
Generated Hash ≠ Stored Hash
The bid is rejected.
This mechanism prevents bidders from changing their bid amounts after seeing competitors' bids.
Prevention of Bid Sniping
Bid sniping occurs when a participant waits until the last moment to observe other bids and then submits a
slightly higher bid to win the auction.
In a decentralized blind auction, bid sniping is impossible because no participant can see the actual bid values
during the Commit Phase. All bidders only see cryptographic hashes, which reveal no information about the
underlying bid amount.
Since bid amounts remain hidden until the Reveal Phase, participants must decide their bids independently
without knowing competitors' offers.
How Bid Sniping is Prevented
• Bid values remain hidden
• Competitors cannot view bids
• Last-minute manipulation is eliminated
• Equal opportunity for all bidders
Winner Determination
After all valid bids have been revealed and verified, the smart contract compares the bid amounts. The bidder
who submitted the highest valid bid becomes the winner of the auction.
The smart contract automatically identifies the highest bid and records the winner on the blockchain. This
process is completely transparent and does not require human intervention.
Winner Selection Steps
1. Collect all revealed bids.
2. Verify hash commitments.
3. Reject invalid bids.
4. Compare valid bid values.
5. Select highest bidder.
6. Announce winner.
Refund Mechanism
Participants who do not win the auction are allowed to withdraw their deposited funds using a refund or
withdraw function.
The smart contract securely stores refundable balances and transfers funds back to unsuccessful bidders. This
ensures fairness and prevents loss of funds.
Benefits of Refund System
• Secure fund recovery
• Fair treatment of participants
• Automated withdrawal process
• Reduced disputes
Smart Contract Workflow
Step 1: Auction Creation
The auction creator deploys the smart contract and defines auction rules.
Step 2: Commit Phase
Bidders generate hashes and submit bid commitments.
Step 3: Storage of Hashes
The smart contract stores bid hashes securely on the blockchain.
Step 4: Reveal Phase
Bidders reveal their actual bids and secret values.
Step 5: Verification
The smart contract validates each bid using hash comparison.
Step 6: Winner Selection
The highest valid bid is identified automatically.
Step 7: Fund Distribution
Winner receives the auctioned asset, and unsuccessful bidders receive refunds.
Architectural Diagram
Bidder A
|
Hash(Bid+Secret)
|
v
---------------------
| Smart Contract |
---------------------
^
|
Hash(Bid+Secret)
|
Bidder B
----- Commit Phase -----
|
v
----- Reveal Phase -----
Reveal Bid + Secret Values
|
v
---------------------
| Verification |
---------------------
|
v
Highest Valid Bid Wins
|
v
Refund Others
Advantages
A decentralized blind auction provides strong privacy because bid values remain hidden until the reveal stage. It
prevents bid sniping, collusion, and manipulation by ensuring that competitors cannot observe each other's bids.
Smart contracts automate verification and winner selection, reducing human intervention and increasing trust.
The blockchain ledger provides transparency, immutability, and auditability throughout the auction process.
Advantages
• Bid privacy
• Prevention of bid sniping
• Transparent winner selection
• Automated verification
• Secure refunds
• Reduced fraud
• Decentralized operation
The decentralized blind auction system uses Commit and Reveal phases to ensure secure and fair bidding.
Hashed bid commitments hide bid values during the auction, while the Reveal Phase verifies bid authenticity
through cryptographic validation. This approach prevents bid sniping, protects bidder privacy, and guarantees
that the highest valid bidder is selected fairly. By leveraging blockchain and smart contracts, the system
provides transparency, security, and trust without requiring a central auction authority.
3(c) A medicine-transfer transaction is executed using Hyperledger Fabric chaincode. Evaluate the
effectiveness of the chaincode execution lifecycle (from installation to invoke) in ensuring security and
consistency. Justify your assessment and recommend suitable enhancements. Also, explain the steps and
commands in chaincode execution lifecycle with a sample medicine-transfer transaction chaincode. (10
Marks)
Introduction
Hyperledger Fabric is a permissioned blockchain platform designed for enterprise applications. It uses
Chaincode (Smart Contracts) to define business logic and automate transactions between participants. In a
pharmaceutical supply chain, chaincode can be used to manage medicine transfers between manufacturers,
distributors, pharmacies, and hospitals. The chaincode lifecycle ensures that smart contracts are securely
installed, approved, committed, and executed across the network while maintaining consistency and trust among
all participants.
Chaincode Execution Lifecycle
The chaincode lifecycle in Hyperledger Fabric consists of multiple stages that ensure all organizations agree on
the smart contract before it becomes active on the blockchain.
1. Chaincode Packaging
The first step is packaging the chaincode source code into a deployable format. Packaging creates a compressed
file containing the smart contract logic that can be distributed to all participating organizations.
This step ensures that all organizations receive the same chaincode version and prevents inconsistencies in
contract execution.
Command
peer lifecycle chaincode package [Link] \
--path ./medicine-transfer \
--lang golang \
--label medicine_1
2. Chaincode Installation
After packaging, the chaincode is installed on peer nodes of participating organizations. Installation makes the
smart contract available locally on the peer but does not yet activate it.
Each organization independently installs the chaincode on its peers to prepare for approval and execution.
Command
peer lifecycle chaincode install [Link]
3. Chaincode Approval
Every participating organization reviews and approves the chaincode definition. This step ensures that all
organizations agree on the chaincode version, endorsement policy, and execution rules.
Approval prevents unauthorized smart contracts from being deployed on the network.
Command
peer lifecycle chaincode approveformyorg \
--channelID pharmachannel \
--name medicinecc \
--version 1.0 \
--package-id <PACKAGE_ID> \
--sequence 1
4. Chaincode Commit
After receiving sufficient approvals, the chaincode definition is committed to the channel. Once committed, the
chaincode becomes active and available for execution by all authorized network participants.
This step establishes consensus among organizations regarding the chaincode configuration.
Command
peer lifecycle chaincode commit \
--channelID pharmachannel \
--name medicinecc \
--version 1.0 \
--sequence 1
5. Chaincode Invocation
Once the chaincode is committed, users can invoke its functions to execute transactions. In the pharmaceutical
supply chain, invocation may involve transferring medicine ownership from a manufacturer to a distributor.
The transaction proposal is sent to endorsing peers, executed, validated, and recorded on the ledger.
Command
peer chaincode invoke \
-C pharmachannel \
-n medicinecc \
-c '{"Args":["TransferMedicine","MED001","DistributorA"]}'
6. Query Execution
Users can query the blockchain to retrieve medicine details without modifying the ledger. Queries help track
medicine ownership and shipment status.
Command
peer chaincode query \
-C pharmachannel \
-n medicinecc \
-c '{"Args":["QueryMedicine","MED001"]}'
Sample Medicine Transfer Chaincode
The following simplified chaincode demonstrates medicine ownership transfer.
func TransferMedicine(ctx [Link],
medicineID string,
newOwner string) error {
medicine, err := [Link]().GetState(medicineID)
if err != nil {
return err
}
var med Medicine
[Link](medicine, &med)
[Link] = newOwner
updatedMedicine, _ := [Link](med)
return [Link]().PutState(
medicineID,
updatedMedicine)
}
Explanation
The chaincode retrieves medicine information from the ledger using the medicine ID. It updates the ownership
field with the new owner's name and stores the updated information back on the blockchain. Every ownership
transfer becomes permanently recorded and can be audited later.
Medicine Transfer Workflow
Step 1: Manufacturer Creates Medicine Record
The manufacturer registers the medicine batch on the blockchain by storing details such as medicine ID,
manufacturing date, batch number, and ownership information.
Step 2: Transfer Request
The manufacturer initiates a transfer request to send the medicine to a distributor.
Step 3: Chaincode Invocation
The TransferMedicine function is invoked through the chaincode.
Step 4: Endorsement
Endorsing peers execute the transaction proposal and generate endorsements according to the endorsement
policy.
Step 5: Ordering Service
The endorsed transaction is forwarded to the ordering service, which organizes transactions into blocks.
Step 6: Validation
Peers validate endorsements and verify compliance with endorsement policies.
Step 7: Ledger Update
The transaction is committed to the blockchain, and ownership of the medicine is updated.
Security Provided by Chaincode Lifecycle
Smart Contract Verification
Before activation, chaincode must be approved by participating organizations. This prevents malicious or
unauthorized smart contracts from being deployed.
Endorsement Policies
Hyperledger Fabric requires transactions to receive endorsements from specified organizations. This prevents a
single participant from manipulating transaction outcomes.
Example:
Manufacturer AND Distributor
Both organizations must approve the transaction before it becomes valid.
Access Control
Only authorized users can invoke specific chaincode functions. This prevents unauthorized modification of
medicine records.
Immutable Ledger
Once a medicine transfer is recorded, it cannot be altered or deleted. This ensures traceability and auditability.
Cryptographic Security
Digital signatures verify the identity of transaction participants and protect against tampering.
Consistency Provided by Chaincode Lifecycle
Uniform Smart Contract Execution
All peers execute the same chaincode logic, ensuring identical results across the network.
Consensus Validation
Transactions are validated according to endorsement policies before being committed.
Distributed Ledger Synchronization
All peers maintain synchronized copies of the ledger, ensuring consistency among participants.
Version Control
Chaincode lifecycle management ensures that all organizations operate using the same approved chaincode
version.
Evaluation of Effectiveness
The Hyperledger Fabric chaincode lifecycle is highly effective because it provides security, consistency, and
controlled governance. Multiple approval stages prevent unauthorized contract deployment, while endorsement
policies ensure trustworthy transaction validation. The lifecycle also guarantees that all organizations execute
the same business logic, eliminating discrepancies.
For pharmaceutical supply chains, this is especially important because medicine records must remain accurate,
tamper-proof, and traceable throughout the product lifecycle.
Recommended Enhancements
Integration with IoT Sensors
Temperature and humidity sensors can automatically update medicine storage conditions on the blockchain.
Multi-Level Endorsement Policies
Critical transactions can require approvals from multiple organizations for increased security.
AI-Based Anomaly Detection
Artificial intelligence can identify suspicious transactions or counterfeit medicine activities.
Automated Regulatory Compliance
Smart contracts can automatically verify compliance with pharmaceutical regulations before approving
transfers.
Real-Time Monitoring Dashboards
Organizations can track medicine movements and inventory status through blockchain dashboards.
Architecture Diagram
Manufacturer
|
v
Invoke Chaincode
|
v
+------------------+
| Endorsing Peers |
+------------------+
|
v
+------------------+
| Ordering Service |
+------------------+
|
v
+------------------+
| Validation Peers |
+------------------+
|
v
+------------------+
| Blockchain Ledger|
+------------------+
|
v
Distributor
The Hyperledger Fabric chaincode lifecycle provides a secure and consistent framework for executing
medicine-transfer transactions. Through packaging, installation, approval, commitment, and invocation, it
ensures that only authorized and verified smart contracts operate within the network. Features such as
endorsement policies, access control, immutable ledgers, and consensus validation make it highly suitable for
pharmaceutical supply chain management. By integrating advanced technologies such as IoT, AI, and
automated compliance monitoring, the effectiveness of the system can be further enhanced.
Currency Transaction
Conversion Validation
\ /
\ /
v v
Recipient Bank
|
v
Receiver
Advantages of Blockchain-Based Cross-Border Payments
Blockchain-based cross-border payments offer faster settlement, lower transaction costs, improved
transparency, and enhanced security. The elimination of intermediaries reduces operational complexity and
improves overall efficiency. The use of stablecoins ensures smooth liquidity management and minimizes
foreign exchange risks.
Advantages
• Faster settlements
• Lower costs
• Improved transparency
• Enhanced security
• Better liquidity management
• Reduced dependence on intermediaries
• Real-time transaction tracking
The proposed blockchain-based cross-border payment system uses a permissioned blockchain, smart contracts,
and stablecoin-based liquidity management to provide fast, secure, and cost-effective international money
transfers. By eliminating intermediaries and automating settlement processes, the solution significantly reduces
transaction time and operational costs while maintaining transparency, security, and regulatory compliance.
This makes blockchain an ideal technology for modern cross-border payment systems.
\ /
\ /
v v
Recipient Bank
|
v
Receiver
Advantages of Blockchain-Based Cross-Border Payments
Blockchain-based cross-border payments offer faster settlement, lower transaction costs, improved
transparency, and enhanced security. The elimination of intermediaries reduces operational complexity and
improves overall efficiency. The use of stablecoins ensures smooth liquidity management and minimizes
foreign exchange risks.
Advantages
• Faster settlements
• Lower costs
• Improved transparency
• Enhanced security
• Better liquidity management
• Reduced dependence on intermediaries
• Real-time transaction tracking
The proposed blockchain-based cross-border payment system uses a permissioned blockchain, smart contracts,
and stablecoin-based liquidity management to provide fast, secure, and cost-effective international money
transfers. By eliminating intermediaries and automating settlement processes, the solution significantly reduces
transaction time and operational costs while maintaining transparency, security, and regulatory compliance.
This makes blockchain an ideal technology for modern cross-border payment systems.
4(b) Explain the working of Sybil Attack, Selfish Mining and 51% Attack with suitable defense
mechanisms for each attack. (7 Marks)
Introduction
Blockchain networks are designed to provide security, transparency, and decentralization. However, malicious
users may attempt to exploit the network through various attacks. Among the most common attacks are Sybil
Attack, Selfish Mining Attack, and 51% Attack. These attacks can affect consensus, transaction validation,
and the overall trustworthiness of the blockchain. Therefore, understanding their working mechanisms and
defense strategies is important for maintaining a secure blockchain ecosystem.
1. Sybil Attack
Working of Sybil Attack
A Sybil Attack occurs when a malicious user creates multiple fake identities or nodes within a blockchain
network. Instead of participating as a single node, the attacker controls many fake nodes that appear to be
independent participants. These fake identities are then used to influence network decisions, manipulate voting
processes, or disrupt communication among honest nodes.
For example, if a blockchain network contains 100 nodes and an attacker creates 40 fake nodes, the attacker
gains significant influence over the network. Even though the nodes appear different, they are all controlled by
the same person.
Effects of Sybil Attack
• Creation of fake identities
• Manipulation of network decisions
• Reduced trust among participants
• Increased network congestion
• Threat to decentralization
Defense Mechanisms
Blockchain networks use consensus mechanisms that make creating multiple identities expensive.
• Proof of Work (PoW) requires computational power.
• Proof of Stake (PoS) requires financial stake.
• Identity verification in permissioned blockchains prevents fake participants.
• Resource-based participation increases attack cost.
2. Selfish Mining Attack
Working of Selfish Mining Attack
Selfish Mining is a strategy where a miner or mining pool does not immediately publish newly mined blocks to
the network. Instead, the miner secretly keeps the blocks and continues mining on a private chain.
When the private chain becomes longer than the public blockchain, the attacker releases it to the network. Since
blockchain protocols accept the longest valid chain, the attacker's chain becomes the official blockchain. Honest
miners who worked on the public chain lose their rewards because their blocks become invalid.
This gives selfish miners an unfair advantage and allows them to earn more rewards than honest participants.
Example
1. Attacker mines a block.
2. Instead of broadcasting it, the attacker keeps it private.
3. Attacker mines additional blocks secretly.
4. Private chain becomes longer than public chain.
5. Attacker releases private chain.
6. Network accepts attacker's chain.
7. Honest miners lose rewards.
Effects of Selfish Mining
• Unfair mining rewards
• Wastage of computational resources
• Increased centralization
• Reduced network efficiency
• Lower trust in the mining process
Defense Mechanisms
Several measures can reduce the effectiveness of selfish mining.
• Faster block propagation across the network.
• Improved consensus protocols.
• Monitoring suspicious mining behavior.
• Encouraging decentralization of mining pools.
• Limiting excessive concentration of hash power.
3. 51% Attack
Working of 51% Attack
A 51% Attack occurs when a miner or group of miners gains control of more than 50% of the total
computational power (hash rate) of the blockchain network. Since blockchain systems follow the longest-chain
rule, the attacker can generate blocks faster than the rest of the network.
With majority control, the attacker can create an alternative blockchain and force the network to accept it. This
allows the attacker to reverse transactions, perform double-spending attacks, and prevent other users'
transactions from being confirmed.
Example
Suppose a blockchain network has:
• Total Hash Power = 100 TH/s
• Honest Miners = 49 TH/s
• Attacker = 51 TH/s
Since the attacker controls the majority of mining power, they can continuously create the longest blockchain
and influence transaction validation.
Double Spending in 51% Attack
The attacker sends cryptocurrency to a merchant and receives goods or services. At the same time, the attacker
secretly mines an alternative blockchain where the payment never occurred.
After receiving the goods, the attacker releases the longer blockchain. The network accepts the attacker's
version, causing the original payment transaction to disappear. As a result, the attacker keeps both the
cryptocurrency and the purchased goods.
Effects of 51% Attack
• Double spending
• Transaction reversal
• Blocking legitimate transactions
• Network manipulation
• Loss of user confidence
Defense Mechanisms
To reduce the risk of a 51% attack, blockchain networks should ensure mining power remains decentralized.
• Increase participation of independent miners.
• Prevent mining pool dominance.
• Encourage geographic distribution of miners.
• Monitor unusual hash power concentration.
• Require multiple transaction confirmations.
Comparison of Attacks
Attack Objective Impact Defense Mechanism
Sybil Attack Create fake identities Manipulate network decisions PoW, PoS, Identity Verification
Selfish Gain extra mining Wasted resources and Fast propagation, mining
Mining rewards centralization decentralization
Control majority hash Double spending and transaction Decentralization, hash power
51% Attack
power reversal distribution
Sybil Attack, Selfish Mining, and 51% Attack are major threats to blockchain networks. A Sybil Attack uses
multiple fake identities to influence network operations, Selfish Mining exploits hidden blocks to gain unfair
rewards, and a 51% Attack allows attackers to control transaction validation and perform double spending.
Effective defense mechanisms such as decentralization, proof-based participation, rapid block propagation, and
continuous monitoring help maintain blockchain security, fairness, and trustworthiness.
IoT Sensors
(Temperature, Humidity, GPS)
|
v
ORACLES
|
v
CUSTOMER
(QR Verification)