TeachMeBitcoin

The Coinbase Transaction and Block Rewards

From TeachMeBitcoin, the free encyclopedia Reading time: 4 min

The Coinbase Transaction and Block Rewards

Every transaction in Bitcoin is a transfer of energy. Normally, a transaction must reference a previous output (a UTXO) to prove that the coins being spent actually exist.

However, there is exactly one exception in every block: the Coinbase Transaction. It is the very first transaction in every single block, and it is where new bitcoins are born.


What is a Coinbase Transaction?

The Coinbase transaction is the mechanism through which the pre-programmed monetary supply is distributed to miners who successfully secure the network. It has several unique properties that set it apart from standard transactions:

1. No Parent Inputs

A standard transaction spends existing inputs. A coinbase transaction has no inputs to spend. In the codebase:

2. The Coinbase Script / Data (100 Bytes)

Because there is no unlocking script required to spend a nonexistent UTXO, the input field—known as the Coinbase Script—can hold up to 100 bytes of arbitrary data.


How the Reward is Calculated

The total amount of bitcoin a miner is allowed to claim in the coinbase transaction is mathematically capped: $$\text{Max Coinbase Output} = \text{Block Subsidy} + \text{Sum of All Transaction Fees in the Block}$$

If a miner accidentally claims less than this amount, the remaining coins are permanently burned (this has happened several times in history). If a miner claims even one satoshi more than this limit, nodes reject the block as invalid.

 [ Block Subsidy ] ────┐
 (Halves every 4 yrs) │
 ├───► [ Total Allowed Coinbase Output ] ───► Miner Address
 [ Transaction Fees ] ─┘
 (Paid by block users)

The Halving Schedule Capped Supply

The block subsidy began at 50 BTC and halves every 210,000 blocks (approximately every 4 years). This decay defines the 21 million supply limit:


The Coinbase Maturity Rule: 100-Block Lock

What happens if a miner receives a 3.125 BTC block reward, immediately spends those coins to buy a car from Bob, and then a few minutes later, their block is reorganized out of the blockchain due to a network fork?

If the block is erased, the coinbase transaction that created those coins is also erased. The coins Bob received would vanish into thin air, leaving him empty-handed.

To prevent this nightmare scenario, Bitcoin consensus enforces the Coinbase Maturity Rule:

☕ Help support TeachMeBitcoin

TeachMeBitcoin is an ad-free, open-source educational repository curated by a passionate team of Bitcoin researchers and educators for public benefit. If you found our articles helpful, please consider supporting our hosting and ongoing content updates with a clean donation:

Ethereum: 0x578417C51783663D8A6A811B3544E1f779D39A85
Bitcoin: bc1q77k9e95rn669kpzyjr8ke9w95zhk7pa5s63qzz
Solana: 4ycT2ayqeMucixj3wS8Ay8Tq9NRDYRPKYbj3UGESyQ4J
Address copied to clipboard!