How to generate a coinbase transaction?
To create a coinbase transaction you need to send this RPC command to your Bitcoin-Qt
createrawtransaction '[{&quot;txid&quot;:&quot;0000000000000000000000000000000000000000000000000000000000000000&quot;,&quot;vout&quot;:2147483647}]{&quot;Your Bitcoin Adress&quot;:Amount}'
Why 2147483647 ?
Because the vout must be numeric, and you can't put 0xffffffff
So this will give you 0x7fffffff and the easiest way to do that is to change manually the 7 to f
Now as required in BIP34 you must include the block height inside the scriptSig otherwise your coinbase transaction will not be valid
PS: Be aware of little and big endian