Bitcoin Forum
May 10, 2024, 07:21:47 AM *
News: Latest Bitcoin Core release: 27.0 [Torrent]
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: Target difficulty value, enough bits in nonce?  (Read 1642 times)
forgotmypassword6x (OP)
Newbie
*
Offline Offline

Activity: 8
Merit: 0


View Profile
April 19, 2011, 07:59:06 PM
 #1

What is the format of the target difficulty?

e.g. looking at a recent block

http://blockexplorer.com/block/0000000000009e3acd91fa2a9b330b7172ef039997b1207274553e4e3dab468e

The first 12 chars are 0, suggesting the current difficulty is first 6bytes 0 = 48 bits (maybe up to 3 more hidden in high order bits of that 9).

The block header has:
Difficulty?: 92 347.590952 ("Bits"?: 1b00b5ac)

how do I go from that difficulty value to the # of bits?


On the other hand, the nonce field is only 32 bits, so for most block headers, there is likely *no* nonce that hashes to first 48 bits zero, and the only reason a valid nonce is because something else in the header is changing to add more entropy (like added transactions changing the merkle root)

I'm hoping this is wrong, as this would be a really dumb bug and should be fixed immediately if it's the case (by making the nonce atleast the maximum difficulty ever, say 128 bits).  What am I missing?
1715325707
Hero Member
*
Offline Offline

Posts: 1715325707

View Profile Personal Message (Offline)

Ignore
1715325707
Reply with quote  #2

1715325707
Report to moderator
1715325707
Hero Member
*
Offline Offline

Posts: 1715325707

View Profile Personal Message (Offline)

Ignore
1715325707
Reply with quote  #2

1715325707
Report to moderator
1715325707
Hero Member
*
Offline Offline

Posts: 1715325707

View Profile Personal Message (Offline)

Ignore
1715325707
Reply with quote  #2

1715325707
Report to moderator
"Bitcoin: the cutting edge of begging technology." -- Giraffe.BTC
Advertised sites are not endorsed by the Bitcoin Forum. They may be unsafe, untrustworthy, or illegal in your jurisdiction.
1715325707
Hero Member
*
Offline Offline

Posts: 1715325707

View Profile Personal Message (Offline)

Ignore
1715325707
Reply with quote  #2

1715325707
Report to moderator
1715325707
Hero Member
*
Offline Offline

Posts: 1715325707

View Profile Personal Message (Offline)

Ignore
1715325707
Reply with quote  #2

1715325707
Report to moderator
theymos
Administrator
Legendary
*
Offline Offline

Activity: 5194
Merit: 12982


View Profile
April 19, 2011, 08:08:37 PM
 #2

The scriptSig of the generation input is changed when the nonce overflows, which changes the Merkle root.

"Bits" expands to a 256-bit target number, which the hash must be below. Current target:
http://blockexplorer.com/q/hextarget

1NXYoJ5xU91Jp83XfVMHwwTUyZFK64BoAD
Pieter Wuille
Legendary
*
qt
Offline Offline

Activity: 1072
Merit: 1174


View Profile WWW
April 20, 2011, 08:24:33 AM
 #3

And there is another nonce inside the coinbase transaction, which is updated every time the nonce in the header overflows. Furthermore there is added entropy using the timestamp, and the public key of the miner.

I do Bitcoin stuff.
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!