Bitcoin Forum
December 05, 2016, 12:44:08 AM *
News: Latest stable version of Bitcoin Core: 0.13.1  [Torrent].
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Why is difficulty calculated every two weeks?  (Read 1273 times)
theGECK
Sr. Member
****
Offline Offline

Activity: 410



View Profile
February 15, 2012, 09:31:48 PM
 #1

I couldn't find an answer to this question elsewhere, and I'm assuming it's been answered before, so perhaps somebody can point me there. Why is difficulty only calculated every two weeks? This seems to cause issues either when calculating power is going up (causing blocks to be mined faster than anticipated) or when going down (causing blocks to be mined slower than anticipated). Does anybody know the rationale for going with a 2016 block window, rather than, say, a 144 block window for recalculation taking into account the last 2016 blocks for averaging purposes and to minimize abuse of the system? It also seems like the difficulty change would harm people who use bitcoin as the available hashing power drops, as their transactions will go through slower, and miners will mine fewer blocks gaining fewer rewards.

Again, sorry if this has been answered elsewhere, I couldn't find it with the search function, or with Google.

Use my referral codes for Bitcoin faucets and I'll send you 25% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
1480898648
Hero Member
*
Offline Offline

Posts: 1480898648

View Profile Personal Message (Offline)

Ignore
1480898648
Reply with quote  #2

1480898648
Report to moderator
1480898648
Hero Member
*
Offline Offline

Posts: 1480898648

View Profile Personal Message (Offline)

Ignore
1480898648
Reply with quote  #2

1480898648
Report to moderator
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction. Advertise here.
1480898648
Hero Member
*
Offline Offline

Posts: 1480898648

View Profile Personal Message (Offline)

Ignore
1480898648
Reply with quote  #2

1480898648
Report to moderator
Revalin
Hero Member
*****
Offline Offline

Activity: 728


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
February 15, 2012, 09:41:02 PM
 #2

The hashrate estimation is noisy.  It requires a lot of smoothing.

A sliding window like you suggest would work too, but it has the same problem: short high spikes in hashrate cause the difficulty to rise then persist through the rest of the 2016-block window, making the net blockrate come out about the same in the end.

So it would work, but it wouldn't have much advantage, and the hashrate is stable enough that there's not much incentive to fool with something that works.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
kjlimo
Legendary
*
Offline Offline

Activity: 1498


View Profile WWW
February 15, 2012, 10:16:43 PM
 #3

There have been some alternative chains that have messed with this "setting."  However, none of them have really taken hold in the economy and most still have their value dependent on bitcoin.

CampBX for buying BTCs, Coinbase for selling BTCs or Vircurex or Cryptsy for trading alternate cryptocurrencies like DOGEs

PM me with any questions on these sites!  Happy to help!

Bitcoin Poker at Seals                  Strike Sapphire Casino  Free games every hour & day!
  Get Free Bitcoins here.

Spondoolies-Tech or KnC Miner for the fastest mining hardware available!

Bitpay to help your business accept bitcoin payments!
theGECK
Sr. Member
****
Offline Offline

Activity: 410



View Profile
February 15, 2012, 10:26:33 PM
 #4

The hashrate estimation is noisy.  It requires a lot of smoothing.

A sliding window like you suggest would work too, but it has the same problem: short high spikes in hashrate cause the difficulty to rise then persist through the rest of the 2016-block window, making the net blockrate come out about the same in the end.

So it would work, but it wouldn't have much advantage, and the hashrate is stable enough that there's not much incentive to fool with something that works.

Isn't the current system also affected by the short high spikes? Since the difficulty is calculated on time spent finding the blocks, a short burst of activity finding blocks also affects the difficulty, but then it's locked in for the next two weeks. Would the sliding window smooth out those sorts of oddities as well? Making the window too small (such as every block) wouldn't work, as you wouldn't have enough data to calculate anything from. I'm not suggesting that we change things, since I've enjoyed how it's working, but a friend and I were wondering about this earlier today and I have not read any answer to it before.

Use my referral codes for Bitcoin faucets and I'll send you 25% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
Revalin
Hero Member
*****
Offline Offline

Activity: 728


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
February 15, 2012, 10:38:02 PM
 #5

No, the sliding window just changes the shape of the effect.  The spike will bump difficulty sooner, but it also makes it revert sooner.  Overall the network averages it out and ends up the same number of blocks ahead or behind either way.

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
theGECK
Sr. Member
****
Offline Offline

Activity: 410



View Profile
February 15, 2012, 10:41:29 PM
 #6

Also, software that was using the sliding window for difficulty wouldn't be backwards compatible with older versions of Bitcoin, correct? You would have to create a secondary chain to institute a different way to calculate difficulty.

Use my referral codes for Bitcoin faucets and I'll send you 25% of my referral bonus - Win/Win! PM for details on all sites available or use one of the links here.

FreeBitco.in | FreeDoge.co.in
kjj
Legendary
*
Offline Offline

Activity: 1302



View Profile
February 15, 2012, 10:42:00 PM
 #7

As far as I know, no one has ever demonstrated an actual advantage of a sliding window, but quite a few sliding window system have been found to be exploitable.

p2pcoin: a USB/CD/PXE p2pool miner - 1N8ZXx2cuMzqBYSK72X4DAy1UdDbZQNPLf - todo
I routinely ignore posters with paid advertising in their sigs.  You should too.
Revalin
Hero Member
*****
Offline Offline

Activity: 728


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
February 15, 2012, 11:09:26 PM
 #8

Also, software that was using the sliding window for difficulty wouldn't be backwards compatible with older versions of Bitcoin, correct? You would have to create a secondary chain to institute a different way to calculate difficulty.

Changing it would fork the blockchain.  This can be done non-catastrophically by adding support in one version, waiting a while for everyone to upgrade, then having the change actually activate on a pre-determined block number.  People who did not upgrade or who reject the new system will reject sliding-window blocks; people who do upgrade will reject the old-style blocks; the side with >50% of the hashrate wins.  (Realistically this won't be done without a supermajority of support.)

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
Pages: [1]
  Print  
 
Jump to:  

Sponsored by , a Bitcoin-accepting VPN.
Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!