Blockchain Mid 1 Paper
Blockchain Mid 1 Paper
_____________________ . .
Roll No Section Signature
Section A Blockchain
National University of Computer and Emerging Sciences
Department of Computer Science Chiniot-Faisalabad Campus
Optimizing Merkle Calculation: Monero Style
Q No 1: The Monero approach could be described as converting the hash tree to a perfect
binary tree. It hashes enough leaf nodes in the first iteration, so that the following iterations
will always have some variant of 2ˣ (a power of 2) nodes.
Suppose a miner, Rocky has 2480 transactions in the mempool. He took 27 and 36
transactions in two consecutive block mining processes. The Merkle root has been computed
based on 27 and 36 transactions. The Merkle root optimizes the odd number of transactions
using the monero approach. What will be the values in the first iteration and the second
iteration for both blocks?
For 27:
2^5 = 32
The annual reward rate is typically set by the network protocol and can be adjusted over time
based on factors such as network usage, transaction volume, and the total supply of tokens.
The reward rate is designed to incentivize participation in the network and provide
compensation for the resources and effort required to maintain the network's security and
integrity.
Question: What is the expected annual reward that Bob can earn as a validator in this proof-
of-stake blockchain?
Section B Cryptocurrency
Mempool
Q No 3: A mempool, short for memory pool, is a data structure used by Bitcoin and other
cryptocurrencies to store unconfirmed transactions. When a user sends a transaction, it is first
broadcasted to the network and then added to each node's mempool. Each node validates the
transaction and checks that it is not a duplicate or spending more than the user has available,
before adding it to the mempool. Miners use the mempool to select transactions to include in
the next block they mine, typically choosing the ones with the highest transaction fees first.
Once a transaction is included in a block and confirmed, it is removed from the mempool and
added to the blockchain.
Tx1 60 200
Tx2 90 400
Assume that the current block size limit is 1000 bytes and that the miners always choose
transactions with the highest fee rates first.
What is the maximum amount of transaction fees that can be collected in the next block?
What is the reward (total) in BTC that can be collected in the next block?
Note: 1 BTC = 100000000 Satoshi
Section C Cryptography
SHA-512
SHA-512 is a secure cryptographic hash function that produces a fixed-size output of 512
bits. It uses a compression function that iteratively processes input message blocks and
updates an initial hash state. The resulting hash value is unique to the input message and is
computationally infeasible to reverse or tamper with.
Q No 4: What is the number of padding bits if the length of the original message is 2590
bits?