Skip to content
buybitcoinsmart

Glossary / Transactions & fees

Coinbase transaction

Also known as Generation transaction.

Definition
The coinbase transaction is the first transaction in every block, created by the miner to pay out the block subsidy plus the fees, with no inputs to spend.

Specified in BIP-34.

The coinbase transaction is the only place new bitcoin comes from. Every other transaction moves coins that already exist, while this one conjures an amount fixed by the protocol, currently 3.125 BTC per block since the halving on April 20, 2024, and adds the fees paid by everything else in the block. Understanding it is how you check the supply schedule yourself instead of taking anyone's word for it.

How it works

A coinbase transaction breaks the rule that every input must name an existing coin, and it is the single exception the consensus rules make.

Its one input points at nothing: an outpoint of 32 zero bytes with the index set to 0xffffffff, a combination no real output could ever have. Where an ordinary input carries a signature, this one carries an arbitrary field of 2 to 100 bytes that the miner fills however it likes. Since BIP34 became enforced at block 227,931 in March 2013, that field must begin with the height of the block being mined, which quietly solved an ugly problem: two miners producing identical empty coinbase transactions would have produced identical transaction ids, and that actually happened twice in 2010, at blocks 91,842 and 91,880. Including the height makes every coinbase unique by construction.

The outputs are ordinary. Usually there is one, paying the pool's address, and since SegWit activated there is a second carrying no value: an OP_RETURN output holding the witness commitment, a 32 byte hash that ties the block's witness data into the header. Pools that pay out on chain sometimes add hundreds of outputs, and some add a small message.

Two hard constraints apply. The total claimed may not exceed the subsidy plus the fees actually collected; claim a satoshi more and every node rejects the block, which is why nobody can quietly inflate the supply. And the coins cannot be spent until 100 more blocks are built on top, roughly 16 hours and 40 minutes. That delay exists because a coinbase output vanishes if its block loses a reorganization, and letting freshly minted coins circulate before then would spread the damage to everyone who touched them.

The very first one is worth looking up. The genesis block's coinbase input holds the text "The Times 03/Jan/2009 Chancellor on brink of second bailout for banks", the date stamp and the political statement that opens the ledger, and by a quirk of the original code its 50 BTC output can never be spent.

Why this matters when you buy bitcoin

You will never receive a coinbase output when you buy from an exchange, and that distance is worth understanding for three reasons.

The first is supply verification. Bitcoin's 21 million cap is not a promise in a document, it is arithmetic your own node performs on every block: the subsidy halves every 210,000 blocks, and any coinbase transaction claiming more than the current allowance is rejected outright. When someone tells you bitcoin's issuance could be changed, the honest answer is that every full node in the world checks this transaction independently and would fork away from a chain that got it wrong.

The second is the origin of what you are buying. Coins that come straight from a coinbase transaction have no transaction history at all, which some buyers pay a premium for, and a small industry sells so called virgin coins on that basis. For an ordinary buyer this is mostly noise. The coins arriving in your account from a regulated exchange have passed through custody and screening, and the exchange reviews on this site record which venues run heavy chain analysis on withdrawals. If a stranger offers you newly mined coins at a discount in a private trade, treat the offer, not the coins, as the risk.

The third is tax. In most jurisdictions that have published guidance, coins received from mining are income valued at the moment they are received, and only later gains are capital gains. That distinction does not touch you as a buyer, but it does explain why mining businesses sell steadily rather than holding, which is a real source of continuous sell pressure in the market you are buying into.

Reading block 840,000's coinbase transaction

The halving block is the clearest example available, because it shows both halves of the reward at once.

Block 840,000 was mined by ViaBTC on April 20, 2024. Its coinbase transaction paid out 3.125 BTC of new subsidy, the first block at the reduced rate, plus 37.6 BTC in fees collected from the roughly 3,000 other transactions in the block. Fees were more than ten times the subsidy that day because a token protocol launched at that exact height and buyers competed for position, a situation that has occurred only a handful of times in bitcoin's history.

Open it on an explorer and you can see each piece: the input with no source, the height encoded at the front of the coinbase field, the pool's payout output, the zero value witness commitment, and a total that matches subsidy plus fees to the satoshi. Nothing here is hidden, and checking the arithmetic takes a minute.

Coinbase transaction vs the coinbase field

The coinbase transaction is the whole transaction; the coinbase field is the small block of arbitrary bytes inside its single input. Miners use that field for the required block height, for pool identifiers, for soft fork signaling in the past, and occasionally for messages, and it is the only place in bitcoin where anyone can write text without paying for an output.

Neither has anything to do with Coinbase the exchange, which took its name from the term. The exchange was founded in 2012, three years after the field existed. When a support article or a tax form mentions "coinbase transactions", read the context carefully: it usually means transactions on that company's platform, not the block reward payment described here.

Not to be confused with

Frequently asked questions

Does the coinbase transaction have anything to do with Coinbase the exchange?

No. The coinbase transaction is the block reward payment built by a miner, and the term predates the company, which was founded in 2012 and borrowed the name. They share a word and nothing else.

Why can a miner not spend the block reward immediately?

Consensus rules impose a 100 block maturity, roughly 16 hours and 40 minutes. If the block were later replaced in a chain reorganization, its newly created coins would cease to exist, and the delay stops those coins circulating before that risk has passed.

How do I check that no extra bitcoin was created?

Your own node does it for every block. It computes the allowed subsidy from the block height, adds the fees paid by the block's transactions, and rejects the block if the coinbase transaction claims more. No trust in miners or developers is involved.

Read next

Related terms

More in Transactions & fees