SlideShare a Scribd company logo
1 of 49
Lecture 2
How Bitcoin Achieves Decentralization
Lecture 2.1:
Centralization vs. decentralization
Centralization vs. decentralization
Competing paradigms that underlie many
digital technologies
Decentralization is not all-or-nothing
E-mail:
decentralized protocol, but dominated by
centralized webmail services
Aspects of decentralization in Bitcoin
1. Who maintains the ledger?
2. Who has authority over which transactions are valid?
3. Who creates new bitcoins?
4. Who determines how the rules of the system change?
5. How do bitcoins acquire exchange value?
Beyond the protocol:
exchanges, wallet software, service providers...
Aspects of decentralization in Bitcoin
Peer-to-peer network:
open to anyone, low barrier to entry
Mining:
open to anyone, but inevitable concentration of power
often seen as undesirable
Updates to software:
core developers trusted by community, have great power
Lecture 2.2:
Distributed consensus
Bitcoin’s key challenge
Key technical challenge of decentralized
e-cash: distributed consensus
or: how to decentralize ScroogeCoin
Why consensus protocols?
Traditional motivation: reliability in distributed systems
Distributed key-value store enables various applications:
DNS, public key directory, stock trades …
Good targets for Altcoins!
Defining distributed consensus
The protocol terminates and all correct nodes decide on
the same value
This value must have been proposed by some correct node
Bitcoin is a peer-to-peer system
When Alice wants to pay Bob:
she broadcasts the transaction to all Bitcoin nodes
Pay to pkBob : H( )
signed by Alice
Note: Bob’s computer is not in the picture
How consensus could work in Bitcoin
At any given time:
● All nodes have a sequence of blocks of transactions
they’ve reached consensus on
● Each node has a set of outstanding transactions it’s
heard about
How consensus could work in Bitcoin
Tx
Tx
…
Tx
Tx
Tx
…
Tx
Tx
Tx
…
Tx
Tx
Tx
…
Tx
Tx
Tx
…
Tx
Tx
Tx
…
Tx Consensus
protocol
OK to select any valid block, even if proposed by only one node
Why consensus is hard
Nodes may crash
Nodes may be malicious
Network is imperfect
• Not all pairs of nodes connected
• Faults in network
• Latency
No notion of global time
Many impossibility results
• Byzantine generals problem
• Fischer-Lynch-Paterson (deterministic nodes):
consensus impossible with a single faulty node
Some well-known protocols
Example: Paxos
Never produces inconsistent result, but can
(rarely) get stuck
Understanding impossibility results
These results say more about the model than
about the problem
The models were developed to study systems
like distributed databases
Bitcoin consensus: theory & practice
Bitcoin consensus works better in practice
than in theory
Theory is still catching up
BUT theory is important, can help predict
unforeseen attacks
Some things Bitcoin does differently
Introduces incentives
• Possible only because it’s a currency!
Embraces randomness
• Does away with the notion of a specific end-point
• Consensus happens over long time scales — about 1 hour
Lecture 2.3:
Consensus without identity: the block chain
Why identity?
Pragmatic: some protocols need node IDs
Security: assume less than 50% malicious
Why don’t Bitcoin nodes have identities?
Identity is hard in a P2P system — Sybil attack
Pseudonymity is a goal of Bitcoin
Weaker assumption: select random node
Analogy: lottery or raffle
When tracking & verifying identities is hard,
we give people tokens, tickets, etc.
Now we can pick a random ID & select that
node
Key idea: implicit consensus
In each round, random node is picked
This node proposes the next block in the chain
Other nodes implicitly accept/reject this block
• by either extending it
• or ignoring it and extending chain from earlier block
Every block contains hash of the block it extends
Consensus algorithm (simplified)
1. New transactions are broadcast to all nodes
2. Each node collects new transactions into a block
3. In each round a random node gets to broadcast its
block
4. Other nodes accept the block only if all transactions in
it are valid (unspent, valid signatures)
5. Nodes express their acceptance of the block by
including its hash in the next block they create
What can a malicious node do?
CA → B
CA → A’
Pay to pkB : H( )
signed by A
Pay to pkA’ : H( )
signed by A
Double-
spending
attack
Honest nodes will extend the longest valid branch
From Bob the merchant’s point of view
CA → B
CA → A’
Hear about CA → B transaction
0 confirmations
1 confirmation
double-spend
attempt
3 confirmations
Double-spend probability
decreases exponentially
with # of confirmations
Most common heuristic:
6 confirmations
Recap
Protection against invalid transactions is cryptographic,
but enforced by consensus
Protection against double-spending is purely by consensus
You’re never 100% sure a transaction is in consensus branch.
Guarantee is probabilistic
Lecture 2.4:
Incentives and proof of work
Can we give nodes incentives for behaving honestly?
Everything so far is just a distributed consensus protocol
But now we utilize the fact that the currency has value
Assumption of honesty is problematic
Can we penalize the node
that created this block?
Can we reward nodes
that created these blocks?
Incentive 1: block reward
Creator of block gets to
• include special coin-creation transaction in the block
• choose recipient address of this transaction
Value is fixed: currently 25 BTC, halves every 4 years
Block creator gets to “collect” the reward only if the
block ends up on long-term consensus branch!
There’s a finite supply of bitcoins
Block reward is how
new bitcoins are created
Runs out in 2040. No new
bitcoins unless rules change
Year
Total
bitcoins
in
circulation
First inflection point:
reward halved from 50BTC to 25BTC
Total supply: 21 million
Incentive 2: transaction fees
Creator of transaction can choose to make
output value less than input value
Remainder is a transaction fee and goes to
block creator
Purely voluntary, like a tip
Remaining problems
1. How to pick a random node?
1. How to avoid a free-for-all due to rewards?
1. How to prevent Sybil attacks?
Proof of work
To approximate selecting a random node:
select nodes in proportion to a resource
that no one can monopolize (we hope)
• In proportion to computing power: proof-of-work
• In proportion to ownership: proof-of-stake
Equivalent views of proof of work
1. Select nodes in proportion to computing power
1. Let nodes compete for right to create block
1. Make it moderately hard to create new
identities
Hash puzzles
To create block, find nonce s.t.
H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) is very small
Output space of hash
Target
space If hash function is secure:
only way to succeed is to try enough nonces until you get lucky
nonce
prev_h
Tx
Tx
PoW property 1: difficult to compute
As of Aug 2014: about 1020 hashes/block
Only some nodes bother to compete —
miners
PoW property 2: parameterizable cost
Nodes automatically re-calculate the target every
two weeks
Goal: average time between blocks = 10 minutes
Prob (Alice wins next block) =
fraction of global hash power she controls
Key security assumption
Attacks infeasible if majority of miners
weighted by hash power follow the protocol
Solving hash puzzles is probabilistic
Time to next block (entire network)
Probability
density
10
minutes
PoW property 3: trivial to verify
Nonce must be published as part of block
Other miners simply verify that
H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) < target
Mining economics
Complications:
• fixed vs. variable costs
• reward depends on global hash rate
If mining reward
(block reward + Tx fees)
>
hardware +
electricity cost
→ Profit
Lecture 2.5:
Putting it all together
Recap
Identities
Transactions
P2P network
Block chain &
consensus
Hash puzzles &
mining
Bitcoin has three types of consensus
• Value
• State
• Rules
Bitcoin is bootstrapped
security of
block chain
value of
currency
health of
mining
ecosystem
What can a “51% attacker” do?
Steal coins from existing address?
Suppress some transactions?
• From the block chain
• From the P2P network
Change the block reward?
Destroy confidence in Bitcoin?
✗
✓
✗
✗
✓✓
Remaining questions
How do we get from consensus to currency?
What else can we do with consensus?

More Related Content

What's hot

HMAC authentication
HMAC authenticationHMAC authentication
HMAC authenticationSiu Tin
 
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기Hyperledger Korea User Group
 
HyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdfHyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdfwonyong hwang
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainMalak Abu Hammad
 
Advantages and disadvantages of permissionless blockchain
Advantages and disadvantages of permissionless blockchainAdvantages and disadvantages of permissionless blockchain
Advantages and disadvantages of permissionless blockchainBlockchain Council
 
Consensus Algorithms.pptx
Consensus Algorithms.pptxConsensus Algorithms.pptx
Consensus Algorithms.pptxRajapriya82
 
Blockchain in healthcare sector
Blockchain in healthcare sectorBlockchain in healthcare sector
Blockchain in healthcare sectorBalaji Naik
 
SSH.ppt
SSH.pptSSH.ppt
SSH.pptjoekr1
 
Blockchain basics
Blockchain basicsBlockchain basics
Blockchain basicsRomit Bose
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart ContractDeepak Aryal
 
Distributed systems and blockchain technology
Distributed systems and blockchain technologyDistributed systems and blockchain technology
Distributed systems and blockchain technologyAlket Cecaj
 
blockchain and iot: Opportunities and Challanges
blockchain and iot: Opportunities and Challangesblockchain and iot: Opportunities and Challanges
blockchain and iot: Opportunities and ChallangesChetan Kumar S
 
IBM Blockchain Platform Technical Introduction v1.1
IBM Blockchain Platform Technical Introduction v1.1IBM Blockchain Platform Technical Introduction v1.1
IBM Blockchain Platform Technical Introduction v1.1Matt Lucas
 
Présentation blockchain v2
Présentation blockchain v2Présentation blockchain v2
Présentation blockchain v2Amine HAMOUDA
 
Secure electronic transaction
Secure electronic transactionSecure electronic transaction
Secure electronic transactionNishant Pahad
 
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski buildacloud
 

What's hot (20)

HMAC authentication
HMAC authenticationHMAC authentication
HMAC authentication
 
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
[2019.04] 쿠버네티스 기반 하이퍼레저 패브릭 네트워크 구축하기
 
HyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdfHyperLedger Fabric V2.5.pdf
HyperLedger Fabric V2.5.pdf
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
Blockchain concepts
Blockchain conceptsBlockchain concepts
Blockchain concepts
 
Advantages and disadvantages of permissionless blockchain
Advantages and disadvantages of permissionless blockchainAdvantages and disadvantages of permissionless blockchain
Advantages and disadvantages of permissionless blockchain
 
Consensus Algorithms.pptx
Consensus Algorithms.pptxConsensus Algorithms.pptx
Consensus Algorithms.pptx
 
Blockchain in healthcare sector
Blockchain in healthcare sectorBlockchain in healthcare sector
Blockchain in healthcare sector
 
Hash crypto
Hash cryptoHash crypto
Hash crypto
 
SSH.ppt
SSH.pptSSH.ppt
SSH.ppt
 
Blockchain basics
Blockchain basicsBlockchain basics
Blockchain basics
 
Creating Smart Contract
Creating Smart ContractCreating Smart Contract
Creating Smart Contract
 
Blockchain+IOT
Blockchain+IOTBlockchain+IOT
Blockchain+IOT
 
Distributed systems and blockchain technology
Distributed systems and blockchain technologyDistributed systems and blockchain technology
Distributed systems and blockchain technology
 
Smart contracts
Smart contractsSmart contracts
Smart contracts
 
blockchain and iot: Opportunities and Challanges
blockchain and iot: Opportunities and Challangesblockchain and iot: Opportunities and Challanges
blockchain and iot: Opportunities and Challanges
 
IBM Blockchain Platform Technical Introduction v1.1
IBM Blockchain Platform Technical Introduction v1.1IBM Blockchain Platform Technical Introduction v1.1
IBM Blockchain Platform Technical Introduction v1.1
 
Présentation blockchain v2
Présentation blockchain v2Présentation blockchain v2
Présentation blockchain v2
 
Secure electronic transaction
Secure electronic transactionSecure electronic transaction
Secure electronic transaction
 
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
Troubleshooting Strategies for CloudStack Installations by Kirk Kosinski
 

Similar to Bitcoin MOOC Lecture 2.pptx

Blockchain-Presentation.pptx
Blockchain-Presentation.pptxBlockchain-Presentation.pptx
Blockchain-Presentation.pptxMeganaaGodhala
 
unit3consesence.pptx
unit3consesence.pptxunit3consesence.pptx
unit3consesence.pptxGopalSB
 
Blockchain in Practice, ETH Computational Social Science, Fall 2019
Blockchain in Practice, ETH Computational Social Science, Fall 2019Blockchain in Practice, ETH Computational Social Science, Fall 2019
Blockchain in Practice, ETH Computational Social Science, Fall 2019Rafael Kallis
 
Blockchain overview, use cases, implementations and challenges
Blockchain overview, use cases, implementations and challengesBlockchain overview, use cases, implementations and challenges
Blockchain overview, use cases, implementations and challengesSébastien Tandel
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsGautam Anand
 
The Basic Theories of Blockchain
The Basic Theories of BlockchainThe Basic Theories of Blockchain
The Basic Theories of BlockchainSota Watanabe
 
Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...I MT
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionDSCIITPatna
 
Blockchain Fundamentals - Day 3 - PoW consensus and ICOs (new style)
Blockchain Fundamentals - Day 3 -  PoW consensus and ICOs (new style)Blockchain Fundamentals - Day 3 -  PoW consensus and ICOs (new style)
Blockchain Fundamentals - Day 3 - PoW consensus and ICOs (new style)Chhay Lin Lim
 
Cryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed ConsensusCryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed ConsensusDallas Kennedy
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchainseancarmody
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin Jérôme Kehrli
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & EthereumBlockchainHub Graz
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to BlockchainAalok Singh
 
Overview of bitcoin
Overview of bitcoinOverview of bitcoin
Overview of bitcoinAbdul Nasir
 

Similar to Bitcoin MOOC Lecture 2.pptx (20)

01 what is blockchain
01 what is blockchain01 what is blockchain
01 what is blockchain
 
Blockchain-Presentation.pptx
Blockchain-Presentation.pptxBlockchain-Presentation.pptx
Blockchain-Presentation.pptx
 
unit3consesence.pptx
unit3consesence.pptxunit3consesence.pptx
unit3consesence.pptx
 
Blockchain in Practice, ETH Computational Social Science, Fall 2019
Blockchain in Practice, ETH Computational Social Science, Fall 2019Blockchain in Practice, ETH Computational Social Science, Fall 2019
Blockchain in Practice, ETH Computational Social Science, Fall 2019
 
Blockchain overview, use cases, implementations and challenges
Blockchain overview, use cases, implementations and challengesBlockchain overview, use cases, implementations and challenges
Blockchain overview, use cases, implementations and challenges
 
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) AlgorithmsUnderstanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
Understanding Proof of Work (PoW) and Proof of Stake (PoS) Algorithms
 
The Basic Theories of Blockchain
The Basic Theories of BlockchainThe Basic Theories of Blockchain
The Basic Theories of Blockchain
 
Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...Can we safely adapt the construction of permissionless blockchain to user dem...
Can we safely adapt the construction of permissionless blockchain to user dem...
 
Blockchain for Beginners
Blockchain for Beginners Blockchain for Beginners
Blockchain for Beginners
 
Introduction to Blockchain Web3 Session
Introduction to Blockchain Web3 SessionIntroduction to Blockchain Web3 Session
Introduction to Blockchain Web3 Session
 
Blockchain
BlockchainBlockchain
Blockchain
 
Blockchain Fundamentals - Day 3 - PoW consensus and ICOs (new style)
Blockchain Fundamentals - Day 3 -  PoW consensus and ICOs (new style)Blockchain Fundamentals - Day 3 -  PoW consensus and ICOs (new style)
Blockchain Fundamentals - Day 3 - PoW consensus and ICOs (new style)
 
Cryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed ConsensusCryptomania! The Past and Future of Digital Distributed Consensus
Cryptomania! The Past and Future of Digital Distributed Consensus
 
Bitcoin, Banking and the Blockchain
Bitcoin, Banking and the BlockchainBitcoin, Banking and the Blockchain
Bitcoin, Banking and the Blockchain
 
Lecture3
Lecture3Lecture3
Lecture3
 
The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin The Blockchain - The Technology behind Bitcoin
The Blockchain - The Technology behind Bitcoin
 
BCHGraz - Meetup #8 - Intro & Ethereum
 BCHGraz - Meetup #8 - Intro & Ethereum BCHGraz - Meetup #8 - Intro & Ethereum
BCHGraz - Meetup #8 - Intro & Ethereum
 
blockchain.pptx
blockchain.pptxblockchain.pptx
blockchain.pptx
 
Introduction to Blockchain
Introduction to BlockchainIntroduction to Blockchain
Introduction to Blockchain
 
Overview of bitcoin
Overview of bitcoinOverview of bitcoin
Overview of bitcoin
 

Recently uploaded

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application ) Sakshi Ghasle
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionSafetyChain Software
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentInMediaRes1
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...M56BOOKSTORE PRODUCT/SERVICE
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docxPoojaSen20
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13Steve Thomason
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...EduSkills OECD
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactdawncurless
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)eniolaolutunde
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityGeoBlogs
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Educationpboyjonauth
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17Celine George
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxiammrhaywood
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesFatimaKhan178732
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxpboyjonauth
 

Recently uploaded (20)

Hybridoma Technology ( Production , Purification , and Application )
Hybridoma Technology  ( Production , Purification , and Application  ) Hybridoma Technology  ( Production , Purification , and Application  )
Hybridoma Technology ( Production , Purification , and Application )
 
Mastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory InspectionMastering the Unannounced Regulatory Inspection
Mastering the Unannounced Regulatory Inspection
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Alper Gobel In Media Res Media Component
Alper Gobel In Media Res Media ComponentAlper Gobel In Media Res Media Component
Alper Gobel In Media Res Media Component
 
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
KSHARA STURA .pptx---KSHARA KARMA THERAPY (CAUSTIC THERAPY)————IMP.OF KSHARA ...
 
mini mental status format.docx
mini    mental       status     format.docxmini    mental       status     format.docx
mini mental status format.docx
 
The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13The Most Excellent Way | 1 Corinthians 13
The Most Excellent Way | 1 Corinthians 13
 
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
Presentation by Andreas Schleicher Tackling the School Absenteeism Crisis 30 ...
 
Accessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impactAccessible design: Minimum effort, maximum impact
Accessible design: Minimum effort, maximum impact
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)Software Engineering Methodologies (overview)
Software Engineering Methodologies (overview)
 
Paris 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activityParis 2024 Olympic Geographies - an activity
Paris 2024 Olympic Geographies - an activity
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
Introduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher EducationIntroduction to ArtificiaI Intelligence in Higher Education
Introduction to ArtificiaI Intelligence in Higher Education
 
How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17How to Configure Email Server in Odoo 17
How to Configure Email Server in Odoo 17
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptxSOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
SOCIAL AND HISTORICAL CONTEXT - LFTVD.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
Separation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and ActinidesSeparation of Lanthanides/ Lanthanides and Actinides
Separation of Lanthanides/ Lanthanides and Actinides
 
Introduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptxIntroduction to AI in Higher Education_draft.pptx
Introduction to AI in Higher Education_draft.pptx
 

Bitcoin MOOC Lecture 2.pptx

  • 1. Lecture 2 How Bitcoin Achieves Decentralization
  • 3. Centralization vs. decentralization Competing paradigms that underlie many digital technologies
  • 4. Decentralization is not all-or-nothing E-mail: decentralized protocol, but dominated by centralized webmail services
  • 5. Aspects of decentralization in Bitcoin 1. Who maintains the ledger? 2. Who has authority over which transactions are valid? 3. Who creates new bitcoins? 4. Who determines how the rules of the system change? 5. How do bitcoins acquire exchange value? Beyond the protocol: exchanges, wallet software, service providers...
  • 6. Aspects of decentralization in Bitcoin Peer-to-peer network: open to anyone, low barrier to entry Mining: open to anyone, but inevitable concentration of power often seen as undesirable Updates to software: core developers trusted by community, have great power
  • 8. Bitcoin’s key challenge Key technical challenge of decentralized e-cash: distributed consensus or: how to decentralize ScroogeCoin
  • 9. Why consensus protocols? Traditional motivation: reliability in distributed systems Distributed key-value store enables various applications: DNS, public key directory, stock trades … Good targets for Altcoins!
  • 10. Defining distributed consensus The protocol terminates and all correct nodes decide on the same value This value must have been proposed by some correct node
  • 11. Bitcoin is a peer-to-peer system When Alice wants to pay Bob: she broadcasts the transaction to all Bitcoin nodes Pay to pkBob : H( ) signed by Alice Note: Bob’s computer is not in the picture
  • 12. How consensus could work in Bitcoin At any given time: ● All nodes have a sequence of blocks of transactions they’ve reached consensus on ● Each node has a set of outstanding transactions it’s heard about
  • 13. How consensus could work in Bitcoin Tx Tx … Tx Tx Tx … Tx Tx Tx … Tx Tx Tx … Tx Tx Tx … Tx Tx Tx … Tx Consensus protocol OK to select any valid block, even if proposed by only one node
  • 14. Why consensus is hard Nodes may crash Nodes may be malicious Network is imperfect • Not all pairs of nodes connected • Faults in network • Latency No notion of global time
  • 15. Many impossibility results • Byzantine generals problem • Fischer-Lynch-Paterson (deterministic nodes): consensus impossible with a single faulty node
  • 16. Some well-known protocols Example: Paxos Never produces inconsistent result, but can (rarely) get stuck
  • 17. Understanding impossibility results These results say more about the model than about the problem The models were developed to study systems like distributed databases
  • 18. Bitcoin consensus: theory & practice Bitcoin consensus works better in practice than in theory Theory is still catching up BUT theory is important, can help predict unforeseen attacks
  • 19. Some things Bitcoin does differently Introduces incentives • Possible only because it’s a currency! Embraces randomness • Does away with the notion of a specific end-point • Consensus happens over long time scales — about 1 hour
  • 20. Lecture 2.3: Consensus without identity: the block chain
  • 21. Why identity? Pragmatic: some protocols need node IDs Security: assume less than 50% malicious
  • 22. Why don’t Bitcoin nodes have identities? Identity is hard in a P2P system — Sybil attack Pseudonymity is a goal of Bitcoin
  • 23. Weaker assumption: select random node Analogy: lottery or raffle When tracking & verifying identities is hard, we give people tokens, tickets, etc. Now we can pick a random ID & select that node
  • 24. Key idea: implicit consensus In each round, random node is picked This node proposes the next block in the chain Other nodes implicitly accept/reject this block • by either extending it • or ignoring it and extending chain from earlier block Every block contains hash of the block it extends
  • 25. Consensus algorithm (simplified) 1. New transactions are broadcast to all nodes 2. Each node collects new transactions into a block 3. In each round a random node gets to broadcast its block 4. Other nodes accept the block only if all transactions in it are valid (unspent, valid signatures) 5. Nodes express their acceptance of the block by including its hash in the next block they create
  • 26. What can a malicious node do? CA → B CA → A’ Pay to pkB : H( ) signed by A Pay to pkA’ : H( ) signed by A Double- spending attack Honest nodes will extend the longest valid branch
  • 27. From Bob the merchant’s point of view CA → B CA → A’ Hear about CA → B transaction 0 confirmations 1 confirmation double-spend attempt 3 confirmations Double-spend probability decreases exponentially with # of confirmations Most common heuristic: 6 confirmations
  • 28. Recap Protection against invalid transactions is cryptographic, but enforced by consensus Protection against double-spending is purely by consensus You’re never 100% sure a transaction is in consensus branch. Guarantee is probabilistic
  • 30. Can we give nodes incentives for behaving honestly? Everything so far is just a distributed consensus protocol But now we utilize the fact that the currency has value Assumption of honesty is problematic Can we penalize the node that created this block? Can we reward nodes that created these blocks?
  • 31. Incentive 1: block reward Creator of block gets to • include special coin-creation transaction in the block • choose recipient address of this transaction Value is fixed: currently 25 BTC, halves every 4 years Block creator gets to “collect” the reward only if the block ends up on long-term consensus branch!
  • 32. There’s a finite supply of bitcoins Block reward is how new bitcoins are created Runs out in 2040. No new bitcoins unless rules change Year Total bitcoins in circulation First inflection point: reward halved from 50BTC to 25BTC Total supply: 21 million
  • 33. Incentive 2: transaction fees Creator of transaction can choose to make output value less than input value Remainder is a transaction fee and goes to block creator Purely voluntary, like a tip
  • 34. Remaining problems 1. How to pick a random node? 1. How to avoid a free-for-all due to rewards? 1. How to prevent Sybil attacks?
  • 35. Proof of work To approximate selecting a random node: select nodes in proportion to a resource that no one can monopolize (we hope) • In proportion to computing power: proof-of-work • In proportion to ownership: proof-of-stake
  • 36. Equivalent views of proof of work 1. Select nodes in proportion to computing power 1. Let nodes compete for right to create block 1. Make it moderately hard to create new identities
  • 37. Hash puzzles To create block, find nonce s.t. H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) is very small Output space of hash Target space If hash function is secure: only way to succeed is to try enough nonces until you get lucky nonce prev_h Tx Tx
  • 38. PoW property 1: difficult to compute As of Aug 2014: about 1020 hashes/block Only some nodes bother to compete — miners
  • 39. PoW property 2: parameterizable cost Nodes automatically re-calculate the target every two weeks Goal: average time between blocks = 10 minutes Prob (Alice wins next block) = fraction of global hash power she controls
  • 40. Key security assumption Attacks infeasible if majority of miners weighted by hash power follow the protocol
  • 41. Solving hash puzzles is probabilistic Time to next block (entire network) Probability density 10 minutes
  • 42. PoW property 3: trivial to verify Nonce must be published as part of block Other miners simply verify that H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) < target
  • 43. Mining economics Complications: • fixed vs. variable costs • reward depends on global hash rate If mining reward (block reward + Tx fees) > hardware + electricity cost → Profit
  • 44. Lecture 2.5: Putting it all together
  • 45. Recap Identities Transactions P2P network Block chain & consensus Hash puzzles & mining
  • 46. Bitcoin has three types of consensus • Value • State • Rules
  • 47. Bitcoin is bootstrapped security of block chain value of currency health of mining ecosystem
  • 48. What can a “51% attacker” do? Steal coins from existing address? Suppress some transactions? • From the block chain • From the P2P network Change the block reward? Destroy confidence in Bitcoin? ✗ ✓ ✗ ✗ ✓✓
  • 49. Remaining questions How do we get from consensus to currency? What else can we do with consensus?