Coinbase Transaction

The first transaction in each block: it creates the subsidy and collects the block's fees.

Basically

The coinbase transaction is the first transaction in every Bitcoin block. It creates new bitcoin for the miner and collects the fees from the block's other transactions.

Key Takeaways

  • The coinbase transaction is the first transaction in every Bitcoin block. It has no inputs, creates new UTXOs from nothing, and is how new bitcoin enters circulation.
  • Miners collect the block subsidy and all of the block's transaction fees in this one transaction. It is the sole source of miner revenue per block.
  • Coinbase transaction outputs need 100 block confirmations before you can spend them. This maturity rule stops chain reorganisations from invalidating later transactions built on newly minted coins.

What Is a Coinbase Transaction?

A coinbase transaction, not to be confused with the cryptocurrency exchange of the same name, is a special transaction that miners include as the very first transaction in every Bitcoin block. It has no inputs, unlike regular transactions that spend existing UTXOs. It creates new bitcoin out of thin air and acts as the protocol's built-in monetary issuance mechanism.

Every bitcoin that has ever existed was first created through a coinbase transaction. Satoshi Nakamoto mined the genesis block on January 3, 2009, and its coinbase transaction created the first 50 BTC. Since then, every block has contained exactly one coinbase transaction, each minting new coins according to the current block subsidy schedule and collecting the cumulative fees from all other transactions in the block.

The coinbase transaction sits at a key intersection of Bitcoin's design. It enforces the monetary policy, including the capped supply of 21 million BTC, and incentivises miners to secure the network. It also anchors the Merkle tree that commits to all transactions in the block.

How It Works

The coinbase transaction follows Bitcoin's standard transaction format, with specific rules that set it apart from regular transactions. Its structure shows how Bitcoin's consensus rules enforce monetary policy at the protocol level.

Transaction Structure

A regular Bitcoin transaction references one or more previous transaction outputs as inputs and proves ownership through Bitcoin Script signatures. The coinbase transaction breaks this pattern because its single input references no previous output. The input's "previous transaction hash" field is set to all zeros, and the "previous output index" is set to 0xFFFFFFFF.

The output side works like any normal transaction. Miners can create multiple outputs and split the reward across different addresses, which mining pools commonly use to distribute payouts directly within the coinbase transaction.

The Coinbase Field

A regular transaction input contains a scriptSig, or unlocking script, but the coinbase transaction contains a special "coinbase field" of up to 100 bytes. This field can hold arbitrary data, and miners have historically used it for various purposes.

BIP-34, activated in March 2013, requires the coinbase field to begin with the block height encoded as a Script number. This requirement prevents coinbase transactions in different blocks from having identical transaction IDs, which previously caused issues with duplicate transactions.

After the mandatory block height, miners typically include an "extra nonce" value. A miner who exhausts the 4-billion-value range of the block header nonce without finding a valid hash increments the extra nonce in the coinbase field. The change alters the coinbase transaction's hash, which cascades up through the Merkle tree and produces an entirely new block header hash for the search to continue.

Output Value Rules

The total value of the coinbase transaction's outputs must not exceed the sum of the current block subsidy plus all transaction fees collected from the block's other transactions. If a miner claims more than they are entitled to, the block is invalid and will be rejected by the network.

A miner may claim less than the maximum allowed value. Any unclaimed portion is permanently destroyed, effectively reducing Bitcoin's total supply, and this has happened accidentally several times in Bitcoin's history, most notably when miners failed to claim full fees. For a deeper look at how fees interact with mining economics, see the research article on Bitcoin fee market dynamics.

The 100-Block Maturity Rule

Coinbase transaction outputs cannot be spent until they have received 100 confirmations. A miner must wait approximately 16.5 hours, or 100 blocks at ~10 minutes each, before using their newly minted coins.

The maturity requirement exists because of chain reorganisations. If a competing chain overtakes the current one, the coinbase transaction in the orphaned block disappears entirely because it created coins that no longer exist on the winning chain. Without the maturity rule, downstream transactions that spent those coins would also become invalid and failures would cascade through the network, so the 100-block buffer gives the network ample time to reach consensus on which chain is canonical.

Normal transaction confirmations work differently. Regular transactions that get reorganised out of a block still exist as valid transactions and can be re-included in a future block. Coinbase transactions cannot because each block produces its own unique coinbase, so an orphaned block's coinbase is gone forever.

Notable Coinbase Messages

The arbitrary data field in coinbase transactions has carried some of Bitcoin's most iconic moments. Miners control this data, so it has served as a public message board etched permanently into the blockchain.

The Genesis Block Message

The most famous coinbase message appears in Bitcoin's very first block. Satoshi Nakamoto mined it on January 3, 2009.

The Times newspaper headline serves two purposes. It timestamps the genesis block, proving it was not pre-mined before that date, and makes a political statement about the financial system that Bitcoin was designed to provide an alternative to.

Signalling and Activation

Miners use the coinbase field to signal support for protocol upgrades. During the activation of SegWit and Taproot, miners included specific bit patterns in their coinbase data to indicate readiness for the new consensus rules. BIP-9, or version bits, formalises this signalling mechanism, which was used to coordinate the activation of soft forks without contentious hard forks.

Pool Identification

Mining pools typically include their name or identifier in the coinbase field. Anyone can use it to track which pool mined a given block, with common tags including "/Foundry USA/", "/AntPool/", and "/ViaBTC/". The protocol does not require this convention, but it helps with network monitoring and pool transparency.

Embedded Data via OP_RETURN

Miners can also include OP_RETURN outputs in the coinbase transaction to embed additional data beyond the coinbase field. Some mining pools use this to commit to merge-mined sidechains or other auxiliary data. The Ordinals protocol has also brought renewed attention to the data embedded in coinbase transactions.

Mining Pool Payouts

Mining pools use the coinbase transaction to distribute rewards to their participants. Rather than making separate payout transactions, which would incur additional fees, pools create multiple outputs in the coinbase transaction, each paying a proportional share to contributing miners. The coinbase transaction is the most efficient payout method since it is already required and its space is effectively free.

Merge Mining

Merge mining allows miners to mine Bitcoin and other blockchains that share the same proof-of-work algorithm at the same time. The coinbase transaction plays a central role because miners embed a commitment to the auxiliary chain's block header in the coinbase data. The commitment proves to the auxiliary chain that the miner performed sufficient work without requiring any additional computational effort beyond what was already done for Bitcoin.

Blockchain Timestamping

The coinbase field provides a censorship-resistant way to timestamp data on the Bitcoin blockchain. Miners create an immutable record tied to a specific block height and approximate time by including a hash or message in the coinbase. Uses have ranged from protest messages to cryptographic commitments for document verification.

Fee Market Analysis

Researchers and analysts examine coinbase transactions to study Bitcoin's evolving fee market. The ratio of fee revenue to subsidy revenue in each coinbase transaction reveals how Bitcoin's security model transitions over time from subsidy-dependent to fee-dependent. The UTXO model vs. account model research article explores how Bitcoin's transaction model influences these dynamics.

Maturity Lock and Liquidity

The 100-block maturity rule means miners cannot immediately access their earnings. Solo miners or small pools face a liquidity delay and cannot use freshly mined coins if they need to cover electricity costs immediately. The constraint makes mining a capital-intensive activity that favours well-funded operations.

Coinbase Transaction Size Limits

The coinbase field is limited to 100 bytes of arbitrary data, but the overall coinbase transaction has no special size limit beyond the standard block weight constraints. Large mining pools creating dozens of payout outputs can produce sizeable coinbase transactions, consuming block space that could otherwise hold fee-paying transactions.

Supply Implications of Unclaimed Rewards

Unclaimed coins are permanently lost when miners accidentally or intentionally claim less than their full entitlement. The genesis block itself is a notable example because a quirk in the original code makes the 50 BTC reward from block 0 unspendable. Combined with other unclaimed rewards throughout Bitcoin's history, the actual circulating supply will always be slightly less than the theoretical maximum of 21 million BTC.

Centralisation Concerns

The coinbase transaction reveals mining centralisation. A small number of pools consistently producing the majority of coinbase transactions, identifiable by their embedded pool tags, raises concerns about mining power concentration. Individual miners within a pool can switch pools, but the coinbase data provides transparent evidence of the current distribution of hash power across the network.

The glossary entry is for informational purposes only and does not constitute financial or investment advice. Always do your own research before using any protocol or technology.

0

← All 1876 glossary terms