Bitcoin Forum
June 15, 2024, 08:28:49 AM *
News: Voting for pizza day contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Nonce size - 2*32 bit !?  (Read 652 times)
fevir (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 5


View Profile
April 24, 2015, 03:12:25 PM
 #1

Hi all,

I've a question about the nonce size in the bitcoin header. The bitcoin documentation (https://bitcoin.org/en/developer-reference#block-headers) reads: "Nonce: An arbitrary number miners change to modify the header hash in order to produce a hash below the target threshold. If all 32-bit values are tested, the time can be updated or the coinbase transaction can be changed and the merkle root updated."

So far, so good, a nonce is a 32-bit value. Now, the maximum number in 32 bits is 2147483647 (http://en.wikipedia.org/wiki/2147483647). However, if I take a look at some nonces in the blockchain (for example: http://blockexplorer.com/b/3500 - Nonce: 4133247770) the number exceeds 32 bits. The largest nonce I found was 4294638616, which is almost 2*2147483647. However, I haven't been able to explain this phenomenon.

Anyone? Thanks.

Tom
Amph
Legendary
*
Offline Offline

Activity: 3206
Merit: 1069



View Profile
April 24, 2015, 03:28:56 PM
 #2

i guess it is because of the extranonce that the miners add to the coinbase transaction, but i'm not entirely sure about this
fevir (OP)
Newbie
*
Offline Offline

Activity: 22
Merit: 5


View Profile
April 24, 2015, 03:46:04 PM
 #3

aarrgghh...

2 to the power of 31 = 2147483648

2 to the power of 32 = 4294967296

silly me, should have double checked. The wiki link refers to 2^31.

Nothing to see here, keep on mining, please.
DannyHamilton
Legendary
*
Offline Offline

Activity: 3430
Merit: 4658



View Profile
April 24, 2015, 04:19:08 PM
 #4

aarrgghh...

2 to the power of 31 = 2147483648

2 to the power of 32 = 4294967296

silly me, should have double checked. The wiki link refers to 2^31.

Nothing to see here, keep on mining, please.

Glad to see you figured it out.

Note that the signed range of integer values that can be stored in 32 bits is -2,147,483,648 through 2,147,483,647

However the nonce is an unsigned integer, meaning it does not represent negative values. The unsigned range of integer values that can be stored in 32 bits is 0 through 4,294,967,295.
Pages: [1]
  Print  
 
Jump to:  

Powered by MySQL Powered by PHP Powered by SMF 1.1.19 | SMF © 2006-2009, Simple Machines Valid XHTML 1.0! Valid CSS!