BrianSutioso
    • Create new note
    • Create a note from template
      • Sharing URL Link copied
      • /edit
      • View mode
        • Edit mode
        • View mode
        • Book mode
        • Slide mode
        Edit mode View mode Book mode Slide mode
      • Customize slides
      • Note Permission
      • Read
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Write
        • Only me
        • Signed-in users
        • Everyone
        Only me Signed-in users Everyone
      • Engagement control Commenting, Suggest edit, Emoji Reply
    • Invite by email
      Invitee

      This note has no invitees

    • Publish Note

      Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

      Your note will be visible on your profile and discoverable by anyone.
      Your note is now live.
      This note is visible on your profile and discoverable online.
      Everyone on the web can find and read all notes of this public team.
      See published notes
      Unpublish note
      Please check the box to agree to the Community Guidelines.
      View profile
    • Commenting
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
      • Everyone
    • Suggest edit
      Permission
      Disabled Forbidden Owners Signed-in users Everyone
    • Enable
    • Permission
      • Forbidden
      • Owners
      • Signed-in users
    • Emoji Reply
    • Enable
    • Versions and GitHub Sync
    • Note settings
    • Note Insights
    • Engagement control
    • Transfer ownership
    • Delete this note
    • Save as template
    • Insert from template
    • Import from
      • Dropbox
      • Google Drive
      • Gist
      • Clipboard
    • Export to
      • Dropbox
      • Google Drive
      • Gist
    • Download
      • Markdown
      • HTML
      • Raw HTML
Menu Note settings Versions and GitHub Sync Note Insights Sharing URL Create Help
Create Create new note Create a note from template
Menu
Options
Engagement control Transfer ownership Delete this note
Import from
Dropbox Google Drive Gist Clipboard
Export to
Dropbox Google Drive Gist
Download
Markdown HTML Raw HTML
Back
Sharing URL Link copied
/edit
View mode
  • Edit mode
  • View mode
  • Book mode
  • Slide mode
Edit mode View mode Book mode Slide mode
Customize slides
Note Permission
Read
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Write
Only me
  • Only me
  • Signed-in users
  • Everyone
Only me Signed-in users Everyone
Engagement control Commenting, Suggest edit, Emoji Reply
  • Invite by email
    Invitee

    This note has no invitees

  • Publish Note

    Share your work with the world Congratulations! 🎉 Your note is out in the world Publish Note

    Your note will be visible on your profile and discoverable by anyone.
    Your note is now live.
    This note is visible on your profile and discoverable online.
    Everyone on the web can find and read all notes of this public team.
    See published notes
    Unpublish note
    Please check the box to agree to the Community Guidelines.
    View profile
    Engagement control
    Commenting
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    • Everyone
    Suggest edit
    Permission
    Disabled Forbidden Owners Signed-in users Everyone
    Enable
    Permission
    • Forbidden
    • Owners
    • Signed-in users
    Emoji Reply
    Enable
    Import from Dropbox Google Drive Gist Clipboard
       owned this note    owned this note      
    Published Linked with GitHub
    Subscribed
    • Any changes
      Be notified of any changes
    • Mention me
      Be notified of mention me
    • Unsubscribe
    Subscribe
    --- tags: Homeworks --- # HW 1: Blockchains :::info **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](https://www.gradescope.com/). 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. 1. **Collision resistance:** it is hard to find any two $x , y$, where $x \neq y$, such that $H(x) = H(y)$ 2. **Preimage resistance:** your adversary can choose $y$ so that it is hard to find $x$ such that $y = H(x)$. 3. **Second preimage resistance:** your adversary can choose $x$ so that it is hard to find $y$ such that $H(x) = H(y)$ For a nice distinction between preimage resistance and second preimage resistance, check out this [thread](https://stackoverflow.com/questions/28378326/difference-between-preimage-resistance-and-second-preimage-resistance). **Which of the following statements are true (2 points each)?** - [ ] Collision resistance implies preimage resistance. - [ ] Collision resistance implies second preimage resistance. - [ ] Second preimage resistance implies collision resistance. - [ ] Suppose an adversary is trying to steal your unique password to Disney Plus. Your operating system keeps your password secure by hashing and storing them in a file. The primary reason your adversary can't steal your unique password is second preimage resistance. - [ ] If you sign a message by hashing it, the primary property securing your message is collision resistance. ## 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](https://bitcoin.org/bitcoin.pdf) or reviewing the [lecture notes](https://drive.google.com/drive/folders/1cnjMyu9_kkDlh_MXsLWPBaggKH9ZyON0?usp=sharing) (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)?** - [ ] If 80% of the mining power runs $A$, then miners running $A$ will build long chains not recognized by $B$, and the miners running $B$ will eventually go bankrupt. - [ ] If 80% of the mining power runs $A$, the miners running $B$ will ignore the double spending blocks. They will outcompute the miners in $A$, and the miners running $A$ will eventually go bankrupt. - [ ] If 80% of the mining power runs $B$, then miners running $A$ will build long chains not recognized by $B$, and the miners running $B$ will eventually go bankrupt. - [ ] If 80% of the mining power runs $B$, the miners running $B$ will ignore the double spending blocks. They will outcompute the miners in $A$, and the miners running $A$ will eventually go bankrupt. ## 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. :::info $$\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. :::info $$\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)?** - [ ] Pair 1 1. In Equation 0.1, $\textrm{coin}_{1}$ is valid if there is no earlier minting transaction with the same serial number. Afterwards, $\textrm{coin}_{1}$ belongs to Bob. 2. In Equation 0.2, $\textrm{coin}_{2}$ is valid if $\textrm{coin}_{1}$ is valid, and there is no earlier spending transaction for that coin signed by Bob. Afterwards, $\textrm{coin}_{2}$ belongs to Carol. - [ ] Pair 2 1. In Equation 0.1, same as above. 2. In Equation 0.2, $\textrm{coin}_{2}$ is valid if $\textrm{coin}_{1}$ is valid and owned by Bob, and there is no earlier spending transaction for that coin signed by Bob. Afterwards, $\textrm{coin}_{2}$ belongs to Carol. - [ ] Pair 3 1. In Equation 0.1, $\textrm{coin}_{1}$ is valid if there is no earlier minting transaction with the same serial number assigning ownership to someone other than Bob (so exact duplicates are OK). Afterwards, $\textrm{coin}_{1}$ belongs to Bob. 2. In Equation 0.2, same as above.

    Import from clipboard

    Paste your markdown or webpage here...

    Advanced permission required

    Your current role can only read. Ask the system administrator to acquire write and comment permission.

    This team is disabled

    Sorry, this team is disabled. You can't edit this note.

    This note is locked

    Sorry, only owner can edit this note.

    Reach the limit

    Sorry, you've reached the max length this note can be.
    Please reduce the content or divide it to more notes, thank you!

    Import from Gist

    Import from Snippet

    or

    Export to Snippet

    Are you sure?

    Do you really want to delete this note?
    All users will lose their connection.

    Create a note from template

    Create a note from template

    Oops...
    This template has been removed or transferred.
    Upgrade
    All
    • All
    • Team
    No template.

    Create a template

    Upgrade

    Delete template

    Do you really want to delete this template?
    Turn this template into a regular note and keep its content, versions, and comments.

    This page need refresh

    You have an incompatible client version.
    Refresh to update.
    New version available!
    See releases notes here
    Refresh to enjoy new features.
    Your user state has changed.
    Refresh to load new user state.

    Sign in

    Forgot password

    or

    By clicking below, you agree to our terms of service.

    Sign in via Facebook Sign in via Twitter Sign in via GitHub Sign in via Dropbox Sign in with Wallet
    Wallet ( )
    Connect another wallet

    New to HackMD? Sign up

    Help

    • English
    • 中文
    • Français
    • Deutsch
    • 日本語
    • Español
    • Català
    • Ελληνικά
    • Português
    • italiano
    • Türkçe
    • Русский
    • Nederlands
    • hrvatski jezik
    • język polski
    • Українська
    • हिन्दी
    • svenska
    • Esperanto
    • dansk

    Documents

    Help & Tutorial

    How to use Book mode

    Slide Example

    API Docs

    Edit in VSCode

    Install browser extension

    Contacts

    Feedback

    Discord

    Send us email

    Resources

    Releases

    Pricing

    Blog

    Policy

    Terms

    Privacy

    Cheatsheet

    Syntax Example Reference
    # Header Header 基本排版
    - Unordered List
    • Unordered List
    1. Ordered List
    1. Ordered List
    - [ ] Todo List
    • Todo List
    > Blockquote
    Blockquote
    **Bold font** Bold font
    *Italics font* Italics font
    ~~Strikethrough~~ Strikethrough
    19^th^ 19th
    H~2~O H2O
    ++Inserted text++ Inserted text
    ==Marked text== Marked text
    [link text](https:// "title") Link
    ![image alt](https:// "title") Image
    `Code` Code 在筆記中貼入程式碼
    ```javascript
    var i = 0;
    ```
    var i = 0;
    :smile: :smile: Emoji list
    {%youtube youtube_id %} Externals
    $L^aT_eX$ LaTeX
    :::info
    This is a alert area.
    :::

    This is a alert area.

    Versions and GitHub Sync
    Get Full History Access

    • Edit version name
    • Delete

    revision author avatar     named on  

    More Less

    Note content is identical to the latest version.
    Compare
      Choose a version
      No search result
      Version not found
    Sign in to link this note to GitHub
    Learn more
    This note is not linked with GitHub
     

    Feedback

    Submission failed, please try again

    Thanks for your support.

    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.

     

    Thanks for your feedback

    Remove version name

    Do you want to remove this version name and description?

    Transfer ownership

    Transfer to
      Warning: is a public team. If you transfer note to this team, everyone on the web can find and read this note.

        Link with GitHub

        Please authorize HackMD on GitHub
        • Please sign in to GitHub and install the HackMD app on your GitHub repo.
        • HackMD links with GitHub through a GitHub App. You can choose which repo to install our App.
        Learn more  Sign in to GitHub

        Push the note to GitHub Push to GitHub Pull a file from GitHub

          Authorize again
         

        Choose which file to push to

        Select repo
        Refresh Authorize more repos
        Select branch
        Select file
        Select branch
        Choose version(s) to push
        • Save a new version and push
        • Choose from existing versions
        Include title and tags
        Available push count

        Pull from GitHub

         
        File from GitHub
        File from HackMD

        GitHub Link Settings

        File linked

        Linked by
        File path
        Last synced branch
        Available push count

        Danger Zone

        Unlink
        You will no longer receive notification when GitHub file changes after unlink.

        Syncing

        Push failed

        Push successfully