Blockchain &
Money
Class 4
September 18, 2018
1
Class 4 (9/18): Study Questions
• What is the Byzantine Generals problem? How does proof-of-work and
mining in Bitcoin address it? More generally how does blockchain
technology address it?
• What other consensus protocols are there? What are some of the
tradeoffs of alternative consensus algorithms – proof-of-work, proof-of-
stake, etc.?
• How do economic incentives work within blockchain technology to
maintain decentralized ledgers and avoid double spending? What are the
incentives of consensus protocols and mining? (Moved from 9/20)
2
Class 4 (9/18): Readings
• ‘Geneva Report’ Chapter 1 (pages 1 – 7); Casey, Crane, Gensler, Johnson, and Narula
• ‘Blockchain Technology Review’ NIST (pages 23 - 32, sections 3 & 4)
• ‘The Byzantine Generals Problem’ Lamport, Shostak, & Pease (382-387)
• ‘A Short Guide to Consensus Protocols’ CoinDesk
3
Class 4 Overview
• Review of Blockchain Design
• Consensus through Proof of Work
• Bitcoin Mining
• Native Currency
• Network
• Other Consensus Protocols
• Conclusions
4
Review - Blockchain Technology
timestamped
auditable database network consensus protocol
append-only log
Secured via cryptography Addresses ‘cost of trust’
• Hash functions for tamper (Byzantine Generals problem)
resistance and integrity • Permissioned
• Digital signatures for consent • Permissionless
Consensus for agreement
5
Bitcoin – Technical Features
• Cryptography & Timestamped Logs
• Cryptographic Hash Functions
• Timestamped Append-only Logs (Blocks)
• Block Headers & Merkle Trees
• Asymmetric Cryptography & Digital Signatures
• Addresses
• Decentralized Network Consensus
• Proof of Work
• Native Currency
• Network
• Transaction Script & UTXO
• Transaction Inputs & Outputs
• Unspent Transaction Output (UTXO) set
• Scripting language 6
Cryptography:
Communications in the presence of adversaries
Scytale Cipher Enigma Machine Asymmetric Cryptography
Ancient Times 1920s - WWII 1976 to today
© Luringen on Wikimedia Commons. License CC BY-SA. All rights
Image by the CIA and is in the public domain via Image is in the public domain via Wikipedia.
reserved. This content is excluded from our Creative Commons license.
Wikimedia Commons.
For more information, see https://ocw.mit.edu/help/faq-fair-use/
7
Cryptographic Hash Functions
One-Way Data Compression
© Source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see
Data Commitment https://ocw.mit.edu/help/faq-fair-use/
8
Timestamped Append-only Log - Blockchain
9
Image is in the public domain.
Merkle Tree – Binary Data Tree with Hashes
10
Image is in the public domain.
Asymmetric Cryptography & Digital Signatures
Guarding against Tampering & Impersonation
Digital Signature without Hash
Shyam Nandan Kumar et al. Review on Network Security and Cryptography. © Science
11 and Education Publishing. All rights reserved. This content is excluded from our Creative
Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use/
Asymmetric Cryptography & Digital Signatures
Guarding against Tampering & Impersonation
Digital Signature with Hash
Shyam Nandan Kumar et al. Review on Network Security and Cryptography.
12
Bitcoin Address
Determined by – but not identical to - Public Key
13
© Source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use/
Decentralized Networks
Permissionless Blockchains -
Byzantine Generals Problem
Unknown participants
Attack!
Attack! ? ?
Retreat ?
?
Retreat
Security based on:
Attack!
• Consensus protocol &
• Native currency
14
Hashcash – Proof of Work (Adam Back, 1997)
Proposed to address E-mail Spam and Denial of Service attacks
• Requires computational work to find a hash within predetermined range
E-mail
or
Header
Hash
© Source unknown. All rights reserved. This content is excluded from our Creative Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use/
• Difficulty defined by Hash outputs’ # of leading zeros
• Proof of Work can be Efficiently Verified 15
Blockchain – Proof of Work
Innovation – Chained Proof of Work for Distributed Network Consensus & Timestamping
© Cryptographics.info. All rights reserved. This content is excluded from our Creative Commons license. For more information, see https://ocw.mit.edu/help/faq-fair-use/
16
Blockchain – Proof of Work
17
Image by Anders Brownworth. Used with permission.
Blockchain – Proof of Work
18
Image by Anders Brownworth. Used with permission.
Blockchain – Consensus supports Longest Chain
19
Image by Meek Mark on Wikipedia . CC BY.
Bitcoin Proof of Work Difficulty
• Targets 10 minute average block generation time
• Defined by the # of leading zeros Hash output requires to solve proof of work
• Adjusts every 2016 blocks - about every two weeks
• Currently, > 18 leading zeros (out of 64 hexadecimal characters)
• Block 541974 (9/18/18)- 18 leading zeros
0000000000000000001104a863046dfbad1a2941128815669623ff93c2a3945f
• Genesis Block (1/3/09) – 10 leading zeros, though only required 8
000000000019d6689c085ae165831e934ff763ae46a2a6c172b3f1b60a8ce26f
20
Bitcoin Mining Difficulty
21
Source: Blockchain.com Courtesy of Blockchain Luxembourg S.A. Used with permission.
Bitcoin Network Hash Rate
22
Source: Blockchain.com Courtesy of Blockchain Luxembourg S.A. Used with permission.
Bitcoin Mining Evolution
Application Specific Integrated Circuit
(ASICs) 2013 – 2018
4 – 16 TH/S
Image by InstagramFOTOGRAFIN on Pixabay.
Graphics Processing Units
(GPUs) 2010 – 2013
20 - 300 MH/S
Central Processing Units Image is in the public domain.
(CPUs) 2009 – 2010
Modern Mining Factory
2 - 20 MH/S
Image by Axel Castillo. CC0 Public Domain.
Image by MiNE on flickr. CC BY 23
Bitcoin Mining Hashrate Distribution
24
Courtesy of Blockchain Luxembourg S.A.
Source: Blockchain.com – 9/18/18 (4 day avg.) Used with permission.
Native Currency
Economic Incentive System
‘Monetary Policies’ vary widely
• Bitcoin - BTC
• Created through Coinbase Transaction in each block
• ‘Monetary Policy’ preset in Bitcoin Core
• Creation originally 50 Bitcoin per block
• Reward halves (1/2s) every 210,000 blocks
• Currently 12.5 BTCs created per block – thus ‘inflation’ 4.1%
• Currently 17.3 million BTC; capping at 21 million BTC in 2040
• Market based transaction fee mechanism also provided for in Bitcoin Core
• Ethereum
• Currently 3 ETH per block – thus ‘inflation’ 7.4%
• Recent proposal to decline to 2 ETH per block in 11/18
• Fees paid in Gas (109 Gas per ETH) for computation are credited to miners
25
Network
• Full Nodes – Store full Blockchain & able to Validate all Transactions
• Pruning Nodes – Prune transactions after validation and aging
• Lightweight Nodes - Simplified Payment Verification (SPV) nodes – Store
Blockchain Headers only
• Miners – Performs Proof of Work & Create new Blocks - Do not need to be a
Full Node
• Mining Pool Operators
• Wallets – Store, View, Send and Receive Transactions & Create Key Pairs
• Mempool – Pool of unconfirmed (yet validated) Transactions
26
Alternative Consensus Protocols
Generally Randomized or Delegated Selection of Nodes to Validate next Block
• May have added mechanism to confirm Block Validators’ Work
Randomized Selection May be Based upon:
• Proof of Stake – Stake in Native Currency
• Proof of Activity - Hybrid of POW and POS
• Proof of Burn – Validation comes with Burning of Coins
• Proof of Capacity (Storage or Space) – Based upon Hardware Space
Delegated Selection May be Based upon Tiered System of Nodes
Major Permissionless Blockchain Applications still use Proof of Work – though:
• DASH is a hybrid of POW with a tiered system of ‘Masternodes’
• NEO uses a Delegated protocol of ‘Professional Nodes’
27
Class 5 (9/20): Study Questions
• How does Bitcoin record transactions? What is unspent transaction
output (UTXO)? What is script code embedded in each Bitcoin
transaction and how flexible a programming language is it? (Moved
from 9/18)
• As many design features – public key cryptography, hash functions,
append-only timestamped logs, digital cash, and proof-of-work – pre-
date Bitcoin, what was the novel innovation of Santoshi Nakamoto?
• Who is Satoshi Nakamoto? (Only kidding a bit.)
28
Class 5 (9/20): Readings
• ‘Bitcoin’s Academic Pedigree’ Narayanan and Clark
• ‘Making Sense of Cryptoeconomics’ CoinDesk
29
Conclusions
Reviewed Bitcoin Design Features
• Timestamped Append-only Logs (Blocks)
• Secured through Cryptographic Hash Functions & Digital
Signatures
Decentralized Network Consensus
• Consensus through Proof of Work
• Native Currency
• Network
Transactions Ledgers
• Transaction Inputs & Outputs
• Unspent Transaction Output (UTXO) set
• Scripting language
30
MIT OpenCourseWare
https://ocw.mit.edu/
15.S12 Blockchain and Money
Fall 2018
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.
31 1
MIT OpenCourseWare
https://ocw.mit.edu/
15.S12 Blockchain and Money
Fall 2018
For information about citing these materials or our Terms of Use, visit: https://ocw.mit.edu/terms.
32