mining network economics
play

Mining, network, economics Joseph Bonneau Recap: Bitcoin miners - PowerPoint PPT Presentation

Lecture 2 Mining, network, economics Joseph Bonneau Recap: Bitcoin miners Bitcoin depends on miners to: Store and broadcast the block chain Validate new transactions Vote (by hash


  1. 采 矿业 電學 Lecture 2 Mining, network, economics Joseph Bonneau 计 算机网 络 经济 学

  2. Recap: Bitcoin miners Bitcoin depends on miners to: ● Store and broadcast the block chain ● Validate new transactions ● Vote (by hash power) on consensus Miners rewarded with new coins Who are the miners?

  3. Lecture 2.1: The task of Bitcoin miners

  4. Mining Bitcoins in 6 easy steps 1. Join the network, listen for transactions a. Validate all proposed transactions 2. Listen for new blocks, maintain block chain a. When a new block is proposed, validate it 3. Assemble a new valid block 4. Find a nonce to make your block valid 5. Hope everybody accepts your new block 6. Profit!

  5. Mining Bitcoins in 6 easy steps 1. Join the network, listen for transactions a. Validate all proposed transactions 2. Listen for new blocks, maintain block chain easy a. When a new block is proposed, validate it 3. Assemble a new valid block 4. Find a nonce to make your block valid very hard 5. Hope everybody accepts your new block 6. Profit!

  6. Bitcoin P2P network ● Ad-hoc protocol (runs on TCP port 8333) ● Ad-hoc network with random topology ● All nodes are equal ● New nodes can join at any time ● Forget non-responding nodes after 3 hr

  7. Joining the Bitcoin P2P network 5 Hello World! I’m 1 ready to Bitcoin! 7 8 3 6 2 4

  8. Joining the Bitcoin P2P network 5 1 getaddr() 7 1, 7 8 3 6 2 4

  9. Joining the Bitcoin P2P network 5 1 getaddr() 7 getaddr() getaddr() 8 3 6 2 4

  10. Joining the Bitcoin P2P network 5 1 7 8 3 6 2 4

  11. Transaction propagation (flooding) 5 1 7 8 New tx! 3 6 A→B 2 4 A→B

  12. Transaction propagation (flooding) 5 1 7 8 3 6 A→B 2 A→B A→B A→B 4 A→B

  13. Transaction propagation (flooding) 5 1 7 A→B 8 A→B A→B A→B 3 6 A→B 2 A→B A→B A→B A→B 4 A→B

  14. Nodes may differ on transaction pool New tx! A→C 5 A→C A→B 1 A→C 7 A→B A→C 8 3 6 A→B 2 A→B A→B 4 A→B

  15. Nodes may differ on transaction pool A→C 5 A→B 1 A→C A→C A→C 7 A→B A→C 8 ??? A→B 3 6 A→B 2 A→B A→B 4 A→B

  16. Yonatan Sompolinsky and Aviv Zohar: “Accelerating Bitcoin’s Transaction Processing” 2014

  17. Lecture 2.2: Finding a valid block

  18. It’s never easy being a miner Chilkoot pass, 1898 Klondike gold rush

  19. Finding a valid nonce is the hard part! prev: H( ) prev: H( ) mrkl_root: H( ) mrkl_root: H( ) nonce: 0x0000... nonce: 0x0001... nonce: 0xffff... nonce: 0x0002... nonce: 0x0000... nonce: 0x7a83 hash: 0xd0c7... hash: 0xc9c8... hash: 0x6a1f... hash: 0x300c... hash: hash: hash: 0x3485... hash: 0x0000 H( ) H( ) H( ) H( ) H( ) H( ) 25.0→A 25.0→A 25.0→A transaction transaction transaction coinbase: coinbase: coinbase: 0x0000...01 0x0000...00 0x3df5...65

  20. Finding a valid nonce is the hard part! prev: H( ) prev: H( ) mrkl_root: H( ) mrkl_root: H( ) nonce: 0xffff... nonce: 0x0002... nonce: 0x0000... nonce: 0x0001... nonce: 0x0001... nonce: 0x0000... nonce: 0x7a83 hash: 0x300c... hash: hash: 0x6a1f... hash: 0xd0c7... hash: 0xc9c8... hash: 0x0224... hash: hash: 0x3485... hash: 0x0000 H( ) H( ) H( ) H( ) H( ) H( ) 25.0→A 25.0→A 25.0→A transaction transaction transaction coinbase: coinbase: coinbase: 0x0000...01 0x0000...00 0x3df5...65

  21. Finding a valid nonce is the hard part! prev: H( ) prev: H( ) mrkl_root: H( ) mrkl_root: H( ) nonce: 0x0001... nonce: 0x0000... nonce: 0xffff... nonce: 0x0002... nonce: 0x0001... nonce: 0xffff... nonce: 0x0000... nonce: 0x7a83 hash: 0xd0c7... hash: 0x590e... hash: 0x6a1f... hash: 0x0224... hash: 0xc9c8... hash: 0x300c... hash: hash: 0x3485... hash: hash: 0x0000 H( ) H( ) H( ) H( ) H( ) H( ) 25.0→A 25.0→A 25.0→A transaction transaction transaction coinbase: coinbase: coinbase: 0x0000...01 0x0000...00 0x3df5...65

  22. Finding a valid nonce is the hard part! prev: H( ) prev: H( ) mrkl_root: H( ) mrkl_root: H( ) nonce: 0x0000... nonce: 0xffff... nonce: 0x0002... nonce: 0x0001... nonce: 0x0000... nonce: 0x7a83 hash: 0x6a1f... hash: hash: 0x300c... hash: 0xc9c8... hash: 0xd0c7... hash: hash: 0x3485... hash: 0x0000 H( ) H( ) All changed H( ) H( ) H( ) H( ) 25.0→A 25.0→A 25.0→A transaction transaction transaction coinbase: coinbase: coinbase: 0x0000...01 0x0000...00 0x3df5...65

  23. Finding a valid nonce is the hard part! prev: H( ) prev: H( ) mrkl_root: H( ) mrkl_root: H( ) nonce: 0x88fc... nonce: 0xffff... nonce: 0x0002... nonce: 0x0001... nonce: 0x0000... nonce: 0x7a83 hash: hash: 0x0000 hash: 0x0000 H( ) H( ) H( ) H( ) H( ) H( ) 25.0→A 25.0→A 25.0→A transaction transaction transaction coinbase: coinbase: coinbase: 0x0000...00 0x0000...01 0x3df5...65

  24. Mining difficulty (2017-01-14) 256 bit “target” 0000000000000000058436000000000000000000000000000000000000000000 70+ leading zero bits required Network hash rate = 2,743,378 TH/s Number of blocks tried per 10 min. 2 70.6 = 1,767,408,003,483,225,292,800

  25. SHA-256 is “puzzle-friendly” Optimization-free No better strategy than trying random nonces Progress-free You don’t get any closer the more work you do Parameterizable Easy to adjust difficulty

  26. Time to solution is probabilistic 10 minutes Probability density Time to next block (entire network)

  27. Setting the mining difficulty Every two weeks, compute: next_difficulty= previous_difficulty * (2 weeks)/(time to mine last 2016 blocks) Expected number of blocks in 2 weeks at 10 minutes/block

  28. Mining difficulty over time bitcoinwisdom.com

  29. Time to find a block 10 minutes 2 weeks bitcoinwisdom.com

  30. Lecture 2.3: Mining hardware (Bitcoin)

  31. SHA-256 in more depth 256-bit state Bitwise tweaks 64 iterations round constants Addition mod 32

  32. CPU mining while (1){ HDR[kNoncePos]++; IF (SHA256(SHA256(HDR)) < (65535 << 208)/ DIFFICULTY) return; } two hashes Throughput on a high-end PC = 10- 20 MHz ≈ 2 24 >2 million years to find a block today!

  33. GPU mining ● GPUs designed for high-performance graphics ○ high parallelism ○ high throughput ● First used for Bitcoin ca. October 2010 ● Implemented in OpenCL ○ Later: hacks for specific cards

  34. GPU mining advantages ● easily available, easy to set up ● parallel ALUs ● bit-specific instructions ● can drive many from 1 CPU ● can overclock!

  35. “Effective throughput” Observation: some errors are okay (may miss a valid block) Effective throughput: throughput × success rate Worth over-clocking by 50% with 30% errors!

  36. Source: LeonardH, cryptocurrencies talk.com

  37. GPU mining disadvantages Instead of time-to-find-block, ● poor utilization of hardware compare to a lottery. What’s the chance of finding one in day? ● poor cooling ● large power draw ● few boards to hold multiple GPUs Throughput on a good card = 20- 200 MHz ≈ 2 27 ≈ 17,000 years to find a block w/100 cards!

  38. FPGA mining ● F ield P rogrammable G ate A rea ● First used for Bitcoin ca. June 2011 ● Implemented in Verilog

  39. FPGA mining advantages ● higher performance than GPUs ○ excellent performance on bitwise operations ● better cooling ● extensive customisation, optimisation

  40. Bob Buskirk, thinkcomputers.org

  41. FPGA mining disadvantages ● higher power draw than GPUs designed for ○ frequent malfunctions, errors ● poor optimization of 32-bit adds ● fewer hobbyists with sufficient expertise ● more expensive than GPUs ● marginal performance/cost advantage over GPUs Throughput on a good card = 100- 1000 MHz ≈ 2 30 2,000 years to find a block w/100 boards!

  42. Bitcoin ASICs ● special purpose ○ approaching known limits on feature sizes ○ less than 10x performance improvement expected ● designed to be run constantly for life ● require significant expertise, long lead-times ● perhaps the fastest chip development ever!

  43. Market dynamics (2013/2014) ● Most boards obsolete within 3-6 months ○ Half of profits made in first 6 weeks ● Shipping delays are devastating to customers ● Most companies require pre-orders ● Most individual customers should have lost... But... rising prices saved them!

  44. Bitcoin ASICs

  45. Current hardware (2015/2016)

  46. Case study: Ant Miner S7 ● First shipped 2015 ● 4.7 TH/s ● 1210 W ● Cost: US$619 Still, 4.8 years to find a block!

  47. Market dynamics (2015/2016) ● Growth rate leveling off ● Mining hardware approaching fab. limits ● Mining becoming professionalized [Taylor 2013] Bitcoin and the Age of Bespoke Silicon.

  48. Market dynamics (2015/2016)

  49. Evolution of mining CPU GPU FPGA ASIC gold pan sluice box placer mining pit mining

  50. Professional mining centers Needs: ● cheap power ● good network ● cool climate Industrial mining

  51. Bitcoin mining in China ~ 70%

  52. Mining hardware is illiquid ➔ High entry costs ➔ Low salvage value Conclusion: Miners care about future exchange rate

  53. Philosophical questions ● Can small miners stay in the game? ● Do ASICs violate the original Bitcoin vision? ● Would we be better off without ASICs?

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend