区块链比特币代写-COMP 5521
时间:2021-05-10
The Hong Kong Polytechnic University
COMP 5521 - Distributed Ledger Technology, Cryptocurrency and
E-Payment
Take-home assignment (Winter 2021)
This is an open-book individual assignment. You may use the course material to answer the questions;
however, you must NOT collaborate with anyone or seek direct answers to the questions online. Note
that for the second part of the assignment, you are asked to do some online research. Create a Word/text
document to write your answers and submit preferably a PDF file to Blackboard. This assignment is due
before Wednesday 12 May 2021 11:59PM. Late submissions will be subjected to a 15% penalty per
day. In case of any mistake in the assignment, announcements will be made on Blackboard.
Total: 100 points. (Updated on May 9th 5:40PM)
Part 1 (50 pts)
Question 1 [5 pts]. In Bitcoin, suppose a block contains an nBits field of 0x170DA862.
1. What is the resulting target value for the mining puzzle? Show intermediate calculations.
2. How many hashes a miner is expected to compute before solving the puzzle for this block?
Question 2 [10 pts]. In the Bitcoin blockchain, the block header contains a hash of the Merkle root
that includes all transactions from the current block. Instead, we want to replace the Merkle root by a
simple digest of all transactions concatenated together. In other words, replacing the Merkle root by h
defined as h = SHA256(TX1|TX2| . . . |TXn) where ‘|’ denotes concatenation. Explain why this change
would negatively impact performance. In particular, consider updating the coinbase transaction during
the mining process, and verifying whether a transaction is included in a block.
Question 3 [10 pts]. To estimate the probability of finding a hash value with certain characteristics,
we assumed that the hash function (e.g., SHA256) acts as a random function: given an input value, each
bit of the output has a 50% chance to be either 0 or 1. Let’s now consider a hash function H that has
48% chance to output a 0 (and 52% to output a 1) for each output bit, independently of each other. If
Bitcoin’s puzzle used H instead of SHA256:
1. Would the puzzle be easier or harder to solve? Justify.
2. What would be the expected number of hashes to find a solution given a target threshold of 2180?
Show intermediate calculations.
Question 4 [5 pts]. Suppose the Bitcoin Core development team decides to replace ECDSA with
SPHINCS, a post-quantum digital signature algorithm that cannot be easily defeated by (hypothetical)
quantum computers. The team releases an update of the software that only considers blocks mined after
June 2021 to be valid if transactions are signed with SPHINCS instead of ECDSA.
1. What type of fork will this change create?
2. Describe the resulting consequences on the Bitcoin ecosystem.
Question 5 [5 pts]. If you clone the source code of Bitcoin Core, rename Bitcoin (currency: BTC) to
PolyUCoin (currency: PUC), and start from a new genesis block, does 1 PUC = 1 BTC, i.e., is the value
of a PolyUCoin the same as the value of a bitcoin? Explain why.
Question 6 [15 pts]. Basic Attention Token (BAT) is an ERC-20 token deployed on Ethereum at address
0x0D8775F648430679A709E98d2b0Cb6250d2887EF. The smart contract can be found at https://gist.
github.com/yuriy77k/9f8fcc78745cf81e3aff92da724b3d5c (also attached to this assignment). Brave,
the company that launched BAT in 2017, started a crowdsale to distribute these tokens during a limited
period and raised enough funds to call finalize() successfully. Answer the following questions from
reading the Solidity smart contract.
1. What happened to the ether sent to this smart contract during the crowdsale, now that the
1
crowdsale is finished?
2. Can anyone still send ether to this contract in exchange for BAT tokens? Why?
Note that a contract C inherits functions defined in other contracts A and B, and can redefine those
functions, through the declaration contract C is A, B {...}. You may also refer to Solidity docu-
mentation: https://docs.soliditylang.org/en/latest/introduction-to-smart-contracts.html.
Part 2 (50 pts)
Question 7 [50 pts]. In recent years, we have seen many attacks against Bitcoin, Ethereum, companies
involved with cryptocurrencies, or applications built on top of a blockchain. Choose one such incident,
research it, and prepare a report on it (3 pages maximum including citations).
Ensure that you choose an incident that involves technical concepts. Describe the circumstances of
the incident, the technical details of the issue, what the impact of the issue is, and how the issue was
addressed. Comment on how the issue could have been prevented (if it could have) and what broader
lessons we can learn from it.
Cite all sources. Note that it is inappropriate to copy text (even with grammatical changes) from any
source without proper citation. Citations can be given in an informal, conversational style. Also review
PolyU’s plagiarism policy.1
The following rubric will be used to evaluate your answer.
Technicality
- The selected incident should involve technical concepts.
- The circumstances of the incident should be described completely.
- The technical details of the issue should be clearly explained.
20 pts
Broader Impact
- The description of the impact of the issue.
- How the issue was addressed (mitigations).
- How the issue could have been prevented (if it could have).
- The broader lessons one can learn from the issue.
15 pts
Clarity
- Appropriate background and introduction.
- Report is clearly written and well organized.
- Report displays student’s proper understanding of the issue.
15 pts
1https://www.polyu.edu.hk/ogur/academic_integrity/Plagiarism_Booklet.pdf
2

















































































学霸联盟


essay、essay代写