more mining david evans and samee zahur cs4501, fall 2015 university of virginia

35
More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Upload: amice-griffin

Post on 05-Jan-2016

213 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

More MiningDavid Evans and Samee Zahur

CS4501, Fall 2015University of Virginia

Page 2: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Selfish mining – back with math!

𝛼=our   hashing  powertotal   hashing   power

Page 3: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

3 42

𝛼 𝛼

1−𝛼1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

Page 4: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

State diagram

2 31

𝛼 𝛼

1−𝛼

1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

0

1−𝛼

Page 5: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

[Ittay Eyal and Emin Gün Sirer, 2013]

Page 6: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

State diagram

2 31

𝛼 𝛼

1−𝛼

1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

0

1−𝛼

Blocks won = number of forward advances

Page 7: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Expected advances

3 42

𝛼 𝛼

1−𝛼1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

Define = Expected number of additional forward steps taken, before we exit through branch

Page 8: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Expected advances

3 42

𝛼 𝛼

1−𝛼1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

𝐸=(1−𝛼 )×0+…

Page 9: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Expected advances

3 42

𝛼 𝛼

1−𝛼1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

𝐸=(1−𝛼 )×0+𝛼×(1+…)

Page 10: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Expected advances

3 42

𝛼 𝛼

1−𝛼1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

𝐸=(1−𝛼 )×0+𝛼×(1+𝐸+𝐸)

Page 11: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Expected advances

3 42

𝛼 𝛼

1−𝛼1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

𝐸=𝛼×(1+2𝐸)

∴𝐸=𝛼

1−2𝛼,assuming  𝛼<

12

Page 12: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

2 31

𝛼 𝛼

1−𝛼

1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

0

1−𝛼

Selfish Others

𝛼 (1−𝛼 )×1

Page 13: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

2 31

𝛼 𝛼

1−𝛼

1−𝛼

𝛼

1−𝛼

𝛼

1−𝛼

0

1−𝛼

Selfish Others

+𝛼 (1−𝛼 )×1¿1−𝛼2

Page 14: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Selfish Others

1−𝛼2

At ,

Selfish reward = 0.64 blocks/cycle Honest reward = 0.84 blocks/cycle

=

Page 15: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia
Page 16: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia
Page 17: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Mining cooperatively – in pools!

Page 18: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Mining profit

Intel Core i5 2600K• Quad core• Speed: total 17.3 M hashes per second• Power: 75 WattsAt last night’s difficulty, we would need over 374,000 years.

Page 19: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia
Page 20: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia
Page 21: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Distributed computing: SETI@home

Page 22: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Engaging small miners … again

GPUs @ 30-100 MH/sec

ASICs @ 11 GH/sec

Page 23: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

blockchain.info/pools

Page 24: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Calculate at: http://www.alcula.com/calculators/finance/bitcoin-mining/

Page 25: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Pool manager

WorkerWorker

Worker

Hey, I found a block!

Yay!Yay!

Yay!

Page 26: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Puzzle “shares”

Worker

Pool manager Lower difficulty:Hash(B1) = 0x00000002dd43…Hash(B2) = 0x0000000076a5…Hash(B3) = 0x0000000f270b…Hash(B4) = 0x0000000f3f5b…

Purpose of “shares”:• Proof of work• Measures hash rate

Page 27: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Proportional rewards

When block is found:yourShares = shares you submitted since last blocktotalShares = shares submitted by the pool since last block

yourReward = 25 BTC * yourShares/totalShares

Page 28: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Reward variation

You get more reward if this block is found is found early. I.e. early shares are worth more in expectation. Exploit by:• Send shares only early in search• Hop to a different pool if they found a block

recently

Page 29: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Expected share reward

Page 30: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Combating pool hopping

Ineffective methods:• Detect and punish/ban• Delaying pool block statistics

De-incentivize by changing scoring system:• Reward miners who stay longer• Make rewards independent of “block found” time

Page 31: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Encouraging small miners … again

Can we use “GPU/ASIC resistant” cryptocurrencies?

Page 32: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Password Databases

Username Password

Jack.Clough 12password

Betty.Smith 8c2odkw

Username “Salt” Scrypt(password+salt)

Jack.Clough 150FE5Btiq… PaR6mPwHBj…

Betty.Smith t1Y1B67ulN… QrUaLRqFvc…

Insecure Better

Page 33: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia
Page 34: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Comparison of cryptocurrencies

Page 35: More Mining David Evans and Samee Zahur CS4501, Fall 2015 University of Virginia

Logistics

• No class on Monday, Oct 5th

• Next class on Wednesday, Oct 7th • Problemset 2 is out: due Oct 9th • Midterm: Oct 19th