I was wondering if I can add dummy data into a coinbase transaction’s inputs. Is it possible to do this? Can you insert invalid input scripts into a coinbase transaction? Can you add multiple inputs scripts into a coinbase, do they all have to be legit scripts, if they do open inputs does the coinbase transaction send more than the regular block reward?
1 Answer
Coinbase transactions must:
- Have exactly 1 input.
- That input must have prevout hash 0000...0000, and index 0xFFFFFFFF (an output which isn't actually spent).
- The input's scriptSig must be between 2 and 100 bytes long.
- Post BIP34 (2012), the scriptSig must start with a push of the block height in little endian encoding.
- Be the first transaction in a block.
If it doesn't satisfy all these rules, the transaction, and the block it is in, are invalid.
-
thanks!, are you super sure about this? why are we adding block height? Feb 11 at 22:11
-
5Yes, see the BIP34 document itself for a brief rationale: github.com/bitcoin/bips/blob/master/bip-0034.mediawiki; it was a more complete solution for a problem originally addressed by BIP30: github.com/bitcoin/bips/blob/master/bip-0030.mediawiki (which I'm the author of). Feb 11 at 22:35