While discussing the recent Bitcoin Core pull request (0), it was pointed out that the original Bitcoin code, more precisely the first commit on Github, was miners producing Coinbase. scriptSig Like this:
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 was the reason for adding it? nBits?It’s already in the header.
Yes, this ensures compliance with Coinbase’s minimum length rule, but I could have chosen a different rule.
if (vin(0).scriptSig.size() < 2 || vin(0).scriptSig.size() > 100)
return error("CTransaction::CheckTransaction() : coinbase script size");
Perhaps Satoshi had other purposes in mind for this field. Or maybe you came up with a different header design that doesn’t include: nBits?
(0) https://github.com/bitcoin/bitcoin/pull/32420#issuecomment-3476735672
Discover more from Earlybirds Invest
Subscribe to get the latest posts sent to your email.

