{"id":460,"date":"2016-12-30T00:57:28","date_gmt":"2016-12-30T00:57:28","guid":{"rendered":"http:\/\/www.talkcrypto.org\/blog\/?p=460"},"modified":"2017-01-20T01:07:15","modified_gmt":"2017-01-20T01:07:15","slug":"op_return-40-to-80-bytes","status":"publish","type":"post","link":"https:\/\/www.talkcrypto.org\/blog\/2016\/12\/30\/op_return-40-to-80-bytes\/","title":{"rendered":"OP_RETURN 40 to 80 bytes"},"content":{"rendered":"<p>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 &#8220;standardised&#8221;\u00a0in v0.9.0 of the bitcoin core client on <a href=\"https:\/\/bitcoin.org\/en\/release\/v0.9.0\" target=\"_blank\">19 March 2014<\/a>. The core developers noted however that &#8220;<em>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.<\/em><\/p>\n<p>5 Jun 2013 was the initial pull request for the 80 byte OP_RETURN\u00a0<a href=\"https:\/\/github.com\/bitcoin\/bitcoin\/pull\/2738\" target=\"_blank\">https:\/\/github.com\/bitcoin\/bitcoin\/pull\/2738<\/a>\u00a0These notes go with it:\u00a0<a href=\"http:\/\/bitcoinfoundation.org\/core-development-update-5\/\" target=\"_blank\">http:\/\/bitcoinfoundation.org\/core-development-update-5\/<\/a><\/p>\n<p>On 25 Feb 2014, it was proposed to be reduced to 40 bytes as can be seen by this pull request\u00a0<a href=\"https:\/\/github.com\/bitcoin\/bitcoin\/pull\/3737\" target=\"_blank\">https:\/\/github.com\/bitcoin\/bitcoin\/pull\/3737<\/a>. The comments make an interesting read! It was then accepted (merged) into the code on 27 Feb 2014 as part of v0.9.0.<\/p>\n<p>On 16 Nov 2014 there was a pull request to have the OP_RETURN size increased &#8220;back&#8221; to 80 bytes.\u00a0<a href=\"https:\/\/github.com\/bitcoin\/bitcoin\/pull\/5286\" target=\"_blank\">https:\/\/github.com\/bitcoin\/bitcoin\/pull\/5286<\/a><\/p>\n<p><em>&#8220;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.&#8221;<\/em><\/p>\n<p>This was then accepted (merged) on 4 Feb 2015.<\/p>\n<p><a href=\"https:\/\/bitcoin.org\/en\/developer-guide#null-data\" target=\"_blank\">Bitcoin.org<\/a> summarises this well saying:<\/p>\n<ul>\n<li>Bitcoin Core 0.9.x to 0.10.x will, by default, relay and\u00a0<a class=\"auto-link\" title=\"Mining is the act of creating valid Bitcoin blocks, which requires demonstrating proof of work, and miners are devices that mine or people who own those devices.\" href=\"https:\/\/bitcoin.org\/en\/glossary\/mining\">mine<\/a>\u00a0<a class=\"auto-link\" title=\"A transaction type relayed and mined by default in Bitcoin Core 0.9.0 and later that adds arbitrary data to a provably unspendable pubkey script that full nodes don't have to store in their UTXO database.\" href=\"https:\/\/bitcoin.org\/en\/glossary\/null-data-transaction\">null data transactions<\/a>\u00a0with up to <strong>40 bytes<\/strong> in a single data push<\/li>\n<li>Bitcoin Core 0.11.x increases this default to <strong>80 bytes<\/strong>, with the other rules remaining the same.<\/li>\n<\/ul>\n<p>It seems that OP_RETURN has been there from the beginning, referenced from\u00a0<a href=\"http:\/\/bitcoin.stackexchange.com\/questions\/50414\/what-was-the-very-initial-value-of-op-return\" target=\"_blank\">http:\/\/bitcoin.stackexchange.com\/questions\/50414\/what-was-the-very-initial-value-of-op-return<\/a><\/p>\n<pre><code>case OP_RETURN:\r\n        {\r\n            pc = pend;\r\n        }\r\n        break;<\/code><\/pre>\n<p>&nbsp;<\/p>\n<p>&nbsp;<\/p>\n","protected":false},"excerpt":{"rendered":"<p>At first it is really confusing understanding the actual size<\/p>\n","protected":false},"author":1,"featured_media":637,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3],"tags":[],"class_list":["post-460","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-blockchain"],"featured_image_urls":{"full":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1.jpg",1056,379,false],"thumbnail":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1-150x150.jpg",150,150,true],"medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1-300x108.jpg",300,108,true],"medium_large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1-768x276.jpg",640,230,true],"large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1-1024x368.jpg",640,230,true],"1536x1536":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1.jpg",1056,379,false],"2048x2048":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1.jpg",1056,379,false],"chromenews-featured":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1.jpg",1024,368,false],"chromenews-large":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1.jpg",825,296,false],"chromenews-medium":["https:\/\/www.talkcrypto.org\/blog\/wp-content\/uploads\/2016\/12\/opreturn-1.jpg",590,212,false]},"author_info":{"info":["seandotau"]},"category_info":"<a href=\"https:\/\/www.talkcrypto.org\/blog\/category\/blockchain\/\" rel=\"category tag\">Blockchain<\/a>","tag_info":"Blockchain","comment_count":"1","_links":{"self":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/460","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/comments?post=460"}],"version-history":[{"count":7,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/460\/revisions"}],"predecessor-version":[{"id":698,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/posts\/460\/revisions\/698"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media\/637"}],"wp:attachment":[{"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/media?parent=460"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/categories?post=460"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.talkcrypto.org\/blog\/wp-json\/wp\/v2\/tags?post=460"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}