OP_RETURN Overview
OP_RETURN: Arbitrary Data Storage
OP_RETURN is a special Bitcoin opcode that allows users to embed small amounts of metadata directly into the blockchain. Unlike other script types, OP_RETURN outputs are not meant to store money; they are meant to store Information.
1. The Data Carrier
Bitcoin is primarily a financial network, but developers quickly realized that its immutability makes it a perfect place to "Anchor" data.
-
Proof of Existence: You can hash a document and store that hash in an OP_RETURN output.
-
Protocol Signals: Layer-2 protocols (like Omni or Counterparty) use OP_RETURN to signal asset transfers that happen "on top" of Bitcoin.
2. A "Provably Unspendable" Output
When a script starts with OP_RETURN, the Bitcoin Virtual Machine immediately stops execution and marks the script as Invalid.
-
This means any Bitcoin sent to an OP_RETURN address is Burned (lost forever).
-
Because they can never be spent, nodes can safely remove these outputs from their RAM-based UTXO Set.
3. The 80-Byte Standard
To prevent the blockchain from being used as a cheap hard drive (which would bloat the network), a standard "Data Limit" was introduced.
-
Today's Limit: 80 Bytes of data.
-
This is enough for a SHA256 hash (32 bytes) plus some metadata, but too small for high-resolution images or large files.
4. The Civil War of Data
The history of OP_RETURN is controversial.
-
Purists: Some argued that Bitcoin should only be used for payments and that data embeds are "spam."
-
Pragmatists: Argued that users will find ways to hide data in multisig scripts anyway, so it's better to provide a standard, "clean" way to do it.
-
The Result: OP_RETURN became the official compromise that kept the blockchain clean while allowing for metadata.
| Feature | Standard Output (P2PKH) | Data Output (OP_RETURN) |
|---|---|---|
| Primary Use | Storing Value | Storing Metadata |
| Spendable? | Yes | No (Provably Unspendable) |
| UTXO Impact | Persistent | Pruned (None) |
| Data Limit | N/A | 80 Bytes |
In the next section, we will analyze the 80-Byte Limit in detail.
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: