Skip to content

Latest commit

 

History

History
244 lines (162 loc) · 7.6 KB

SLIDES.md

File metadata and controls

244 lines (162 loc) · 7.6 KB

title: Bitcoins and the Blockchain name: inverse layout: true class: middle inverse

<style type="text/css"> this { color: white; } </style>

class: center middle

#Bitcoins and the Blockchain ##Part 1: The Story of Bitcoins David Andrews, Ryatta Group


class: center middle

#Halloween 2008

Bitcoin white paper


Bitcoin - motivation

  • elimination of intermediaries from Internet commerce
    • who are they?
      • trusted third-parties who vouch for either side - financial institutions
        • banks/credit card companies
        • Paypal
        • the Mint
    • why eliminate them?
      • intermediating third-parties cannot avoid disputes
      • the dispute mechanism increases transaction costs

Intermediaries


Bitcoin - outcomes

  • small casual transactions not reasonable (fees too high)

  • reversible payments for non-reversible services -> need for further “trust”

    • merchant wants to know more about customer than would with cash transaction
  • a certain amount of fraud is accepted


Bitcoin - goal

  • remote cash

    • transactions are not reversible
    • a certain amount of (complete?) anonymity is possible
    • fraud is limited
  • replace trust with cryptographic proof


#Two sides to any transaction Seller: wants to ensure payment

  • Bitcoins offer to solve this

Buyer: wants to ensure delivery of goods/services

  • the white paper suggests using “escrow mechanisms” (we will examine this more in depth later)

Let’s focus first on:

  1. the seller's needs
  2. building blocks from the ground up

Seller wants to ensure payments that are

  • non-reversible - disputes can only be resolved directly

    • only way to "reverse" payment is to pay it back
    • seller enforces own policy
    • non-reversible services demand certain payment
  • verifiable

    • coin is real, not forgery
    • cannot spend same coin twice - “double spending” problem
  • consider: cash, credit cards, gift cards, cheques


Keypairs 101

  • public and private key - "asymmetric"

    • public key is shared
    • private key is kept private
  • you can do two things with your private key

    • sign something (from you to the sender)
    • decrypt something (from a sender to you)
  • with someone else's public key you can

    • verify a signature (sent to you)
    • encrypt something (for a particular recipient)

Encryption

encryption


Signing

signing


#Transactions

  • Bitcoins are composed of digital signatures. The signature supports three features of the Bitcoin:
    • that the data was created by a specific sender, or Authenticity
    • that the data was sent by a specific sender in such a way that the sender cannot deny it, or Non-repudiability
    • that the data was not altered in transit, or Integrity

Q: Which of the above are features of keypairs?


#Transactions

bitcoin-transaction


#Transactions

  • when you pay with Bitcoin, you sign the Bitcoin with your (Bitcoin wallet's) signature.

  • each Bitcoin carries within it a little ledger listing its transaction history.

  • from this ledger, we can be sure that the Bitcoins are "real"


#Double-spending problem

  • we can determine from the chain of signatures that Bitcoins are "real"

  • we cannot determine if they have already been spent elsewhere

  • one way to confirm this is for anyone (or everyone) to be aware of all transactions

  • with proof of the time of a transaction, we can rule that the first payee was given the coin and all later transfers were invalid


#Time-stamps

  • a certain server or servers could collect transactions occuring before a certain time
  • all new transactions would be grouped, hashed and chained to create a widely accessible document
  • however this task must be done peer-to-peer, such that there are a large number of sources

#Mining

  • how to distribute the collection, grouping, hashing and chaining of transactions?

  • Proof-of-work is a scheme in which the server that solves a specially selected problem first wins a prize

  • benefits:

    1. miners have incentive to mine (the prize)
    2. the difficulty of the PoW can be increased or decreased based on the number and power of miners
    3. since miners are competing, no one miner has control

#Proof-of-work algorithm

The proof-of-work looks like this:

  1. A block starts out with a header and a single transaction to pay the miner reward. This transaction has a special name (called the “coinbase”).
  2. Transactions are added to the block.
  3. A block “header” of fixed length is formed by doing cryptographic hashes of the transactions (called the Merkle root).
  4. Mining uses SHA256 cryptography which breaks the data up into 64 byte chunks and operates on each chunk so there are 2 chunks and 2 steps to the SHA256 algorithm in this case.
  5. The first sha256 step is performed on the first chunk of the header and that does not change. This is called the “midstate” because it is partway through the SHA256 process which is 2 steps in this case.
  6. The second step of SHA256 is done on the second chunk of the header. This includes the nonce field.
  7. The entire solution is run through a second round of SHA256 and the solution compared to the difficulty (that is part of the block header). The nonce is returned if it meets the difficulty.
  8. The nonce is incremented and the last 2 steps (6 and 7) are done again 2^32 (4 billion) times to exhaust all possible nonce values.
  9. If no solution is found another nonce contained within the coinbase transaction is incremented. This changes the hash of the coinbase transaction and the merkle root
  10. The process goes back to step 5 and continues until a solution is found.

#Proof-of-work algorithm bitcoin mining


#Wallet

  • A bitcoin wallet is software designed to hold Bitcoins and make Bitcoin transactions possible.
  • It is possible to determine at any point in time the amount in a specific wallet.

Wallet = bank account blockchain = shared document (some say database) = ledger of all transactions transactions are in blocks blocks are chained


#Choose a Wallet

  1. Desktop
  2. Mobile
  3. Web

Choose a wallet: https://bitcoin.org/en/choose-your-wallet
Bitcoin Core is a good one: https://bitcoin.org/en/download
Bitcoin Core on OSX: https://bitcoin.org/bin/bitcoin-core-0.12.1/bitcoin-0.12.1-osx.dmg

Don't forget to verify the software as follows (remember you're storing cash in this wallet!):

  1. Download the package checksums: https://bitcoin.org/bin/bitcoin-core-0.12.1/SHA256SUMS.asc

  2. Verify the download by running shasum -a 256 bitcoin-0.12.1-osx.dmg

  3. Compare what you got to what's in the checksum file. If they don't match, don't install it!


#Creating your wallet

To get started with Bitcoin Core, you need to sync the blockchain. Syncing takes a long time and consumes up to 80GB of storage, but you can "prune" the blockchain to the last two weeks by running the client with --prune=550

The Bitcoin Core (bitcoin-qt) client has a built-in P2P client to bring your copy of the blockchain up-to-date. The initial run takes several hours (even with prune set) to download the blockchain.


#Resources