Bitcoin Forum

Other => Beginners & Help => Topic started by: dxm on March 01, 2012, 01:23:29 AM



Title: Valid nonces in pooled mining
Post by: dxm on March 01, 2012, 01:23:29 AM
When generating a block, its hash has to be smaller than target (~13 first chars are zeros). What is exactly required for a nonce in pooled mining? I thought it's like hashing a block with difficulty 1 (~8 first chars are zeros). But when mined on bitcoinplus.com, I noticed that this data is valid(I got a payout for this):
00000001 - version
82629e89fdcbe6662a350e82895f6f508767a5b2580e2b4b0000084d00000000 - previous hash
a44cfbae9c9734db6c372ef28fa9eb6282889679114e4138462366b696fd22da - merkle root
4f4e9582 - timestamp
1a0c309c - bits
52990488 - nonce

After conversion to little-endian it looks like:
01000000000000004d0800004b2b0e58b2a56787506f5f89820e352a66e6cbfd899e6282da22fd9 6b666234638414e117996888262eba98ff22e376cdb34979caefb4ca482954e4f9c300c1a880499 52

And final result for double sha256 is 0b26bd7ab017063b4b158c479a340e165228fed254d490d1f31352812ca57aea (ea7aa52c815213f3d190d454d2fe2852160e349a478c154b3b0617b07abd260b for little endian).
Why is it valid if it doesn't have any leading zeros?


Title: Re: Valid nonces in pooled mining
Post by: grue on March 01, 2012, 02:23:10 AM
all pool mining shares = 1 difficulty


Title: Re: Valid nonces in pooled mining
Post by: dxm on March 01, 2012, 02:52:29 AM
all pool mining shares = 1 difficulty

But doesn't "1 difficulty" means hash lower than 00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF ?
ea7aa52c815213f3d190d454d2fe2852160e349a478c154b3b0617b07abd260b  is higher than 00000000FFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFFF  but it was accepted...


Title: Re: Valid nonces in pooled mining
Post by: dxm on March 01, 2012, 04:15:51 PM
Ok, I finally understood, there already was similar topic. This little-endian conversion was wrong, it has to be done separately for every 4-byte block. The python code in https://bitcointalk.org/index.php?topic=52409.0 was really helpful.  :)