Overview
The coinbase transaction is a special transaction that appears as the first transaction in every block. Unlike regular transactions, it does not spend any existing UTXOs. Instead, it creates new bitcoin out of thin air, awarding the block reward (subsidy plus collected transaction fees) to the miner. This is the only mechanism by which new bitcoin enters circulation.
Structure
Regular Transaction:
Inputs: [references to existing UTXOs with signatures]
Outputs: [new UTXOs with locking scripts]
Coinbase Transaction:
Input: [no UTXO reference — "coinbase" field with arbitrary data]
Outputs: [block reward + fees → miner's address(es)]
┌─────────────────────────────────────────────┐
│ Coinbase TX │
│ │
│ Input (coinbase): │
│ ├── Previous TX Hash: 0000...0000 (null) │
│ ├── Previous Output Index: 0xFFFFFFFF │
│ └── Coinbase Data: [arbitrary bytes] │
│ │
│ Outputs: │
│ ├── Output 0: Block reward → Miner │
│ └── Output 1: (optional additional) │
│ │
│ Maturity: 100 blocks before spendable │
└─────────────────────────────────────────────┘
The Coinbase Data Field
Since the coinbase transaction has no real input to reference, the input field can contain up to 100 bytes of arbitrary data. Miners use this space for:
- Block height: Required since BIP34 to ensure unique transaction IDs
- Extra nonce: Additional nonce space for mining when the 4-byte header nonce is exhausted
- Pool identification: Mining pools often include their name
- Messages: Satoshi famously embedded "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks" in the genesis block's coinbase
Maturity Rule
Coinbase transaction outputs cannot be spent until they have received 100 confirmations. This maturity requirement exists because coinbase transactions would become invalid if their block were orphaned during a chain reorganization. The 100-block waiting period ensures sufficient depth to make reorganization extremely unlikely.
Common Misconceptions
The coinbase transaction should not be confused with the cryptocurrency exchange "Coinbase" (the company). The term "coinbase" in Bitcoin predates the exchange by several years and refers exclusively to this special transaction type within the protocol.