Glossary

Coinbase Transaction

The first transaction in every Bitcoin block that creates new coins as the mining reward and collects transaction fees.

Key Takeaways

  • The coinbase transaction is the first transaction in every Bitcoin block: it has no inputs, creates new UTXOs from nothing, and serves as the mechanism through which new bitcoin enters circulation.
  • Miners collect both the block subsidy and all transaction fees from the block into this single transaction, making it the sole source of miner revenue per block.
  • Coinbase transaction outputs require 100 block confirmations before they can be spent, a maturity rule that prevents chain reorganizations from invalidating downstream 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. Unlike regular transactions that spend existing UTXOs, the coinbase transaction has no inputs. It creates new bitcoin out of thin air, serving as the protocol's built-in monetary issuance mechanism.

Every bitcoin that has ever existed was first created through a coinbase transaction. When Satoshi Nakamoto mined the genesis block on January 3, 2009, the coinbase transaction in that block 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 critical intersection of Bitcoin's design: it enforces the monetary policy (capped supply of 21 million BTC), incentivizes miners to secure the network, and anchors the Merkle tree that commits to all transactions in the block.

How It Works

The coinbase transaction follows Bitcoin's standard transaction format but with specific rules that distinguish it from regular transactions. Understanding its structure reveals 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, proving ownership through Bitcoin Script signatures. The coinbase transaction breaks this pattern: its single input references no previous output. Instead, the input's "previous transaction hash" field is set to all zeros, and the "previous output index" is set to 0xFFFFFFFF.

// Coinbase transaction structure (simplified)
{
  "txid": "abc123...",
  "vin": [{
    "coinbase": "03a5b20c...",   // Arbitrary data (coinbase field)
    "txid": "0000...0000",       // 32 bytes of zeros (no previous tx)
    "vout": 4294967295,          // 0xFFFFFFFF (no previous output)
    "sequence": 4294967295
  }],
  "vout": [{
    "value": 3.25,               // Subsidy + fees
    "scriptPubKey": {
      "address": "bc1q..."       // Miner's payout address
    }
  }]
}

The output side works like any normal transaction. Miners can create multiple outputs, splitting the reward across different addresses. This is commonly used by mining pools to distribute payouts directly within the coinbase transaction.

The Coinbase Field

Where a regular transaction input contains a scriptSig (unlocking script), 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.

Since BIP-34 (activated in March 2013), the coinbase field must 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.

// Coinbase field structure (post BIP-34)
// Byte layout:
// [block_height] [extra_nonce] [arbitrary_data]

// Example at block height 800,000:
// 03 00350c        -> push 3 bytes: 800000 in little-endian
// 08 a1b2c3d4...   -> extra nonce (used for mining)
// 2f spam text /   -> optional arbitrary data

After the mandatory block height, miners typically include an "extra nonce" value. When a miner exhausts the 4-billion-value range of the block header nonce without finding a valid hash, they increment the extra nonce in the coinbase field. This changes the coinbase transaction's hash, which cascades up through the Merkle tree, producing an entirely new block header hash to continue searching.

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.

Interestingly, a miner may claim less than the maximum allowed value. Any unclaimed portion is permanently destroyed, effectively reducing Bitcoin's total supply. 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. This means a miner must wait approximately 16.5 hours (100 blocks at ~10 minutes each) before using their newly minted coins.

This maturity requirement exists because of chain reorganizations. If a competing chain overtakes the current one, the coinbase transaction in the orphaned block disappears entirely (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, cascading failures through the network. The 100-block buffer gives the network ample time to reach consensus on which chain is canonical.

This is distinct from normal transaction confirmations. Regular transactions that get reorganized out of a block still exist as valid transactions and can be re-included in a future block. Coinbase transactions cannot: 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 been used for some of Bitcoin's most iconic moments. Since miners control this data, 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, mined by Satoshi Nakamoto on January 3, 2009:

The Times 03/Jan/2009 Chancellor on brink of second bailout for banks

This headline from The Times newspaper serves dual 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.

Signaling 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. This signaling mechanism is formalized in BIP-9 (version bits) and 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. This allows anyone to track which pool mined a given block. Common tags include "/Foundry USA/", "/AntPool/", and "/ViaBTC/". While not required by the protocol, this convention helps with network monitoring and pool transparency.

Embedded Data via OP_RETURN

Beyond the coinbase field, miners can also include OP_RETURN outputs in the coinbase transaction to embed additional data. 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.

Use Cases

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. This is the most efficient payout method since the coinbase transaction is already required and its space is effectively free.

Merge Mining

Merge mining allows miners to simultaneously mine Bitcoin and other blockchains that share the same proof-of-work algorithm. The coinbase transaction plays a central role: miners embed a commitment to the auxiliary chain's block header in the coinbase data. This 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. By including a hash or message in the coinbase, miners create an immutable record tied to a specific block height and approximate time. This has been used for everything 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.

Risks and Considerations

Maturity Lock and Liquidity

The 100-block maturity rule means miners cannot immediately access their earnings. For solo miners or small pools, this creates a liquidity delay. If a miner needs to cover electricity costs immediately, they cannot use freshly mined coins. This constraint makes mining a capital-intensive activity that favors well-funded operations.

Coinbase Transaction Size Limits

While the coinbase field is limited to 100 bytes of arbitrary data, 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

When miners accidentally or intentionally claim less than their full entitlement, those coins are permanently lost. The genesis block itself is a notable example: due to a quirk in the original code, the 50 BTC reward from block 0 cannot be spent. 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.

Centralization Concerns

The coinbase transaction reveals mining centralization. When a small number of pools consistently produce the majority of coinbase transactions (identifiable by their embedded pool tags), it raises concerns about mining power concentration. While individual miners within a pool can switch pools, the coinbase data provides transparent evidence of the current distribution of hash power across the network.

This 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.