BitCoin and the Blockchain

Doug Twitchell

May 16, 2017

Doug Twitchell

  • PhD, University of Arizona
  • Illinois State University, 11 years
  • Boise State University, since August
  • Teaching: All InfoSec, Cryptography, Networking
  • Research: Deception, policy compliance, Bayesian analysis
  • This presentation: https://twitched.github.io/blockchain_presentation/
  • @dtwitched

Today

  • BitCoin and its building blocks
  • Ethereum and "smart" contracts
  • Private blockchains

₿itCoin

BitCoin Cash Payment Card
Use for Purchases X X X
Reversible X
Stores Value X X
Anonymous pseudo X
Ledger consensus central
Central Authority X X

BitCoin Components

  • Blockchain
    • Cryptographic Hash functions
    • Digital signatures
    • Transaction information
  • Mining
  • Scripts
  • Rules

The Blockchain

Big Numbers


$$2^{128} \\ = 340,282,366,920,938,463,463,374,607,431,768,211,456 \\ \approx 3 \times 10^{38}$$

Odds of winning Powerball lottery four times: 1 in
$$ \\ 7,290,021,363,225,027,714,833,921,447,179,536 \\ \approx 7 \times 10^{33}$$

Cryptographic Hash Functions

H(Doug) → aa1cda9fb50938bfd033eb7b79c4fc0b3ec87a18433bfa02c8d5a68f2c3157e2

H(Hawley Troxell) → 469b53d0d17fdc622bded61a6e4a5720bd25a290890ea01d7687167ec6a2f3c3

H(We the people of the United...) → 63a43b7fc439f05fbf2b0d25d40b860b426a6abeb087ead2b2c4cae0b95c839d

H(Star Wars as a compressed video) → 31c4ba98d4a14a71b6da13830f1c3c508cbf93c89a348d382f76070a23588d6b

H(Bob should pay Alice 4 BitCoins) → fef45d0c7e08bfafa7551e9ec27ee06c9fba6ef86665e1a8f77eeb23b495e1e9

H(Bob should pay Alice 5 BitCoins) → 3ef34acc394f1ac5d5671c339ffe65b5aa976f88862fe4e87c24b4e3f237cce0

SHA256

Digital Signatures

The Blockchain

Decentralization and Mining

Mining

  • Proof of Work: Who does the most work?
  • Proof of Stake: Who's willing to bet the most?
  • Proof of Authority: Who's been designated?

Scripts

All transactions include a script

Payments:

  OP_DUP
  OP_HASH160
  69e02e18...
  OP_EQUALVERIFY
  OP_CHECKSIG

BitCoin scripts are limited in what they can do (no loops)

Scripts

BitCoin Scripts can be used to:

  • Destroy BitCoins (Proof of Burn)
  • Insert arbitrary data (also Proof of Burn)
  • Pay to a script, which is run by recipient
  • Escrow Payments (transactions require three signatures)
  • Efficient Micropayments (escrow adding up small payments)

Rules

To have a valid currency, we want to:

  • Regularly and efficiently validate transaction blocks
  • Incentivize miners to do validations
  • Increase the supply of currency over time

Rules

To have a valid currency, we want to:

  • Regularly and efficiently validate transaction blocks
    • Bitcoin: Every 10 minutes
    • Ethereum: Every minute
  • Incentivize miners to do validations
    • BitCoin: 25 BitCoins per block mined, transaction fees
    • Ethereum: 5 Ether per block mined, transaction & Gas fees
  • Increase the supply of currency over time
    • BitCoin: 25 BitCoins per block mined, halved every 210k blocks. Total: 21m
    • Ethereum: 60m start, 15m per year mined, no cap, but mining will change

Ethereum Scripts

Difference between Ethereum and BitCoin: Scripts

Ethereum scripts can do anything a computer can do

Require purchasing "Gas"

Ethereum Scripts

Ethereum Scripts can be used to:

  • Create complicated smart contracts
  • Create Distributed Autonomous Organizations (DAOs)
  • Do whatever as long as you pay for it (loops)
pragma solidity ^0.4.2;
  // Proof of Existence contract, version 1
  contract ProofOfExistence1 {
    bytes32 public proof;
    // calculate and store the proof for a document
    function notarize(string document) {
      proof = calculateProof(document);
    }
  // helper function to get a document's sha256
    function calculateProof(string document) constant returns (bytes32) {
      return sha256(document);
    }
  }

The DAO

Blockchain thoughts: The Good

  • BitCoin is currently a viable currency ($30B)
  • Cryptocurrencies work well in the digital world
    • Micropayments
    • Low transaction fees
    • Guaranteed escrow
  • Smart contracts
  • Innovation: LiteCoin, ZeroCoin, Monero, private blockchains, etc.

Blockchain: The Good

Blockchain: The Bad

Blockchain: The Bad

Blockchain: The Ugly

Questions?