COMP4137-无代写
时间:2024-05-15
Examination Paper
Examination Session:
May/June
Year:
2023
Exam Code:
COMP4137-WE01
Blockchain & Cryptocurrencies
Release Date/Time 18/05/2023 09:30
Latest Submission Date/Time 18/05/2023 12:30
Format of Exam Restricted window exam
Duration: 2 hours
Word/Page Limit:
Additional Material provided:
Expected form of Submission A SINGLE PDF file submitted to Gradescope
Submission method Gradescope
Instructions to Candidates: Answer ALL questions
Page 1 of 5 COMP4137-WE01
Section A Blockchain & Cryptocurrencies
Dr Gagangeet Aujla
Question 1
(a) George is fascinated by cryptocurrencies after learning about bitcoin’s
success. So, he decides to design a simple cryptocurrency, GeorgeCoin.
He talks to his Daddy (a computer scientist) regarding cryptocurrencies.
Daddy tells George some simple requirements that must be followed while
designing a new cryptocurrency. In this question, you will design a data
structure for GeorgeCoin that satisfies a list of requirements. You also need
to provide the pictorial representation of the data structure following the
suggested requirements. Marks are allocated by requirement, and you will
be marked on whether your design meets the requirement as well as on
your justification that it does so.
i. A single designated entity, George, can create GeorgeCoins, and he
can create them whenever he wants. The created GeorgeCoin be-
long to George, and this can be verified without accessing personal
information. [4 Marks]
ii. The entity that owns the GeorgeCoin can transfer it to any other
entity (let us say, Masha). This must follow some cryptographic
primitives rather than just sending the coin data structure to the
recipient entity. The coin in the transaction should be linked to the
original coin creation transaction. [3 Marks]
iii. The identities of the recipient entity should not be real and may be
referred to using some kind of cryptographic primitive. [2 Marks]
iv. The transfer of funds must be initiated by the owner of the coins, and
the fact that the owner initiated it can be verified using the credentials
sent in the transfer. [2 Marks]
v. Once the valid data structure representing George’s transaction is
created and exists in a blockchain system, how can Masha prove that
she owns the coin and that the coin is valid? [4 Marks]
(b) Once George designed the GeorgeCoin, he creates a transaction to pay
Masha. After that, Masha creates a transaction to pay Peter. Now, Masha
tries to be clever and creates another transaction to pay Mickey. Masha
signs both these transactions. So, Mickey doesn’t know that Masha has
continued
Page 2 of 5 COMP4137-WE01
paid the coin (that is unique) to Peter; he thinks the coin belongs to him.
Both Peter and Mickey can claim to be GeorgeCoin’s legitimate owner,
which is valid. In this question, you need to complete the following tasks.
i. How can this be possible that two different entities are claiming the
same unique coin? It is desired for a cryptocurrency to work in a
reliable manner. So, your task is to design a modified data structure
that follows an efficient transaction processing system to resolve the
above-stated problem in cryptocurrency. Represent the data structure
you have designed with a diagram. [4 Marks]
ii. Show how coins are created and transferred in this new cryptocurrency
and represent the data structure you have designed with a diagram.
[2 Marks]
iii. Your designed data structure must follow a set of constraints that
can be validated to prove the correctness of a transaction. List the
validity constraints that your designed data structure must follow to
prove the correctness of a transaction. [4 Marks]
(c) The simple cryptocurrency you designed in Question 1(b) is still vulnerable
to several issues (or flaws) in practice.
i. Identify any key issues (or flaws) in the cryptocurrency you designed
in Question 1(b), and justify why these issues can occur. [3 Marks]
ii. Describe a solution to the issues identified in Question 1(c)(i). [2 Marks]
Question 2
You are provided with a transaction scenario in the bitcoin system, as
shown in the following figure.
continued
Page 3 of 5 COMP4137-WE01
You are required to answer the following questions.
i. Where has the ‘change address’ happened in the above figure? [2 Marks]
ii. There are several errors in the above transaction scenario. You must
find all the errors and support your answer with valid reasons. Also,
provide the correct replacement for the identified errors. [8 Marks]
iii. What is the technical speciality of transaction 1? Why does it show
input as a null value? Why is there no signature for this transaction?
[3 Marks]
Question 3
(a) George plans to travel to an event in another city he is unfamiliar with.
He is concerned about the security of the device storing his secret/private
keys. He wants to store his GeorgeCoins using a method that does not
allow anyone to redeem them without knowing a password. George uses
the ScriptPubKey address provided below to store them.
OP SHA256
< 987dcca6ea151951c963ce256e3a035b044ee0c597836759e30ca11d08bf74ed >
OP EQUALV ERIFY
i. You are tasked to write a redeem script (ScriptSig) for the above ex-
emplar transaction. [HINT: 3 words related to this exam] [2 Marks]
ii. Is password a secure method to protect GeorgeCoin? Justify your
answer with at least two valid reasons. [3 Marks]
continued
Page 4 of 5 COMP4137-WE01
iii. Do you think Pay-to-script-hash (P2SH) can be a better solution to
tackle the security challenge that concerns George? Provide reasons
to support your answer. [3 Marks]
iv. Can MultiSig provide any additional security benefits when used with
P2SH? Provide reasons to support your answer. [2 Marks]
(b) You need to create a P2SH script using MultiSig to fix the security issue
discussed in Question 3(a). In this question, you will provide the syntax
using any real example for the following cases.
i. P2SH script [2 Marks]
ii. P2SH script using MultiSig
You will be marked on whether your syntax includes the key functional
steps required to create the script, as well as on your justification of
the role of the functional steps. [8 Marks]
Question 4
Assume that the mining difficulty on 3rd May 2023 and 17th May 2023 is
37,590,453,655,497 and 34,093,570,325,203, respectively. Based on this
information, you need to complete the following tasks.
i. What will be the difficulty on 27th May 2023 if the average time to
mine the block was 10 minutes 50 seconds in the past two weeks?
[2 Marks]
ii. What will be the difficulty on 31st May 2023 if the average time to
mine the block was 10 minutes 35 seconds in the past two weeks?
Will it change from the value on 27th May 2023? [3 Marks]
iii. What will be the difficulty on 17th May 2023 if the average time to
mine the block was 9 minutes 10 seconds in the past two weeks? Will
it change from the value on 26th May 2023? [3 Marks]
iv. Compute the possible nonces that can be checked while finding a
valid block. Why do we need to change the nonce parameter in a
coinbase transaction? [4 Marks]
continued
Page 5 of 5 COMP4137-WE01
Question 5
You have been asked to estimate the energy usage of the bitcoin system.
Estimate the energy usage (in MW) for mining blocks using the following
two approaches.
i. Top-down approach (100% mining income spent on energy) for one
hour and 24 hrs scenarios.
You will be marked on the basis of the correctness and completeness
of the answer. [Assume that the average commercial energy price is
18.82 pence per kWh and 1 BTC = £18,600] [5 Marks]
ii. Bottom-up approach (based on the number of hashes) for three hard-
ware infrastructure scenarios listed below.
• GPU [Hashing capability is 60 MH/s for 0.8 kW] [3 Marks]
• FPGA [Hashing capability is 140 MH/s for 0.6 kW] [3 Marks]
• ASIC [Hashing capability is 166TH/s for 3 kW] [4 Marks]
Consider total hash rate as 274,421,895 TH/s.
Question 6
You are provided with several statements related to blockchain. Which of
the following statements are true and which are false? Justify your answer
and provide a corrected version for any statement that is wrong.
i. Super nodes have authority over which transactions are valid. [2 Marks]
ii. Some of the nodes may have a slightly different version of the out-
standing transaction pool. [2 Marks]
iii. The block that fails to be a part of long-term consensus gets ignored
by the network and is called a candidate block. [2 Marks]
iv. Bitcoin incentives for the nodes are not limited to transaction fees.
[2 Marks]
v. Lock time is used to add the transactions permanently in a block.
[2 Marks]
You will be marked on the basis of your answer, justification and the cor-
rected version of the statement that is wrong.
END OF PAPER