OP_RETURN is a Bitcoin script opcode (represented as 0x6a i…
OP_RETURN is a Bitcoin script opcode (represented as 0x6a in hex) used to embed small amounts of arbitrary data directly into the Bitcoin blockchain.
learnmeabitcoin.com
What it does:
It creates a special transaction output that is provably unspendable (also called a "nulldata" output).
Any Bitcoin sent to an OP_RETURN output is effectively burned (permanently locked and cannot be spent).
The main purpose is to attach metadata or arbitrary data (e.g., text, hashes, or references) to the blockchain without interfering with normal Bitcoin transactions.
How it works:An OP_RETURN output typically looks like this in the locking script (scriptPubKey):OP_RETURN <data>
The opcode causes the script to fail immediately when someone tries to spend it.
This tells Bitcoin nodes that the output can be safely ignored for the UTXO set (it doesn't bloat the set of spendable coins).
Common uses:
Proof of existence / document timestamping (e.g., hashing a file and embedding the hash).
Metadata storage for tokens, NFTs, or protocols built on Bitcoin (like Ordinals, Stamps, or other layer-2 solutions).
Commitment schemes (anchoring data from other blockchains or systems).
Messages or small notes.
Limits:
Originally limited to 40 bytes, later increased to 80 bytes.
In 2025 (Bitcoin Core v30+), the limit was significantly relaxed or removed in some implementations, allowing much larger data.
oakresearch.io
OP_RETURN was introduced as a compromise: it gives people a clean, standardized way to store data on Bitcoin while making it easy for nodes to prune the data and avoid network abuse.
Replies
!quoted by MarkKordusic
Correction, on BSV if you pay the fee you can embed any arbitrary sized data in OP_RETURN