Bitcoin Forum
May 12, 2024, 12:44:34 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Warning: One or more bitcointalk.org users have reported that they strongly believe that the creator of this topic is a scammer. (Login to see the detailed trust ratings.) While the bitcointalk.org administration does not verify such claims, you should proceed with extreme caution.
Pages: [1]
  Print  
Author Topic: What's wrong with PPCoin's difficulty algorithm?  (Read 2572 times)
galambo (OP)
Sr. Member
****
Offline Offline

Activity: 966
Merit: 311



View Profile
February 02, 2013, 11:29:04 PM
Last edit: February 12, 2013, 02:27:45 AM by galambo
 #1

I decided to make a quick graph of what would happen if Bitcoin used PPCoin's difficulty adjustment. The results are kind of strange, as you can see in the graph below.

The results are on a semi-log plot, with the Y axis being difficulty and the X axis being blocks. As you can see, when Bitcoin has a difficulty of 10^6 (one million) PPCoin has a difficulty of 10^10 (10 billion).



I think that's a little high. Do you think Bitcoin would be successful if it had a mining difficulty of 10 billion right now? Is this how SunnyKing will achieve his goals of a coin that nobody wants to mine?
Even if you use Bitcoin through Tor, the way transactions are handled by the network makes anonymity difficult to achieve. Do not expect your transactions to be anonymous unless you really know what you're doing.
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715474674
Hero Member
*
Offline Offline

Posts: 1715474674

View Profile Personal Message (Offline)

Ignore
1715474674
Reply with quote  #2

1715474674
Report to moderator
1715474674
Hero Member
*
Offline Offline

Posts: 1715474674

View Profile Personal Message (Offline)

Ignore
1715474674
Reply with quote  #2

1715474674
Report to moderator
Sunny King
Legendary
*
Offline Offline

Activity: 1205
Merit: 1010



View Profile WWW
February 03, 2013, 12:10:27 AM
Last edit: February 03, 2013, 02:53:53 AM by Sunny King
 #2

I have no idea how you get this graph but I think you need to review some basics as I have already mentioned in ppcoin thread:

Code:
hash rate = difficulty * (2**32) / spacing target

ppcoin proof-of-work spacing target: between 10 minutes and 2 hours (1x-12x of bitcoin's)
bitcoin spacing target: 10 minutes

So ppcoin's proof-of-work difficulty is at most 12x of bitcoin's difficulty at the same hash rate, and most likely much less than that.
galambo (OP)
Sr. Member
****
Offline Offline

Activity: 966
Merit: 311



View Profile
February 12, 2013, 02:24:10 AM
Last edit: February 12, 2013, 02:45:21 AM by galambo
 #3

I wonder if Sunny King will talk to me about this without DDoSing me off the internet for 3 days? Like he did the last time?

Let's take another shot now that "NovaCoin" has released with the PPCoin difficulty algorithm.

Quote

    int64 nActualSpacing = (pindexLast->GetBlockTime() - pindexLast->pprev->GetBlockTime());


    CBigNum bnPPC;
    bnPPC.SetCompact(nPPCBits);

  //  printf("\n\nBefore: %08x  %s\n", bnPPC.GetCompact(), bnPPC.getuint256().ToString().c_str() );

    int64 nTargetSpacing = 600;
    int64 nInterval = nTargetTimespan / nTargetSpacing;
    bnPPC *= ((nInterval - 1) * nTargetSpacing + nActualSpacing + nActualSpacing);
    bnPPC /= ((nInterval + 1) * nTargetSpacing);

    if (bnPPC > bnProofOfWorkLimit)
        bnPPC = bnProofOfWorkLimit;

   // printf("PPC  : %08x  %s\n\n", bnPPC.GetCompact(), bnPPC.getuint256().ToString().c_str());

    nPPCBits = bnPPC.GetCompact();


The aboive is the code I used to get PPCoin difficulty on the Bitcoin blockchain. To reduce the amount of data I only printed it to the debug file once every 72 blocks and plotted the result with GNU Octave.

As you can see, your equation
Quote
hash rate = difficulty * (2**32) / spacing target
is quite wrong. PPcoin uses the interblock spacing, not the hash rate, to determine its difficulty. In fact, its pretty impossible to know the exact hash rate of a cryptocurrency. Why would you think your own coin uses hash rate in the calculation?
Sunny King
Legendary
*
Offline Offline

Activity: 1205
Merit: 1010



View Profile WWW
February 12, 2013, 05:03:43 AM
 #4

I wonder if Sunny King will talk to me about this without DDoSing me off the internet for 3 days? Like he did the last time?

Can you not throw baseless accusations around? What do you mean that I 'DDoSing you off the internet'? Why do I even do that assuming even if I have such capability? I genuinely view all altcoin developers as all part of a big team and I truly hope all can be friends of each other and help each other.

The above is the code I used to get PPCoin difficulty on the Bitcoin blockchain. To reduce the amount of data I only printed it to the debug file once every 72 blocks and plotted the result with GNU Octave.

As you can see, your equation
Quote
hash rate = difficulty * (2**32) / spacing target
is quite wrong. PPcoin uses the interblock spacing, not the hash rate, to determine its difficulty. In fact, its pretty impossible to know the exact hash rate of a cryptocurrency. Why would you think your own coin uses hash rate in the calculation?

Please do describe details the process you derive the chart. The equation I gave is the way to estimate network hash rate, I never said you could get exact hash rate of the network, it's an approximation.

The difficulty adjustment is not complicated but based on a very easy to understand moving average. And it has been observed to produce difficulty matching the formula above. If you set spacing target to a fixed 600 second (the same as bitcoin), then it should generally match the bitcoin curve only a bit smoother. Please do describe how you derive your chart in more detail so we can look at what might have gone wrong.
Sunny King
Legendary
*
Offline Offline

Activity: 1205
Merit: 1010



View Profile WWW
February 12, 2013, 06:48:35 AM
 #5

Looking at your chart my guess is that you just feed an array of actual block spacing to the calculation of block difficulty. If this is not what you did then you can disregard this post.

If you did that say keep feeding a 9-minute actual spacing into the difficulty calculation, yeah I could imagine your result in the chart. However that's not the correct way of simulating things. With a different difficulty adjustment algorithm, you wont get the same actual spacing series. This is because unlike bitcoin's 2-week adjustment, ppcoin's adjustment is every block. You would quickly raise the difficulty and then given the same network hashrate, you would see a completely different series of actual block spacing. If you still doubt it, you can try devcoin's adjustment as well I bet it's gonna look the same as ppcoin's on your chart.

I hope this would clear some misunderstandings here.
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!