Bitcoin Core 30.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 <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 110 of file 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 140 of file types.h.

◆ lock_time

uint32_t node::CoinbaseTx::lock_time

Definition at line 149 of file types.h.

◆ required_outputs

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

Definition at line 148 of file 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.

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 124 of file types.h.

◆ sequence

uint32_t node::CoinbaseTx::sequence

Definition at line 114 of file types.h.

◆ version

uint32_t node::CoinbaseTx::version

Definition at line 112 of file 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 133 of file types.h.


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