Unlocking the Potential of OP_RETURN: How Bitcoin Can Store Data Efficiently in Its Blockchain

Here’s the translated and uniquely rephrased version of the text while maintaining its meaning:

1

Bitcoin’s code is crafted using a simple and intentionally limited programming language known as Script. This language is designed to avoid infinite loops and complex constructs for the sake of safety and efficiency. Operations are executed in a stack that follows a «last in, first out» (LIFO) principle.

Operation codes, or opcodes, serve as instructions that set the conditions for executing a transaction based on specific commands.

Within the Bitcoin network, each opcode is represented by a command prefixed with OP (OP_RETURN), facilitating various functions, including computations, transaction validation or cancellation, and managing elements in the stack—such as adding, removing, or moving them. Here are a few examples:

Although the architecture of the blockchain for the first cryptocurrency allows for up to 256 distinct opcodes, currently, fewer than half are actively in use.

In 2010, Satoshi Nakamoto intentionally removed 16 of these instructions for security reasons. One of these, OP_CAT, has the potential to significantly enhance the functionality of smart contracts on the Bitcoin platform, making them programmable similar to those on Ethereum.
After the activation of the soft fork Taproot at the end of 2021, a potential memory consumption vulnerability was mitigated—this was a primary reason for Satoshi’s removal of that opcode. Since 2023, the return of OP_CAT has been a topic of active discussion within the community.

2

OP_RETURN is a standardized locking script that allows users to embed arbitrary data or messages into Bitcoin transactions. As one of the implementations of NULLDATA, it typically creates an explicit, verifiable, unspendable, and removable output.

In simpler terms, this opcode designates transactions as unequivocally reversible or unspendable, ensuring that the messages attached—due to the immutable nature of the blockchain—remain forever. It allows for the storage of 83 bytes of data, akin to «notes on a check,» without disrupting the financial foundation of the network.

Introduced in 2014 within Bitcoin Core 0.9.0, OP_RETURN was developed as a compromise to prevent a barrage of spam associated with messages in UTXO.

In the early days, data attachment required sending Bitcoin to non-functional addresses—effectively burning coins. Each transaction accumulated outputs in the UTXO set, which posed a long-term threat of overwhelming validator nodes and the entire network.

OP_RETURN eliminates the generation of new unspent outputs, making this opcode a more efficient method for sending data to the blockchain of the first cryptocurrency. However, users must exercise caution; Bitcoin sent with this function is permanently lost.

Initially, the limit on attached data was set at 40 bytes but was increased to 80 bytes in 2015 and to 83 bytes in 2016. These limits were intentionally chosen to encourage the use of hashes rather than the raw data itself.

On April 27, 2025, Bitcoin Core developer Peter Todd submitted Pull Request #32359 to the Bitcoin Core repository. This proposal called for the complete removal of the size limitations for OP_RETURN outputs, allowing data sizes of up to 4 MB.

On June 9, the Bitcoin Core developers decided to lift the data volume limit for OP_RETURN in the upcoming client release v30, scheduled for October. Furthermore, users will have the option to temporarily set their own limits.

The opposing faction, Bitcoin Knots, offers alternative Bitcoin nodes with a more conservative limit. By June 2025, the number of validators using such nodes had approached 10%.

3

The first person to successfully embed a message into a Bitcoin transaction was the network’s founder—Satoshi Nakamoto. He included the phrase in the genesis block: «The Times 03/Jan/2009 Chancellor on brink of second bailout for banks.»

Satoshi used the available option to place information in the scriptSig field of the coinbase transaction. This field still allows for arbitrary messages, such as pool names, software versions, or hash rate data.

To store information on the blockchain, an encoding system is utilized. In the ASCII standard, each letter, number, or symbol is represented by a unique number ranging from 0 to 127.

For instance, the letter F corresponds to the decimal (dec) number 70 in ASCII, and a comma corresponds to 44.

When viewing the blockchain through specialized software or an AI assistant like ChatGPT, users can easily decode hex data back into readable text. This means that the Bitcoin blockchain houses a multitude of encoded messages.
Currently, the OP_RETURN field permits up to 83 bytes of data. Since each ASCII character occupies 1 byte, this allows for approximately 83 units of information in a single transaction. Users often need to be creative in selecting concise yet expressive phrases or simply include a coded IPFS link to a web resource.

4

OP_RETURN presents a more efficient method for storing small data sets that can be applied across various fields. Considering that the data limit will soon expand to a block size of 4 MB, this will greatly enhance the potential use cases.

Current use cases include:

decentralized applications and second-layer networks (L2). Sidechains or state channel networks, like Lightning Network, can utilize OP_RETURN to incorporate summary data about off-chain states into the Bitcoin blockchain. This assists scalable solutions that need to regularly interact with the main chain and release two UTXOs due to existing limitations.

5

The various applications of OP_RETURN for data storage in the blockchain underscore the innovative nature of this technology. However, the division within the community indicates a downside to this development.

Many argue that Bitcoin’s primary function should be as digital gold rather than a data storage platform. Excessive use of OP_RETURN could lead to an unnecessary increase in blockchain size. The larger each node in the network becomes, the higher the hardware requirements, which may ultimately result in increased centralization.

Some drawbacks of OP_RETURN include: