Bitcoin Core 31.99.0
P2P Digital Currency
Public Attributes | List of all members
node::CoinbaseTx Struct Reference

Template containing all coinbase transaction fields that are set by our miner code. More...

#include <mining_types.h>

Collaboration diagram for node::CoinbaseTx:
[legend]

Public Attributes

uint32_t version
 
uint32_t sequence
 
CScript script_sig_prefix
 Prefix which needs to be placed at the beginning of the scriptSig. More...
 
std::optional< uint256witness
 The first (and only) witness stack element of the coinbase input. More...
 
CAmount block_reward_remaining
 Block subsidy plus fees, minus any non-zero required_outputs. More...
 
std::vector< CTxOutrequired_outputs
 
uint32_t lock_time
 

Detailed Description

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.

Definition at line 132 of file mining_types.h.

Member Data Documentation

◆ block_reward_remaining

CAmount node::CoinbaseTx::block_reward_remaining

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

Currently there are no non-zero required_outputs, so block_reward_remaining is the entire block reward. See also required_outputs.

Definition at line 164 of file mining_types.h.

◆ lock_time

uint32_t node::CoinbaseTx::lock_time

Definition at line 173 of file mining_types.h.

◆ required_outputs

std::vector<CTxOut> node::CoinbaseTx::required_outputs

Definition at line 172 of file mining_types.h.

◆ script_sig_prefix

CScript node::CoinbaseTx::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.

Currently with BIP 34, the prefix is guaranteed to be less than 8 bytes, but future soft forks could require longer prefixes.

Definition at line 148 of file mining_types.h.

◆ sequence

uint32_t node::CoinbaseTx::sequence

Definition at line 136 of file mining_types.h.

◆ version

uint32_t node::CoinbaseTx::version

Definition at line 134 of file mining_types.h.

◆ witness

std::optional<uint256> node::CoinbaseTx::witness

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

Omitted for block templates without witness data.

This is currently the BIP 141 witness reserved value, and can be chosen arbitrarily by the node, but future soft forks may constrain it.

Definition at line 157 of file mining_types.h.


The documentation for this struct was generated from the following file: