<p>Coinbase transactions must:</p>
<ul>
<li>Have exactly 1 input.</li>
<li>That input must have prevout hash 0000...0000, and index 0xFFFFFFFF (an output which isn't actually spent).</li>
<li>The input's scriptSig must be between 2 and 100 bytes long.</li>
<li>Post BIP34 (2012), the scriptSig must start with a push of the block height in little endian encoding.</li>
<li>Be the first transaction in a block.</li>
</ul>
<p>If it doesn't satisfy all these rules, the transaction, and the block it is in, are invalid.</p>

CC BY-SA 4.0
2023-02-11T22:11:22.360Z
thanks!, are you super sure about this?
why are we adding block height?
Haim Bender
CC BY-SA 4.0
2023-02-11T22:35:39.077Z
Yes, see the BIP34 document itself for a brief rationale: https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki; it was a more complete solution for a problem originally addressed by BIP30: https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki (which I'm the author of).
Pieter Wuille
CC BY-SA 4.0
2023-02-11T21:06:06.503Z
2023-02-11T21:06:06.503Z
Pieter Wuille
<p>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?</p>

<consensus><coinbase-transaction><transaction-input>
Does the coinbase transaction have inputs?
Haim Bender
# Does the coinbase transaction have inputs?

(Asked by: username_0 on 2023-02-11)

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?

**Tags:** consensus, coinbase-transaction, transaction-input


---

## 1 answers

### Answer by username_1 on 2023-02-11. Score: 8 | Accepted 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.

> **Comments:**
> **username_0**: thanks!, are you super sure about this? why are we adding block height?  
> **username_1**: Yes, see the BIP34 document itself for a brief rationale: https://github.com/bitcoin/bips/blob/master/bip-0034.mediawiki; it was a more complete solution for a problem originally addressed by BIP30: https://github.com/bitcoin/bips/blob/master/bip-0030.mediawiki (which I'm the author of).  

---

