Opret
The opret format is byte-identical in both lines. See Two RGB lines.
Opret is the simpler of the two deterministic Bitcoin commitment schemes. The 32-byte MPC commitment goes into a zero-value OP_RETURN output of the witness transaction.
The script​
OP_RETURN OP_PUSHBYTES_32 <mpc::Commitment>
0x6a 0x20 32 bytes = 34 bytes
That is all: no protocol tag, no version byte. The 32 bytes are the tagged MPC commitment (tag urn:ubideco:mpc:commitment#2024-01-31), and nothing in the script itself says "RGB". The verifier rejects an OP_RETURN script of any other length (bp-core 0.12.0 dbc/src/opret/spk.rs; rgb-consensus 0.11.1 src/dbc/opret/). The format is documented on the docs.rgb.info opret page.
The full output is 43 bytes: an 8-byte value (zero), a 1-byte script length and the 34-byte script.
The rules​
- First output only. The commitment must be in the first output of the transaction that is
OP_RETURNor P2TR. If a P2TR output comes before theOP_RETURN, the verifier looks for a tapret commitment in that P2TR output instead, and the opret output is ignored. See the first-output rule. - One commitment per transaction. Several contracts share it through the MPC tree.
- Placeholder, then fill. When building the transaction, the wallet adds a bare
OP_RETURNoutput (a 1-byte script). After the MPC tree is built, it replaces that output's script with the 34-byte commitment. The embed code refuses any other starting script (bp-coredbc/src/opret/spk.rs,embed_commit).
Sign and broadcast the transaction exactly as the RGB wallet produced it. If you add a P2TR output in front of the OP_RETURN, or change the OP_RETURN payload, the anchor is invalid and the RGB state moved by that transaction is lost. Also send the consignment to the recipient, and keep your own copy, before you broadcast.
Who uses it​
- Line B.
rgb-lib, the library behind most Line B wallets, always builds opret commitments: it callsset_rgb_close_method(CloseMethod::OpretFirst)(rgb-libsrc/wallet/online.rs).rgb-cmduses opret for--wpkhwallets. - Line A.
rgb create --wpkhmakes an opret wallet.--tapret-key-onlymakes a tapret one.
Opret has not been deprecated in either line.
Trade-offs against tapret​
| Opret | Tapret | |
|---|---|---|
| Extra output | One 43-byte zero-value output | None |
| On-chain visibility | A 32-byte OP_RETURN is visible and easy to fingerprint | Looks like an ordinary taproot output |
| Spending the change | Ordinary; no key tweak to back up | The tweak must be backed up, or the output can't be spent |
| Wallet support | Works with any output type for the other outputs | Needs a taproot wallet that tracks tapret tweaks |
Bitcoin relay policy​
OP_RETURN outputs are unspendable and are never added to the UTXO set. Since Bitcoin Core 0.11.0 (July 2015) the default relay limit for data carrier scripts was 83 bytes, with one such output per transaction. Bitcoin Core 30.0 (October 10, 2025) raised the default -datacarriersize to 100,000 and allows several OP_RETURN outputs per transaction (release notes). A 34-byte opret script fits under both the old and new policy. These are relay-policy defaults, not consensus rules. Background: OP_RETURN on the Bitcoin wiki.
Even when a transaction has several OP_RETURN outputs, RGB looks only at the first OP_RETURN-or-P2TR output.