Determining a Block's Extranonce Value How do I determine a block's extranonce value? I know they are in the coinbase transaction, but where? How do I decode the part that is the extranonce?
In Bitcoin v0.1.5 to v0.3.24, the coinbase scriptSig contained:

txNew.vin[0].scriptSig &lt;&lt; nBits &lt;&lt; ++bnExtraNonce;


In Bitcoin v0.4.0 to v0.5.3, it changed to:

pblock-&gt;vtx[0].vin[0].scriptSig = CScript() &lt;&lt; pblock-&gt;nTime &lt;&lt; CBigNum(nExtraNonce);


Bitcoin v0.6.0 to v0.6.3:

pblock-&gt;vtx[0].vin[0].scriptSig = (CScript() &lt;&lt; pblock-&gt;nTime &lt;&lt; CBigNum(nExtraNonce)) + COINBASE_FLAGS;


Bitcoin v0.7.0 to current:

txCoinbase.vin[0].scriptSig = (CScript() &lt;&lt; nHeight &lt;&lt; CScriptNum(nExtraNonce)) + COINBASE_FLAGS;


So the coinbase scriptSig field has changed over time, but it has always placed the extranonce as the second item.

In Bitcoin v0.1.5, the size was unlimited, and in more current versions, it's 4 bytes or less. (This is caused by the switch from bnExtraNonce to nExtraNonce.)

There are some other odd details - in v0.1.5, it only resets when the client resets, but in later versions it resets on every new block.

Of course, this is just what the core client does. Other miners or pools might do something else.