Bitcoin Forum
November 01, 2024, 01:31:12 PM *
News: Bitcoin Pumpkin Carving Contest
 
   Home   Help Search Login Register More  
Pages: [1]
  Print  
Author Topic: What have they done to the Nonce?  (Read 3188 times)
betatest512 (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
September 20, 2012, 10:07:19 PM
 #1

In https://en.bitcoin.it/wiki/Block_hashing_algorithm the algorithm show's that the nonce is "42a14695" and blockexplorer http://blockexplorer.com/block/00000000000000001e8d6829a8a21adc5d38d0a473b144b6765798e61f98bd1d show's that the nonce is 2504433986

so what is done to the nonce to make it "42a14695"
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 20, 2012, 10:11:08 PM
 #2

They haven't "done" anything.  It is called hexadecimal.

betatest512 (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
September 20, 2012, 10:15:42 PM
 #3

They haven't "done" anything.  It is called hexadecimal.

2504433986 = 0x42a14695 = 1001100011011011110001 = "two trillion five hundred and four million, four hundred and thirty three thousand, nine hundred eighty six"

Not to be rude or anything but this thread combined with your other thread on blockheader indicates you lack even the most basics of programming.  Jumping right into something as complex as Bitcoin is unlikely going to pay any dividends if you don't have a foundation.

You may be better served by some self study of just basic programming concepts.  The language doesn't really matter but java is generally pretty easy for a beginner to pick up.

i used the converter here http://number.webmasters.sk/numerical.php and it tell's me that "42a14695" is equal to "1117865621"
Remember remember the 5th of November
Legendary
*
Offline Offline

Activity: 1862
Merit: 1011

Reverse engineer from time to time


View Profile
September 20, 2012, 10:31:01 PM
 #4

They haven't "done" anything.  It is called hexadecimal.


You seriously can't count? It's 2 billion, 504 million...where on earth did you see 2 trillion and how do you expect it to fit in a 32-bit variable?

BTC:1AiCRMxgf1ptVQwx6hDuKMu4f7F27QmJC2
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 20, 2012, 10:35:53 PM
 #5

i used the converter here http://number.webmasters.sk/numerical.php and it tell's me that "42a14695" is equal to "1117865621"

Yeah I forgot Satoshi for some reason messed around with the endianess of each 16bit bit portion of the number.

12345678 -> 12 34 56 78 -> 78 56 34 12 -> 78563412

So
42a14695 -> 42 a1 46 95 -> 95 46 a1 42 -> 9546a142
Inaba
Legendary
*
Offline Offline

Activity: 1260
Merit: 1000



View Profile WWW
September 20, 2012, 10:39:12 PM
 #6

I wonder if the endian-ness of things might be a clue as to Satoshi's origins... maybe he was a big-iron programmer from back in the day or something?

Is there any definitive statements on why the endian-ness is swapped around so strangely from the start?

If you're searching these lines for a point, you've probably missed it.  There was never anything there in the first place.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 20, 2012, 10:46:11 PM
 #7

I wonder if the endian-ness of things might be a clue as to Satoshi's origins... maybe he was a big-iron programmer from back in the day or something?

Hmm.  Never thought about that angle before.  I mean for 99% of programmers all these endian conversions just make the code more confusion to understand however for some programmers it might be second nature.

Then again there are a lot of other "quirks" which are equally hard to explain.

Why use 32 bit nonce + extra nonce?  Why not just use a 64 bit nonce?

Why a double SHA-256?  If the fear was that SHA-256 would be partially compromised one would gain some security by using two algorithms but you don't really gain much performing the same algorithm twice.
dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
September 20, 2012, 10:47:37 PM
 #8

I wonder if the endian-ness of things might be a clue as to Satoshi's origins... maybe he was a big-iron programmer from back in the day or something?

Hmm.  Never thought about that angle before.  I mean for 99% of programmers all these endian conversions just make the code more confusion to understand however for some programmers it might be second nature.

Then again there are a lot of other "quirks" which are equally hard to explain.

Why use 32 bit nonce + extra nonce?  Why not just use a 64 bit nonce?

Why a double SHA-256?  If the fear was that SHA-256 would be partially compromised one would gain some security by using two algorithms but you don't really gain much performing the same algorithm twice.
The double SHA-256 prevents, I believe, hash extension attacks.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 20, 2012, 10:50:21 PM
 #9

hash extension attacks are only possibly on arbitrary sized message.
Bitcoin block headers are fixed size.  A valid block header must be exactly 640 bits (no more, no less).
betatest512 (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
September 20, 2012, 10:50:45 PM
 #10

I wonder if the endian-ness of things might be a clue as to Satoshi's origins... maybe he was a big-iron programmer from back in the day or something?

Hmm.  Never thought about that angle before.  I mean for 99% of programmers all these endian conversions just make the code more confusion to understand however for some programmers it might be second nature.

Then again there are a lot of other "quirks" which are equally hard to explain.

Why use 32 bit nonce + extra nonce?  Why not just use a 64 bit nonce?

Why a double SHA-256?  If the fear was that SHA-256 would be partially compromised one would gain some security by using two algorithms but you don't really gain much performing the same algorithm twice.

please can anyone explain how the extra nonce portion work..
dree12
Legendary
*
Offline Offline

Activity: 1246
Merit: 1077



View Profile
September 20, 2012, 10:53:41 PM
 #11

hash extension attacks are only possibly on arbitrary sized message.
Bitcoin block headers are fixed size.  A valid block header must be exactly 640 bits (no more, no less).
I was going by this.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 20, 2012, 10:55:28 PM
 #12

The generation (block reward) tx has a single input.  Normally the input of any tx is the unspent output of a prior tx however generated coins are produced from "thin air".  The input is a special type of tx called the coinbase.   The Bitcoin network doesn't use the value in here for anything (although it is now used by subordinate chain in merged mining).   Miners can modify this to produce more possible block headers for the same set of inputs.

So say for a given set of transactions, time, prior block, and difficulty you try all nonces 0 to 2^32-1.  What can you hash next if you don't want to wait for any of the other values to change.  You simply change the value in the coinbase field to another value.  That will produce a new merkle tree and thus a new markle root hash.  Technically it doesn't need to be incremented any new value is fine but for simplicity and record keeping (pools) it makes sense to just increment the value.   Pools do this to issue work to multiple workers that are otherwise the same.   solo miners will need to increment this if they have a hashing rate greater than ~4GH/s.
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 20, 2012, 10:58:51 PM
 #13

hash extension attacks are only possibly on arbitrary sized message.
Bitcoin block headers are fixed size.  A valid block header must be exactly 640 bits (no more, no less).
I was going by this.

Yeah the answer is technically correct in the general sense.  Double hash is a useful cryptographic feature to prevent extension attacks.  The author of that answer may not have been aware that Bitcoin has a fixed size header.
betatest512 (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
September 21, 2012, 12:20:28 AM
 #14

The generation (block reward) tx has a single input.  Normally the input of any tx is the unspent output of a prior tx however generated coins are produced from "thin air".  The input is a special type of tx called the coinbase.   The Bitcoin network doesn't use the value in here for anything (although it is now used by subordinate chain in merged mining).   Miners can modify this to produce more possible block headers for the same set of inputs.

So say for a given set of transactions, time, prior block, and difficulty you try all nonces 0 to 2^32-1.  What can you hash next if you don't want to wait for any of the other values to change.  You simply change the value in the coinbase field to another value.  That will produce a new merkle tree and thus a new markle root hash.  Technically it doesn't need to be incremented any new value is fine but for simplicity and record keeping (pools) it makes sense to just increment the value.   Pools do this to issue work to multiple workers that are otherwise the same.   solo miners will need to increment this if they have a hashing rate greater than ~4GH/s.

can some provide an example of how it is done..
Revalin
Hero Member
*****
Offline Offline

Activity: 728
Merit: 500


165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g


View Profile
September 21, 2012, 04:10:39 AM
 #15

I wonder if the endian-ness of things might be a clue as to Satoshi's origins... maybe he was a big-iron programmer from back in the day or something?

Is there any definitive statements on why the endian-ness is swapped around so strangely from the start?


http://en.wikipedia.org/wiki/Endianness#Endianness_in_networking

      War is God's way of teaching Americans geography.  --Ambrose Bierce
Bitcoin is the Devil's way of teaching geeks economics.  --Revalin 165YUuQUWhBz3d27iXKxRiazQnjEtJNG9g
betatest512 (OP)
Full Member
***
Offline Offline

Activity: 140
Merit: 100


View Profile
September 21, 2012, 02:54:20 PM
 #16

can anyone tell me how to increment the coinbase after going though all the nonce..
DeathAndTaxes
Donator
Legendary
*
Offline Offline

Activity: 1218
Merit: 1079


Gerald Davis


View Profile
September 21, 2012, 04:28:05 PM
 #17

can anyone tell me how to increment the coinbase after going though all the nonce..

Same way you increment anything.

coinbase = coinbase +1
DannyHamilton
Legendary
*
Offline Offline

Activity: 3472
Merit: 4801



View Profile
September 24, 2012, 10:05:07 PM
 #18

Same way you increment anything.

coinbase = coinbase +1
coinbase++;
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!