Bitcoin Forum

Bitcoin => Mining => Topic started by: smoothie on August 15, 2011, 09:19:59 PM



Title: [Help] How far in terms of time do two qualifying hashes?
Post by: smoothie on August 15, 2011, 09:19:59 PM
How close/soon can a block be generated after a valid block has been generated and put into the blockchain?

Is it 1 second? 2 seconds? 3 seconds? more?


Title: Re: [Help] How far in terms of time do two qualifying hashes?
Post by: bcpokey on August 15, 2011, 11:12:49 PM
Is there a limit? As far as I understand it, a qualifying hash is a qualifying hash, the only possible problem I could see would be in ordering the submission if they came in almost simultaneously, and maybe at the end of a difficulty period if one would be the last block of the difficulty and the next fell into a higher difficulty period.


Title: Re: [Help] How far in terms of time do two qualifying hashes?
Post by: SleeperUnit on August 16, 2011, 01:03:56 AM
... the only possible problem I could see would be in ordering the submission if they came in almost simultaneously, and maybe at the end of a difficulty period if one would be the last block of the difficulty and the next fell into a higher difficulty period.

There is no ordering problem. The second block must use the first block as an input. If it doesn't then it will be considered invalid. In fact, this is typically how invalid blocks are made.

And yes, if the second block comes after a difficulty increase then it must take that into consideration too.


Title: Re: [Help] How far in terms of time do two qualifying hashes?
Post by: twmz on August 16, 2011, 05:38:39 AM
There is no ordering problem. The second block must use the first block as an input. If it doesn't then it will be considered invalid.

It's actually the next block to be found after that that determines which is valid.  Until then, they are "tied".

Say you have Block 0 that was found 5 minutes ago.

1. Block 1 is found and points at Block 0 as the previous block.
2. A split second later, Block 2 is found somewhere else in the p2p network that hasn't heard about Block 1 yet and it also points at Block 0 as the previous block.

Both chains are the same length and it's not until Block 3 is found that one of the chains "wins" and becomes the valid chain.

3. Ten minutes later, a miner finds Block 3 which will point at either Block 1 or Block 2 as the previous block (depending on which of the two blocks the miner was notified about first via the p2p network).  If it points at Block 1, then Block 2 is no longer part of the longest chain and is "invalid".  Or if it points at Block 2, then block 1 becomes the "invalid" block.