My understanding is that OP_RETURN was first introduced in v0.9.0 (https://bitcoin.org/en/release/v0.9.0).

This link (https://lists.linuxfoundation.org/pipermail/bitcoin-dev/2014-November/006917.html) mentions "initially supposed to be 80 bytes, but got reduced to 40".

This link (https://github.com/bitcoin/bitcoin/pull/5286) says: "The maximum size for OP_RETURN outputs used to be 80 bytes, then got changed to 40 bytes to be on the safe side".

Pull request https://github.com/bitcoin/bitcoin/pull/3737 talks about reducing it to 40 bytes. Was it ever in the code at 80 bytes prior?

up vote 5 down vote accepted

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 will not mine the transaction.

OP_RETURN has been around since the beginning, in 0.1.0. This was the fragment that implemented OP_RETURN in 0.1.0:

        case OP_RETURN:
        {
            pc = pend;
        }
        break;

Back then, OP_RETURN didn't necessarily cause a script to fail. You could also use it in the scriptSig of a transaction, meaning that you could steal anyone's Bitcoins by pushing a non-zero value and calling OP_RETURN. Ah, those were the days.

Your Answer

By clicking "Post Your Answer", you acknowledge that you have read our updated terms of service, privacy policy and cookie policy, and that your continued use of the website is subject to these policies.

Not the answer you're looking for? Browse other questions tagged or ask your own question.