Hash

 
  • Money / A token can be valuable because we think it is valuable
  • A cryptocurrency is a digital or virtual currency that is secured by cryptography, which makes it nearly impossible to counterfeit or double-spend.
  • A defining feature of cryptocurrencies is that they are generally not issued by any central authority, rendering them theoretically immune to government interference or manipulation.
 

Money

  • pros of banks: digital payments, maintain the balance
  • cons of banks: 1. bank must be online 2. bank can fail 3. bank can delay 4. privacy

E-cash

  • should make sure that people can’t copy the coins
  • the bank keeps a serial number, make sure that it’s the same coin after transaction
  • pros of simple e-cash : digital payments, peer-to-peer
  • cons: 1. bank needs to be online 2. bank can fail 3. privacy 4. bank can delay or censor transactions
 

Chaumian e-cash

  • Alice can choose serial number (SN)
  • Alice adds some random noise to the SN to the bank so bank can’t see SN
  • when Bob redeems, bank doesn’t know payment came from Alice
  • if Alice give the same coin to two people (double spent), bank would know it was Alice, then she would be punished.
  • Alice gives a coin to Bob, the coin holds both SN and sig(SN), the bank makes sure that each SN is seen once
  • pros:digital, peer-to-peer, privacy, offline double-spend detection
  • cons: bank can censor withdraw transactions
 
 

Hash functions:

  1. data can be any size, output is fixed size & “random” looking
    1. Hash function with n bit output is referred to as an n-bit hash function
      “Avalenche effect” : change 1 bit of the input, about half the output should change
 
  1. properties:
  • preimage resistance
    • given y, you can’t find any x such that hash(x) == y
  • 2nd preimage resistance
    • given x, y, such that hash(x) == y, can’t find x’ ≠ x, where hash(x’)==y
  • collision resistance ( harder )
    • nobody can find any x, z such that x ≠ z, where hash(x) == hash(z)
 
  1. usages:
hashes are names / references / pointers / commitments
in circle maps, can’t use hash functions: thus preimage can be found
 
  1. Commit reveal
commit to something secret by publishing a hash
reveal the preimage later
 
$ echo “ it won’t snow. d79fe819” | sha256sum
a3iaohfoir32ohaoi23i
 
d79fe819 : randomness; HMAC; so people can’t guess my preimage
 
commit reveal
a3iaohfoir32ohaoi23i
reveal
it won’t snow. d79fe819
 
  1. signature ( a message signed by someone ):
3 funtions are needed:
  • GenerateKeys()
    • returns a privateKey, publicKey pair
    • takes in only randomness
    • public key : your identity
    • secrete key : only you control, prove your identity
  • Sign( secreteKey, message )
    • signs a message given a secreteKey
  • Verify( publicKey, message, signature )
    • verify a signature on a message from a public key. returns a boolean
 
 
Lamport Sigs :
  • Generate Key
notion image
pubKey = hash( secKey )
 
  • Sign
notion image
 
  • verify
notion image
 
notion image
notion image