Bitcoin Forum

Bitcoin => Bitcoin Discussion => Topic started by: gigabytecoin on March 24, 2011, 03:45:40 AM



Title: Are We All Generating The Exact Same Hashes?
Post by: gigabytecoin on March 24, 2011, 03:45:40 AM
This is how I imagine the mining system to work...

There is a certain block value that needs to be "cracked" next.

Code:
1. You take a hash of the current block's value plus the number 0 (as the nonce). 

2. If the resulting hash is less than the value of the target number, you "win".

3. If it is larger than the value of the target number you add 1 to the nonce and then hash the block's value plus 1.

4. Repeat step 2.

Tell me if I am wrong on the above please, that will answer the question I am about to ask!

Are we all generating the exact same hashes? Is there no random "salt" that we each add to the hash strings to make then unique?

Couldn't a "cheater" safely assume that the first 10 million nonces were going to be wrong, and start at 10 million and 1st nonce to get a "head start" on everybody else that is mining?

Just trying to wrap my head around Satoshi's genius.


Title: Re: Are We All Generating The Exact Same Hashes?
Post by: theymos on March 24, 2011, 03:59:58 AM
There is a "salt" in the form of your unique public key. See:
https://en.bitcoin.it/wiki/Block_hashing_algorithm


Title: Re: Are We All Generating The Exact Same Hashes?
Post by: FreeMoney on March 24, 2011, 04:20:24 AM
A cryptographic nonce is pseudo-random.

I thought the nonce stared at 1 for everyone and the public key in the generate transaction ensured we were not redoing work. I may have gotten that out of some oversimplified explanation though.


Title: Re: Are We All Generating The Exact Same Hashes?
Post by: gigabytecoin on March 24, 2011, 04:21:39 AM
Ok then. Thanks guys! That answers my question. I was wrong.

So a nonce can be basically anything then?

Like 0, or 0a9257n02370?

Any links to the nonce specifications???


Title: Re: Are We All Generating The Exact Same Hashes?
Post by: theymos on March 24, 2011, 04:51:46 AM
I thought the nonce stared at 1 for everyone and the public key in the generate transaction ensured we were not redoing work. I may have gotten that out of some oversimplified explanation though.

You're right. It starts at 1 and increments. The public key is what makes your block unique.


Title: Re: Are We All Generating The Exact Same Hashes?
Post by: Syke on March 24, 2011, 07:07:38 AM
Ok then. Thanks guys! That answers my question. I was wrong.

So a nonce can be basically anything then?

Like 0, or 0a9257n02370?
Right. It doesn't matter what your nonce is. You could start at 1 and increment by 3. You could start at 10000000 and decrement by 17. Every attempted nonce has the same chance of "cracking the block".


Title: Re: Are We All Generating The Exact Same Hashes?
Post by: da2ce7 on March 24, 2011, 07:14:12 AM
Right. It doesn't matter what your nonce is. You could start at 1 and increment by 3. You could start at 10000000 and decrement by 17. Every attempted nonce has the same chance of "cracking the block".

Assuming that SHA256 is uniform and well distributed.  :D  That in for our needs it appears to be close enough to.