Coinbase Field (Arbitrary Data)
Free-form bytes in a coinbase input that miners use for tags, extra nonces and messages.
Basically
The coinbase field is a small space in the first transaction of a Bitcoin block. Miners use it for the block height, pool names, mining data and messages.
Key Takeaways
- The coinbase field is the scriptSig of the coinbase transaction's sole input. It holds 2 to 100 bytes of arbitrary data because the input does not reference a previous output.
- Since BIP-34, the coinbase field must begin with the encoded block height. The remaining bytes can hold mining pool identification, extraNonce values and human-readable messages.
- The extraNonce gives modern ASIC miners more hash search space. They iterate it because they can exhaust the 4-byte header nonce in under a millisecond.
What Is the Coinbase Field?
The coinbase field is the scriptSig, or input script, of the coinbase transaction. This special first transaction in every Bitcoin block creates new coins. Unlike regular transaction inputs, its input has no previous output to reference and unlock with a signature.
The field must be between 2 and 100 bytes. Its previous transaction hash is all zeros and its output index is 0xFFFFFFFF, so miners can fill the scriptSig with their chosen data. They embed block height data required by consensus since BIP-34, pool identification tags, extraNonce values and sometimes human-readable messages. The genesis block's coinbase field famously contained a newspaper headline, and miners continue this tradition today.
How It Works
Every Bitcoin block begins with exactly one coinbase transaction. That transaction has a single input whose scriptSig is the coinbase field. No previous output needs satisfying, so the usual script validation rules do not apply and the network enforces only two rules on this field.
The miner has full discretion over any bytes remaining after the block height. Miners and pools usually divide this space among several purposes.
BIP-34: Block Height Encoding
BIP-34 addressed identical coinbase transactions across different blocks, which could cause transaction ID collisions. It activated on mainnet in March 2013 at block 227,931. BIP-34 requires the block height as the first item in the coinbase scriptSig.
The height uses a CScript push encoding: a length byte followed by the height in little-endian format. Current block heights fit in three bytes, so the encoding starts with 0x03 followed by three bytes of height data. This format accommodates blocks up to height 8,388,607, sufficient for approximately the next 150 years at current block intervals.
ExtraNonce: Expanding the Search Space
The block header contains a 4-byte, or 32-bit, nonce field with roughly 4.3 billion possible values. Modern ASIC miners operating at tens or hundreds of terahashes per second exhaust this entire range in under one millisecond.
The extraNonce value in the coinbase field lets miners continue searching for a valid block hash. Changing even one byte in the coinbase transaction alters its transaction ID, cascades through the Merkle tree and produces an entirely new Merkle root in the block header. The miner then has a fresh 2^32 nonce range to iterate, and cycling through extraNonce values effectively provides an unbounded search space.
Pool Mining and the Stratum Protocol
The pool operator constructs a coinbase transaction template for pool mining through the Stratum protocol, version 1. The operator splits it into two halves around the extraNonce region.
The server-assigned extraNonce1 partitions the search space so that no two miners in the pool duplicate work. Each miner independently iterates extraNonce2 and the header nonce, covering a large portion of the hash space before requesting new work. In Stratum v2, version rolling under BIP-320 combines with header nonce and nTime rolling to provide additional search space and reduce reliance on frequent coinbase modifications.
Famous Coinbase Messages
The coinbase field accepts arbitrary data, making it an indelible message board in Bitcoin's blockchain. Several coinbase messages have become part of Bitcoin's cultural history.
The Genesis Block
Satoshi Nakamoto's inscription in the genesis block, block 0, is the most famous coinbase message. It remains the best-known example of this practice.
The Times of London headline served two purposes. It timestamped the genesis block to prove it was not pre-mined before January 3, 2009, and offered commentary on the financial system that motivated Bitcoin's creation.
Halving Celebrations
Miners have continued the tradition at significant milestones. At the third halving at block 629,999 in May 2020, F2Pool embedded a New York Times headline echoing Satoshi's style.
The parallel between Satoshi's original message about bank bailouts and this pandemic-era headline about unprecedented monetary stimulus was deliberate. It served as a reminder of why Bitcoin exists.
Pool Identification Tags
Mining pools routinely embed ASCII identification strings in the coinbase field. Tags like /Foundry USA Pool/, /ViaBTC/ and /AntPool/ let block explorers and analytics services attribute blocks to specific pools. These tags are voluntary, with no protocol requirement to include them, but most pools use them for branding and transparency.
Limited Space
The coinbase field has a tight maximum of 100 bytes. Block height encoding uses 4 bytes at current heights and extraNonce space typically uses 4 to 8 bytes, leaving only 88 to 92 bytes for pool tags and other data. Pools must balance identification, extraNonce size and additional data within this budget.
No Consensus on Content
The BIP-34 block height requirement is the only standard governing coinbase field content. Pool tags are voluntary and can be spoofed by a malicious miner embedding another pool's tag. Block attribution based solely on coinbase strings should be cross-referenced with payout address analysis for accuracy.
Permanent Data Storage
Data written to the coinbase field is stored permanently on every full node. Individual entries are small at under 100 bytes, but inappropriate or illegal content cannot be removed. Unlike prunable OP_RETURN outputs, coinbase scriptSig data forms part of the transaction input and must be retained by all non-pruning nodes.
ExtraNonce Security Implications
The extraNonce mechanism is essential for mining viability. Eliminating the coinbase field or significantly reducing its size would leave modern ASICs without sufficient search space to mine efficiently. Protocol changes affecting the coinbase transaction must preserve adequate room for extraNonce iteration, a constraint that influences mining economics and hardware design.
Coinbase Field vs. OP_RETURN
The coinbase field and OP_RETURN both allow data embedding in Bitcoin transactions. They serve different purposes.
Why It Matters
The coinbase field sits at the intersection of Bitcoin's consensus rules, mining infrastructure and cultural history. Every block relies on it for unique transaction identification through BIP-34, and every mining operation depends on it for extraNonce search space. Developers building on Bitcoin layer-2 protocols like Spark can use it to gain insight into on-chain block production and why miners structure transactions as they do.
The coinbase field also demonstrates a broader principle in Bitcoin's design: even tightly constrained protocol spaces find creative uses. Satoshi's newspaper headline and modern pool tagging systems show how a simple 100-byte space can serve consensus, infrastructure and communication purposes simultaneously.
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.