Author

Topic: Determining a Block's Extranonce Value (Read 1290 times)

sr. member
Activity: 384
Merit: 258
March 14, 2015, 02:57:39 PM
#7
I wrote a summary of how the coinbase scriptSig has changed over time here.
You've pretty much got it right.
Thanks. It's bookmarked ! Smiley

It seems pretty arbitrary, then.
Yep !

He also said that the BitcoinTalk post you cited is outdated.
It is. I've linked this thread because I thought you might be interested by formats used in older blocks (before BIP34). It was just an inference from your previous post about nonces & hash values. My apologies if I was wrong.
newbie
Activity: 2
Merit: 0
March 14, 2015, 02:36:13 PM
#6
EDIT: This format was defined by BIP34 and applies to blocks with version >= 2. I'm not sure how the extranonce was managed before that.
I wrote a summary of how the coinbase scriptSig has changed over time here.
You've pretty much got it right.
sr. member
Activity: 507
Merit: 253
March 14, 2015, 02:25:27 PM
#5
On #eligius I asked Luke-Jr, operator of Eligius pool, and he said:
Quote
[12:08] <@Luke-Jr> throwing it on the end of the coinbase
[12:08] <@Luke-Jr> or in the middle
[12:08] <@Luke-Jr> I think most stratum pools use the end of it
[12:08] <@Luke-Jr> p2pool abuses an output
[12:09] <@Luke-Jr> GBT pools let miners put anything on the end, and at least BFGMiner does
It seems pretty arbitrary, then.

He also said that the BitcoinTalk post you cited is outdated.
sr. member
Activity: 384
Merit: 258
March 14, 2015, 12:25:43 PM
#4
I thought the extranonce was 8 bytes.
My guess is that the extranonce is 8 bytes max but is stored with a compressed representation for lower values.

The extranonce is outside the scope of the bitcoin protocol (BIP34 doesn't say anything about it) and it seems hard to find reliable information about how mining pools manage the coinbase data. Actually, I think different mining pools may enforce different formats.
I've found some sources indicating the 2nd value as the extranonce but I suspect that it's only true for some clients (bitcoind ?).

Investigation in progress...

EDIT:
After some forum archeology, I've found this interesting post related to a study done by Sergio_Demian_Lerner about extranonces.
It seems to confirm the script structure with the extranonce being the second value pushed onto the stack. I was puzzled by the first value but it may be the same value as the bits fields stored in the header.

sr. member
Activity: 507
Merit: 253
March 14, 2015, 10:56:30 AM
#3
Example
Quote
{
   ...
    "vin" : [
        {
            "coinbase" : "03443b0403858402062f503253482f",
            "sequence" : 4294967295
        }
    ],
   ...
}

can be interpreted as:
03 = push 3 bytes onto the stack
443b04 = 3 bytes pushed onto the stack <-- Block index
03 = push 3 bytes onto the stack
858402 = 3 bytes pushed onto the stack <-- The extranonce
06 = push 6 bytes onto the stack
2f503253482f = 6 bytes pushed onto the stack <-- arbitrary data
I thought the extranonce was 8 bytes.
sr. member
Activity: 384
Merit: 258
March 14, 2015, 10:25:53 AM
#2
The extranonce can be found in the coinbase data from a coinbase transaction.
This data can be interpreted as a script pushing data onto the stack and the extranonce is the second value.

Example
Quote
{
   ...
    "vin" : [
        {
            "coinbase" : "03443b0403858402062f503253482f",
            "sequence" : 4294967295
        }
    ],
   ...
}

can be interpreted as:
03 = push 3 bytes onto the stack
443b04 = 3 bytes pushed onto the stack <-- Block index
03 = push 3 bytes onto the stack
858402 = 3 bytes pushed onto the stack <-- The extranonce
06 = push 6 bytes onto the stack
2f503253482f = 6 bytes pushed onto the stack <-- arbitrary data

EDIT: This format was defined by BIP34 and applies to blocks with version >= 2. I'm not sure how the extranonce was managed before that.
sr. member
Activity: 507
Merit: 253
March 13, 2015, 08:22:31 PM
#1
How do I determine a block's extranonce value? I know they are in the coinbase transaction, but where?
Jump to: