Download as pptx, pdf, or txt
Download as pptx, pdf, or txt
You are on page 1of 41

Bitcoin Tutorial

Joseph Bonneau
Thanks to Andrew Miller, Arvind Narayanan, Jeremy Clark, Joshua Kroll, Ed Felten
Bitcoin has many different parts!
Part I: Bitcoin in 6 easy steps
Double spending: why ecash is hard
BANK
Alice
Bob
Sign
A
(Transfer X to B)
Charlie
Sign
A
(Transfer X to C)
Sign
Z
(Transfer X to A)
Redeem X?
Redeem X?
Step 1: Make the bank a global log
Sign
A
(Transfer X to C)
...
Sign
A
(Transfer X to B)
...
Sign
A
(Transfer X to C)
(the block chain)
Signature
BANK
Signature
BANK
Signature
BANK
Signature
BANK
Step 2: Participants vote on blocks
Signature
A
Signature
B
Signature
C
...
Signature
A
Signature
B
Signature
C
...
Signature
A
Signature
B
Signature
D
...
Step 3: A random user picks
N-2
N-1
Sign
A
(Transfer X to C)
Signature
B

Signature
A
N
Signature
C

N
C
Step 4: Resolve conflicts by forking
Sign
A
(Transfer X to B)
Signature
B

Signature
A
Sign
A
(Transfer X to C)
Signature
C
Signature
D

Signature
E

Step 5: Incentivise correct blocks
Signature
B

Signature
A
Signature
C
Signature
D

Signature
E

Mint(X, A)
Mint(X, B)
Mint(X, D)
Mint(X, E)
Mint(X, C)
Step 6: Choose by hash power!
Mint(X, A)
Mint(X, B)
Mint(X, C)
SHA-256(Block
N-1
, n) = 0x00000000000000003f89...
SHA-256(Block
N-1
, n) = 0x00000000000000008c71...

Mining difficulty
Mining difficulty
Preventing double spending
Sign
A
(Transfer X to B) Sign
A
(Transfer X to C) Sign
A
(Transfer X to B)
Longest chain wins
Transaction confirmation (~6 blocks)
Bitcoin is transaction-based
IN:
scriptSig ...
scriptSig ...
OUT:
scriptPub A,
5.9
...
...
IN:
scriptSig A
OUT:
scriptPubB,
5.0
scriptPubA,
0.9
IN:
scriptSig A
scriptSig A
OUT:
scriptPubC,
10.0
IN:
scriptSig ...
OUT:
scriptPubA,
9.2
...
Bitcoin transactions specify scripts
scriptPubKey: OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG

IN:
scriptSig ...
scriptSig ...
OUT:
scriptPub A,
5.9
IN:
scriptSig A
OUT:
scriptPubB,
5.0
scriptPubA,
0.9
<sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
scriptSig: <sig> <pubKey>
Redemption script:
Bitcoin transactions specify scripts
<sig> <pubKey> OP_DUP OP_HASH160 <pubKeyHash> OP_EQUALVERIFY OP_CHECKSIG
<sig>

<pubKey>
<pubKey>
<pubKeyHash?>
<pubKeyHash>
Bitcoin script features
multiple signatures
escrow
time locking
commitment opening
...

smart contracts?
Part II: Mining & Consensus
51% attacks
Goldfinger Attack?
Checkpointing
How decentralized is Bitcoin?
Selfish mining
Observation: for 0.33 < x < 0.5, a fraction x of selfish miners
can earn greater than a fraction x of rewards
Secret Block
Secret Block
Majority is not enough: Bitcoin mining is vulnerable
Ittay Eyal and Emin Gn Sirer. Financial Crypto 2014
Mining difficulty
bitcoinwisdom.com
Difficulty adjustment
bitcoinwisdom.com
10 minutes
2 weeks
Mining rewards
Courtesy:
Brian Warner
Total network capacity
2
64
hashes per block (every 10 minutes!)
2
75
hashes in 2013
o In exchange for ~US$250M
Consuming > 100 MW
Bitcoin mining hardware
Should I mine bitcoins?
Chilkoot pass,
Klondike 1898
Mining pools
Mint(25, K
POOL
)
0x00000000000000003f89...
0x000000000000490c6b00...
0x00000000000000003f89... 0x0000000000001e8709ce...
0x00000000000007313f89... 0x00000000000045a1611f...
0x000000000000a877902e...
Mining pools
Part III: Bitcoin as a currency
Why does Bitcoin have value?
Consensus

Consensus in state (blockchain)
Consensus in payment
Consensus in rules

The Economics of Bitcoin Mining, or Bitcoin in the Presence of Adversaries
Joshua Kroll, Ian Davey, Ed Felten. WEIS 2013
Price during 2013
Black Markets
Silk Road: US$14M in Revenue in 2012 [Christin 2012]
Traveling the Silk Road: A measurement analysis of a large anonymous online marketplace
Nicolas Christin, WWW 2013
Capital controls
E-commerce
Bitcoin exchanges
Beware the middleman: Empirical analysis of Bitcoin-exchange risk
Tyler Moore and Nicolas Christin, Financial Crypto 2013
Bitcoin ATMs
Bitcoin meetups
Bitcoin meetups
Bitcoin limitations
~7 transactions per second
o Visa: ~10k tps (peak)
2
48
currency units
o ~32k per person on earth
0.0001 BTC transaction fees typical
o ~$0.40 US
~60 minutes confirmation delay
A reserve currency?
Questions

You might also like