Bitcoin Series 30: Hashing Power and Difficulty

A short explainer

  1. It is critical to understand that "the amount of effort needed to mine a block" is a variable that resets every 2016 blocks (about every two weeks).
     
  2. Mining is effectively solving a computational puzzle.   The amount of "hashing power" in the Bitcoin mining system is effectively how many guesses per second exist to try to solve that puzzle
     
  3. The "difficulty" is how hard it is to solve the puzzle.   Simplified, the puzzle is like a massive version of Powerball where the miners have to guess a very long number.  The puzzle is made harder by requiring the winning number to have more 0s at the beginning of the number and made easier by requiring the winning number to have fewer 0s at the beginning of the number
     
  4. Because the puzzle is effectively a lottery, the algorithm can figure out approximately how much hashing power is in the system by seeing how often the puzzle is solved (aka how often a block is mined).   The target is every 10 minutes.   If the blocks are being mined sooner than every 10 minutes (on average) then the algorithm needs to raise the difficulty of the puzzle to get back to 10 minutes.   If the blocks are being mined longer than every 10 minutes (on average), the algorithm needs to reduce the difficulty of the puzzle to get back to 10 minutes
     
  5. This auto-adjustment is why you can safely ignore any statement in this format: "it costs $xxx to mine a bitcoin and that is not profitable and so Bitcoin is in trouble."   If the cost to solve the puzzle is higher than the value of the bitcoins earned by solving the puzzle AND the miners have no incentives to wait it out, then miners/hashing power will drop out of the system and difficulty will drop and the system will come into balance*

    In other words, the system auto-adjusts for how much hashing power is in the system, whether it is 2 laptops' worth (as it was Day 1) or xxx,xxx supercomputers' worth (as it is now)
     
  6. A more technical explanation can be found here.   Same story in tweetstorm format here and here.

* There is a known edge case that could cause an issue if there was a discontinuous drop in hashing power.

  • Let's say we just started a 2016 block period at a new level of difficulty and then for some reason all miners dropped out simultaneously (imagine all data centers were blown up as I can't really envision where they all drop out voluntarily). 
     
  • It is true that the difficulty will readjust in 2016 blocks to account for the lower hashing power but that might take months to get there with reduced mining power and in the interim blocks would be slow.  
     
  • If this happened in real-life, I expect at least some miners with a long-term incentive to have a functioning Bitcoin network would stay on (just like they have done recently) or worst-case scenario, you would need a soft-update to the Bitcoin algorithm.    
     
  • But, on the whole, long-term market incentives I think will handle this.  By analogy, if a steel manufacturer does not like the price of steel for a two week period, they usually would not put their customers out of business by not delivering steel until the price reset.
     
  • In the longer-term, miners will just hedge their output using futures, just like with other commodities

For the full Bitcoin series:  ledracapital.com/bitcoin
Follow us on Twitter: @polemitis and @ledracapital
Facebook:  facebook.com/ledracapital
Email Newletters: ledracapital.com/subscribe

Important disclaimer: ledracapital.com/btcdisclaimer

Posted on January 17, 2015 .