I know that a coinbase transaction must have one input, but can it have more than one?
2 Answers
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? (H/T RedGrittyBrick)
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.