Bitcoin Forum
September 11, 2024, 11:16:01 AM *
News: Latest Bitcoin Core release: 27.1 [Torrent]
 
  Home Help Search Login Register More  
  Show Posts
Pages: [1]
1  Bitcoin / Development & Technical Discussion / Re: How is chain length calculated? on: June 09, 2011, 12:15:52 PM
That solves that mystery!  Thankyou.
2  Bitcoin / Development & Technical Discussion / How is chain length calculated? on: June 08, 2011, 02:32:55 PM
If my understanding is correct, clients assume the currently longest chain is authoritative.  The chain with most peers working on it gets longer quicker, and therefore anyone on any other chain "switches" to the longest.  This is a clever way to ensure no "forks" exist for long.

Difficulty is calculated based on how many blocks have been calculated in the past week/2 weeks, to keep a global target of around 1 block every 10 mins.


If I were to start a new isolated firewalled bitcoin network, working from the same base block as the existing network, with only a single slow host working on it, the chain would still get longer by 1 block every 10 minutes, since the difficulty would adjust after 2 weeks to ensure this.

If I now tweak the system clock to go at double-speed, the difficulty will re-adjust to make generation yet easier, and a block will be generated every 5 minutes.  I now have the possibility for my chain to catch up and overtake the official one.  When this happens, I unfirewall my host, upload all my blocks to the network, and all the clients see my chain as longer, and therefore authorative.

How does the network protect against this?  Is the "chain length" actually a function of both difficulty and length in blocks?
Pages: [1]
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!