trick or treat?: bitcoin for non-believers, cryptocurrencies for cypherpunks

59
Trick or Treat? Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks David Evans University of Virginia www.cs.virginia.edu/evans bitcoin-class.org DC Area Crypto Day All Hallows’ Eve 2 Johns Hopkins University

Upload: david-evans

Post on 29-Jan-2018

2.909 views

Category:

Internet


0 download

TRANSCRIPT

Page 1: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Trick or Treat? Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

David EvansUniversity of Virginiawww.cs.virginia.edu/evansbitcoin-class.org

DC Area Crypto DayAll Hallows’ Eve2

Johns Hopkins University

Page 2: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Plan

Tutorial Introduction to Bitcoin

Hype vs. Reality in Bitcoin Today

Scaling Bitcoin

Ombuds (Nick Skelsey)

1

Page 3: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

What is money?

2

Page 4: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

3

Aristotle’s Politics 350 BCE

Page 5: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Fiat Currency

4

Page 6: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

5

With a strong enough army, anything can be a fiat currency

Page 7: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Centralized Digital Currency

6Trusted Bank

Account No. Owner’s Identify Value

3022493 Alice 2033.23

3022494 Bob 85733.03

3022495 Colleen 24331.77

3022496 Dave 0.01

Page 8: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

7

Communications of the ACMOctober 1985

Page 9: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

8

Communications of the ACMOctober 1985

Page 10: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

First Wave Cryptocurrency

9David Chaum

Page 11: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

First Wave Cryptocurrency

10David Chaum

Bankrupt, 1998

Page 12: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Decentralized CurrencyCurrency without trust

11

Page 13: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Double Spending Challenge

12

M = transfer X to Bob SignKRA[H(M)]

Bob wants to verify:1. Alice owns X2. Alice hasn’t transferred X3. The coin will be valuable for Bob

Page 14: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Double Spending Challenge

13

M = transfer X to Bob SignKRA[H(M)]

Bob wants to verify:1. Alice owns X2. Alice hasn’t transferred X3. The coin will be valuable for Bob

Node CNode A Node B

txb

txb

Page 15: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

14

M = transfer X to Bob SignKRA[H(M)]

Bob wants to verify:1. Alice owns X2. Alice hasn’t transferred X3. The coin will be valuable for Bob

Node CNode A Node B

txb

txb

M = transfer X to Coleen SignKRA[H(M)]

txc

Page 16: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

15

M = transfer X to Bob SignKRA[H(M)]

Bob wants to verify:1. Alice owns X2. Alice hasn’t transferred X3. The coin will be valuable for Bob

Node CNode A Node B

txb

txb

M = transfer X to Coleen SignKRA[H(M)]

txc

Page 17: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

16

M = transfer X to Bob SignKRA[H(M)]

Bob wants to verify:1. Alice owns X2. Alice hasn’t transferred X3. The coin will be valuable for Bob

Node CNode A Node B

txb

txb

M = transfer X to Coleen SignKRA[H(M)]

txc

Node E

Node D

Page 19: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Blockchain

18

B0H(B0) Nonce

Transactions

H(B1) Nonce

Transactions

H(B2) Nonce

Transactions

Distributed ledger maintained by network of untrusted nodesBlocks added require proof-of-workNode’s agree to consensus: longest (most difficult) chain

Incentives designed to encourage network nodes to:Validate and record transactionsSpend effort on extending consensus chain

Page 20: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

19

BitcoinTransaction

Input 1: v1, a1

Input 2: v2, a2

Output 1: x1, d1

Output 2: x2, d2

transaction fees = sum(input values) – sum(output values)(must be non-negative for valid transaction)

Page 21: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Bitcoin Script

20

OP_DATA <public key>OP_CHECKSIG

Lock

ing

Scri

pt

OP_DATA <signature>

Un

lock

ing

Scri

pt

Transactio

na0

b6

ea…

..

Input 1: v1, a1

Output 1: x1, d1

Output 2: x2, d2

Transactio

nd

87

30

d…

Locking Script

Unlocking Script

If B

itco

in A

dd

ress

wer

e ju

st p

ub

lic k

ey

Page 22: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Bitcoin Script

21

OP_DUPOP_HASH160OP_DATA <bitcoin address>OP_EQUALVERIFY OP_CHECKSIGLock

ing

Scri

pt

OP_DATA <signature>OP_DATA <public key>

Un

lock

ing

Scri

pt

Transactio

na0

b6

ea…

..

Input 1: v1, a1

Output 1: x1, d1

Output 2: x2, d2

Transactio

nd

87

30

d…

Locking Script

Unlocking Script

Bit

coin

Ad

dre

ss =

H(p

ub

lic k

ey)

Page 23: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

OP_RETURN (until July 2010)

22

https://github.com/bitcoin/bitcoin/blob/v0.1.5/script.cpp#L170

Universal Unlocking Script!OP_DATA 1OP_RETURN

Page 26: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

25

Exhibit B

Page 27: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

26

BitcoinTransaction

Input 1: v1, a1

Input 2: v2, a2

Output 1: x1, d1

Output 2: x2, d2

transaction fees = sum(input values) – sum(output values)(must be non-negative for valid transaction)

How is new bitcoin created?

Page 28: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

27

CoinbaseTransaction

Output 1: x1, d1

Output 2: x2, d2

sum(output values) ≤ sum(transaction fees) + mining reward

mining reward = 50 BTC 2floor(block number / 210,000)

Page 30: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Bitcoin’s Proof-of-Work

29

B0H(B0) Nonce

Transactions

H(B1) Nonce

Transactions

H(B2) Nonce

Transactions

Find a nonce x such that: SHA-256(SHA-256(r || x)) < T/d

r = header includes H(previous block)root of Merkle tree of transactions

Page 31: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

30

difficulty = 62,253,982,450expected hashes = 2.67 * 1020 ~ 268

“number of grains of sand on earth”

Page 32: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Actual Bitcoin Block

31

https://en.bitcoin.it/wiki/Protocol_documentation#Block_Headers

Page 33: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Mining32

Page 34: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

(General-Purpose)Computers are Useless

33

Page 35: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

34

XOR two 32-bit values in CPU XOR two 32-bit values in ASIC

4 transistors XOR design

Page 36: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

35

https://en.bitcoin.it/wiki/Mining_hardware_comparison

Page 39: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

38

Fire at mining facility in Thailand, 14 Oct 2014Photo credit: www.thairath.co.th

Page 40: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

39

Page 41: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

40

Page 42: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

41

Entire bitcoin network: 1/10th Lake Anna Power Station

Page 43: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

42

Bitcoin Hype!

Page 44: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

43

William Mougayar, The Global Landscape of Blockchain Companies in Financial Services

Page 46: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

45

Bitcoin “Hype”

Bitcoin MarketPrice (US$)

Page 47: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Reality Check

46

Bitcoin “Market Capitalization” = Number of Bitcoins ✕ Market Price

= 14,777,800 ✕ $314 = $4.64B

Page 48: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

What does a $4.64B Market Cap company look like?

47

Page 49: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

48

NASDAQ: WOOFMarket Cap: $4.4BAverage daily trading: $35M

BitcoinMarket Cap: $4.6BAverage daily transactions: $50M (?)Average daily US$ exchange value: $3M

Page 50: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Can Bitcoin Scale?

49

Page 51: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

50

https://github.com/bitcoin/bitcoin/blob/master/src/consensus/consensus.h

Page 52: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

51https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp

Page 53: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

52https://github.com/bitcoin/bitcoin/blob/master/src/main.cpp

Page 54: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Scale Today

53

Block Size = 1MBTypical transaction size ~ 500 BytesMaximum of ~2000 transactions per block / 10 minutesSo, about 3-4 transactions per second

Page 55: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Scale Today

54

Cost to control bitcoin (assuming other miners are “rational”):value per block-minute = $7500/10 minutes ~ $750/minute ~ $1M/dayto increase to $1B/day with current transaction rate:

$3472 fee per transaction (without losing transactions)or 33 Billion transactions per day (with current $0.03 fee)

Block Size = 1MBTypical transaction size ~ 500 BytesMaximum of ~2000 transactions per block / 10 minutesSo, about 3-4 transactions per second

$1B / day =

Page 56: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Scale Today

55

Cost to control bitcoin (assuming other miners are “rational”):value per block-minute = $7500/10 minutes ~ $750/minute ~ $1M/dayto increase to $1B/day with current transaction rate:

$3472 fee per transaction (without losing transactions)or 33 Billion transactions per day (with current $0.03 fee)

Block Size = 1MBTypical transaction size ~ 500 BytesMaximum of ~2000 transactions per block / 10 minutesSo, about 3-4 transactions per second

Transactions per DayVISA: 300MInterbank: 100M

Page 57: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Scale Today

56

Cost to control bitcoin (assuming other miners are “rational”):value per block-minute = $7500/10 minutes ~ $750/minute ~ $1M/dayto increase to $1B/day with current transaction rate:

$3472 fee per transaction (without losing transactions)or 33 Billion transactions per day (with current $0.03 fee)

Block Size = 1MBTypical transaction size ~ 500 BytesMaximum of ~2000 transactions per block / 10 minutesSo, about 3-4 transactions per second

Transactions per DayVISA: 300MInterbank: 100MCash: 20B?

Page 58: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Scale Today

57

Cost to control bitcoin (assuming other miners are “rational”):value per block-minute = $7500/10 minutes ~ $750/minute ~ $1M/dayto increase to $1B/day with current transaction rate:

$3472 fee per transaction (without losing transactions)or 33 Billion transactions per day (with current $0.03 fee)

Block Size = 1MBTypical transaction size ~ 500 BytesMaximum of ~2000 transactions per block / 10 minutesSo, about 3-4 transactions per second

Transactions per DayVISA: 300MInterbank: 100MCash: 20B?Facebook Likes: 4.5BSMS Messages: 25BWhatsApp Msg: 50B

Page 59: Trick or Treat?: Bitcoin for Non-Believers, Cryptocurrencies for Cypherpunks

Distributed microblogging

58Nick Skelsey – Cofounder @ Soapbox Systems