Demystifying incentives in the consensus computer Loi Luu, Jason Teutsch, Raghav Kulkarni, Prateek Saxena National University of Singapore.

Slides:



Advertisements
Similar presentations
Secure Multiparty Computations on Bitcoin
Advertisements

LOGO Multi-user Broadcast Authentication in Wireless Sensor Networks ICU Myunghan Yoo.
COMS 486 Iowa State University Introduction to Bitcoin A P2P Electronic Cash System.
CS425/CSE424/ECE428 — Distributed Systems — Fall Nikita Borisov - UIUC1.
Bitcoin. What is Bitcoin? A P2P network for electronic payments Benefits: – Low fees – No middlemen – No central authority – Can be anonymous – Each payment.
Theoretical Program Checking Greg Bronevetsky. Background The field of Program Checking is about 13 years old. Pioneered by Manuel Blum, Hal Wasserman,
Bitcoin Double Spending Attack Karame, Androulaki & Capkun Presented by Subhro Kar CSCE 715, Fall 2013.
Yan Huang, Jonathan Katz, David Evans University of Maryland, University of Virginia Efficient Secure Two-Party Computation Using Symmetric Cut-and-Choose.
Towards a More Democratic Mining in Bitcoins Goutam Paul R. C. Bose Centre for Cryptology & Security, Indian Statistical Institute Pratik Sarkar Indian.
Stefan Dziembowski Why do the cryptographic currencies need a solid theory? Forum Informatyki Teoretycznej, Warsaw
SIA: Secure Information Aggregation in Sensor Networks Bartosz Przydatek, Dawn Song, Adrian Perrig Carnegie Mellon University Carl Hartung CSCI 7143: Secure.
BITCOIN An introduction to a decentralised and anonymous currency. By Andy Brodie.
Bitcoin is the FUTURE of MONEY!!
Mitigating DoS Attacks against Broadcast Authentication in Wireless Sensor Networks Peng Ning, An Liu North Carolina State University and Wenliang Du Syracuse.
The world’s first decentralized digital currency Meni Rosenfeld Bitcoil 29/11/2012Written by Meni Rosenfeld1.
On Power Splitting Games in Distributed Computation: The case of Bitcoin Pooled Mining Loi Luu, Ratul Saha, Inian Parameshwaran, Prateek Saxena & Aquinas.
Ragesh Jaiswal Indian Institute of Technology Delhi Threshold Direct Product Theorems: a survey.
On the Incentive Compatibility of Bitcoin & Cryptocurrency Loi Luu Joint works with Jason Teutsch, Raghav Kulkarni, Ratul Saha, Inian Parameshwaran, Aquinas.
BitTorrent Nathan Marz Raylene Yung. BitTorrent BitTorrent consists of two protocols – Tracker HTTP protocol (THP) How an agent joins a swarm How an agent.
Bitcoins and the Digital Economy Presented By: Matt Blackman.
1 Bitcoin A Digital Currency. Functions of Money.
SIA: Secure Information Aggregation in Sensor Networks B. Przydatek, D. Song, and A. Perrig. In Proc. of ACM SenSys 2003 Natalia Stakhanova cs610.
On the Communication Complexity of SFE with Long Output Daniel Wichs (Northeastern) joint work with Pavel Hubáček.
Chapter 10 Verification and Validation of Simulation Models
Neural Network Implementation of Poker AI
Intro to Block Chain Bitcoin. Blocks ●Ethereum - block chain ●Dogecoin - block chain ●Ripple - not a block chain ●Stellar - not a block chain ●Bitcoin.
© 2006 Pearson Addison-Wesley. All rights reserved 2-1 Chapter 2 Principles of Programming & Software Engineering.
Bitcoin Jeff Chase Duke University.
Electronic Cash R. Newman. Topics Defining anonymity Need for anonymity Defining privacy Threats to anonymity and privacy Mechanisms to provide anonymity.
SCP: A Computationally Scalable Byzantine Consensus Protocol for Blockchains Loi Luu, Viswesh Narayanan, Kunal Baweja, Chaodong Zheng, Seth Gilbert, Prateek.
BITMINGLE REID BIXLER AND CARTER HALL. BACKGROUND Unlinkability – Input and Output must be unlinkable Verifiability – Attacker must not be able to steal.
Subverting Bitcoin David Evans and Samee Zahur. Mining Why do we need miners?
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.
Stubborn Mining: Generalizing Selfish Mining and Combining with an Eclipse Attack With Srijan Kumar, Andrew Miller and Elaine Shi 1 Kartik Nayak.
Using Rhythmic Nonces for Puzzle-Based DoS Resistance Ellick M. Chan, Carl A. Gunter, Sonia Jahid, Evgeni Peryshkin, and Daniel Rebolledo University of.
How Bitcoin Achieves Decentralization
Block Chain 101 May 2017.
CSE 4095 Lecture 22 – BlockChain Slides adapted from Claudio Orlandi.
Blockchain Infrastructure for e-Science
Designing Proofs of Human Work for Cryptocurrency and Beyond
On the Size of Pairing-based Non-interactive Arguments
Virtual currency? Crypto-currency? Internet Money? Property?
Bitcoin - a distributed virtual currency system
Instability Of Bitcoin Without the Block Reward.
Mechanics of Bitcoin Part I
Distributed Systems for Information Systems Management
Oyente: Making Smart Contracts Smarter
Cryptocurrencies By Rui Sakurai and Shane Spears
M onero is an open source, secure, private and non-traceable cryptocurrency. Monero token is known as XMR. Monero is aimed at privacy of transaction and.
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)
Ethereum Blockchain Development
Chapter 10 Verification and Validation of Simulation Models
Technical Overview of Bitcoin
Bitcoin: Data flow.
Kai Bu 04 Blockchain Kai Bu
Scalable and Privacy-preserving Design of On/Off-chain Smart Contracts
Faculty Seminar Series Blockchain Technology
Reducing Forks in the Blockchain via Probabilistic Verification
Proofs of Space 徐昊 2017/5/31.
Campbell R. Harvey Duke University and NBER
Blockchain Tech Big Picture
Blockchain Tech Big Picture
Majority is not Enough: Bitcoin Mining is Vulnerable
Explore Txs, block, blockchain in Bitcoin
Blockchains Lecture 6.
Blockchain Mining Games
Presentation transcript:

Demystifying incentives in the consensus computer Loi Luu, Jason Teutsch, Raghav Kulkarni, Prateek Saxena National University of Singapore

Consensus computer  Decentralized network for computation – Some user posts a puzzle – Solved by someone, verified by all others f(x)=y f(x)=? Consensus computer f(x)=y f(x)=y? 2

Cryptocurrencies as consensus computers  Bitcoin – f: verify transactions  Anyone can produce f via transaction script – Determines applications of cryptocurrencies 3 Input : PreviousTX: ID of previous IX Index: 0 scriptSig: Sign(PubKey), PubKey Output : Value: scriptPubKey: %take Signature and PubKey as params checkif Hash(PubKey) = Payee's ID, checkif Sign(PubKey) is valid Specify the puzzle 1 BTC

Ethereum: Consensus computer with Turing complete language  Support Turing complete script  Can run arbitrary applications  Example – key-value registration on the blockchain 4 # Is the key not yet taken? if !contract.storage[msg.data[0]]: # Then take it! contract.storage[msg.data[0]] = msg.data[1] return(1) else: return(0) // Otherwise do nothing

Why study consensus computers? 5

Problem: correctness of computation?  Assumption: Users always verify and accept only correct solutions – Users are under attack if they verify? – Users have incentive to skip?  Previous work – Focus on mining – Implement more applications on top of consensus computers Rely on the assumption 6

Oops! 7 -5% miners mined an invalid block -Half the network hash rate was mining without fully validating blocks -Build new blocks on top of that invalid block. -5% miners mined an invalid block -Half the network hash rate was mining without fully validating blocks -Build new blocks on top of that invalid block.

Findings  The verification assumption is shaky! – Users are vulnerable to attacks – Rational users have incentive to skip verifications – Computation may be incorrect! 8

Contributions  Consensus computer may produce incorrect results – Verifier’s dilemma  Classes of computations can be performed correctly – Formalize the protocol used by consensus computers – Understand the incentive structure  Techniques to support more applications 9

ANALYZING THE VERIFICATION ASSUMPTION 10

Background: Cryptocurrency mining  Join the network – Prepare a block Include several TXs  Solve Proof-of-Work – Perform many SHA2 computations – Get the right to broadcast new blocks  Listen for new blocks – If receive a block from others, validate it Verify all TXs Run all scripts included in TXs – Extend the blockchain  When find a valid PoW – Broadcast – If it gets accepted, receive reward Being a miner Being a verifier 11

Incentives in cryptocurrencies 12  Incentive for miners – Block reward (e.g. 25 Bitcoins) – Transaction fees  There is no reward for verifiers!  Assumption – Users always validate other’s blocks

ATTACKS ON VERIFIERS 13

Resource exhaustion attack  Goal – Create expensive TXs which require more resources & time to verify  Damages – Waste other resources – Gain advantage in finding next blocks 14

Resource exhaustion attack in Bitcoin  Protection mechanism – Only allow basic arithmetic & crypto opcodes – Block size limit  Attacks in Bitcoin – CVE CVE Make users hash 19.1GB of data Take 3 mins CPU time to run – Include as many TXs as possible Verification time is increased 15

Users’ ill-fated choices Mine valid blocks xLess advantage in next blocks xOthers start ahead xWaste resource 16 More advantage in finding next blocks xMine invalid blocks xWaste all efforts on invalid blocks VerifyNot Verify Verifier’s dilemma Users do not know to do or skip the verification Users have incentive to skip verification TXs and computation on blockchain may be incorrect!

Resource exhaustion attack in Ethereum  Protection mechanism – Pay gas as transaction fee Gas depends on opcodes  Attack observation – gas fee is credited to the block founder Attacker = block founder? Attack with 0-fee  The attack – Include expensive TXs in its block 17 N = matrix_size A = N*N input matrix B = N*N input matrix if msg.data[0] = 1: C = get_matrix(msg.data[1]) if (C == A * B) //run O(N 3 ) sendReward() Verifier’s dilemma applies to all consensus computers!

INCENTIVIZING VERIFICATION 18

Approach overview  Goal – Determine classes of computations can be performed correctly  Intuition – Limit advantage of skipping verification Formulate the underlying protocol of consensus computers Understand incentive structure 19

Consensus-based computation (CBC) 20 Problem Giver (G) Prover (P) Consensus Computer Consensus Computer Compute f(x) y = f(x) Verifier (V) Verify if y = f(x) Do W b work to get reward Do W b work to get reward Employed by consensus computer

Advantage of rational users Def 1: Advantage of rational users w.r.t a TX: adv(f) = W f - W df – W f : amount of work to verify f – W df : amount of work in deviated protocol – Generally adv(f) = W f – O(1) 21 Def 2: Advantage to skip block verification adv(blk) = =  Threat model: ε - rational users Def 3: ε - rational users are honest if adv(blk) ≤ ε W b deviate otherwise

Incentivize correct consensus computation Def 4: ε - Consensus computer requires at most ε W b in verifying a block  ε - consensus computer produces correct results w.r.t ε - rational users 22 Lemma: Computation that requires less than ε W b is computed correctly by consensus computers of ε - rational users Applications that require more than ε W b work?

Run more applications on ε -consensus computer: Correct computation  Split verification work into multiple TXs across multiple blocks Each TX is correctly run by a ε - Consensus computer Advantage of rational miners is bounded Correctness guaranteed xLatency is high 23 N = matrix_size A = N*N input matrix B = N*N input matrix if msg.data[0] = 1: C = get_matrix(msg.data[1]) if msg.data[0] > 1: i, j = get_index(msg.data[0]) check_if (C[i][j] == A[i][] * B[][j]) //require to run O(N) Each TX checks one element Each TX checks one element

Run more applications on ε -consensus computer: Approximate computation  Probabilistic checking Reduce TXs and latency xguarantee probabilistic correctness  Goal – Ensure y differs from f(x) by at most δ elements with at least probability of, say, 99%  Intuition – If a solution is incorrect, a random check will detect with some probability 24

Approximate computation in Ethereum  How to randomly sample? – Use next block hash as a random seed Hard to control High guarantee of randomness and fairness 25 N = matrix_size A = N*N input matrix B = N*N input matrix counter = 0 if msg.data[0] = 1: C = get_matrix(msg.data[1]) if msg.data[0] > 1: blkHash= get_current_block_hash() i, j = get_index(blkHash) if (C[i][j] == A[i][] * B[][j]) if ++counter > THRESHOLD: return OK Else return WRONG-SOLUTION Sample element to check Accept solution if check enough samples

Other case studies  Correct consensus computation – GCD computation of large numbers – Dot product  Approximate consensus computation – Matrix multiplication – Sorting – k-coloring 26

Conclusion  Computation done by consensus computer is not guaranteed! – Verifier’s dilemma  Determine classes of computations can be executed correctly – Formalize the consensus computer protocol – Understand the incentive structure  Techniques to deploy large applications – Tradeoff between correctness & performance 27

Thank you Q&A 28

Related work  Incentive incompatible in Bitcoin Mining – [LSPSB 15] On Power Splitting Games in Distributed Computation: The Case of Bitcoin Pooled Mining – [Eyal 15] The miner’s dilemma  Other Bitcoin attacks – [Rosen 11] Analysis of Bitcoin Pooled Mining Reward Systems Pool hopping, Lie in wait attack – [EyalSi 13] Majority is not enough: Bitcoin mining is vulnerable Selfish mining attack – [HKZG 15] Eclipse Attacks on Bitcoin’s Peer-to-Peer Network 29

Ethereum system overview TXs Smart Contract TXs

Steps to verify a block in Bitcoin  If block hash meets difficulty – One SHA256 computation  Merkle tree of N TXs is correctly constructed – O(N) SHA256 computations  If all TXs are valid: Depends on – Number of TXs – Logic in each TX 31 Currently in a Bitcoin block: -N= TXs -Verifying a normal TX requires 2 signatures, 2 SHA256 -Verifying a Merkle tree is relatively cheap

Attack Bitcoin’s verfiers  Intuition: Bitcoin limits the TX size, but not the number of opcodes – Expensive opcode ~ easy opcode SHA256, CheckSig, etc – What if a TX requires signatures verification?  The attack: CVE CVE – Attacker includes multiple OP_Checksig in a block-size TX – Miners have to hash 19.1 GB of data to verify Take relatively 190 seconds CPU-time Expected time to find a block is only 10 mins 32

CBC in existing cryptocurrencies  In Bitcoin – G: sender of a TX f: decides what a receiver has to do – P: receiver of a TX proves the ownership of the address – V: miners verify if receiver’s signature is valid W blk : solve PoW  In Ethereum – G can define more expressive problem f() – V may have to do more work 33

CBC in existing cryptocurrencies 34 Problem Giver (G) Prover (P) Blockchain f: provide a correct signature y: correct signature Verifier (V) Verify if signature is correct Solve PoW Sender of a TX Miner Receiver of a TX  Ethereum G defines more expressive problems f() V has to do more work

ε -Consensus computer in existing cryptocurrencies  Goal: limiting ε W b work in verifying a block  Method: Limiting work in each TX to – In Ethereum Leveraging the gas mechanism – In Bitcoin Introduce TX size Bound number of expensive opcodes Only allow predefined standard TXs 35

gas_limit in Ethereum  Limit the gas in a block  Can be adjusted by miners – Let the “consensus” decide the gas_limit  Different miners have different thresholds for gas_limit – Raise gas_limit to above the gas required in the attack – Some miners are vulnerable 36