115
Bitcoin Mikal Vike Villa

Bitcoin Tutorial Proof of Work

Embed Size (px)

DESCRIPTION

Proof of work bitcoin explanation, escpecially related to proof of work. Please check this out

Citation preview

Page 1: Bitcoin Tutorial Proof of Work

Bitcoin

Mikal Vike Villa

Page 2: Bitcoin Tutorial Proof of Work

High level brief

Page 3: Bitcoin Tutorial Proof of Work

High level brief● Decentralized ledger

● Each node has it's own copy

Page 4: Bitcoin Tutorial Proof of Work

High level brief

● Nodes applies changes and pass on message

Page 5: Bitcoin Tutorial Proof of Work

High level brief

● Transactions and balances are public available for all

Page 6: Bitcoin Tutorial Proof of Work

High level brief

● 160bit hash of an ECDSA public key == “bank account”

Page 7: Bitcoin Tutorial Proof of Work

High level brief

● Mathematical functions to protect every aspect

Page 8: Bitcoin Tutorial Proof of Work

High level brief

● No trust

● Decentralized ledger

● Each node has it's own copy

● Nodes applies changes and pass on message

● Transactions and balances are public available for all

● 160bit hash of an ECDSA public key == “bank account”

● Mathematical functions to protect every aspect

… And that's about it!

Page 9: Bitcoin Tutorial Proof of Work

Hash?

● What is a hash?

Page 10: Bitcoin Tutorial Proof of Work

Hash?

● What is a hash?

● Often used for checksums (ex. file, password check)

Page 11: Bitcoin Tutorial Proof of Work

Hash?

● What is a hash?

● Often used for checksums (ex. file, password check)

● In this case, also a 32byte or 256bit number

Page 12: Bitcoin Tutorial Proof of Work

Hash?

● What is a hash?

● Often used for checksums (ex. file, password check)

● In this case, also a 32byte or 256bit numberSHA256(“little me.”)

0x 48db362a9723246da3fd21ba423e4c77a4bba95d4f6cbf8c232cb56a3e760df6

SHA256(“This is a longer text, for example some transactions”)

0x 27afd01c52c5f1ea8f2f901dfcc94a9099a5a78e7e8c88d143b1120b3708d74d

SHA256(“This is a longer text, for example some transactions.”)

0x 15f75c42e4c97d347971dc92a71498587f66da69385047337f2a8180d63bb016

Page 13: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

Page 14: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

● Base58 (Using non similar characters, ex. 0OIl )

Page 15: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

● Base58 (Using non similar characters, ex. 0OIl )

● Public and private keys (Keypair)

Page 16: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

● Base58 (Using non similar characters, ex. 0OIl )

● Public and private keys (Keypair)

● Generated in “keypool” inside wallet (or 3rdparty)

Page 17: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

● Base58 (Using non similar characters, ex. 0OIl )

● Public and private keys (Keypair)

● Generated in “keypool” inside wallet (or 3rdparty)

● (Alternative) Send Bitcoin to an IP address

Page 18: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

● Base58 (Using non similar characters, ex. 0OIl )

● Public and private keys (Keypair)

● Generated in “keypool” inside wallet (or 3rdparty)

● (Alternative) Send Bitcoin to an IP address

● (Alternative) Not recommended due to MITM attack

Page 19: Bitcoin Tutorial Proof of Work

Bitcoin addresses

● Elliptic curve digital signature algorithm (ECDSA)

● Base58 (Using non similar characters, ex. 0OIl )

● Public and private keys (Keypair)

● Generated in “keypool” inside wallet (or 3rdparty)

● (Alternative) Send Bitcoin to an IP address

● (Alternative) Not recommended due to MITM attack

Page 20: Bitcoin Tutorial Proof of Work

Bitcoin address creation

What if the address is already taken?

Like emails

alice@mail , alice1@mail , alicealice@mail ,

alice999@mail, alice420@mail, alice20@mail

Page 21: Bitcoin Tutorial Proof of Work

Bitcoin address creation

Don't worry.

Possible Bitcoin addresses1461501637330902918203684832716283019655932542976

1.46 x 10^48 or 2^160

Page 22: Bitcoin Tutorial Proof of Work

Bitcoin address creation

● Public key

0478d430274f8c5ec1321338151e9f27f4c676a008bdf8638d07c0b6be9ab35c71a1518063243acd4dfe96b66e3f2ec8013c8e072cd09b3834a19f81f659cc3455

● Private key

5KJvsngHeMpm884wtkJNzQGaCErckhHJBGFsvd3VyK5qMZXj3hS

● Address

1JwSSubhmg6iPtRjtyqhUYYH7bZg3Lfy1T

Page 23: Bitcoin Tutorial Proof of Work
Page 24: Bitcoin Tutorial Proof of Work

Sending Bitcoins

● Send 50.0 BTC from Alice to Bob

Page 25: Bitcoin Tutorial Proof of Work

Sending Bitcoins

● Send 50.0 BTC from Alice to Bob

● Password check without revealing to network

Page 26: Bitcoin Tutorial Proof of Work

Sending Bitcoins

● Send 50.0 BTC from Alice to Bob

● Password check without revealing to network

● Authentic request?

Page 27: Bitcoin Tutorial Proof of Work

Sending Bitcoins

● Send 50.0 BTC from Alice to Bob

● Password check without revealing to network

● Authentic request?

● Signature!

● Elliptic curve digital signature algorithm (ECDSA)

Page 28: Bitcoin Tutorial Proof of Work

Sending Bitcoins

● Send 50.0 BTC from Alice to Bob

● Signature = f(message, private key)

Page 29: Bitcoin Tutorial Proof of Work

Sending Bitcoins

● Send 50.0 BTC from Alice to Bob

● Signature = f(message, private key)

● 1 = ? v(message, public key, signature)

● Other nodes verify transaction without revealing private key

Page 30: Bitcoin Tutorial Proof of Work

Sending Bitcoins

Page 31: Bitcoin Tutorial Proof of Work

Sending Bitcoins

Signatures can't be altered.

Page 32: Bitcoin Tutorial Proof of Work

So far we're coveredhow transactions are made and the ledger

Page 33: Bitcoin Tutorial Proof of Work

Bitcoin address balances

Page 34: Bitcoin Tutorial Proof of Work

Bitcoin address balances

Page 35: Bitcoin Tutorial Proof of Work
Page 36: Bitcoin Tutorial Proof of Work
Page 37: Bitcoin Tutorial Proof of Work
Page 38: Bitcoin Tutorial Proof of Work

Bitcoin address balances

Page 39: Bitcoin Tutorial Proof of Work

Bitcoin address balances

Page 40: Bitcoin Tutorial Proof of Work
Page 41: Bitcoin Tutorial Proof of Work

Real transactions

Page 42: Bitcoin Tutorial Proof of Work

Real transactions

Page 43: Bitcoin Tutorial Proof of Work

Real transactions

Page 44: Bitcoin Tutorial Proof of Work

Back to transactions

Page 45: Bitcoin Tutorial Proof of Work
Page 46: Bitcoin Tutorial Proof of Work
Page 47: Bitcoin Tutorial Proof of Work
Page 48: Bitcoin Tutorial Proof of Work

Complex transactions

Page 49: Bitcoin Tutorial Proof of Work

Complex transactions

Page 50: Bitcoin Tutorial Proof of Work

Complex transactions

Page 51: Bitcoin Tutorial Proof of Work
Page 52: Bitcoin Tutorial Proof of Work

Complex transactions

Page 53: Bitcoin Tutorial Proof of Work
Page 54: Bitcoin Tutorial Proof of Work

Trust?

● How can you trust previous transactions?

Page 55: Bitcoin Tutorial Proof of Work

Trust?

● How can you trust previous transactions?● You can! That's the “block chain”

Page 56: Bitcoin Tutorial Proof of Work

Trust?

● How can you trust previous transactions?● You can! That's the “block chain”● Downloaded on initial launch

Page 57: Bitcoin Tutorial Proof of Work

Trust?

● How can you trust previous transactions?● You can! That's the “block chain”● Downloaded on initial launch● As of 15 Jan 2014, 18Gb

Page 58: Bitcoin Tutorial Proof of Work

Bitcoin transaction security

Digital signaturesReferenced transactions

Page 59: Bitcoin Tutorial Proof of Work
Page 60: Bitcoin Tutorial Proof of Work
Page 61: Bitcoin Tutorial Proof of Work
Page 62: Bitcoin Tutorial Proof of Work
Page 63: Bitcoin Tutorial Proof of Work
Page 64: Bitcoin Tutorial Proof of Work
Page 65: Bitcoin Tutorial Proof of Work
Page 66: Bitcoin Tutorial Proof of Work

Solution

● Nodes need to agree on transaction order

Page 67: Bitcoin Tutorial Proof of Work

Solution

● Nodes need to agree on transaction order● Not easy in a decentralized system

Page 68: Bitcoin Tutorial Proof of Work

Solution

● Nodes need to agree on transaction order● Not easy in a decentralized system● Ordering solution: The block chain

Page 69: Bitcoin Tutorial Proof of Work

Solution

● Nodes need to agree on transaction order● Not easy in a decentralized system● Ordering solution: The block chain

Page 70: Bitcoin Tutorial Proof of Work
Page 71: Bitcoin Tutorial Proof of Work
Page 72: Bitcoin Tutorial Proof of Work
Page 73: Bitcoin Tutorial Proof of Work
Page 74: Bitcoin Tutorial Proof of Work
Page 75: Bitcoin Tutorial Proof of Work
Page 76: Bitcoin Tutorial Proof of Work
Page 77: Bitcoin Tutorial Proof of Work
Page 78: Bitcoin Tutorial Proof of Work
Page 79: Bitcoin Tutorial Proof of Work
Page 80: Bitcoin Tutorial Proof of Work
Page 81: Bitcoin Tutorial Proof of Work

Double spend attack

Page 82: Bitcoin Tutorial Proof of Work

Double spend attack

Page 83: Bitcoin Tutorial Proof of Work

Double spend attack

Page 84: Bitcoin Tutorial Proof of Work

Double spend attack

Page 85: Bitcoin Tutorial Proof of Work

Double spend attack

Page 86: Bitcoin Tutorial Proof of Work

Double spend attack

Page 87: Bitcoin Tutorial Proof of Work

Double spend attack

Page 88: Bitcoin Tutorial Proof of Work

Double spend attack

Page 89: Bitcoin Tutorial Proof of Work

Double spend attack

Page 90: Bitcoin Tutorial Proof of Work

Double spend attack

Page 91: Bitcoin Tutorial Proof of Work

Double spend attack

Page 92: Bitcoin Tutorial Proof of Work

Double spend attack

Page 93: Bitcoin Tutorial Proof of Work
Page 94: Bitcoin Tutorial Proof of Work
Page 95: Bitcoin Tutorial Proof of Work
Page 96: Bitcoin Tutorial Proof of Work

Mining pools

● “BTC Guild” has solved 6 blocks in a row by itself

Page 97: Bitcoin Tutorial Proof of Work

Mining pools

● “BTC Guild” has solved 6 blocks in a row by itself

● Asked members to leave to secure the network

Page 98: Bitcoin Tutorial Proof of Work

Mining pools

● “BTC Guild” has solved 6 blocks in a row by itself

● Asked members to leave to secure the network

● Ghash.io, “yesterday's problem”

Page 99: Bitcoin Tutorial Proof of Work

Mining pools

Page 100: Bitcoin Tutorial Proof of Work

Mining pools

Page 101: Bitcoin Tutorial Proof of Work

Mining pools

Page 102: Bitcoin Tutorial Proof of Work

Anonymity

● Hide behind Tor or I2P

Page 103: Bitcoin Tutorial Proof of Work

Anonymity

● Hide behind Tor or I2P● Only reveal public address

Page 104: Bitcoin Tutorial Proof of Work

Anonymity

● Hide behind Tor or I2P● Only reveal public address● Generate new for each income

Page 105: Bitcoin Tutorial Proof of Work

Anonymity

● Hide behind Tor or I2P● Only reveal public address● Generate new for each income● Still get linked

Page 106: Bitcoin Tutorial Proof of Work

Anonymity

Page 107: Bitcoin Tutorial Proof of Work

Anonymity

Page 108: Bitcoin Tutorial Proof of Work

Summary

Page 109: Bitcoin Tutorial Proof of Work

Summary

● Digital signatures

- protects money● Transaction chains

- store history of ownership● Block chain

- hold transaction order

Page 110: Bitcoin Tutorial Proof of Work

Benefits?

● Government can't print, or manipulate currency

Page 111: Bitcoin Tutorial Proof of Work

Benefits?

● Government can't print, or manipulate currency● “Anonymity”

Page 112: Bitcoin Tutorial Proof of Work

Benefits?

● Government can't print, or manipulate currency● “Anonymity”● Lower fees than credit cards

Page 113: Bitcoin Tutorial Proof of Work

References, and thanks to

● bitcointalk.org● imponderablethings.com● en.bitcoin.it● coinchoose.com● IRC (Freenode, #bitcoin-wizards, #bitcoin-dev)

Page 114: Bitcoin Tutorial Proof of Work

● Bitcoin: 10 min, diff: 1,789,546,951.05320, SHA256, 14967.91 Th/sec

● PPCoin: 10 min, diff: 58,462,273.67400, SHA256, 82990.827 Gh/sec

● Litecoin: 2.5 min, diff: 3,931.59487, scrypt, 100.08 GH/sec

● Anoncoin 3 min, diff: 59.04968, scrypt, 1.39 GH/sec

● Franko: 0.5 min, diff: 1.38000, scrypt, 43.66 MH/sec

Difficulty is as of 15 Januar 2014.

Note: scrypt takes about ~10x time more than sha256

Page 115: Bitcoin Tutorial Proof of Work

Technologies and keywords

● Base58 (Fonts, 0OIl, what is what)● ECDSA (secp256k1)● JSON (Control, RPC)● Leveldb (key/value database, data storage)● OpenSSL (for ECDSA, RPC SSL)● Qt (for GUI in the original client)