Bitcoin Forum
November 11, 2024, 03:50:09 PM *
News: Latest Bitcoin Core release: 28.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Precise specifications  (Read 729 times)
valiron (OP)
Sr. Member
****
Offline Offline

Activity: 311
Merit: 250


View Profile
June 30, 2011, 02:29:22 PM
Last edit: June 30, 2011, 06:11:38 PM by valiron
 #1

Sorry to open a thread about something that has surely been discussed before (this is the newbie section right?).

Where can I find the precise technical specifications and descriptions of the algorithms running the BTC community?

For example, what are the precise rules for the increase in difficulty?

It is easy to find general descriptions, but I haven't been able to find the technical papers.
fizzisist
Hero Member
*****
Offline Offline

Activity: 720
Merit: 525



View Profile WWW
June 30, 2011, 02:34:31 PM
 #2

I believe this is the original paper: http://www.bitcoin.org/bitcoin.pdf

I haven't found a more in depth paper yet, but the wiki seems to have a lot of information: https://en.bitcoin.it/wiki/Main_Page

luxgladius
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
June 30, 2011, 02:40:12 PM
 #3

The wiki has most of it, but the best place to look is the code.

Code:
    int64 nActualTimespan = pindexLast->GetBlockTime() - pindexFirst->GetBlockTime();
    printf("  nActualTimespan = %"PRI64d"  before bounds\n", nActualTimespan);
    if (nActualTimespan < nTargetTimespan/4)
        nActualTimespan = nTargetTimespan/4;
    if (nActualTimespan > nTargetTimespan*4)
        nActualTimespan = nTargetTimespan*4;

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

    if (bnNew > bnProofOfWorkLimit)
        bnNew = bnProofOfWorkLimit;
valiron (OP)
Sr. Member
****
Offline Offline

Activity: 311
Merit: 250


View Profile
June 30, 2011, 06:10:38 PM
 #4


Thanks guys, but I wanted to avoid to look into the code.

I cannot believe that there is no layman description of what the algorithms are. The foundational Nakamoto's paper is really not precise about the procedures.

In particular, how it is determined the common computational power, and how the increase of difficulty is set.

Thanks in advance to those that can provide a link.
luxgladius
Newbie
*
Offline Offline

Activity: 28
Merit: 0


View Profile
June 30, 2011, 07:07:07 PM
 #5

Well, for such things as difficulty, there's not a lot of difference in how the code reads and just a verbal explanation. It's kind of just busy work to write it out. But if you have questions, go ahead and ask them.

Every 2016 blocks, look at the last 2016 blocks. IntervalLength=Last blocktime - first blocktime. Adjust the difficulty according to NewDifficulty=OldDifficulty*(2 weeks)/(IntervalLength). If the NewDifficulty is more than 4x or less than .25x, limit it.

There you go.
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!