§ 06

§ 06 · Script

OP_RETURN

An output for data that can never be spent

An OP_RETURN output is a note pinned to a transaction. It carries bytes, usually a small amount of data, and no one can ever spend it.

The trick is in the first byte. 0x6a is the opcode OP_RETURN, which ends a script as failed. A locking script that starts with it can never be satisfied, so the output is provably dead from the moment it’s created. Nodes know that, and never bother remembering it.

Try it

Pick the OP_RETURN example and hover its middle output.

Transaction decoder

Paste raw hex: every byte colored and explained

Carries an OP_RETURN data output (block 130,809) 253 bytes
0200000000010145e83fb8acdfc3cbe7a71b17fe2a05a807fc2222100aab42081ad4e40f344ead0200000000fdffffff03b881db2f0b000000225120894b4852db6a243fb705236b47da5ccb18c3ba896c5b0838b9d5c2e93a2efcf40000000000000000276a2550524c5501be1688fc1b2fc0671d18c396f9daed531579848f1f8cf002d1579ee333d9ae8787214249d7050000225120a26b47f694abf29858cc7d1eb44319fc31c12f8bd093d042003b27f9ba91731b0140834fa0d9eb91ac59fcf21e911b43eca33608b6b8393c6a304a959cfaeebbb505ff38d095905be416e78c70ae3fe6d018d823d6ff36467f3199bea33f91976c7100000000
Hover or focus the bytes, or a row below, to name each field
All 22 fields
FieldBytesValue
Versionversion4@02int32 little-endian. Pearl wallets and pearld coinbases use version 1; relay policy accepts 1-2.
Markermarker1@40x00Segwit marker (BIP-144): says witness data follows the outputs.
Flagflag1@50x01Witness flag; 0x01 is the only value Pearl accepts.
Input countvin.length1@61CompactSize number of inputs.
Previous txidvin[0].txid32@7ad4e340fe4d41a0842ab0a102222fc07a8052afe171ba7e7cbc3dfacb83fe845The transaction being spent, stored byte-reversed (internal order); shown here in normal display order.
Output indexvin[0].vout4@392Which output of that transaction is spent (uint32 LE).
scriptSig lengthvin[0].scriptSig.length1@430Always 0 for non-coinbase inputs in Pearl: every spend uses the witness instead.
Sequencevin[0].sequence4@440xfffffffdsignals opt-in replace-by-fee (BIP-125).
Output countvout.length1@483CompactSize number of outputs.
Amountvout[0].value8@4948,047,555,000 grains (480.47555000 PRL)int64 little-endian, in grains (1 PRL = 100,000,000 grains).
Script lengthvout[0].scriptPubKey.length1@5734CompactSize length of the locking script.
Locking scriptvout[0].scriptPubKey34@58prl1p3995s5kmdgjrldc9yd450kjuevvv8w5fd3dssw9e6hpwjw3wln6qstfvctOP_1 OP_PUSHBYTES_32 <output key Q>: a Taproot output.
Amountvout[1].value8@920 grains (0.00000000 PRL)int64 little-endian, in grains (1 PRL = 100,000,000 grains).
Script lengthvout[1].scriptPubKey.length1@10039CompactSize length of the locking script.
Locking scriptvout[1].scriptPubKey39@101OP_RETURN data (unspendable)OP_RETURN data carrier: provably unspendable, never enters the UTXO set.
Amountvout[2].value8@1406,422,205,178,247 grains (64222.05178247 PRL)int64 little-endian, in grains (1 PRL = 100,000,000 grains).
Script lengthvout[2].scriptPubKey.length1@14834CompactSize length of the locking script.
Locking scriptvout[2].scriptPubKey34@149prl1p5f450a5540efskxv050tgscelscuztut6zfaqssq8vnlnw53wvdsmw4yvsOP_1 OP_PUSHBYTES_32 <output key Q>: a Taproot output.
Witness itemswitness[0].length1@1831Number of witness stack items for input 0.
Schnorr signature lengthwitness[0][0].length1@18464CompactSize length of this witness item.
Schnorr signaturewitness[0][0]64@185834fa0d9eb91ac59fcf21e911b43eca33608b6b8393c6a304a959cfaeebbb505ff38d095905be416e78c70ae3fe6d018d823d6ff36467f3199bea33f91976c7164-byte BIP-340 signature (R.x ‖ s) with SIGHASH_DEFAULT: a Taproot key-path spend.
Locktimelocktime4@24900: no time lock.
txidSHA256d without witness, reversed

4ce980a19e940dadd3ecb0ca5c59e05880c252c254ae5f690bfaac7d6c642e0c

wtxidSHA256d of everything, reversed

b72fd7fd902f1543319533cb080daf996bf49190157a23412b3e797336f270fe

Size
253 B
vsize
202 vB
185 + ⌈68 / 4⌉
Version
2
Locktime
0
Fee
10,200 grains
50.5 grains/vB
Total out
64,702.52733247 PRL

1 input

#0 Spends

ad4e340fe4…acb83fe845 : 2

sequence 0xfffffffd

  • Schnorr signature 834fa0d9…91976c71 64 B

3 outputs

#0 480.47555 PRL Taproot (P2TR, witness v1)

prl1p3995s5kmdgjrldc9yd450kjuevvv8w5fd3dssw9e6hpwjw3wln6qstfvct

48,047,555,000 grains

#1 0 PRL OP_RETURN data (unspendable)

6a2550524c5501…579ee333d9ae87

0 grains

#2 64,222.05178247 PRL Taproot (P2TR, witness v1)

prl1p5f450a5540efskxv050tgscelscuztut6zfaqssq8vnlnw53wvdsmw4yvs

6,422,205,178,247 grains

Runs in your browser · nothing is sent src/lib/tx.ts · real txs from mainnet

What does an OP_RETURN output look like?

Here is a real one, in a transaction from block 130,809:

Carries an OP_RETURN data output 253 bytes
02000000 00 01 01 45e83fb8acdfc3cbe7a71b17fe2a05a807fc2222100aab42081ad4e40f344ead 02000000 00 fdffffff 03 b881db2f0b000000 22 5120894b4852db6a243fb705236b47da5ccb18c3ba896c5b0838b9d5c2e93a2efcf4 0000000000000000 27 6a2550524c5501be1688fc1b2fc0671d18c396f9daed531579848f1f8cf002d1579ee333d9ae87 87214249d7050000 22 5120a26b47f694abf29858cc7d1eb44319fc31c12f8bd093d042003b27f9ba91731b 01 40 834fa0d9eb91ac59fcf21e911b43eca33608b6b8393c6a304a959cfaeebbb505ff38d095905be416e78c70ae3fe6d018d823d6ff36467f3199bea33f91976c71 00000000
Field Bytes Value
Version version 4 @0 2 int32 little-endian. Pearl wallets and pearld coinbases use version 1; relay policy accepts 1-2.
Marker marker 1 @4 0x00 Segwit marker (BIP-144): says witness data follows the outputs.
Flag flag 1 @5 0x01 Witness flag; 0x01 is the only value Pearl accepts.
Input count vin.length 1 @6 1 CompactSize number of inputs.
Previous txid vin[0].txid 32 @7 ad4e340fe4d41a0842ab0a102222fc07a8052afe171ba7e7cbc3dfacb83fe845 The transaction being spent, stored byte-reversed (internal order); shown here in normal display order.
Output index vin[0].vout 4 @39 2 Which output of that transaction is spent (uint32 LE).
scriptSig length vin[0].scriptSig.length 1 @43 0 Always 0 for non-coinbase inputs in Pearl: every spend uses the witness instead.
Sequence vin[0].sequence 4 @44 0xfffffffd signals opt-in replace-by-fee (BIP-125).
Output count vout.length 1 @48 3 CompactSize number of outputs.
Amount vout[0].value 8 @49 48,047,555,000 grains (480.47555000 PRL) int64 little-endian, in grains (1 PRL = 100,000,000 grains).
Script length vout[0].scriptPubKey.length 1 @57 34 CompactSize length of the locking script.
Locking script vout[0].scriptPubKey 34 @58 prl1p3995s5kmdgjrldc9yd450kjuevvv8w5fd3dssw9e6hpwjw3wln6qstfvct OP_1 OP_PUSHBYTES_32 <output key Q>: a Taproot output.
Amount vout[1].value 8 @92 0 grains (0.00000000 PRL) int64 little-endian, in grains (1 PRL = 100,000,000 grains).
Script length vout[1].scriptPubKey.length 1 @100 39 CompactSize length of the locking script.
Locking script vout[1].scriptPubKey 39 @101 OP_RETURN data (unspendable) OP_RETURN data carrier: provably unspendable, never enters the UTXO set.
Amount vout[2].value 8 @140 6,422,205,178,247 grains (64222.05178247 PRL) int64 little-endian, in grains (1 PRL = 100,000,000 grains).
Script length vout[2].scriptPubKey.length 1 @148 34 CompactSize length of the locking script.
Locking script vout[2].scriptPubKey 34 @149 prl1p5f450a5540efskxv050tgscelscuztut6zfaqssq8vnlnw53wvdsmw4yvs OP_1 OP_PUSHBYTES_32 <output key Q>: a Taproot output.
Witness items witness[0].length 1 @183 1 Number of witness stack items for input 0.
Schnorr signature length witness[0][0].length 1 @184 64 CompactSize length of this witness item.
Schnorr signature witness[0][0] 64 @185 834fa0d9eb91ac59fcf21e911b43eca33608b6b8393c6a304a959cfaeebbb505ff38d095905be416e78c70ae3fe6d018d823d6ff36467f3199bea33f91976c71 64-byte BIP-340 signature (R.x ‖ s) with SIGHASH_DEFAULT: a Taproot key-path spend.
Locktime locktime 4 @249 0 0: no time lock.
txid
4ce980a19e940dadd3ecb0ca5c59e05880c252c254ae5f690bfaac7d6c642e0c
Size
253 bytes · 202 vbytes
Block
130,809
Fee
10,200 grains
Output 1 of 4ce980a1…2e0c
Field Size Description
amount 8 0000000000000000: 0 grains.
script length 1 27 = 39 bytes.
OP_RETURN 1 6a: this output can never be spent.
push 37 1 25: the next 37 bytes are data.
tag 4 50524c55, ASCII "PRLU".
data 33 01 then 32 bytes, be1688fc…33d9ae87.

What does it mean? Nobody has said. Twelve outputs with this “PRLU” tag appeared in 200 recent blocks, all from one large address, along with one tagged “PRLB” whose payload looks like a 20-byte Ethereum-style address padded with zeros. They may be bridge or custody messages; neither tag appears in Pearl’s own software. Pearl doesn’t care: to the protocol it’s 39 bytes nobody can spend.

What are the rules?

Size
1 byte or more
Type
Locking script
Format
6a ‖ anything

Pearl’s consensus rule is short:

node/txscript/standard.go Go
func isNullDataScript(script []byte) bool {
	return len(script) >= 1 && script[0] == OP_RETURN
}

Anything after 0x6a is allowed: pushes, other opcodes, bytes that don’t even parse. Pearl’s own comment notes this is looser than Bitcoin Core, which requires the rest to be data pushes.

Consensus (blocks) Policy (relay)
Size No limit beyond the transaction’s (1,000,000 vB) No byte cap; a standard transaction is at most 100,000 vB
Outputs per transaction Any number At most one
Contents after 6a Anything Anything
Amount Any (a non-zero amount is burned) Any; exempt from the dust limit

These were tested against Pearl’s own code: a bare 6a, an 81-byte push, a 1,000-byte push, 6a ac (OP_RETURN then OP_CHECKSIG) and a 1-PRL burn all pass both consensus and policy. Two OP_RETURN outputs in one transaction pass consensus but fail policy.

How is more data written?

The push opcode after 6a grows with the data, exactly as in any script:

Data size Script starts Example
1 to 75 bytes one length byte, 01–4b 6a 25 … for the 37-byte PRLU payload
76 to 255 bytes 4c (OP_PUSHDATA1) + 1 length byte 6a 4c 51 …: 81 bytes, an 84-byte script
256 to 65,535 bytes 4d (OP_PUSHDATA2) + 2 length bytes, little-endian 6a 4d e803 …: 1,000 bytes, a 1,004-byte script

Both of those larger examples pass Pearl’s consensus and relay checks. Since the data is never executed, the 520-byte limit on stack items doesn’t apply to it.

What does it cost?

Output bytes are base bytes, counted in full. The PRLU output is 8 (amount) + 1 (length) + 39 (script) = 48 bytes, so it adds 48 vbytes to its transaction: 48 grains at the minimum relay fee, or about 2,400 at the 50 grains per vbyte most transactions paid that day.

Why do nodes forget them?

Because they can’t be spent. Every other output joins the UTXO set and stays until someone spends it, which may be never. An OP_RETURN output is skipped when the set is updated, so data stored this way costs nodes disk space in the block history, but not in the set of live coins that every node must keep fast.

Data still isn’t free. Output bytes are base bytes, counted in full toward vsize, so each byte of OP_RETURN data costs at least a grain at the minimum relay fee.

Where else does OP_RETURN appear?

  • The witness commitment. Every coinbase in a block with witness data has an output 6a 24 aa21a9ed followed by 32 bytes, committing to all the block’s witnesses. In 200 recent blocks there were 192 of them. See coinbase.
  • The genesis block. Pearl’s very first coinbase pays 0 grains to a bare 6a, its only output. There was no premine to spend.
  • Merged mining. Some coinbases carry a tag, such as OP_RETURN "NAC*" plus 32 bytes from one merged-mining pool. Coinbases skip relay policy, so they can carry this alongside the witness commitment.
  • Message signing. Oyster’s signmessage signs a small virtual transaction whose output is OP_RETURN <your message>. It never goes on chain.

Make a guess

Could you send 1 PRL to an OP_RETURN output by mistake and get it back later?

Think of your answer first, then check it.

Answer No. It's gone for good.

Consensus allows a non-zero amount on an OP_RETURN output, and relay policy accepts it (it’s exempt from dust). But the output can never be spent, so those grains are destroyed. Wallets pay to addresses, and an OP_RETURN output has no address, so this only happens with hand-built transactions.

The codex

Suggested

Up and down arrows move through the results, Enter opens one, Escape closes. Anywhere on the site, slash or Command K opens this search, and the square brackets [ and ] go to the previous and next page.