Bitcoin Forum
March 28, 2024, 10:38:16 AM *
News: Latest Bitcoin Core release: 26.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Why is difficulty calculated every two weeks?  (Read 1492 times)
theGECK (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



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 30% 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
1711622296
Hero Member
*
Offline Offline

Posts: 1711622296

View Profile Personal Message (Offline)

Ignore
1711622296
Reply with quote  #2

1711622296
Report to moderator
1711622296
Hero Member
*
Offline Offline

Posts: 1711622296

View Profile Personal Message (Offline)

Ignore
1711622296
Reply with quote  #2

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

Posts: 1711622296

View Profile Personal Message (Offline)

Ignore
1711622296
Reply with quote  #2

1711622296
Report to moderator
1711622296
Hero Member
*
Offline Offline

Posts: 1711622296

View Profile Personal Message (Offline)

Ignore
1711622296
Reply with quote  #2

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

Activity: 728
Merit: 500


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: 2086
Merit: 1031


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.

Coinbase for selling BTCs
Fold for spending BTCs
PM me with any questions on these sites/apps!  http://www.montybitcoin.com


or Vircurex for trading alt cryptocurrencies like DOGEs
CoinNinja for exploring the blockchain.
theGECK (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



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 30% 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
Merit: 500


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 (OP)
Sr. Member
****
Offline Offline

Activity: 411
Merit: 250



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 30% 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
Merit: 1024



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.

17Np17BSrpnHCZ2pgtiMNnhjnsWJ2TMqq8
I routinely ignore posters with paid advertising in their sigs.  You should too.
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


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:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!