Skip to main content
12 votes
Accepted

How does OP_RETURN burn coins?

What does exactly cause the output containing OP_RETURN to be unspendable? Simply the fact that no input can possibly unlock coins which are encumbered with such an OP_RETURN-containing script. ...
Pieter Wuille's user avatar
11 votes
Accepted

Why would a miner put an OP_RETURN in a coinbase transaction?

Every segwit block has one such OP_RETURN in the coinbase transaction: It's the Merkle root of the witness tree. When the segwit softfork was activated, this included a fix to the third-party ...
Murch's user avatar
  • 76.1k
9 votes

Why does this coinbase transaction have two op_return outputs?

Coinbase transactions have some special rules not shared by other transactions: only one per block must be the first transaction in the block must have OP_RETURN output with witness commitment if ...
Murch's user avatar
  • 76.1k
8 votes
Accepted

Raw data vs information encoded in OP_RETURNs

The current Bitcoin P2P protocol has no concept of compression, though there have been some proposals to incorporate it. The transaction data is sent as-is. Some earlier discussion: https://lists....
Pieter Wuille's user avatar
8 votes
Accepted

When is OP_RETURN cheaper than OP_FALSE OP_IF?

TL;DR: OP_RETURN is cheaper for data smaller than 143 bytes. The overhead of an OP_RETURN output is at least 11 bytes: amount (8 bytes) compact size of script (at least 1 byte) script: OP_RETURN ...
Vojtěch Strnad's user avatar
6 votes
Accepted

Can a transaction have a single 0-value OP_RETURN as its only output?

Yes. Such transactions are valid and standard.
Ava Chow's user avatar
  • 71.1k
6 votes
Accepted

OP_RETURN max bytes clarification

The limitation is a relay standard, but not a consensus rule. This can be modified on a per-node basis with $ bicoind -datacarriersize flag. The consensus rule that would limit this is the max block ...
JBaczuk's user avatar
  • 7,428
6 votes
Accepted

Can Taproot be used to commit arbitrary data to chain without any additional footprint?

Yes, you can commit to data this way, but there is nothing special about Taproot here. The Pay-to-Contract construction used to tweak the root key in Taproot is generally usable, and has in fact been ...
Pieter Wuille's user avatar
6 votes
Accepted

Understanding how ordinals work with the Bitcoin blockchain. What is exactly stored on the blockchain?

Ordinals Inscriptions don't use OP_RETURN, they are embedded within the script of a taproot input. It's not just a link to a file on some website, the entire file is actually published to the ...
Vojtěch Strnad's user avatar
6 votes
Accepted

Can any Script opcode be used in the witness program, or only specific ones?

I was wondering, can one use an OP_RETURN in the witness script? Yes, you can, though I believe it is pointless. Executing an OP_RETURN opcode causes the script to return false immediately, marking ...
Pieter Wuille's user avatar
6 votes
Accepted

When was the first OP_RETURN output in a coinbase?

The first coinbase transaction that has an OP_RETURN output is in block 246816. The transaction has 288 outputs in total, and the OP_RETURN is the last one.
Vojtěch Strnad's user avatar
5 votes
Accepted

Segwit: Arbitrary data storage in witness?

Your transaction, although not invalid, is non-standard. Since it is non-standard, it will not be propagated and will be rejected for being non-standard. However this does not mean that it cannot be ...
Ava Chow's user avatar
  • 71.1k
5 votes
Accepted

What has OP_RETURN been used for over Bitcoin's history?

pourteaux answered this in a Twitter thread. The story starts in 2010, when there was debate on bitcointalk about a proposal to include a DNS service on bitcoin called BitDNS. There was concern (...
Michael Folkson's user avatar
5 votes
Accepted

What is OP_RETURN b9e11b6d?

The mentioned OP_RETURN output appears to be the footprint of merged-mining VCash, a Mimblewimble-based SHA-256d coin, with Bitcoin. I discovered this via the string 0xb9e11b6d appearing in these ...
Murch's user avatar
  • 76.1k
5 votes
Accepted

How can I recognize an OP_RETURN transaction looking only at the hex?

You can use bitcoin-cli to decode the transaction and get a sense of what is going on: bitcoin-cli decoderawtransaction 0100000000010173...275d9a2100000000 That returns: { "txid": "...
sr_gi's user avatar
  • 3,220
5 votes
Accepted

Was the lifting of the Taproot transaction size limit "accidental"? Why would ordinals want to fill a block with OP_RETURNs?

No it was not accidental, see the BIP342 section on Resource Limits Script size limit: The maximum script size of 10000 bytes does not apply. Their size is only implicitly bounded by the block weight ...
pinhead's user avatar
  • 5,164
4 votes
Accepted

Does any current SegWit or blocksize increase proposal also seek an increase in the OP_RETURN byte limit?

Currently, there are no BIPS (Bitcoin Improvement Proposals) that seek to increase the 80 byte limit as you can see here. Doing a cursory search on that repository, you can see that only a few ...
Jimmy Song's user avatar
  • 7,759
4 votes
Accepted

OP_RETURN marks transaction or output as invalid

Both. Transaction output scripts are only executed at the time they are attempted to be spent. If you try to spend an OP_RETURN output, the spending transaction is invalid, as this instruction ...
Pieter Wuille's user avatar
4 votes

Explanation of what an OP_RETURN transaction looks like

OP_RETURN is a way to get arbitrary data into the blockchain with less burden to the network As a consequence, the data will also be present in less clients, as OP_RETURN data can be pruned out. The ...
Ciro Santilli OurBigBook.com's user avatar
4 votes
Accepted

creating OP_RETURN script on bitcoin core console. i.e. with the help of commands

createrawtransaction has an option for data. That will create an OP_RETURN output with whatever hex-encoded data you want in it. So you would have a createrawtransaction command that looks something ...
Ava Chow's user avatar
  • 71.1k
4 votes
Accepted

What was the very initial value of OP_RETURN?

My understanding is that OP_RETURN was first introduced in v0.9.0 No, it was just changed to be standard in 0.9.0. If a transaction is nonstandard, miners running Bitcoin Core with default settings ...
Nick ODell's user avatar
  • 29.4k
4 votes
Accepted

OP_RETURN malleability?

The OP_RETURN is in the scriptPubKey, which is signed as part of the transaction, so it can't be altered. So it is not malleable. The known types of malleability are described in BIP 62.
Ken Shirriff's user avatar
4 votes
Accepted

Why is there an output with op-return in regtest mode?

You did, presumably. The transaction you're showing is the coinbase; it's a special transaction added by the miner. The OP_RETURN output is the SegWit block commitment. It is the Merkle root of all ...
Pieter Wuille's user avatar
4 votes
Accepted

In the bitcoin scripting language, how can I access other outputs of the transaction? Or how else can I limit how the coins may be spent?

There is no way to enforce a rule regarding the nature of an output when an input is spent. You will have to enforce this off chain in some manner, perhaps through multisig schemes where one key is ...
Raghav Sood's user avatar
  • 17.1k
4 votes

Is OP_RETURN dangerous for Bitcoin?

The method described in the post has nothing to to with OP_RETURN, but is concerned with the SIGOP limits in a block. Each block has a limit on the number of SIGOPs that can be present in ...
Raghav Sood's user avatar
  • 17.1k
4 votes

"At first, anyone could spend anyone's coins"?

He might be talking about the "1 Return" bug 1 RETURN Bug (July 2010) In July 2010, Satoshi and fellow developer Gavin Andresen received a tip-off about this bug that would have made it ...
RedGrittyBrick's user avatar
4 votes

Why are OP_RETURN transactions discouraged? Does using version or locktime make any difference?

Whether OP_RETURN transactions are discouraged or not is a matter of opinion. Personally, I think transactions should not store any data that isn't needed for the world to verify them, which is by ...
Pieter Wuille's user avatar
4 votes
Accepted

Was Bitcoin 0.3.7 actually hard-forking?

Yes. An invalid pair of arguments to CHECKSIG can become valid after the fork. This is because the scriptSig is evaluated too. scriptPubKey: OP_TRUE scriptSig: <sig> <pubkey> ...
Antoine Poinsot's user avatar
4 votes

Why isn't it possible to add an OP_RETURN (or some arbitrary script) inside a taproot script path with a descriptor?

It's not clear to me why one would want to commit to an OP_RETURN inside of a P2TR output construction, let alone inside of a descriptor. I feel like there might be a misunderstanding here. Using the ...
Murch's user avatar
  • 76.1k
4 votes

Tx with OP_RETURN with 77 bytes of data refused by node

UPDATE: The first version of this answer suggested using two data pushes, updated to use OP_PUSHDATA1. Further research has clarified the issue: OP_RETURN max data length is 80 bytes, however Maximum ...
OptOut's user avatar
  • 354

Only top scored, non community-wiki answers of a minimum length are eligible