Bitcoin Mining CS1951 L Spring 2019 5 February 2019 Maurice Herlihy

Slides:



Advertisements
Similar presentations
For a New Liberty CTIR Literature Series 1 Part 4 Chapter 9.
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
BITCOIN An introduction to a decentralised and anonymous currency. By Andy Brodie.
Bitcoin is the FUTURE of MONEY!!
The world’s first decentralized digital currency Meni Rosenfeld Bitcoil 29/11/2012Written by Meni Rosenfeld1.
AIM Why should we invest in real estate? DO NOW What are the advantages of investing in real estate? REAL ESTATE.
On Power Splitting Games in Distributed Computation: The case of Bitcoin Pooled Mining Loi Luu, Ratul Saha, Inian Parameshwaran, Prateek Saxena & Aquinas.
Bitcoin (what, why and how?)
Security Update Vincent BRILLAULT HEPiX Spring 2014, Annecy.
Bitcoins and the Digital Economy Presented By: Matt Blackman.
Bitcoins – Mining and Trading Jonathan Day, Carpe Diem 18 th July 2013.
Subverting Bitcoin David Evans and Samee Zahur. Mining Why do we need miners?
First… What is Cryptocurrency? A Cryptocurrency is a digital currency that is created through mathematical engineering (algorithm). It is designed to.
An Introduction to Product Markets. What is a Market? Institution or mechanism that brings together buyers and sellers Common element is goods or services.
Block Chain 101 May 2017.
Motivation ✓ ✘ ? Bitcoin/Ideal Credit Card Works on Internet
Math 1050 Project Part 3 Joshua Funderburk Sarah Hansen
The Federal Reserve System
Crypto Mining Presented by: 803Mine.com & TheCryptoMiners.com.
Who cares….is there really that much to know about them???
Bitcoin A Basic Tutorial on Decentralized money
Join Bitcoin2You & Start Earning Today!!
Chapter 7 Raising money to repay debts: Making good choices and
Economics of Virtual Currency
Unit 4 IT Security.
Cryptocurrencies by.
Unwrap the objectives Factual: Define Inflation and Deflation
Bitcoin - a distributed virtual currency system
Instability Of Bitcoin Without the Block Reward.
Where Money and Technology Meet
Distributed Systems for Information Systems Management
Cryptocurrencies By Rui Sakurai and Shane Spears
Introduction to Blockchain & Ethereum
Blockchains and Cryptocurrencies: What Financial Planners Need to Know
Mining Profits + Leveraged Profits
Dash Mining - for Dummies. Dash, an altcoin, is best known for two main features – ability to send instantly and highest level of privacy provision. It’s.
Free Enterprise and the
So what is Blockchain anyway?
Deanonymization of Clients in Bitcoin P2P Network

Bitcoin and Why I See Bad Future for It
Nakamoto Consensus Marco Canini
From “Cash on the internet” to “Digital Gold”
EECS 498 Introduction to Distributed Systems Fall 2017
Crypto Mining LLC.
FULLY AUTOMATED WEALTH GENERATOR
Blockchain technology
GasToken: A Journey Through Blockchain Resource Arbitrage
Lecture 13: Balance of Payments Benjamin Graham
Your 403(b) Plan – What you need to know…
– Communication Technology in a Changing World
Kai Bu 04 Blockchain Kai Bu
Exchange Rates.
Blockchains and Auditing
Bitcoin Data Structures
Ethereum Virtual Machine
Off-Chain Payment Channels
Privacy Coins CS1952 L Spring 2019 Maurice Herlihy Brown University.
CS 188: Artificial Intelligence Spring 2006
Wokshop SAIS 2018 Dr. Meg Murray Kennesaw state university
What is a ‘Cryptocurrency’?
Create Crypto Coin. INTRODUCTION The field of cryptocurrencies is ever expanding. Being considered as the contrast of fiat money, cryptocurrency now finds.
Campbell R. Harvey Duke University and NBER
Majority is not Enough: Bitcoin Mining is Vulnerable
Blockchain Mining Games
Presentation transcript:

Bitcoin Mining CS1951 L Spring 2019 5 February 2019 Maurice Herlihy Brown University

Nakamoto Consensus in One Line hash of block on longest branch public key difficulty SHA256( h | T | K | nonce ) < D standard hash function transactions Find this!

Mining … Try nonce = 1 Compute hash Try nonce = 2 Enough leading zeros? Try nonce = 3 … Try nonce = 1,000,000

As value rises, GPUs displace CPUs 2009-2011 Era of CPU mining Bitcoin not worth much As value rises, GPUs displace CPUs

Large size, high power, heat … 2011-2014 Era of GPU mining Versatile, high resale Large size, high power, heat …

Today Era of ASiC mining Power efficient, small, effective Expensive, no resale value

Mining Payoff is high, but expected wait is now years … Bitcoin gets harder and harder to mine Maybe I can pool the risk …

Work on this block credited to me Pools Work on this block credited to me boss Try nonce = 1… Try nonce = 100… Try nonce = 200… worker worker worker

I won! My nonce yields k leading zeros! Pools I won! My nonce yields k leading zeros! boss worker worker worker

You get most of the reward! Pools You get most of the reward! boss worker worker worker

How do I know you’re not freeloaders? Pools How do I know you’re not freeloaders? boss I worked just as hard! I worked just as hard! worker worker worker

Pools boss worker worker worker Here is a stream of partial results …

Payment proportional to your hash’s number of leading zeros Pools boss worker worker worker

Pools have no incentive to launch 51% attack, so who cares? Just kidding about that decentralized, censorship-resistence thing!

Competing Pools

Sometimes this increases green pool’s income Infiltration Diluting blue pool’s income, but … pretending to work, but suppressing full solutions Reducing green pool’s mining rate Sometimes this increases green pool’s income Reducing overall Bitcoin difficulty

Best for both, but unstable No infiltration Best for both, but unstable

Asymmetric Infiltration Favors infiltrating pool (sometimes)

Not great for either but stable Mutual Infiltration Not great for either but stable

Prisoner’s Dilemma Prisoner A choices Prisoner B choices Stay silent Confess & betray Each 1 month jail A goes free, B gets 1 year jail B goes free, A gets 1 year jail Each 3 months jail Prisoner B choices

Iterated Prisoner’s Dilemma Dominant strategy is to infiltrate But both are better off if they refrain 3+ miners, anonymous attacks, complex, unstable?

In-Depth

Feather-Forking I refuse to mine on any chain that includes Alice’s transaction Threat not credible, too expensive

Rational to blacklist Alice Feather-Forking I refuse to mine on any chain that includes Alice’s transaction in last k blocks Threat is credible Rational to blacklist Alice

Feather-Forking Source

Finney Attack Bob’s Pizza cannot affort to delay customers… So Bob accepts 0-confirmation transactions Alice pre-mines block with tranaction to self Alice sends txn paying Bob, receives pizza Alice releases pre-mined block …

Double Spending Attack 51% pool? Lowers confidence in BTC … Clients abandon, BTC becomes worthless Not profitable to rational player …

Harder to detect, maybe profitable Censorship Attack 51% pool? Extort higher fees? Political control? Harder to detect, maybe profitable

Attempt to destroy currency Auric Goldfinger, villain, … Goldfinger Attacks Attempt to destroy currency From 1964 Movie Auric Goldfinger, villain, … wants to increase value of own gold by … making gold in Ft. Knox radioactive!

Bitcoin “Death Spiral” Mining rigs cost fiat (USD, Euro, etc.) Reward in BTC Loss of confidence in BTC … Lowers mining reward … Fewer miners, BTC easier to subvert. … Further lowering confidence

Goldfinger Attack Motivation Law enforcement, anti-laundering … Most plausible Government Law enforcement, anti-laundering … Too expensive? Non-state atttacker Political or social goal Hard to short? Investment gain Short BTC

Technology Review Article The Fed issues a stablecoin Dollar Facebook issues stablecoin, or subverts BTC Everyone issues a stablecoin

Hysteria about China

Rent equipment for 51% attack Rental Attack Rent equipment for 51% attack Very expensive against BTC or ETH Not so expensive for lesser coins … Even for BTC, getting cheaper …

Most Expensive as of 26 Dec 18 Hash rates from Mine the Coin Rental prices from NiceHash Percent rentable from NiceHash

Least Expensive https://www.crypto51.app/

After DAO disaster (later), Ethereum split into ETH and ETC This Happened After DAO disaster (later), Ethereum split into ETH and ETC 18th-largest cryptocurrency Deep reorganization” of 100s of blocks Double spends ~1.1M USD Numbers unreliable, but something happened

Price almost didn’t move It gets weirder Price almost didn’t move “a lot of these assets have dogmatic diehard communities that refuse to submit, and most tokens are held by them anyway”

Attacker returned about half the stolen money to at least one exchange And weirder Attacker returned about half the stolen money to at least one exchange “the hashing power of ETC network is still not strong enough and it's still possible to rent enough hashing power to launch another 51% attack.”

Game Theory: Auric vs Bond Auric gets utility A by destroying BTC Bond gets utility B by preserving BTC Bond sets mining reward C Auric destroys by spending more than C Preserve Destroy Auric A-C Bond B-C

If A > B Auric destroys BTC If B > A, Bond preserves BTC… Auric vs Bond Preserve Destroy Auric A-C Bond B-C If A > B Auric destroys BTC If B > A, Bond preserves BTC… By setting C = A BTC must pay a “tax” of A to stay alive!

Probability distributions? Need to have governance to respond Auric vs Bond Bitcoin must pay a “tax” of A to stay alive! What if you don’t know A? Probability distributions? Need to have governance to respond

Governance?

In greater depth …

In the future when block rewards are gone … Long-term Stability? In the future when block rewards are gone … And there are only transaction fees… Often more effective to steal “whale” transactions … Than to build on other blocks Existential threat?

If I’m ahead, withhold my block and mine on private chain Selfish Mining If I’m ahead, withhold my block and mine on private chain

Selfish Mining If public chain catches up, publish private chain, and hope for best

If I’m still ahead, keep mining on private chain Selfish Mining If I’m still ahead, keep mining on private chain

Selfish Mining If public chain starts to catch up, publish enough private chain to invalidate public blocks

Selfish Mining “Rational miners will prefer to join the selfish miners, and the colluding group will increase in size until it becomes a majority. At this point, the Bitcoin system ceases to be a decentralized currency.”

Selfish mining can be profitable for any size pool Fixes exist that work for < 25% pools. No fix works for > 33% pools

Fake News? Vitalik Buterin "No honest (or semi-honest) miner would want to join a selfish pool… Even if they do have a small incentive to [join], they have an even greater incentive to not break the Bitcoin network to preserve the value of their own Bitcoins and mining hardware." Vitalik Buterin

Ittay Eyal & Emin Gün Sirer Fake News? "No honest (or semi-honest) miner would want to join a selfish pool… Even if they do have a small incentive to [join], they have an even greater incentive to not break the Bitcoin network to preserve the value of their own Bitcoins and mining hardware." “This is patently false. Take your regular, run-of-the-mill counterfeiter. Every time he manufactures a banknote, he undermines the very currency he is illegally replicating. Yet that doesn't stop counterfeiters from creating bogus banknotes.” Vitalik Buterin Ittay Eyal & Emin Gün Sirer

Lots of orphaned blocks? Lots of blocks in close succession? Not so easy to detect Not hard to obfuscate But no evidence of selfish mining for real

In the future when block rewards are gone … Stability? In the future when block rewards are gone … And there are only transaction fees… Often more effective to steal “whale” transactions … Than to build on other blocks Existential threat?

Let someone else pay for Cryptomining Malware Let someone else pay for Hardware Electricity Bills Two varieties: Browser-based Binary malware-based

Website visitors run mining code Browser-Based Website visitors run mining code Legit: Charities: UNESCO Ad blocker response: Salon.com javascript or web assembly

Website serves “orchestrator”, checks host enviroment “Drive-By” Mining Website serves “orchestrator”, checks host enviroment Downloads optimized Wasm or asm.js mining script Instantiates number of web workers (threads) Sets up connection with pool Fetches work from pool and submits hashes

“Drive-By” Mining Vectors Embedded video streaming: 2,500 sites Advertising websites Compromised websites Torrent portals: mostly Pirate Bay

Drive-By Mining Countermeasures Block blacklisted pool connections Fooled by aliasing Monitor CPU usage Fooled by throttling Inspect binary code Can detect hashing “fingerprint” E.g., 80 XOR, 85 left shfit, 32 right shift …

Domain aliases to fool pools Cryptomining Malware Monero most popular 4.32% mined by criminals ~$57M in January 2019 Evasion Domain aliases to fool pools “Idle” mining when CPU idle, no monitors rnning

Cryptomining Malware as Commodity Malware easily purchased on-line $35 for Monero miner, for example “Miner is free, we charge a fee of 2%” Premium service maintenance, upgrades, proxies, service-level agreements Discussion forums Bot-friendly pools

Mining eras: CPU, GPU, ASIC Ideas we covered in this lecture Mining eras: CPU, GPU, ASIC Pools and pool attacks Feather forking Finney attacks Goldfinger Attacks Selfish Mining Mining Malware