{"id":38092,"date":"2025-06-18T12:00:00","date_gmt":"2025-06-18T09:00:00","guid":{"rendered":"https:\/\/forklog.com\/en\/?p=38092"},"modified":"2025-12-05T06:27:26","modified_gmt":"2025-12-05T03:27:26","slug":"what-is-op_return-and-how-does-it-enable-data-storage-on-the-bitcoin-network","status":"publish","type":"post","link":"https:\/\/forklog.com\/en\/what-is-op_return-and-how-does-it-enable-data-storage-on-the-bitcoin-network\/","title":{"rendered":"What Is OP_RETURN and How Does It Allow Data Storage in the Bitcoin Network?"},"content":{"rendered":"<div class=\"wp-block-text-wrappers-cards single_card\">\n<h2 class=\"card_label\">What are opcodes in Bitcoin\u2019s blockchain?<\/h2>\n<p>Bitcoin\u2019s code is written in Script, a simple, deliberately constrained programming language. It does not support infinite loops or complex constructs, in the interests of security and efficiency. Operations are processed on a stack that follows the \u201clast in, first out\u201d (<span data-descr=\"last in, first out\" class=\"old_tooltip\">LIFO<\/span>) principle.<\/p>\n<p>Opcodes (operation codes) are instructions used to set the conditions for a transaction to execute under a given command.<\/p>\n<p>In the Bitcoin network, each opcode is written as a command prefixed with OP (<strong>OP_RETURN<\/strong>) to carry out functions across categories such as computation, validation or invalidation of transactions, and adding, removing or moving items on the stack. Some examples:<\/p>\n<ul class=\"wp-block-list\">\n<li><em>cryptography.<\/em> Hashing and cryptographic checks: <strong>OP_HASH256<\/strong> applies SHA-256 twice to the input, strengthening protection;<\/li>\n<\/ul>\n<ul class=\"wp-block-list\">\n<li><em>control flow.<\/em> Influences script execution logic: <strong>OP_VERIFY<\/strong> deems a transaction invalid if the top stack item is false;<\/li>\n<\/ul>\n<ul class=\"wp-block-list\">\n<li><em>bitwise logic.<\/em> Works with bits of the input: <strong>OP_INVERT<\/strong> inverts all bits of the input.<\/li>\n<\/ul>\n<p>Although the architecture of the first cryptocurrency\u2019s blockchain allows for up to 256 different opcodes, fewer than half are active today.<\/p>\n<p>In 2010 <a href=\"https:\/\/forklog.com\/en\/news\/my-neighbour-satoshi\">Satoshi Nakamoto<\/a> deliberately removed 16 such instructions on security grounds. One of them \u2014 <a href=\"https:\/\/forklog.com\/en\/news\/add-the-cat-why-bitcoins-potential-op_cat-upgrade-matters\"><strong>OP_CAT<\/strong><\/a> \u2014 could significantly expand <a href=\"https:\/\/forklog.com\/en\/news\/what-is-a-smart-contract\">smart contracts<\/a> on Bitcoin and make them as programmable as in Ethereum.\u00a0<\/p>\n<p>After the <a href=\"https:\/\/forklog.com\/en\/news\/what-is-taproot\">Taproot<\/a> soft fork was activated in late 2021, a potential large-memory-usage vulnerability \u2014 the main reason Satoshi removed the opcode \u2014 was eliminated. A revival of OP_CAT has been actively discussed in the community since 2023.<\/p>\n<\/div>\n<div class=\"wp-block-text-wrappers-cards single_card\">\n<h2 class=\"card_label\">What is OP_RETURN?<\/h2>\n<p>OP_RETURN is a standard output-locking script pattern that allows arbitrary data or messages to be embedded in Bitcoin transactions. As a NULLDATA implementation, it usually creates an explicit, verifiable, unspendable and prunable output.<\/p>\n<p>Put simply, the opcode marks outputs as unambiguously prunable or unspendable, while leaving the attached messages \u2014 thanks to the immutability of the blockchain \u2014 there permanently. It lets users store 83 bytes of data, akin to \u201cnotes on a receipt\u201d, without disrupting the network\u2019s monetary foundation.<\/p>\n<p>OP_RETURN was introduced in 2014 in Bitcoin Core 0.9.0 as a compromise to prevent spam related to messages in the UTXO set.\u00a0<\/p>\n<p>Early on, attaching data required sending bitcoin to one of the non-functioning addresses \u2014 burning coins. But each such transaction increased the number of outputs in the UTXO set, threatening sooner or later to overload validator nodes and the entire network.\u00a0<\/p>\n<p>OP_RETURN prevents the creation of new unspent outputs, making the opcode a more efficient way of sending data to the blockchain of the first cryptocurrency. Caution is necessary: bitcoin sent via this function is lost forever.\u00a0<\/p>\n<p>Initially, the limit on attached data <a href=\"https:\/\/blog.bitmex.com\/dapps-or-only-bitcoin-transactions-the-2014-debate\/\" target=\"_blank\" rel=\"noopener\" title=\"\">was<\/a> 40 bytes, but in 2015 it was raised to 80 bytes, and in 2016 to 83 bytes. These constraints were chosen deliberately to encourage the use of hashes rather than raw data.<\/p>\n<p>On 27 April 2025, Bitcoin Core developer Peter Todd <a href=\"https:\/\/github.com\/bitcoin\/bitcoin\/pull\/32359\" target=\"_blank\" rel=\"noopener\" title=\"\">submitted<\/a> Pull Request #32359 to the Bitcoin Core repository. The proposal included fully removing size limits for OP_RETURN outputs up to 4 MB.<\/p>\n<p>On 9 June, Bitcoin Core developers <a href=\"https:\/\/forklog.com\/en\/news\/bitcoin-core-update-to-remove-data-limit-for-op_return\">decided<\/a> to lift the cap on OP_RETURN-published data in client release v30, scheduled for October. Users will be able to set a temporary limit manually.<\/p>\n<p>The opposing Bitcoin Knots camp offers alternative Bitcoin nodes with a conservative cap. In June 2025, the share of validators of such nodes approached 10%.<\/p>\n<\/div>\n<div class=\"wp-block-text-wrappers-cards single_card\">\n<h2 class=\"card_label\">What ways exist to store data on Bitcoin\u2019s blockchain?<\/h2>\n<p>The first to attach a message to a Bitcoin transaction was the network\u2019s founder \u2014 Satoshi Nakamoto. He embedded in the genesis block the phrase: <span data-descr=\"Times, 3 January 2009: Treasury on the brink of a second bailout for banks\" class=\"old_tooltip\">\u00abThe Times 03\/Jan\/2009 Chancellor on brink of second bailout for banks\u00bb<\/span>.\u00a0<\/p>\n<p>Satoshi used the then-available option of placing information in the scriptSig field of the <span data-descr=\"the first transaction in every Bitcoin block\" class=\"old_tooltip\">coinbase<\/span> transaction. It can still carry arbitrary messages today, such as a pool name, software version or hashrate data.<\/p>\n<p>Encoding is used to place information on-chain. In the ASCII standard, each letter, number or other symbol is represented by a unique number from 0 to 127.<\/p>\n<p>For example, the letter F in decimal (dec) ASCII corresponds to 70, and a comma to 44.<\/p>\n<p>The word ForkLog in dec looks like 70 111 114 107 76 111 103, and its hexadecimal (hex) form for insertion into Bitcoin\u2019s code appears as 466F726B4C6F67.<\/p>\n<p>When browsing the blockchain via specialised software or an AI assistant such as ChatGPT, hex data can be easily decoded back into readable text. Thus, the Bitcoin blockchain stores many encoded messages.<br \/>The OP_RETURN field at this stage allows up to 83 bytes of data to be written. Since each ASCII character occupies 1 byte, around 83 characters can be placed in a single transaction. Users have to be inventive \u2014 choose concise yet expressive phrases, or simply leave an encoded <a href=\"https:\/\/forklog.com\/en\/news\/ipfs-versus-http-the-future-of-a-decentralised-internet\">IPFS<\/a> link to a web resource.<\/p>\n<\/div>\n<div class=\"wp-block-text-wrappers-cards single_card\">\n<h2 class=\"card_label\">How is OP_RETURN used?\u00a0<\/h2>\n<p>As a more efficient way to store small amounts of data, OP_RETURN can be used across various domains. With the limit set to rise to the 4 MB block size, the scope of applications will broaden.<\/p>\n<figure class=\"wp-block-image\"><img decoding=\"async\" src=\"https:\/\/lh7-qw.googleusercontent.com\/docsz\/AD_4nXc8MAuDJWUBOooivtwxn90B-aj8ft75DULAfnwX05SacL4YpstTUAeEipCua0gtHrTnQVve17zHiepI7CbLuoE9IgbIB-M7he37lFn-kvZBVz_1vqdKLyLWToiwLD_bIhyIxPqEyQ?key=_ToLMkiwSF_W8wtHTwDP1w\" alt=\"What is OP_RETURN and how does it enable data storage on the Bitcoin network?\"\/><figcaption class=\"wp-element-caption\">The Proof-of-Existance interface offers selecting a document to place in the Bitcoin blockchain for 0.00025 BTC. Data: <a href=\"https:\/\/proofofexistence.com\/\" target=\"_blank\" rel=\"noopener\" title=\"\">Proof of Existance<\/a>.<\/figcaption><\/figure>\n<p>Existing use cases include:\u00a0\u00a0<\/p>\n<ul class=\"wp-block-list\">\n<li><em>timestamp and Proof-of-Existence.<\/em> Perpetuating an important document: a hash is embedded in a transaction, thereby proving its existence at a specific moment in time immutably and verifiably;<\/li>\n<li><em>metadata and notes.<\/em> Some users add simple notes via OP_RETURN: order numbers, short messages, hashes;<\/li>\n<li><em>creating <\/em><a href=\"https:\/\/forklog.com\/en\/news\/what-are-nfts\"><em>NFTs<\/em><\/a><em>.<\/em> The technology enables the creation and storage of non-fungible tokens on Bitcoin via <a href=\"https:\/\/forklog.com\/en\/news\/what-are-bitcoin-runes-and-how-do-they-differ-from-brc-20\">Runes<\/a>. The earlier \u2014 more \u201charmful\u201d for the network \u2014 <a href=\"https:\/\/forklog.com\/en\/news\/what-are-ordinals-and-brc-20-tokens\">Ordinals<\/a> protocol will be able to switch to the OP_RETURN method after the limits are lifted. Previously, the opcode was one of the key tools behind \u201ccolored coins\u201d. It allowed individual satoshis to be \u201ccoloured\u201d (tagged) with metadata representing shares in NFTs or company tokens. This made it possible to track and transfer Colored Coins in the first cryptocurrency\u2019s blockchain and became a prototype for later developments;<\/li>\n<\/ul>\n<ul class=\"wp-block-list\">\n<li><em>potential profit from large transactions.<\/em> It may be lucrative for miners to process more \u201cheavy\u201d transactions;<\/li>\n<\/ul>\n<p><em>decentralised applications and layer-2 networks (<\/em><a href=\"https:\/\/forklog.com\/en\/news\/what-are-bitcoin-l2-scaling-solutions\"><em>L2<\/em><\/a><em>). <\/em>Sidechains or state-channel networks such as <a href=\"https:\/\/forklog.com\/en\/news\/lightning-network-faster-cheaper-bitcoin-transactions\">Lightning Network<\/a> can use OP_RETURN to embed summary off-chain state information into Bitcoin\u2019s blockchain. This helps scalable solutions that need to interact periodically with the main chain and that currently have to issue two UTXOs because of the limit.<\/p>\n<\/div>\n<div class=\"wp-block-text-wrappers-cards single_card\">\n<h2 class=\"card_label\">What are OP_RETURN\u2019s drawbacks?<\/h2>\n<p>The many ways OP_RETURN can be used to store data in the blockchain underscore the technology\u2019s innovative character. Even so, the community split signals a flipside.\u00a0<\/p>\n<p>Many believe Bitcoin\u2019s primary purpose is to be digital gold, not a data-storage platform. Excessive use of OP_RETURN could lead to undue growth in blockchain size. The bigger every node becomes, the higher the hardware requirements \u2014 potentially increasing centralisation over time.<\/p>\n<p>Some downsides of OP_RETURN:<\/p>\n<ul class=\"wp-block-list\">\n<li><em>no obvious intrinsic benefit.<\/em> While storing non-financial data via OP_RETURN may sound appealing, it does not by itself help the protocol operate: the technology does not participate in processing or validating transactions. Its utility depends entirely on external applications that can interpret and use the information as intended;<\/li>\n<li><em>high fees.<\/em> Enlarging a transaction increases its fee \u2014 especially during periods of heavy network load;<\/li>\n<li><em>possible abuse.<\/em> Data written with the opcode cannot be deleted or altered. This raises ethical and privacy questions, particularly if prohibited content is involved.<\/li>\n<\/ul>\n<\/div>\n","protected":false},"excerpt":{"rendered":"<p>The main pros and cons of adding non-financial data to Bitcoin\u2019s blockchain.<\/p>\n","protected":false},"author":1,"featured_media":38093,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"select":"1","news_style_id":"1","cryptorium_level":"1","_short_excerpt_text":"","creation_source":"ai_translated","_metatest_mainpost_news_update":false,"footnotes":""},"categories":[2113],"tags":[2115],"class_list":["post-38092","post","type-post","status-publish","format-standard","has-post-thumbnail","hentry","category-cryptorium","tag-101-technical-foundations"],"aioseo_notices":[],"amp_enabled":true,"views":"603","promo_type":"1","layout_type":"1","short_excerpt":"","is_update":"0","_links":{"self":[{"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/posts\/38092","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/comments?post=38092"}],"version-history":[{"count":2,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/posts\/38092\/revisions"}],"predecessor-version":[{"id":91846,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/posts\/38092\/revisions\/91846"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/media\/38093"}],"wp:attachment":[{"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/media?parent=38092"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/categories?post=38092"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/forklog.com\/en\/wp-json\/wp\/v2\/tags?post=38092"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}