Bitcoin Forum

Bitcoin => Mining speculation => Topic started by: jmoon on April 06, 2013, 05:23:30 PM



Title: Let'me get mining straight
Post by: jmoon on April 06, 2013, 05:23:30 PM
There is one thing that I still do not understand about bitcoin and bitcoin mining:

The problem is to find a 32bit number - nonce - that yields the desired digest for the full block.
Additionally, the block has the time-stamp parameter which changes every second.

But being the nonce the only "free variable", and having 2^32 (~4.3x10^9) possibilities, how come a 4.3GH/s machine cant find it in one second?
Not every time-stamps allow nonce to get the desired hash?

Best regards


Title: Re: Let'me get mining straight
Post by: mitty on April 06, 2013, 05:24:15 PM
Not every time-stamps allow nonce to get the desired hash?
Yup

The probability of any one given hash producing a block (at current difficulty) can be found here: http://blockexplorer.com/q/probability

A nonce has 2^32 possible values, but most of the time none of those nonces produce a block. (you can see why given the probability above)


Title: Re: Let'me get mining straight
Post by: jmoon on April 06, 2013, 06:07:53 PM
Ok,

so If i've a 8.6GH/s, in each second I calculate nonce for two time-stamps?


Title: Re: Let'me get mining straight
Post by: jmoon on April 06, 2013, 08:03:44 PM
Ok,

so If i've a 8.6GH/s, in each second I calculate nonce for two time-stamps?

By this I mean: Given a block, with a time stamp, lets say "0x00000000" after calculating all nonce's, in half a second, in order to keep the CPU running the miner updates its timestamp to calculate the nonce for the next second "0x00000001"?
I believe then that the block must only be dispatched to the network at the given time, right?

Or the block can be dispatched to the network even if the network time-stamp is lower, and it will be the winning block if noone finds a block with a lower time-stamp?




Title: Re: Let'me get mining straight
Post by: molecular on April 06, 2013, 08:38:51 PM
Ok,

so If i've a 8.6GH/s, in each second I calculate nonce for two time-stamps?

By this I mean: Given a block, with a time stamp, lets say "0x00000000" after calculating all nonce's, in half a second, in order to keep the CPU running the miner updates its timestamp to calculate the nonce for the next second "0x00000001"?
I believe then that the block must only be dispatched to the network at the given time, right?

Or the block can be dispatched to the network even if the network time-stamp is lower, and it will be the winning block if noone finds a block with a lower time-stamp?

Bitcoin doesn't rely on the timestamp at all afaik. I think it can even be lower than the one of the previous block.

EDIT: I'm sorry, there are some rules:

  • Block timestamp must not be more than two hours in the future
  • Reject if timestamp is the median time of the last 11 blocks or before


Title: Re: Let'me get mining straight
Post by: jmoon on April 06, 2013, 09:20:01 PM
ok, so if it cant be latter than 2 hours, and before the median of last 11, this sets a maximum span time: 11*2+2 = 24hours

a 24hour span limits the total freedom to something like  24*3600*2^32 = 3.8x10^14.
Considering that current network capacity is something around 5.6x10^13, it only needs to be multiplied by 8 - which with current technology advancements doen't seems take too long - so that a new block can be found all possible time-stamps and nonce's are tested every second. After that, the network will need to stop, and wait second by second to see if the timestamp 2h+1s after allows nonce to yield the desired digest.

As so, this number, 380 TH/s is what i belive is the theoretical maximum network hashrate, since after this, the network will have to completely stop till the end of current second, waiting for the next second...

Was this predicted before?




Title: Re: Let'me get mining straight
Post by: jmoon on April 06, 2013, 09:51:40 PM
And this is assuming the worst case where a new block is generated every 2 hours. For a 10min span, this number gets lower.


Title: Re: Let'me get mining straight
Post by: grue on April 06, 2013, 10:18:51 PM
Considering that current network capacity is something around 5.6x10^13, it only needs to be multiplied by 8 - which with current technology advancements doen't seems take too long - so that a new block can be found all possible time-stamps and nonce's are tested every second.
modify coinbase = new hash.


Title: Re: Let'me get mining straight
Post by: jmoon on April 06, 2013, 10:46:56 PM
good point. Forgot about coinbase!

Above all, it means that what i said before was only valid for each solo/pool individually, not the entire network.

But is it currently being also used as another degree of freedom? I cant eve see how can it be changed...




Title: Re: Let'me get mining straight
Post by: grue on April 08, 2013, 03:26:27 PM
good point. Forgot about coinbase!

Above all, it means that what i said before was only valid for each solo/pool individually, not the entire network.

But is it currently being also used as another degree of freedom? I cant eve see how can it be changed...



if you change the merkle tree in any way (add, delete, or reorder transactions), you also get new hash.


Title: Re: Let'me get mining straight
Post by: DeathAndTaxes on April 08, 2013, 03:28:17 PM
The reward tx (where miners are paid) in the block has a extra nonce field.  It can contain any random arbitrary value.  One doesn't need to manipulate the timestamp.  Just generate a new merkle tree.  The max hash rate is infinite.


Title: Re: Let'me get mining straight
Post by: DeathAndTaxes on April 08, 2013, 03:30:51 PM
good point. Forgot about coinbase!

Above all, it means that what i said before was only valid for each solo/pool individually, not the entire network.

But is it currently being also used as another degree of freedom? I cant eve see how can it be changed...

Why couldn't it be changed.  One could simply use a different payout address = new coinbase tx = new tx hash = new merkle tree = new merkle root hash = new blockheader.

Of course it is even easier than that.  Since the coinbase has no input it has space for an "extra nonce".  Some pools even put messages in that space.  It can contain a arbitrary value allowing the creation of an infinite amount of block headers in any given time period, even by a single solo miner (assuming sufficient computing power).

In hindsight it probably would have been cleaner to just make the nonce field 64 bits.  One would think alt-coins would have improved on that but since they are all pump and dump copies they did not.