[#node-CoinbaseTx]
= xref:node.adoc[node]::CoinbaseTx
:relfileprefix: ../
:mrdocs:

Template containing all coinbase transaction fields that are set by our miner code&period; Clients are expected to add their own outputs and typically also expand the scriptSig&period;

== Synopsis

Declared in `&lt;node&sol;mining&lowbar;types&period;h&gt;`

[source,cpp,subs="verbatim,replacements,macros,-callouts"]
----
struct CoinbaseTx;
----

== Data Members

[cols="1,4"]
|===
| Name| Description
| xref:node/CoinbaseTx/block_reward_remaining.adoc[`block&lowbar;reward&lowbar;remaining`] 
| Block subsidy plus fees, minus any non&hyphen;zero required&lowbar;outputs&period;
| xref:node/CoinbaseTx/lock_time.adoc[`lock&lowbar;time`] 
| The coinbase transaction&apos;s locktime (nLockTime)&period;
| xref:node/CoinbaseTx/required_outputs.adoc[`required&lowbar;outputs`] 
| To be included as the last outputs in the coinbase transaction&period; Currently this is only the witness commitment OP&lowbar;RETURN, but future softforks or a custom mining patch could add more&period;
| xref:node/CoinbaseTx/script_sig_prefix.adoc[`script&lowbar;sig&lowbar;prefix`] 
| Prefix which needs to be placed at the beginning of the scriptSig&period; Clients may append extra data to this as long as the overall scriptSig size is 100 bytes or less, to avoid the block being rejected with &quot;bad&hyphen;cb&hyphen;length&quot; error&period; At heights &lt;&equals; 16 the BIP 34 height push is only one byte long, so clients must append at least one additional byte to meet the consensus minimum scriptSig length of two bytes&period;
| xref:node/CoinbaseTx/sequence.adoc[`sequence`] 
| The nSequence value for the only coinbase transaction input&period;
| xref:node/CoinbaseTx/version.adoc[`version`] 
| The coinbase transaction&apos;s version number (nVersion)&period;
| xref:node/CoinbaseTx/witness.adoc[`witness`] 
| The first (and only) witness stack element of the coinbase input&period;
|===



[.small]#Created with https://www.mrdocs.com[MrDocs]#
