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

Synopsis

Declared in <node/mining_types.h>

struct CoinbaseTx;

Data Members

Name

Description

block_reward_remaining

Block subsidy plus fees, minus any non‐zero required_outputs.

lock_time

The coinbase transaction's locktime (nLockTime).

required_outputs

To be included as the last outputs in the coinbase transaction. Currently this is only the witness commitment OP_RETURN, but future softforks or a custom mining patch could add more.

script_sig_prefix

Prefix which needs to be placed at the beginning of the scriptSig. 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 "bad‐cb‐length" error. At heights <= 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.

sequence

The nSequence value for the only coinbase transaction input.

version

The coinbase transaction's version number (nVersion).

witness

The first (and only) witness stack element of the coinbase input.

Created with MrDocs