OP_RETURN
Bitcoin script opcode for embedding arbitrary data in transactions.
The OP_RETURN standard locking script just contains the OP_RETURN opcode followed by one or more data pushes. The standard OP_RETURN script has a maximum size limit of 83 bytes. However, there is an ongoing discussion and corresponding pull request to relax these standardness restrictions.
Key Characteristics
Data Embedding
Allows embedding arbitrary data directly in Bitcoin transactions
Provably Unspendable
Creates outputs that can never be spent, reducing UTXO set size
Size Limit
Standard limit of 83 bytes for data payload
Standard Script
Recognized as a standard transaction type by Bitcoin nodes
Script Structure
Example OP_RETURN Script
OP_RETURN
OP_PUSHBYTES_11
68656c6c6f20776f726c64
This example embeds "hello world" (in hexadecimal) into the Bitcoin blockchain.
Use Cases
Timestamping
Prove the existence of documents or data at a specific time
Asset Protocols
Embed metadata for colored coins and other asset protocols
Commitment Schemes
Store hash commitments for off-chain protocols
Protocol Signaling
Signal protocol upgrades or network parameters
Role in RGB++
OP_RETURN outputs may be used in RGB++ transactions to embed commitment data or protocol identifiers that link Bitcoin transactions to their corresponding CKB Cell operations. This enables the binding mechanism to work by providing verifiable on-chain commitments.
Advantages & Considerations
Advantages
- • Permanent data storage
- • Standard transaction type
- • Provably unspendable
- • Widely supported
Considerations
- • Limited data size (83 bytes)
- • Increases blockchain size
- • Transaction fees apply
- • Not suitable for large data
Recent Developments
There are ongoing discussions in the Bitcoin community about relaxing the 83-byte size limit for OP_RETURN outputs. Bitcoin Core Pull Request #32359 proposes changes to these standardness restrictions.
These changes could potentially allow for larger data payloads in OP_RETURN outputs, which would benefit protocols like RGB++ that need to embed commitment data.