COMP90088: Cryptocurrencies and decentralised ledgers Semester 1 2022
Tutorial Sheet, Week 3 Week of March 14, 2022
1. UTXO-based transactions. Suppose that a UTXO-based blockchain has the following transactions:
25→A; 25→B
Copyright By PowCoder代写 加微信 powcoder
10→A; 13→C; 1→D
2→A; 2→B; 4→C; 2→D; 2→E
1[1]; 3[4]
4→A; 11→B; 1→C; 5→D; 5→E
4[2]; 3[2]
1→C; 1→D; 2→E
a. For each key in {A, B, C, D, E}, how much value is controlled after Transaction 5?
b. What is the state of the UTXO set after Transaction 5?
c. How much money in total is given as transaction fees in Transactions 1-5?
d. Which of the following could be a valid Transaction 6? For the invalid possibilities, why are they invalid?
5[1]; 5[2]
4[3]; 2[0]; 5[1]
4[1]; 4[2]
e. If you want to incentivize keeping the UTXO set size minimal, would you want fees to be based on the number of inputs to a transaction, the number of outputs, or both?
2. Bitcoin blocks. Recall that a Bitcoin block has the following format:
Size (bytes)
Previous block hash
of transactions
Difficulty
Nonce (for proof-of-work)
a. For each of these fields, how often do they change in practice from block to block?
b. Block headers are nominally 80 bytes in size. Consider a client that is storing all blocks in the chain. Estimate how much space they can save by intelligently compressing fields that are predictable given the previous block
3. Bitcoin script. Recall that a Bitcoin P2PKH (Pay to Public Key Hash) transaction uses a ScriptPubKey of the following format:
OP_DUP OP_HASH160
Whereas a P2PK transaction (Pay to Public Key) uses a ScriptPubKey as follows:
OP_CHECKSIG
a. For each version, consider what needs to be supplied in the ScriptSig to spend each UTXO.
b. P2PKH is now strongly preferred over P2PK. Explain why this format has performance and security advantages.
程序代写 CS代考 加微信: powcoder QQ: 1823890830 Email: powcoder@163.com