OP_RETURN is a Bitcoin Script opcode whose modern use includes creating provably unspendable transaction outputs that can carry data. Bitcoin Core calls this output class NULL_DATA. It is one of the seams where three different things are easy to blur together: Bitcoin's consensus rules, a node's transaction-relay policy, and the application protocols that interpret the bytes. Bitcoin Core output types — direct repository record · Bitcoin Script interpreter — direct repository record
What the opcode does
In current Bitcoin Core, executing OP_RETURN fails the script with SCRIPT_ERR_OP_RETURN. The output classifier separately names unspendable OP_RETURN scripts NULL_DATA. A transaction can therefore commit bytes in an output that no future transaction can successfully spend under the current script rules. Current interpreter — direct repository record · Current output classification — direct repository record
Calling this an “OP_RETURN field” is convenient but technically loose. It is not a special metadata field added beside a Bitcoin transaction. It is script in a transaction output.
This has a direct dust-policy consequence. Bitcoin Core's GetDustThreshold() returns zero for provably unspendable scripts, rather than estimating a future spending input. An OP_RETURN output can still be subject to separate data-carrier and transaction-relay limits. This differs from tiny but spendable outputs, which continue to occupy UTXO-set state after confirmation until spent. Core 31.0 dust computation — direct source
The earliest tagged source currently pinned by BOMB, Bitcoin v0.1.5, already contains a case OP_RETURN branch in script.cpp. Its exact early execution semantics should not be silently projected forward from modern Core, but the source is enough to reject the simpler claim that the opcode itself first appeared in 2014. Bitcoin v0.1.5 script interpreter — direct repository record
Consensus, relay policy and application meaning
These are different layers.
- Consensus
- A block and the transactions inside it must satisfy Bitcoin's consensus rules. The existence of
OP_RETURNin Script is part of that validation environment.
- Relay and mining policy
- Transaction standardness covers the additional rules Bitcoin Core applies to transactions it will normally admit to its mempool, relay to peers and offer to its block-template logic. Those defaults can change between releases without changing Bitcoin consensus. Node operators and miners can also choose different policies.
- Application protocol
- A system such as Open Assets Protocol can assign its own meaning to the bytes carried by an OP_RETURN output. Bitcoin validates the transaction; the application decides that a particular byte sequence means an asset marker, commitment, message or something else.
This distinction became especially visible in 2025. A Bitcoin Core contributor statement about transaction relay said Core developers view relay policy as a tool for accurately predicting and propagating transactions miners are likely to include, while explicitly saying that this position is not an endorsement of non-financial data use. That is a later first-party policy rationale, not a description BOMB should retroactively place in the mouths of 2013 developers. Bitcoin Core relay-policy statement — first-party
From opcode to standard data carrier
OP_RETURN in the script interpreter. This establishes that the opcode predates its later use as a standard data carrier. Direct source recordIsStandard() whitelist for recognized transaction templates. Default mempool, relay and block-construction policy tightened while blocks containing non-standard transactions remained consensus-valid. A source comparison with 0.3.17 shows that narrower non-standard mempool restrictions already existed, so this was an expansion and formalization of policy rather than its creation from nothing. See Transaction standardness. v0.3.17 source · v0.3.18 source · Contemporary 0.3.18 discussionOP_PUSHDATA1 and simplified a prospective standard-data BIP. Garzik linked PR #3737 later that day; it merged on 26 February. This all happened before 0.9.0 shipped, so 40 bytes, not 80, was the first released default standard allowance. Contemporary bitcoin-development thread · Direct repository record-datacarrier and -datacarriersize, making the node's relay/mining treatment of these outputs explicitly configurable. Release notes — direct repository record-datacarriersize rose to **100,000 bytes**, effectively making transaction size the tighter limit, and multiple OP_RETURN outputs became standard for relay and mining. Operators could still set -datacarriersize=83 to recover the previous size policy. Release announcement · Release notes · Policy change — direct repository recordWhy 40 bytes? The recovered mailing-list record
PR #3737's terse “Per mailing list discussion” note turns out not to be a dead end. The surviving 24 February 2014 bitcoin-development thread preserves the disagreement in unusually useful detail. Contemporary mailing-list thread
The 40-byte choice was not justified by one single rule. Wladimir's proposal combined a concrete cryptographic envelope, an 8-byte identifier plus a 32-byte hash, with a deliberately cautious social boundary: start small and expand later if the carrier proved useful without obvious abuse. Gavin Andresen supplied a separate implementation convenience, since a 40-byte payload would not require OP_PUSHDATA1. Mark Friedenbach likewise argued that common cryptographic commitments fit within roughly that size and wanted the carrier to signal payment-related uses rather than general-purpose data publication.
Other participants challenged the restriction from the opposite direction. Andreas Petersson argued that if determined applications could carry more data more cheaply through multisig outputs, an undersized OP_RETURN carrier could push them toward the less-prunable form. Gregory Maxwell accepted that substitution risk but argued that adoption norms mattered too and that a cautious limit could be relaxed later more easily than a permissive one could be tightened. Troy Benjegerdes pushed a more fee-oriented view: if transaction fees did not cover the cost of arbitrary data, the fee structure was the problem rather than the data category.
The thread also leaves one piece unresolved. Garzik said the reduction proposal had already been circulating on IRC before he brought the subject to the mailing list. The mailing-list record now explains why 40 bytes won in public discussion; it does not yet preserve the preceding IRC path or identify who first proposed that exact value there.
What “prunable” meant in 0.9
The 0.9.0 release note used the phrase “provably-prunable output.” The target of that design argument was the UTXO database: if a node can prove an output can never be spent, it does not need to retain that output as a candidate future coin.
That should not be misread as “the data disappears from Bitcoin.” The transaction remains part of the block history. The historical point is narrower and more interesting: developers were trying to reduce one particular long-lived cost of data-embedding schemes by making the unspendability recognizable to nodes. Contemporary release record
Why metaprotocols cared
OP_RETURN offered a compact place for application protocols to put markers or commitments without pretending that the output was an ordinary spendable coin.
Counterparty exposes the incentive problem that accompanied that convenience. During review of PR #2738 in 2013, Peter Todd argued that a data carrier which was harder or less useful than alternative standard transaction forms could push applications back toward CHECKMULTISIG and other encodings that left a larger UTXO burden. Pieter Wuille described the same tension from another side: arbitrary data was undesirable, but if users would publish it anyway, making the provably-unspendable form available could reduce one persistent cost. Contemporary Core review
When Core 0.9.0 arrived with a 40-byte standard allowance, Counterparty still needed larger messages and continued using multisig-style encodings. The resulting March 2014 dispute is therefore not cleanly described as “OP_RETURN versus no data”. It was partly a dispute over whether the least harmful carrier should be deliberately narrow, and what predictable users would do when it was too narrow. On 21 March, Jeff Garzik explicitly distinguished non-standard relay policy from Bitcoin consensus, while Peter Todd distinguished his technical objection to bare multisig from other participants' reasons for wanting it filtered. Contemporary discussion
Open Assets Protocol is a clean example. Its early specification used OP_RETURN marker outputs while the actual colored-asset meaning was interpreted by Open Assets-aware software. The marker did not make Bitcoin understand shares, coupons or issuer-defined assets; it gave the higher layer a recognizable byte sequence inside an otherwise ordinary Bitcoin transaction. Early Open Assets specification
CoinSpark took a related but distinct route in September 2014: it encoded asset genesis, transfers and payment references in compact OP_RETURN metadata, while retaining separate asset identifiers and requiring CoinSpark-aware interpretation. Its January 2015 messaging extension placed a server locator and a content hash on-chain, not the full attached document or message. This is a useful historical distinction between an on-chain message commitment and on-chain message storage. Library release chronology · First-party message-server description
Runes is a later and deliberately different use of the same Bitcoin output mechanism. Its launched protocol identifies a runestone with OP_RETURN OP_13; Runes-aware software decodes the payload and tracks UTXO-held Rune balances while Bitcoin itself continues to validate only the transaction and script. Current Runes implementation guide
That same architecture appears repeatedly in Bitcoin's application-layer history: Bitcoin provides ordering and transaction inclusion; another system decides what selected bytes mean. Colored coins, Counterparty and later metaprotocols differ sharply in their state models, so sharing Bitcoin as a message substrate does not make them the same protocol family.
The 2014 and 2025 caveats rhyme, but they are not identical
There is a useful archival tension across eleven years of Core material.
The 2014 release note said standardizing OP_RETURN was not an endorsement of storing arbitrary data and justified the change as a way to reduce UTXO-set harm from schemes that were already happening. In 2025, Core contributors again said their relay position was not an endorsement of non-financial data, but argued that relay policy should realistically track transactions with sustained economic demand that miners would include anyway. 2014 release record · 2025 contributor statement
The continuity is the refusal to call relay policy an endorsement. The rationale around what good relay policy should accomplish changed with the network around it. BOMB should keep both statements in their own time rather than compressing them into one timeless “Bitcoin Core position.”
Bitcoin Stamps and the opposite UTXO incentive
Bitcoin Stamps deliberately explored the side of the trade-off that OP_RETURN's 2014 relay policy sought to avoid. Its original image format used Counterparty transactions carrying data in bare-multisig-style outputs, while its later OLGA format puts data chunks in the 32-byte program fields of P2WSH-shaped outputs. The authors considered continued UTXO retention a permanence feature. Contrast that with OP_RETURN, whose provably unspendable output can be left out of chainstate. Classic project rules · OLGA proposal · Core pruning architecture
This distinction must not be overstated: a pruning node retains the current UTXO set while discarding old block files; it does not selectively erase only Ordinals witness bytes, and the Stamps rules cannot force a spent output to stay in the UTXO set forever. See Bitcoin Stamps for the February-to-March 2023 specification change and subsequent per-protocol activation heights.
Related pages
Open research
Pin the earliest confirmed on-chain transaction output using OP_RETURN and distinguish pre-standard consensus-valid uses from the 0.9-era standard data-carrier pattern.
Trace which early application protocols adopted OP_RETURN immediately after 0.9.0 and which continued using alternative encodings because of relay limits or miner policy.
Recover the IRC discussion Jeff Garzik said preceded the 24 February 2014 mailing-list thread, including who first proposed reducing the 80-byte development value and whether 40 bytes had already emerged as the preferred number before the public list discussion.