or
or
By clicking below, you agree to our terms of service.
New to HackMD? Sign up
Syntax | Example | Reference | |
---|---|---|---|
# Header | Header | 基本排版 | |
- Unordered List |
|
||
1. Ordered List |
|
||
- [ ] Todo List |
|
||
> Blockquote | Blockquote |
||
**Bold font** | Bold font | ||
*Italics font* | Italics font | ||
~~Strikethrough~~ | |||
19^th^ | 19th | ||
H~2~O | H2O | ||
++Inserted text++ | Inserted text | ||
==Marked text== | Marked text | ||
[link text](https:// "title") | Link | ||
 | Image | ||
`Code` | Code |
在筆記中貼入程式碼 | |
```javascript var i = 0; ``` |
|
||
:smile: | ![]() |
Emoji list | |
{%youtube youtube_id %} | Externals | ||
$L^aT_eX$ | LaTeX | ||
:::info This is a alert area. ::: |
This is a alert area. |
On a scale of 0-10, how likely is it that you would recommend HackMD to your friends, family or business associates?
Please give us some advice and help us improve HackMD.
Syncing
xxxxxxxxxx
HW 1: Blockchains
Released: Monday, January 29, 2024 at 11:59 E.T.
Due: Sunday, February 4, 2024 at 11:59PM E.T.
Instructions
Submit your answers to the following problems on Gradescope. Problems are NOT all or nothing. For example, each statement in Problem 1 is worth 2 points. The grading breakdown is visible on Gradescope.
The lectures this week may help you complete Problems 2-4.
Problem 1 (10 points)
Here are three properties of cryptographic hash functions.
For a nice distinction between preimage resistance and second preimage resistance, check out this thread.
Which of the following statements are true (2 points each)?
Problem 2 (4 points)
Using what you now know about these key cryptographic hash properties and the concept behind Proof-of-Work ("One CPU, One Vote"), hypothesize how these cryptographic properties may be used in Bitcoin's code to ensure that a miner has performed some amount of computation before voting. In other words, how can we use these properties or your pre-existing knowledge of hashes to make a kind of computationally intensive "puzzle" for the miner to solve? If you are already familiar with Bitcoin's Proof-of-Work Consensus Protocol, feel free to ideate alternative approaches. If you are completely lost or just want to confirm your intuition, consider checking out Bitcoin's White Paper or reviewing the lecture notes (Chapter 3 may be particularly helpful).
Make your response no longer than 150 words. Submissions will be graded on effort and general conceptual understanding.
Problem 3 (8 points)
Suppose there are two distinct Bitcoin protocol implementations, called \(A\) and \(B\).
One day an attacker finds a vulnerability in implementation \(A\) that causes miners running that implementation to accept transactions that double-spend a UTXO. Implementation \(B\) treats such transactions as invalid.
Which of these happens when attackers start submitting double-spending transactions (2 points each)?
Problem 4 (6 points)
Assume everyone has a public/private key pair, and everyone knows everyone else’s public key. For example \(PK_{Alice}, SK_{Alice}\) is Alice’s public/private key pair, and everyone knows that \(PK_{Alice}\) belongs to Alice.
For short, \(\{m\}_{Alice}\) denotes a pair \((m, σ)\) where \(σ\) is Alice’s signature for \(m\) using her private key.
The DeadTreeCoin cryptocurrency is the latest investment craze. Alice, the banker, is authorized to mint coins. Transactions are published in newspaper classified ads. In a minting transaction, Alice creates a coin, here with serial number 1234, and grants ownership to Bob.
\[\textrm{coin$_{1}$} := \{\textrm{mint 1 coin serial 1234 for } PK_{Bob}\}_{Alice} \tag{0.1}\]
In a spending transaction, Bob transfers ownership of a coin to Carol.
\[\textrm{coin$_{2}$} := \{\textrm{spend SHA256($\textrm{coin}_{1}$) to } PK_{Carol}\}_{Bob} \tag{0.2}\]
Your job is define valid coins so that (1) no invalid coin appears valid, and (2) no valid coin can be double-spent. Every day, the coin authority buys a classified ad with any new transactions.
For this problem, we're evaluating equations Equation 0.1 and Equation 0.2 separately. Thus, when evaluating Equation 0.2, we don't know the provenance of \(\textrm{coin}_{1}\). Also note that validity by itself does not imply ownership.
Which of the following pairs of statements accomplishes (1) and (2) (2 points each)?