Bitcoin Forum

Bitcoin => Bitcoin Technical Support => Topic started by: da2ce7 on November 07, 2010, 05:27:31 AM



Title: Average block generation time
Post by: da2ce7 on November 07, 2010, 05:27:31 AM
How does one calculate the average block generation time at any given difficulty factor?

Thanks in advanced.


Title: Re: Average block generation time
Post by: ShadowOfHarbringer on November 07, 2010, 01:00:46 PM
http://www.alloscomp.com/bitcoin/calculator.php


Title: Re: Average block generation time
Post by: tcatm on November 07, 2010, 01:09:18 PM
Average Time = difficulty * 2^32 * hour / (3600 * hashrate)


Title: Re: Average block generation time
Post by: da2ce7 on November 08, 2010, 09:55:39 AM
http://developer.wolframalpha.com/widgets/gallery/view.jsp?id=76444b3132fda0e2aca778051d776f1c (http://developer.wolframalpha.com/widgets/gallery/view.jsp?id=76444b3132fda0e2aca778051d776f1c)

Little gadget that anyone can use... Hope it helps.


Title: Re: Average block generation time
Post by: Transisto on March 09, 2011, 07:34:53 PM
Average Time = difficulty * 2^32 * hour / (3600 * hashrate)

Average Time (in hours) = difficulty * 2^32 *hour / (3600 * hash per second)


Title: Re: Average block generation time
Post by: Serenata on June 07, 2012, 07:12:25 AM
http://developer.wolframalpha.com/widgets/gallery/view.jsp?id=76444b3132fda0e2aca778051d776f1c (http://developer.wolframalpha.com/widgets/gallery/view.jsp?id=76444b3132fda0e2aca778051d776f1c)

Little gadget that anyone can use... Hope it helps.
Useful, thanks!!


Title: Re: Average block generation time
Post by: Kinnardian on November 28, 2012, 09:57:11 PM
Hi, Where does the 2^32 come from?


Title: Re: Average block generation time
Post by: Sparxy on November 29, 2012, 12:47:29 AM
Hi, Where does the 2^32 come from?
The nonce for the block "candidate" is a 32bit integer, meaning it can be anything from 0 to 2^32. While mining, you'll iterate through every single possibility before beginning on a new block "candidate".


Title: Re: Average block generation time
Post by: CrazyGuy on November 30, 2012, 06:30:14 PM
I didn't know you could create widgets with wolfram, that's really neat. So if 250 th worth of ASICs were released today , it would take about 40h to chomp through 2000 blocks.


Title: Re: Average block generation time
Post by: PaperClip on June 26, 2013, 09:06:42 PM
I have question raised from different topic -
Solo mining, no change in total network hash rate, 20 hours a day for 62 days, then you have what percentage of finding a block??
According to this: https://en.bitcoin.it/wiki/Difficulty
time required to find a block = difficulty * 2^48 / 65535 / hashrate

difficulty = 19339258.272387
hashrate = 7.75 GH/s = 7 750 000 000 hash/s
time required to find a block = 19 339 258.272 387 * 2^48 / 65 535 / 7 750 000 000 = 10 717 774 s

20 hours a day for 62 days equals to 4 464 000 seconds
result is 4 464 000 / 10 717 774 = 41.65%

But I have some concerns:
Actually, result percentage should be bigger. 10717774s is maximal time to check all possible hashes. In reality miner does not check them all, it stops as soon as correct hash was found.
Its like if somebody has number between 1 and 9 in his mind, and you will guess it by trying all numbers 1,2,3,.. sequently. You do not need to make 9 guesses every time. It will be from 1 to 9; 5 guesses in average.
Soo, in this case result percentage should be 2 times bigger - 83.3%.
Am I correct?
I want to understand logic behind this. Can anybody help? Correct result is 41.65% or 83.3%?


Title: Re: Average block generation time
Post by: farlack on June 26, 2013, 09:32:36 PM
Anyone else notice the block times you will get 2 in 2 minutes, then none for 30 minutes, its really annoying.


Title: Re: Average block generation time
Post by: cp1 on June 26, 2013, 09:33:42 PM
Average block time = time for last n blocks / n


Title: Re: Average block generation time
Post by: jackjack on June 26, 2013, 09:37:34 PM
Anyone else notice the block times you will get 2 in 2 minutes, then none for 30 minutes, its really annoying.
Fucking maths, how do they work?


Title: Re: Average block generation time
Post by: PaperClip on June 26, 2013, 09:49:53 PM
Average block time = time for last n blocks / n
True
But question was related to device that probobaly will take months to generate at least one block :)
So there is no "time for last n blocks" in this case


Title: Re: Average block generation time
Post by: cp1 on June 26, 2013, 10:18:34 PM
But question was related to device that probobaly will take months to generate at least one block :)
So there is no "time for last n blocks" in this case

I didn't realize the thread was from so long ago either.


Title: Re: Average block generation time
Post by: AnonyMint on November 12, 2013, 12:39:15 AM
Hi, Where does the 2^32 come from?
The nonce for the block "candidate" is a 32bit integer, meaning it can be anything from 0 to 2^32. While mining, you'll iterate through every single possibility before beginning on a new block "candidate".

Incorrect.

The maximum target (https://en.bitcoin.it/wiki/Target)* is 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF, which has 8 zeros at 4 bits each (each hexadecimal digit has pow(2,4) = 2^4 = 16 possibilities: 0 - 9, A, B, C, D, E, and F). 8 x 4 = 32 bits.

The probability of finding a hash which is 0xFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF divided by 0x00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF = 1/pow(2,32) = 1 / (2^32). Since the difficulty (https://en.bitcoin.it/wiki/Difficulty) is the maximum target divided by current target, each hash calculated has 1 / (2^32) probability of being the block solution when the difficulty is 1.

This choice of the maximum target for Bitcoin just so happens to match the number of possible values for the block nonce.

* Note the maximum target is rounded down to 0x00000000FFFF0000000000000000000000000000000000000000000000000000, so all the math presented in this thread is only an approximation.


Title: Re: Average block generation time
Post by: lcharles123 on December 25, 2013, 10:28:10 PM
http://developer.wolframalpha.com/widgets/gallery/view.jsp?id=76444b3132fda0e2aca778051d776f1c (http://developer.wolframalpha.com/widgets/gallery/view.jsp?id=76444b3132fda0e2aca778051d776f1c)

Little gadget that anyone can use... Hope it helps.
Useful, thanks!!

Here a more detailed:
http://bitcoinwisdom.com/litecoin/difficulty