Bitcoin Forum
December 02, 2016, 06:27:53 PM *
News: To be able to use the next phase of the beta forum software, please ensure that your email address is correct/functional.
 
   Home   Help Search Donate Login Register  
Pages: [1]
  Print  
Author Topic: Retargeting algorithm  (Read 1643 times)
Jimmy2011
Hero Member
*****
Offline Offline

Activity: 566



View Profile
August 28, 2011, 02:58:38 AM
 #1

Retargeting algorithm before seems that difficulty was constantly changing. Why should be that? Why not adjust it in time, that means, for example, adjust it with an adjustment factor t_0/t and also an adjustment coefficient zeta is multiplied, zeta = 0.8 for some case and zeta = 1.1 for the other case as an example. Furthermore, zeta can also be adjusted automatically according to some rules.

One more problem is how to get more and more miners and mining power to involve?

Bitcoin:1EBxhCQp2bUdQDZoQsix6vnivtr3EodCdP       Peercoin:PEjCk5P7FDTFbt3ZwtLPqsGpnQSRSTYRJX
1480703273
Hero Member
*
Offline Offline

Posts: 1480703273

View Profile Personal Message (Offline)

Ignore
1480703273
Reply with quote  #2

1480703273
Report to moderator
1480703273
Hero Member
*
Offline Offline

Posts: 1480703273

View Profile Personal Message (Offline)

Ignore
1480703273
Reply with quote  #2

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

Posts: 1480703273

View Profile Personal Message (Offline)

Ignore
1480703273
Reply with quote  #2

1480703273
Report to moderator
1480703273
Hero Member
*
Offline Offline

Posts: 1480703273

View Profile Personal Message (Offline)

Ignore
1480703273
Reply with quote  #2

1480703273
Report to moderator
1480703273
Hero Member
*
Offline Offline

Posts: 1480703273

View Profile Personal Message (Offline)

Ignore
1480703273
Reply with quote  #2

1480703273
Report to moderator
NothinG
Hero Member
*****
Offline Offline

Activity: 560



View Profile
August 28, 2011, 03:07:02 AM
 #2

1) Spend Money (for mining rigs, electricity)
2) Mine BTC
3) Huh
4) Profit!

Jimmy2011
Hero Member
*****
Offline Offline

Activity: 566



View Profile
August 28, 2011, 03:31:03 AM
 #3

1) Spend Money (for mining rigs, electricity)
2) Mine BTC
3) Huh
4) Profit!

Sorry, my question is how to transfer the existing power to the new fork by an algorithm so as to let the fork reach a modest scale.

Bitcoin:1EBxhCQp2bUdQDZoQsix6vnivtr3EodCdP       Peercoin:PEjCk5P7FDTFbt3ZwtLPqsGpnQSRSTYRJX
smoothie
Legendary
*
Offline Offline

Activity: 1834


LEALANA Monero Physical Silver Coins


View Profile
August 28, 2011, 05:42:56 AM
 #4

1) Spend Money (for mining rigs, electricity)
2) Mine BTC
3) Huh
4) Profit!

Sorry, my question is how to transfer the existing power to the new fork by an algorithm so as to let the fork reach a modest scale.


He answered u correctly. You pay the miners for their rigs and the electricity bills and they mine on the network of your choosing...etc..

███████████████████████████████████████

            ,╓p@@███████@╗╖,           
        ,p████████████████████N,       
      d█████████████████████████b     
    d██████████████████████████████æ   
  ,████²█████████████████████████████, 
 ,█████  ╙████████████████████╨  █████y
 ██████    `████████████████`    ██████
║██████       Ñ███████████`      ███████
███████         ╩██████Ñ         ███████
███████    ▐▄     ²██╩     a▌    ███████
╢██████    ▐▓█▄          ▄█▓▌    ███████
 ██████    ▐▓▓▓▓▌,     ▄█▓▓▓▌    ██████─
           ▐▓▓▓▓▓▓█,,▄▓▓▓▓▓▓▌          
           ▐▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▌          
    ▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓─  
     ²▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓╩    
        ▀▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▓▀       
           ²▀▀▓▓▓▓▓▓▓▓▓▓▓▓▀▀`          
                   ²²²                 
███████████████████████████████████████

. ★☆ WWW.LEALANA.COM        My PGP fingerprint is A764D833.        SMOOTHIE'S HEALTH AND FITNESS JOURNAL          History of Monero development Visualization ★☆ .
LEALANA  PHYSICAL MONERO COINS 999 FINE SILVER.
 
Jimmy2011
Hero Member
*****
Offline Offline

Activity: 566



View Profile
August 28, 2011, 05:57:49 AM
 #5

Retargeting algorithm before seems that difficulty was constantly changing. Why should be that? Why not adjust it in time, that means, for example, adjust it with an adjustment factor t_0/t and also an adjustment coefficient zeta is multiplied, zeta = 0.8 for some case and zeta = 1.1 for the other case as an example. Furthermore, zeta can also be adjusted automatically according to some rules.

One more problem is how to get more and more miners and mining power to involve?


It may be not a problem.

Bitcoin:1EBxhCQp2bUdQDZoQsix6vnivtr3EodCdP       Peercoin:PEjCk5P7FDTFbt3ZwtLPqsGpnQSRSTYRJX
Jimmy2011
Hero Member
*****
Offline Offline

Activity: 566



View Profile
August 29, 2011, 12:40:44 AM
 #6

A similar coin can be defined:
1) every 15/4 minutes generate a block
2) each block rewards 32 coins
3) retarget every 64 blocks or 128 blocks
4) the rewards for each block changed to a half every 262144 blocks
5) the limited amount is 16777216 coins
6) zeta in the retargeting algorithm can be simply defined or calculate it in site with theoretical expected probability and an attractive parameter

P.S. could someone get a code to do some analysis on SC?
a) actual consuming time for each block
b) average time of a block in a window of 240 blocks at the same difficulty
c) actual distribution for the block generation time
d) some curves for the quantities change with time

I am not familiar with coding, if someone is interesting, take it and do it, and if you get something please post here. Thanks!


Bitcoin:1EBxhCQp2bUdQDZoQsix6vnivtr3EodCdP       Peercoin:PEjCk5P7FDTFbt3ZwtLPqsGpnQSRSTYRJX
Jimmy2011
Hero Member
*****
Offline Offline

Activity: 566



View Profile
September 05, 2011, 01:51:40 AM
 #7

I post one example of such algorithms as the following code segment. Just an example, it's not usable directly, some necessary validity changes and modifications, optimization should be added for the actual application.

Anyone can use it as long as you find it useful.

------------------------------------------------------------------

// Go back by what we want to be 14 days worth of blocks
    const CBlockIndex* pindexFirst = pindexLast;
    for (int i = 0; pindexFirst && i < nInterval-1; i++)
        pindexFirst = pindexFirst->pprev;
    assert(pindexFirst);

    // Limit adjustment step
    int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
    printf("  nActualTimespan = %"PRI64d"  before bounds\n", nActualTimespan);

    int64 nThisTimespan = nActualTimespan;

   if (nActualTimespan < nTargetTimespan/4)
        nActualTimespan = nTargetTimespan/4;
    if (nActualTimespan > nTargetTimespan*4)
        nActualTimespan = nTargetTimespan*4;

    
    const CBlockIndex* pindexPreviousFirst = pindexFirst;
    for (int i = 0; pindexPreviousFirst && i < nInterval-1; i++)
        pindexPreviousFirst = pindexPreviousFirst->pprev;
    assert(pindexPreviousFirst);                                                        

    int64 nPreviousTimespan = pindexFirst->GetBlockTime() - pindexPreviousFirst->GetBlockTime();


// Retarget
    CBigNum bnNew;
    bnNew.SetCompact(pindexLast->nBits);
    bnNew *= nActualTimespan;

    if ( ( nPreviousTimespan > nThisTimespan ) && ( nPreviousTimespan < nTargetTimespan ) )
    {
                
         bnNew *= 2;
         bnNew /= ( nTargetTimespan + nActualTimespan );
    
     }
     else if ( ( nPreviousTimespan < nThisTimespan ) && ( nPreviousTimespan > nTargetTimespan ) )
     {
          bnNew *=  nActualTimespan;
          bnNew /= ( nTargetTimespan * nTargetTimespan );
      }
      else
      {
          
               bnNew /= nTargetTimespan;
       }

      
      if (bnNew > bnProofOfWorkLimit)
        bnNew = bnProofOfWorkLimit;

    /// debug print
    printf("GetNextWorkRequired RETARGET\n");
    printf("nTargetTimespan = %"PRI64d"    nActualTimespan = %"PRI64d"\n", nTargetTimespan, nActualTimespan);
    printf("Before: %08x  %s\n", pindexLast->nBits, CBigNum().SetCompact(pindexLast->nBits).getuint256().ToString().c_str());
    printf("After:  %08x  %s\n", bnNew.GetCompact(), bnNew.getuint256().ToString().c_str());

    return bnNew.GetCompact();


Bitcoin:1EBxhCQp2bUdQDZoQsix6vnivtr3EodCdP       Peercoin:PEjCk5P7FDTFbt3ZwtLPqsGpnQSRSTYRJX
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!