bitcoin mining demystified

59
Mining demystified

Upload: meinhard

Post on 08-Sep-2014

4.832 views

Category:

Economy & Finance


5 download

DESCRIPTION

Bitcoin mining explained to an advanced audience, in black-and-white. :) A presentation held at Bitcoin Startups meet-up Berlin, 6 May 2014

TRANSCRIPT

Page 1: Bitcoin Mining Demystified

Mining demystified

Page 2: Bitcoin Mining Demystified

Heavy tools

Page 3: Bitcoin Mining Demystified

gigahash

Page 4: Bitcoin Mining Demystified

terahash

Page 5: Bitcoin Mining Demystified

petahash

Page 6: Bitcoin Mining Demystified

1PH=

b50f642411733cd63264d3bedc046a5364ff3c77d2b37ca298ad8f1b5a9f05ba

x1 000 000 000 000 000

(1 quadrillion)

~58 000

TBeach second

!

Page 7: Bitcoin Mining Demystified

1PH=

b50f642411733cd63264d3bedc046a5364ff3c77d2b37ca298ad8f1b5a9f05ba

x1 000 000 000 000 000

(1 quadrillion)

~58 000

TBeach second

!

Current Bitcoin network hash rate: ~50 PH/s

Page 8: Bitcoin Mining Demystified

Y U NEED SO MANY HASHES?

Page 9: Bitcoin Mining Demystified

Mining:creation of new bitcoins and

distributing transactions

Page 10: Bitcoin Mining Demystified

Idea: Make it really hard to mine

Page 11: Bitcoin Mining Demystified

hard mine

Page 12: Bitcoin Mining Demystified

mine hard

Page 13: Bitcoin Mining Demystified

mine hard Get it? :)

Page 14: Bitcoin Mining Demystified

Hard to do, easy to verify

Page 15: Bitcoin Mining Demystified

Proof of work

Page 16: Bitcoin Mining Demystified

A new block roughly every 10 minutes

Page 17: Bitcoin Mining Demystified

New block references previous block

Page 18: Bitcoin Mining Demystified

Forming a ...?

Page 19: Bitcoin Mining Demystified

Forming a block chain

Page 20: Bitcoin Mining Demystified

“Side effect”: adding new bitcoins

Page 21: Bitcoin Mining Demystified

25 bitcoins reward per block

Page 22: Bitcoin Mining Demystified

~7700 EUR every 10 minutes

Page 23: Bitcoin Mining Demystified

~400m EUR per year

Page 24: Bitcoin Mining Demystified

Reward halves every210,000 blocks = 4 years

Page 25: Bitcoin Mining Demystified

Next halving:~ 21 August 2016

Page 26: Bitcoin Mining Demystified

How mining works

Page 27: Bitcoin Mining Demystified

Cryptographic function called“double SHA-256”

Page 28: Bitcoin Mining Demystified

Secure Hash Algorithm

Page 29: Bitcoin Mining Demystified

Invented by NSA

Page 30: Bitcoin Mining Demystified

OMG!

Page 31: Bitcoin Mining Demystified

Nothing to fear,all math, all open source

Page 32: Bitcoin Mining Demystified

256 bits “digest size”(length of resulting hash)

Page 33: Bitcoin Mining Demystified

“hello”first round of SHA-256:

2cf24dba5fb0a30e26e83b2ac5b9e29e1b161e5c1fa7425e73043362938b9824

second round of SHA-256:9595c9df90075148eb06860365df33584b75bff782a510c6cd4883a419833d50

Page 34: Bitcoin Mining Demystified

Hash length of 64 characters:32 hex octets with 8 bits each = 256 bits

Page 35: Bitcoin Mining Demystified

Sort of a checksum

Page 36: Bitcoin Mining Demystified

Virtually impossible to reverse

Page 37: Bitcoin Mining Demystified

First step to mine a new block:Collecting new transactions

Page 38: Bitcoin Mining Demystified

Second step:Hashing of block header

Page 39: Bitcoin Mining Demystified

If hash starts with enough zeros,you found a block

Page 40: Bitcoin Mining Demystified

000000000000000024aed4ca327f8957bb5f112787ff5350971a3fe38c144f14

Bingo!

Page 41: Bitcoin Mining Demystified

If not, increment “nonce” or other values in block header and try again

Page 42: Bitcoin Mining Demystified

A quadrillion times!

Page 43: Bitcoin Mining Demystified
Page 44: Bitcoin Mining Demystified

Enough zeros?

Page 45: Bitcoin Mining Demystified

Currently 17:00000000000000000

Page 46: Bitcoin Mining Demystified

Determined by “difficulty”,adjusted ~ every 2 weeks

Page 47: Bitcoin Mining Demystified

Pooled mining

Page 48: Bitcoin Mining Demystified

Share work with other miners

Page 49: Bitcoin Mining Demystified

Pool participants send partial workto earn shares

Page 50: Bitcoin Mining Demystified

For example all hasheswith 12 leading zeros

Page 51: Bitcoin Mining Demystified

Compensation according to share

Page 52: Bitcoin Mining Demystified

If a block was found,new work is being sent out

Page 53: Bitcoin Mining Demystified

Pool communication protocols:Stratum, Getwork, Getblocktemplate

Page 54: Bitcoin Mining Demystified

Stratum used by most pools

Page 55: Bitcoin Mining Demystified

Stratum uses JSON-RPC

JavaScript Object NotationRemote Procedure Call

Page 56: Bitcoin Mining Demystified

Human-readable (sort of):

{"id": 1, "method": "mining.subscribe", "params": []}

Page 57: Bitcoin Mining Demystified

To be continued...

Page 58: Bitcoin Mining Demystified

Thanks for listening!

@[email protected]

benn.org

Page 59: Bitcoin Mining Demystified

Presentation held atBitcoin Startups Meet-up Berlin

6 May 2014

CC-BY-NC 2014 Meinhard Benn