MENU

OP_RETURN 40 to 80 bytes

December 30, 2016
0
8539
2

At first it is really confusing understanding the actual size of the OP_RETURN field. This field in a bitcoin transaction allows arbitrary data to be written to the bitcoin blockchain and was “standardised” in v0.9.0 of the bitcoin core client on 19 March 2014. The core developers noted however that “Storing arbitrary data in the blockchain is still a bad idea; it is less costly and far more efficient to store non-currency data elsewhere.

5 Jun 2013 was the initial pull request for the 80 byte OP_RETURN https://github.com/bitcoin/bitcoin/pull/2738 These notes go with it: http://bitcoinfoundation.org/core-development-update-5/

On 25 Feb 2014, it was proposed to be reduced to 40 bytes as can be seen by this pull request https://github.com/bitcoin/bitcoin/pull/3737. The comments make an interesting read! It was then accepted (merged) into the code on 27 Feb 2014 as part of v0.9.0.

On 16 Nov 2014 there was a pull request to have the OP_RETURN size increased “back” to 80 bytes. https://github.com/bitcoin/bitcoin/pull/5286

“The maximum size for OP_RETURN outputs used to be 80 bytes, then got changed to 40 bytes to be on the safe side. We have now been running with 40 bytes for about 9 months, and nothing catastrophic happened to the Blockchain, so I am proposing to increase it back to 80 bytes.”

This was then accepted (merged) on 4 Feb 2015.

Bitcoin.org summarises this well saying:

  • Bitcoin Core 0.9.x to 0.10.x will, by default, relay and mine null data transactions with up to 40 bytes in a single data push
  • Bitcoin Core 0.11.x increases this default to 80 bytes, with the other rules remaining the same.

It seems that OP_RETURN has been there from the beginning, referenced from http://bitcoin.stackexchange.com/questions/50414/what-was-the-very-initial-value-of-op-return

case OP_RETURN:
        {
            pc = pend;
        }
        break;

 

 

Leave a Comment!

Your email address will not be published. Required fields are marked *