<p>To the best of my knowledge, a coin base has zero inputs. I'm hoping that someone more experienced can clarify.</p>
<p>After digging through the code, from miner.cpp line 151</p>
<pre><code>    CMutableTransaction coinbaseTx;
    coinbaseTx.vin.resize(1);
    coinbaseTx.vin[0].prevout.SetNull();
</code></pre>
<p>There is one input, that points to a null output. I'm glad you asked, you helped me learn something new.</p>
<p>vin is an array, so it could have more than one, but you would have to change the code to do so. I'm curious of why you would want to do this as coinbase txns don't have previous outputs.</p>

CC BY-SA 4.0
2022-09-02T16:03:55.670Z
It's not the miner's code that you should focus on, but rather the consensus verifier's code.
Nayuki
CC BY-SA 4.0
2022-09-03T23:20:57.860Z
Is that cause the verifier would reject any transaction that had multiple inputs?
Kaizen
CC BY-SA 4.0
2022-09-02T03:10:25.890Z
2022-09-02T03:10:25.890Z
Kaizen
<p>No, coinbase transactions must have exactly one input, one with a coinbase field instead of referencing a UTXO to spend. Additional inputs are not allowed.</p>
<p>See also this related topic which describes more requirements of coinbase transactions: <a href="https://bitcoin.stackexchange.com/q/113392/13866">Does a coinbase transaction&#39;s input field have a VOUT field?</a> (H/T RedGrittyBrick)</p>

CC BY-SA 4.0
2022-09-02T11:01:49.620Z
2022-09-02T14:20:05.950Z
2022-09-02T14:20:05.950Z
Murch
<p>I know that a coinbase transaction must have one input, but can it have more than one?</p>

CC BY-SA 4.0
2022-09-02T13:17:33.913Z
See [Does a coinbase transaction's input field have a VOUT field?](https://bitcoin.stackexchange.com/q/113392/13866) which has answers that describes some of the rules relating to number of inputs and contents for coinbase transactions.
RedGrittyBrick
<coinbase-transaction>
Can a coinbase transaction have more than one input?
Casey Rodarmor
# Can a coinbase transaction have more than one input?

(Asked by: username_0 on 2022-09-02)

I know that a coinbase transaction must have one input, but can it have more than one?

**Tags:** coinbase-transaction

> **Comments:**
> **username_1**: See [Does a coinbase transaction's input field have a VOUT field?](https://bitcoin.stackexchange.com/q/113392/13866) which has answers that describes some of the rules relating to number of inputs and contents for coinbase transactions.  

---

## 2 answers

### Answer by username_4 on 2022-09-02. Score: 5 | Accepted answer

No, coinbase transactions must have exactly one input, one with a coinbase field instead of referencing a UTXO to spend. Additional inputs are not allowed.

See also this related topic which describes more requirements of coinbase transactions: [Does a coinbase transaction's input field have a VOUT field?](https://bitcoin.stackexchange.com/q/113392/13866) (H/T username_1)


---

### Answer by username_2 on 2022-09-02. Score: 0

To the best of my knowledge, a coin base has zero inputs. I'm hoping that someone more experienced can clarify.
After digging through the code, from miner.cpp line 151
    CMutableTransaction coinbaseTx;
    coinbaseTx.vin.resize(1);
    coinbaseTx.vin[0].prevout.SetNull();

There is one input, that points to a null output. I'm glad you asked, you helped me learn something new.
vin is an array, so it could have more than one, but you would have to change the code to do so. I'm curious of why you would want to do this as coinbase txns don't have previous outputs.

> **Comments:**
> **username_3**: It's not the miner's code that you should focus on, but rather the consensus verifier's code.  
> **username_2**: Is that cause the verifier would reject any transaction that had multiple inputs?  

---

