While discussing a recent Bitcoin Core pull request [0] it was pointed out that in the original Bitcoin code, or more accurately the first commit on Github, the miner produces a coinbase scriptSig as follows:
CTransaction txNew;
txNew.vin.resize(1);
txNew.vin[0].prevout.SetNull();
txNew.vin[0].scriptSig << nBits << ++bnExtraNonce;
txNew.vout.resize(1);
txNew.vout[0].scriptPubKey << key.GetPubKey() << OP_CHECKSIG;
What could have been the reason of adding nBits? It’s already in the header.
Yes, it ensures compliance with the minimum coinbase length rule, but he could have picked a different rule:
if (vin[0].scriptSig.size() < 2 || vin[0].scriptSig.size() > 100)
return error("CTransaction::CheckTransaction() : coinbase script size");
Maybe Satoshi had some other purpose in mind with this field, or perhaps a different header design that didn’t include nBits?
[0] https://github.com/bitcoin/bitcoin/pull/32420#issuecomment-3476735672










