From Data to Tokens: The Critical Role of OP_RETURN

How the OP_RETURN opcode revolutionized data storage on the Bitcoin blockchain by enabling permanent embedding of information. Explore its history, debates, applications from embedding art to labeling hacker addresses, and how platforms like Bitfinity are expanding its usage.

From Data to Tokens: The Critical Role of OP_RETURN

In crypto, you have probably heard the term ‘immutability’ more often than not. But it is more than just a term, it refers to the security property of a blockchain where information stored on it cannot be easily changed once recorded. 

This immutability that defines the Bitcoin blockchain has inspired the development of new protocols that go beyond asset transfers, one of them being OP_RETURN- a script opcode that embeds data in Bitcoin transactions and depends on immutability to keep it permanently stored on the blockchain. 

Join us in this article as we explore its technical mechanics, historical debates, and its role.

Technical Mechanics of OP_RETURN

As we know a Bitcoin transaction consists of input and output. OP_RETURN operates within the Bitcoin scripting system to include arbitrary data in the transaction output. An OP_RETURN output contains the OP_RETURN opcode followed by the arbitrary data intended to be embedded in the blockchain.

This output is marked as unspendable, which means nodes can safely ignore them and therefore take up no space in their memory. All that is left is the certainty that the arbitrary data is part of the transaction and that the transaction will eventually be stored on the immutable blockchain.

Historical Context and Initial Debates

The use of OP_RETURN dates back to as far as 2013 when somebody included lyrics to the 1978 song 'Never Gonna Give You Up' by Rick Astley, the song related to the Rickrolling meme in the following transaction output.

This transaction and others of this time were regarded as non-standard as they were not relayed by ordinary Bitcoin nodes. They were just  ‘dust payments’ that bloated the blockchain’s UTXO (Unspent Transaction Output) database.

But in May 2014 all this changed when the Bitcoin Core version 0.9.0 allowed all nodes to relay OP_RETURN transactions but still paired with an important note;

This change is not an endorsement of storing data in the blockchain. The OP_RETURN change creates a provably-prunable output, to avoid data storage schemes – some of which were already deployed – that were storing arbitrary data such as images as forever-unspendable TX outputs, bloating bitcoin’s UTXO database. 

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.- Bitcoin Core

The OP_RETURN Wars 🔫

Although this version was the first to be approved to use OP_RETURN, it wasn’t a smooth transition. There was a 40-byte size limit reduced from a proposed 80-byte, which stirred up a debate and fight among developers and third-party platforms like Counterparty in an event that came to be referred to as ‘The OP_RETURN Wars’.

The OP_Return Wars of 2014 - Dapps Vs Bitcoin Transactions | BitMEX Blog
Abstract: In this piece we explore why Dapps are typically built on Ethereum rather than Bitcoin, which takes us all the way back to March 2014. We examine a debate about whether and how a Dapp protocol called Counterparty should use Bitcoin’s blockchain. This was sometimes called “The OP_Return Wars”. We explain the history of […]

In February 2015, a new version 0.11.0 was introduced, one that finally increased the size limit to 80 bytes. Not long later the version after it (0.12.0), pushed the limit to the current 83 bytes. But even still, truces on both sides were yet to be found… 

The Debate Over OCEAN Pool’s OP_RETURN Size Limit - D-Central
In the ever-evolving landscape of Bitcoin, a recent controversy has emerged, centering on the technical specifics of Bitcoin’s protocol and highlighting the complexities of its governance. At the heart of this debate is the OP_RETURN size limit in Bitcoin transactions, a topic that has sparked discussions and disagreements within the community. This controversy involves key […]

But, one thing remains, this certain immutability has inspired many to embed even data of public interest to ensure that such information remains accessible and unchanged.

The Role of OP_RETURN in Bitcoin

OP_RETURN plays an important role in the following fields:

Burning Bitcoin 🔥

Any script that starts with OP_RETURN in a Bitcoin transaction is unspendable. Therefore nodes will notice this and avoid storing its output in their databases, thus making it ideal for burning coins.

Transactions and Fees 📊

Since the 2014 approval, OP_RETURN brought, in the years that followed, a whole new wave of transactions on Bitcoin.

 

Usage and size of OP RETURN transactions (2014-2017)

From 2018 to 2019, these transactions went parabolic as they constituted about 22% of all Bitcoin transactions. This added around 10 GB to the blockchain size through 32.4 million transactions, most of which were attributed to two major users of OP_RETURN during this period; Veriblock (58% ) and Omni (40%) all with fees to pay.

But it didn't stay to this, as the years that followed saw OP_RETURN bring a paradigm shift to the Bitcoin ethos, that only relied on transactions…

Geopolitics 🌍

Crypto also was a major player in the political arena, as the OP_RETURN had been used to ensure that Bitcoin is a tool for social truth.

In early 2022 an anonymous Bitcoin user utilized OP_RETURN to label nearly 1,000 addresses they claimed belonged to Russian agencies, three weeks before the Russian invasion of Ukraine. 

Each transaction contained one of four messages, all originally in Russian, including accusations like; 

 “GRU to SVR. Used for hacking!”, “GRU to GRU. Used for hacking!”, “GRU to FSB. Used for hacking!”, and “Help Ukraine with money from the GRU Khakir”
Source

These messages accused the addresses of being involved in hacking operations by Russian agencies such as the Foreign Military Intelligence Agency (GRU), Foreign Intelligence Service (SVR), and Federal Security Service (FSB)

What was more interesting is that most of the OP_RETURN messages originated from addresses that the user also claimed, to belong to the Russian government, and were linked to Russian hacking activities, lending credibility to these claims.

Bitcoin in War: OP_RETURN Callouts of Russian Military Bitcoin Addresses Point to Blockchains’ Growing Role in Geopolitical Conflict - Chainalysis
Chainalysis found a direct, aggressive usage of Bitcoin for counterintelligence through the unusual weaponization of the OP_RETURN field. Read more here.

Embedding of such evidence hasn’t been the only connection for Bitcoin in politics and governments. So was the announcement of the 'proposal of Bitcoin as a legal currency' by El Salvador that was also written into the Bitcoin block through OP_RETURN. 

Source

OP_RETURN Being Used for Creating Tokens 👶

OP_RETURN opcode is one of the key elements in the creation of Runes on Bitcoin. 

Runes is a token standard that allows the creation of fungible tokens on the Bitcoin blockchain.

The protocol was introduced in April 2024 and provides a unique mechanism of token creation through the use of UTXO. Which helps address some of the bloating issues caused by previous token standards like BRC-20.

OP_RETURN comes in where its opcode helps Runes ‘etch’ up to 83 bytes of fungible token data such as the token ID, name, and symbol in Runestones, which are messages stored in Bitcoin transaction outputs.

Ownership 💼

This involves certifying the ownership and the timestamp of a document. By embedding a unique hash of the document in an OP_RETURN transaction, individuals and companies can copyright and provide property protection for their valuable assets.

Many websites provide this service, for example, Proof of Existence. A blockchain notary service that offers proof of existence for any document, agreement, or contract.

Creativity 🎨

Artists and creators have always been at the forefront of any revolution, the Bitcoin one is no different as they utilize its immutability for their unstoppable creativity. Through OP_RETURN creators have embedded their music, poems, and even artworks through the ASCII format in the Bitcoin blockchain.

The above roles aren't the only use cases brought to Bitcoin, OP_RETURN has also contributed to some of the outstanding transactions including; love messages, tributes, and even prayers and religious messages.  

To track the usage of OP_RETURN visit this page which updates its usage over time: OP_RETURN.org.

How to Embed Data with OP_RETURN 🚀

In this section, we will guide you on how you can also utilize the protocol and embed your data on the blockchain. Let's get started…

  1. Choose your Wallet/Tool: To begin you have to decide on which wallet you are going to use in your transactions.
  2. Craft your message: Decide on the message output you intend to relay. Bear in mind that the limit is 83 bytes which should have the following elements:
    • 1-byte output sequence number
    • OP_RETURN code (which is represented by the hex value such as,( 0x6a...)
    • Number of bytes of data to follow (up to 80 bytes)
    • Bytes 4-83 contain the data you want to store
  1. Initiate a new transaction: Once you have your message prepared, initiate a new transaction and then add the OP_RETURN Output, which will be done through an option in your chosen wallet. For example in Trezor, this is labeled as “Add OP_RETURN”. Also, some tools might require you to convert the message into a hexadecimal format.
  2. Set transaction fees: This is crucial to encourage miners to include your transaction in a block so don't forget to have a sufficient balance for the transaction fee required.
  3. Broadcast the transaction: Once all the above steps are set, broadcast it to the network. The wallets provide an option to do this through the ‘send’ icon. Then wait for miners to confirm it and once confirmed your message is permanently embedded in the Bitcoin blockchain. Well done! You just made history. 👏

Additionally, Bitcoin Core, the original Bitcoin client, allows you to craft custom OP_RETURN outputs using the NodeJS and the Bitcoin Core GUI console for more advanced control.

How Can You View Your Embedded Text?

After sending your transaction, you can view your embedded text by locating the transaction in any block explorer. For example, Blockstream Explorer and Blockchain.com.

Although some block explorers display only the hexadecimal code, many automatically convert this code back to text for easier reading. And for those that don’t, you can convert it using Dupli Checker which converts hex codes to text and vice versa.

Integrating OP_RETURN and Bitfinity’s Chain Key Technology into a Unified Framework

OP_RETURN opcode, while primarily used for simple data storage such as timestamps or proof-of-existence, has also seen more creative and extensive uses as mentioned earlier.

However, Bitcoin’s inherent limitations in scalability and transaction throughput have spurred the development of additional layers aimed at enhancing this functionality without compromising its decentralized nature.

Bitfinity and the Scaling of Bitcoin through Chain Key Technology

Bitfinity introduces a novel approach by leveraging the Internet Computer's Chain Key Fusion technology to create an EVM-compatible Layer 2 solution that operates with direct, trustless interoperability with the Bitcoin blockchain.

What Is Chain Fusion Technology and How Does It Transform Blockchain Tech?
This article explores how Chain Fusion works through decentralized signing and verification, the capabilities it unlocks, integrations so far, and the future of universal multichain interactions. We also examine Bitfinity’s EVM sidechain that brings advanced smart contracts to Bitcoin.

Unlike traditional rollups that bundle transactions off-chain to alleviate network strain, Bitfinity’s solution maintains each transaction on-chain, ensuring transparency and security, and pushing the boundaries to a theoretical throughput of 1000 transactions per second (TPS).

With Bitfinity's high throughput capabilities, the use of OP_RETURN could expand without the usual concerns over bloating the network or slowing down transaction times. This could be particularly beneficial for applications requiring immutable data storage on the blockchain, such as legal documents, intellectual property rights, or even large-scale data registries.

From Data Embedding to Smart Contract Execution

While OP_RETURN facilitates basic data embedding, Bitfinity’s EVM layer expands this into a full-fledged smart contract platform. Developers can utilize this to create more complex contracts that react to the embedded data dynamically. For instance, a contract could automatically execute or trigger another event based on the data received through an OP_RETURN transaction, thus bridging the gap between simple data storage and active, programmable transactions.

The Flippening Reversed: The Rise of Smart Contracts on Bitcoin
This in-depth article examines the history and capabilities of smart contracts, how they are being brought to Bitcoin through solutions like Bitfinity EVM, and the enormous possibilities this unlocks for building new types of decentralized applications that leverage Bitcoin’s security and scale.

Looking forward, the potential for Bitfinity to incorporate rollup technologies could further scale the capabilities of its EVM. This integration would allow for even higher throughput and more complex decentralized applications, potentially rivaling other high-performance blockchains while maintaining the decentralization and security guaranteed by Bitcoin’s blockchain.

Bitfinity Vs. Base: A Deep Dive
This comprehensive guide delves into Bitfinity’s innovative EVM and Chain Fusion technology, contrasting it with Base’s utilization of Ethereum’s ecosystem for scalability enhancements.

Conclusion

OP_RETURN has evolved from a controversial feature to an important tool in Bitcoin. Through OP_RETURN, Bitcoin has now become a symbol of truth in society, a ledger to express creativity, and above all an open system to all. As the age of building on Bitcoin continues to expand, OP_RETURN proves to be among the key elements in this.

Whether you are an advocate or an opponent of building on Bitcoin, your stance is valued, because, in the end, Bitcoin remains a decentralized system open to all in opinions, development, and transactions wherever you may come from. 

Connect with Bitfinity Network

Bitfinity Wallet | Bitfinity Network | Twitter | Telegram | Discord | Github

*Important Disclaimer: The information provided on this website is for general informational purposes only and should not be considered financial or investment advice. While we strive for accuracy, Bitfinity makes no representations or warranties regarding the completeness, accuracy, or reliability of the content and is not responsible for any errors or omissions, or for any outcomes resulting from the use of this information. The content may include opinions and forward-looking statements that involve risks and uncertainties, and any reliance on this information is at your own risk.

External links are provided for convenience, and we recommend verifying information before taking any action. Bitfinity is not liable for any direct or indirect losses or damages arising from the use of this information.