Professional Documents
Culture Documents
WEEK 1 LECTURE
EXERCISE QUESTIONS/ANSWERS
Submitted by
Group : Senior
PART A
1. Describe the challenges of adding a block to a blockchain faced by the miners when mining a
block
If every miner adds the block to the chain, there will be many branches to the chain, resulting in
inconsistent state. Recall, the blockchain is a single consistent linked chain of BLOCKS
2. Describe the solution used to overcome the challenges of adding a block to a blockchain.
Miners compete to solving a PUZZLE to determine who earn the right to create the next block. In the
case of bitcoin blockchain, this is a computation of PUZZLE using the central processing unit & it is CPU
intensive. Once a miner solves the PUZZLE, the announcement is broadcast to the network and the block
is also broadcast to the network. Then, other participants verify the new block. Participants reach a
consensus to add a new block to the chain. This new block is added to their local copy of the blockchain.
Thus, a new set of transactions are recorded and confirmed.
Proof-Of-Work(POW) is the algorithm for consensus . to claim the right to form the next block.
4. What are the three major types of Blockchains? Give an example in each case.
Type one - deals with the coins in cryptocurrency currency chain. Example, Bitcoin.
Type two - supports cryptocurrency and a business logic layer supported by code execution.
Example, Ethereum.
Type three - involves no currency but supports software execution for business logic. Example,
The Linux Foundation's Hyperledge
5. What are three major classifications of Blockchains based on the access limits.
Public Blockchain
Private Blockchain
Permissioned blockchain
6. Distinguish between Bitcoin & Ethereum with help of Bitcoin Stack and Ethereum Stack
diagrams
Bitcoin: Bitcoin blockchain is associated with wallet application for initiating transactions
Ethereum: Took a step towards transforming the blockchain into a computational framework that
opened many opportunities in the decentralized realm , supports smart contracts and VM.
EVM is An Ethereum Virtual Machine .Provides a run anywhere abstruction layer for the contract cod
9. What are the two types of accounts in Ethereum. Explain them clearly.
An Ethereum FULL NODE hosts the software needed for Transaction initiation, Validation, Mining, Block
creation, Smart contract execution and the Ethereum Virtual Machine, EVM.
11. Describe all the operations involved in the deployment of a smart contract aand in the
invocation of a smart contract.
1. Smart contract is designed, developed, compiled and deployed on the EVM that can be more
than one smart contract in an EVM.
2. When the target address in a transaction is a smart contract, the execution code corresponding
to the smart contract is activated and executed on the EVM.
3. The input needed for this execution is extracted from the payload field of the transaction.
4. Current state of the smart contract is the values of the variables defined in it.
5. The state of the smart contract may be updated by this execution.
6. Results of this execution is stored in the receipts.
7. A blockchain maintains both the state hash and the receipt hash.
8. All the transactions generated are validated.
9. Transaction validation involves checking the time-stamp and the nonce combination to be valid
and the availability of sufficient fees for execution.
10. Miner nodes in the network receive, verify, gather and execute transactions.
11. The in-work smart contract code are executed by all miners.
12. Validated transactions are broadcast and gathered for block creation.
13. The consensus protocol used is a memory-based rather than a CPU-based proof of work.
STEP 1: A user writes and signs a transaction request with the private key of some account.
STEP2 : The user broadcasts the transaction request to the entire Ethereum network from some node.
STEP 3: Upon hearing about the new transaction request, each node in the Ethereum network adds the
request to their local mempool, a list of all transaction requests they’ve heard about that have not yet
been committed to the blockchain in a block.
STEP 4:At some point, a mining node aggregates several dozen or hundred transaction requests into a
potential block, in a way that maximizes the transaction fees they earn while still staying under the block
gas limit.
STEP 5: Eventually, a miner will finish producing a certificate for a block which includes our specific
transaction request. The miner then broadcasts the completed block, which includes the certificate and
a checksum of the claimed new EVM state.
STEP 6: Other nodes hear about the new block. They verify the certificate, execute all transactions on
the block themselves (including the transaction originally broadcasted by our user), and verify that the
checksum of their new EVM state after the execution of all transactions matches the checksum of the
state claimed by the miner’s block. Only then do these nodes append this block to the tail of their
blockchain, and accept the new EVM state as the canonical state.
STEP 7: Each node removes all transactions in the new block from their local mempool of unfulfilled
transaction requests.
STEP 8: New nodes joining the network download all blocks in sequence, including the block containing
our transaction of interest. They initialize a local EVM copy (which starts as a blank-state EVM), and then
go through the process of executing every transaction in every block on top of their local EVM copy,
verifying state checksums at each block along the way.
16. What are Uncle or Ommer Blocks in Ethereum Blockchain? Compare the Uncles blocks
with Orphan blocks in Bitcoin..
There may be other miners who also solve the puzzle besides the winner. These miners will solve the
puzzle, but didn't win the block are called Ommers. The blocks created by them are called Ommer
Blocks
Uncle blocks are created on ethereum-based blockchains, and they are similar to bitcoin’s orphan block.
Uncle blocks are created in Ethereum blockchains when two blocks are mined and submitted to the
ledger at roughly the same time. Only one can enter the ledger as a block, and the other does not.
They are similar to Bitcoin orphans, but have an integrated use, unlike their Bitcoin counterparts.
Miners are rewarded for uncle blocks in the Ethereum system, whereas orphan blocks in Bitcoin were
not rewarded. At times, two different miners may generate a block simultaneously.
This happens due to the working mechanism of the blockchain, which may not accept the newly
identified blocks into the blockchain instantaneously. Due to this delay, a situation arises where
another miner solves for the same block and tries to add it to the network chain, which results in a
temporary and unsettled state of the blockchain network as the various nodes try to build a consensus
about which of the newly identified blocks to continue with and which one to reject. The rejected
ones are those which have a relatively lower share of proof of work (POW) and constitute the uncle
blocks, while the ones with the larger share join the blockchain and work as a normal block.
17. State the reasons for including and incentivizing Uncle blocks in Ethereum Blockchain.
Ethereum incentivizes uncle block miners for several reasons: ➢ To increase the number of transactions
on the blockchain, ethereum allows for the creation of more uncle blocks as a byproduct of shorter
block times. ➢ Valid uncle blocks are rewarded to neutralize the effect of network lag on the
distribution of mining rewards. ➢ Incentivizing uncles helps to decrease the centralization of incentives
where large mining pools with high computing power end up claiming the majority of the rewards
leaving nothing for individual miners. ➢ It also increases the security of the network by supplementing
the work on the main blockchain by the work done in mining uncle blocks.
18. Provide the values in the following fields in TWO blocks recently added from the
Bitcoin blockchain by visiting the website : www.bockchain.com/btc/blocks. (TWO
BLOCKS added to BITCOIN Blockchain any date before 19th of the September 2022)
BLOCK #754,373
BLOCK # 754,372…….
(i) Hash(Block Hash) -
000000000000000000079f85934c82f89c3b71e6b5dddf2410aaa459e1c6978c
(ii) Confirmations - 2
(iii) Timestamp - 16 sep. 2022 г., 21:11:05
(iv) Height - 754,372
(v) Miner - SlushPool
(vi) Number of transactions - 1,424
(vii) Difficulty - 32,045,359,565,303.15
(viii) Merkle root -
f7094d0742a5b0a4bd6a197a2f0d00f6ac837b253e8cfe8f4eda66175c8314d3
(ix) Version 0x2133e004
(x) Bits 386,451,604
(xi) Weight 3,993,334 WU
(xii) Size 1,210,543
(xiii) Nonce 2,629,697,647
(xiv) Transaction volume 2,238.7411
(xv) Block Reward 6.40305209 BTC
(xvi) Fee Reward 0.15305209 BTC
19. Define the following fields in a Bitcoin Block & indicate their purpose.
i) Hash
A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed
length. A hash is created using an algorithm and is essential to blockchain management in
cryptocurrency. Hashing requires processing the data from a block through a mathematical function,
which results in an output of a fixed length. Using a fixed-length output increases security since
anyone trying to decrypt the hash won’t be able to tell how long or short the input is simply by looking
at the length of the output. The blockchain only contains validated transactions, which prevents
ii) Timestamp
iii) Height
The block height of a particular block is defined as the number of blocks preceding it in the blockchain.
The very first block on a blockchain is called the genesis block. It has a block height of zero, as no
blocks precede it in the blockchain. The total height of the blockchain is taken to be the height of the
most recent block, or the highest block, in the chain. Block height is also calculated as the length of the
blockchain minus one.
iv) Miner
Validation and consensus process are carried out by special peer nodes called miners. These miner peer
nodes are powerful computers executing software defined by the blockchain protocol.
v) Number of transactions
vi) Difficulty
The difficulty is a measure of how difficult it is to mine a Bitcoin block, or in more technical terms, to find
a hash below a given target. A high difficulty means that it will take more computing power to mine
the same number of blocks, making the network more secure against attacks. The difficulty is adjusted
every 2016 blocks (every 2 weeks approximately) so that the average time between each block remains
10 minutes. The difficulty comes directly from the confirmed blocks data in the Bitcoin network
A Merkle root is the hash of all the hashes of all the transactions that are part of a block in a blockchain
network. A hash tree, or the Merkle tree, encodes the blockchain data in an efficient and secure
manner. It enables the quick verification of blockchain data, as well as quick movement of large amounts
of data from one computer node to the other on the peer-to-peer blockchain network.
viii) Weight
Block weight is a measure of the size of a block, measured in weight units. The Bitcoin protocol limits
blocks to 4 million weight units, restricting the number of transactions a miner can include in a block.
ix) Nonce
A nonce is an abbreviation for "number only used once," which is a number added to a
hashed—or encrypted—block in a blockchain that, when rehashed, meets the difficulty
level restrictions. The nonce is the number that blockchain miners are solving for.
When the solution is found, the blockchain miners are offered cryptocurrency in
exchange.
x) Transaction volume
Transaction zero, index zero of the confirmed block is created by the miner of the block. It has a
special UTXO and does not have any input UTXO. It is called the coinbase transaction that
generates a miner's fees for the block creation.
22. Provide the values in the following fields in the TWO recently added blocks from the
Ethereum blockchain by visiting the website : www.etherscan.io/blocks. (TWO BLOCKS
added to ETHEREUM Blockchain any date before 19th of the September 2022)
BLOCK # 15550018
xiii) Sha3Uncles
xiv) StateRoot
0xe1fcde0e827b98ba06c7fe68f31e337db1be70c1f7e95fdea506daa60660b6a9
xv) Nonce
0x0000000000000000
BLOCK # 15550014
i) Block height 15550014
23. Define the following fields in a Ethereum Block & indicate their purpose.
i) Block height
It is a current number of the block in the blockchain
ii) Timestamp
Time when this block was added to the blockchain
iii) Transactions
An Ethereum transaction refers to an action initiated by an externally-owned account, in other words an
account managed by a human, not a contract. For example, if Bob sends Alice 1 ETH, Bob's account must
be debited and Alice's must be credited. This state-changing action takes place within a transaction.
iv) Mined by
Shows us which account created a block and added it to the block chain and got a reward
for it
v) Block Reward
Is a reward that account gets for creating a block and adding it to a block chain
vi) Uncles reward
When two accounts build and try to add a block to a block chain in nearly the same time,
account that was later is gets uncles reward
vii) Difficulty
ix) Size
The size of a block equals the amount of data it stores.
x) Gas Used
Gas used is the actual amount of gas used at the completion of the block creation.
Gas limit is the amount of gas points available for a block to spend.
xiii) Hash
A hash is a function that converts an input of letters and numbers into an encrypted output of a fixed
length. A hash is created using an algorithm and is essential to blockchain management in
cryptocurrency. Hashing requires processing the data from a block through a mathematical function,
which results in an output of a fixed length. Using a fixed-length output increases security since
anyone trying to decrypt the hash won’t be able to tell how long or short the input is simply by looking
at the length of the output. The blockchain only contains validated transactions, which prevents
fraudulent transactions and double spending of the currency. The resulting encrypted value is a series
of numbers and letters that do not resemble the original data and is called a hash.
Parent hash,is the Keccak 256-bit hash of the parent. (previous) block's header.
xv) Sha3Uncles
The combined hash of all uncles for a given parent.
xvi) StateRoot
the root hash of a specialized kind of Merkle tree which stores the entire state of the
system
xvii) Nonce
In Ethereum, every transaction has a nonce. The nonce is the number of transactions sent from a given
address.
25. Suppose a block specifies a limit of 3 million 5 hundred thousand units of gas, and a basic
Ether transaction fee is 21,000, Compute the number of plain transactions that can be
included in a Ethereum block.
3500000/21000= 166
PART - B
MULTIPLE CHOICE QUESTIONS – Write the answer a, b, c, or d in the box
provided against each question.
26. Did Bitcoin enable a centralized or a decentralized system for exchange of value? A
a) Decentralized b) Centralized
27. Validation, Verification, Immutable Recording, and _____ lead to Trust and
C
Security.
a) Coins b) Tokens c) Consensus d) Algorithms
32. A transaction generates new UTXOs for transferring the amount specified in the input
UTXOs. True or False?
A
a) True b) False
34. The algorithm for consensus in the Bitcoin blockchain is called _____ protocol.
a) Proof of Work A
b) Proof of Worth
c) Proof of Elapsed Time
d) Proof of Stake
37. In a public blockchain, a participant can join and leave the blockchain as and when
they wish. True or False?
a) False b) True B
44. Miners’ Rewards for successfully completing 1 block halve every ……………….
Blocks, or an average of every ………….years
a) 200,000 & 4 b) 210,000 & 8 c) 200,000 & 8 d) 210,000 & 4 D
45. An ………. block is a block that has been solved within the Bitcoin blockchain
network but was not accepted due to a lag within the network itself.
a) Uncle b) Orphan c)Zombie d) Ommer B
46. Say TRUE or FALSE There is no reward for solving a block which is then
determined to be an orphan block. A
a) False b) True
47. Bitcoin supports an optional and special feature called ……..for conditional
a
transfer of values.
a)Scripts b) shell d) miners d) smart contract
48. What allows for the execution of code in the Ethereum Blockchain, while enhancing the
basic value transfer capability of the Bitcoin Blockchain?
a)Ethereum Virtual Machine Proof-of-Work b)Solidity c
c)Smart Contracts d)Byte-code
51. The _____ can send transactions for ether transfer or they can send transactions to
invoke a smart contract code.
a)accounts (address) b)block headers a
c)algorithms d)blocks
53. ____ hosts the software needed for transaction initiation, validation, mining, block
creation, and smart contract execution.
a)EVM b)External Account c
c)Ethereum full node d)Smart Contract
69. Any changes to the value of a state variable in a smart contract are stored on the
blockchain. True or False? b
a) False b) True
70. GASLIMIT is the actual amount of gas spent at the completion of the Block creation.
True or False?
a) False b) True a
71. What are miners who solved the puzzle but didn't win the block creation called?
c
a)Sisters b)Brothers c)Ommers d) Cousins
73. Which of the following is true about an externally owned account (EOA) in
Ethereum Homestead? c
a) EOAs execute code when triggered by a transaction.
b) EOAs have associated code with them.
c) EOAs can send transactions (ether transfer or invoke a contract code)
77. What is the differentiating factor between the Ethereum Blockchain and the Bitcoin
blockchain? b
a)Currency Exchange b)Smart contracts
c)Wallets d)Distributed ledger
78. ............., then ............ methods devised by the blockchain and implemented by the peers
provide the collective trust needed in a decentralized system.
a)Validation, Verification b)Validation, Centralization a
c)Verification, Centralization d)Validation, mutability
79. If a block specifies a limit of 1 million 5 hundred thousand units of gas, and a basic
Ether transaction fee is 21,000, this particular Ethereum block can fit about ....... plain
Ether transactions.
a
a)70 b)90 c)100 d)140
80. If basic Ether transaction fee is 21000 units, gas price per unit is 200 Gwei, Compute
the transaction fee to be paid in ETH(Ether).
a) 0.0042 ETH b)0.042 ETH c)0.000042 ETH d)0.00000042 ETH a
****************