Nakamoto Consensus Marco Canini

Slides:



Advertisements
Similar presentations
Secure Multiparty Computations on Bitcoin
Advertisements

COMS 486 Iowa State University Introduction to Bitcoin A P2P Electronic Cash System.
Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.
Bitcoin Double Spending Attack Karame, Androulaki & Capkun Presented by Subhro Kar CSCE 715, Fall 2013.
Stefan Dziembowski Why do the cryptographic currencies need a solid theory? Forum Informatyki Teoretycznej, Warsaw
Advanced Computer Communications PROFESSOR:STUDENT: PROF. DR. ING. BRAD REMUS STEFAN FEILMEIER FACULTATEA DE INGINERIE HERRMANN OBERTH MASTER-PROGRAM.
BITCOIN An introduction to a decentralised and anonymous currency. By Andy Brodie.
The world’s first decentralized digital currency Meni Rosenfeld Bitcoil 29/11/2012Written by Meni Rosenfeld1.
Bitcoin (what, why and how?)
Bitcoins and the Digital Economy Presented By: Matt Blackman.
1 Bitcoin A Digital Currency. Functions of Money.
Bitcoin today (October 2, 2015)
Bitcoin Jeff Chase Duke University.
SCP: A Computationally Scalable Byzantine Consensus Protocol for Blockchains Loi Luu, Viswesh Narayanan, Kunal Baweja, Chaodong Zheng, Seth Gilbert, Prateek.
Bitcoin Tech Talk Zehady Abdullah Khan (Andy) Graduate Assistant, Computer Science Department, Purdue University.
Bitcoin is a cryptographic currency that has been in continuous operation over the last 3 years. It currently enjoys an exchange rate of $4.80 (as of April.
Bitcoin Based on “Bitcoin Tutorial” presentation by Joseph Bonneau, Princeton University Bonneau slides marked “JB”
Intro to Cryptocurrencies & Review of Relevant Crypto Tyler Moore, CS 7403, University of Tulsa Slides adapted from Arvind Narayanan, Joseph Bonneau, Edward.
How Bitcoin Achieves Decentralization
Bitcoin Bitcoin is a cryptocurrency. The platform that hosts Bitcoin is a p2p system. Bitcoin can be abstracted as a digital file that records the account.
Block Chain 101 May 2017.
Motivation ✓ ✘ ? Bitcoin/Ideal Credit Card Works on Internet
CSE 4095 Lecture 22 – BlockChain Slides adapted from Claudio Orlandi.
What Is Bitcoin? Launched in 2009 A p2p Electronic Cash System
Kermit Lowry, John Whatley, Wesley Cooper, and Matthew Eith
Bitcoin and the Blockchain
Bitcoin Based on “Bitcoin Tutorial” presentation by
Mechanics of Bitcoin Part II
Virtual currency? Crypto-currency? Internet Money? Property?
Bitcoin - a distributed virtual currency system
Distributed Systems for Information Systems Management
Cryptocurrencies By Rui Sakurai and Shane Spears
Introduction to Blockchain & Ethereum
Bitcoin and the Blockchain
Ling Ren Joint work with Ittai Abraham, Dahlia Malkhi,
So what is Blockchain anyway?

Zcash Mining – A Guide For Beginners. Zcash (also known as ZEC and seventeenth most valued cryptocurrency with market capitalization of $500 million)
CS898AT – Bitcoins and Cryptocurrencies
CS898AT – Bitcoins and Cryptocurrencies
Technical Overview of Bitcoin
Advanced Cryptography Protocols
Data Structures and Analysis (COMP 410)
Let’s build a Blockchain!
EECS 498 Introduction to Distributed Systems Fall 2017
CS 240: Computing Systems and Concurrency Lecture 20 Marco Canini
Bitcoin and the Blockchain
Bitcoin: A New Internet Currency
Blockchains slides have been taken from:
Blockchains (2) slides have been taken from:
Campbell R. Harvey Duke University and NBER
Nonce Making Sense of Nonces.
Introduction to Blockchain
Data Structures and Analysis (COMP 410)
Consensus Algorithms.
Kai Bu 04 Blockchain Kai Bu
Blockchains and Auditing
Blockchains and Smart Contracts for the Internet of Things
TELE3119: Trusted Networks Week 5
Production and usage of Cryptocurrencies
Wokshop SAIS 2018 Dr. Meg Murray Kennesaw state university
Faculty Seminar Series Blockchain Technology
Κατανεμημένα Συστήματα
Campbell R. Harvey Duke University and NBER
Blockchain Tech Big Picture
Blockchain Tech Big Picture
Bitcoin and Blockchain
Explore Txs, block, blockchain in Bitcoin
Author: Satoshi Nakamoto
Not about digital currencies
Presentation transcript:

Nakamoto Consensus Marco Canini Slides reproduced with permission from Bitcoin and Cryptocurrency Technologies by Arvind Narayanan, Joseph Bonneau, Edward Felten, Andrew Miller and Steven Goldfeder

Recap digital currency

GoofyCoin

Goofy can create new coins New coins belong to me. signed by pkGoofy CreateCoin [uniqueCoinID]

A coin’s owner can spend it. Alice owns it now. signed by pkGoofy Pay to pkAlice : H( ) signed by pkGoofy CreateCoin [uniqueCoinID]

The recipient can pass on the coin again. signed by pkAlice Bob owns it now. Pay to pkBob : H( ) signed by pkGoofy Pay to pkAlice : H( ) signed by pkGoofy CreateCoin [uniqueCoinID]

CreateCoin [uniqueCoinID] double-spending attack signed by pkAlice signed by pkAlice Pay to pkBob : H( ) Pay to pkChuck : H( ) signed by pkGoofy Pay to pkAlice : H( ) signed by pkGoofy CreateCoin [uniqueCoinID]

double-spending attack the main design challenge in digital currency

ScroogeCoin

H( ) trans trans trans Scrooge publishes a history of all transactions (a block chain, signed by Scrooge) H( ) trans prev: H( ) trans prev: H( ) trans prev: H( ) transID: 71 transID: 72 transID: 73 optimization: put multiple transactions in the same block

CreateCoins transaction creates new coins Valid, because I said so. transID: 73 type:CreateCoins coins created num value recipient 3.2 0x... 1 1.4 2 7.1 coinID 73(0) coinID 73(1) coinID 73(2)

PayCoins transaction consumes (and destroys) some coins, and creates new coins of the same total value transID: 73 type:PayCoins consumed coinIDs: 68(1), 42(0), 72(3) Valid if: -- consumed coins valid, -- not already consumed, -- total value out = total value in, and -- signed by owners of all consumed coins coins created num value recipient 3.2 0x... 1 1.4 2 7.1 signatures

Immutable coins Coins can’t be transferred, subdivided, or combined. But: you can get the same effect by using transactions to subdivide: create new trans consume your coin pay out two new coins to yourself

Don’t worry, I’m honest. Crucial question: Can we descroogify the currency, and operate without any central, trusted party?

Nakamoto consensus

Aspects of decentralization in Bitcoin Who maintains the ledger? Who has authority over which transactions are valid? Who creates new bitcoins? Who determines how the rules of the system change? 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

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

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) New transactions are broadcast to all nodes Each node collects new transactions into a block In each round a random node gets to broadcast its block Other nodes accept the block only if all transactions in it are valid (unspent, valid signatures) Nodes express their acceptance of the block by including its hash in the next block they create

What can a malicious node do? Double-spending attack CA → B Pay to pkB : H( ) signed by A CA → A’ Can’t create new transactions from someone else’s address, or modify them. Suppressing tx’s is only a minor annoyance. Pay to pkA’ : H( ) signed by A Honest nodes will extend the longest valid branch

From Bob the merchant’s point of view 1 confirmation 3 confirmations CA → B CA → A’ Double-spend probability decreases exponentially with # of confirmations Most common heuristic: 6 confirmations double-spend attempt Hear about CA → B transaction 0 confirmations

Assumption of honesty is problematic 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 Can we reward nodes that created these blocks? Can we penalize the node that created this block?

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 Total supply: 21 million Year Total bitcoins in circulation First inflection point: reward halved from 50BTC to 25BTC

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 How to pick a random node? How to avoid a free-for-all due to rewards? 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 Select nodes in proportion to computing power Let nodes compete for right to create block Make it moderately hard to create new identities

Hash puzzles To create block, find nonce s.t. prev_h Tx To create block, find nonce s.t. H(nonce ‖ prev_hash ‖ tx ‖ … ‖ tx) is very small Output space of hash If Alice has 100x more computing power than Bob it doesn’t mean she always wins the race. It means she has about a 99% chance of wining. In the long run Bob will create 1% of the blocks Target space If hash function is secure: only way to succeed is to try enough nonces until you get lucky

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 what happens if time b/w blocks is too low or too high 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

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? ✗ ✓ ✓✓