Bitcoin Core 31.0.0
P2P Digital Currency
Loading...
Searching...
No Matches
CoinbaseTx Struct Reference

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

#include <types.h>

Collaboration diagram for 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.
std::optional< uint256witness
 The first (and only) witness stack element of the coinbase input.
CAmount block_reward_remaining
 Block subsidy plus fees, minus any non-zero required_outputs.
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 119 of file types.h.

Member Data Documentation

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

◆ lock_time

Definition at line 158 of file types.h.

◆ required_outputs

Definition at line 157 of file types.h.

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

◆ sequence

Definition at line 123 of file types.h.

◆ version

Definition at line 121 of file types.h.

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


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