Review and sign transactions from a single secure screen with Ledger Flex™

Discover now

Up your Web3 game

Ledger Academy Quests

  • Test your knowledge
  • Earn POK NFTs
Play now See all quests

OP_Return Meaning

Jun 5, 2024 | Updated Jun 5, 2024
OP_Return is a special data storage function in a blockchain transaction. It allows users to include arbitrary data in transactions and transmit them to the entire network.

What Does OP_Return Mean?

Sometimes known as the “nulldata” script, OP_Return is a standard locking script pattern that records arbitrary data or messages in a blockchain transaction. This locking script typically creates an explicit, verifiable, unspendable, and prunable output on the blockchain. 

Simply put, OP_Returns designate transaction outputs as provably prunable or unspendable. This means that while data can be attached to transactions, nodes can “prune” them if desired. 

How Does This Opcode Work in Bitcoin?

Bitcoin Core client version 0.9.0 introduced the OP_Return function as a compromise to allow users to attach additional information in Bitcoin transactions. Therefore, the term simply defines a special data storage function in a Bitcoin transaction. It leverages the Bitcoin network’s irreversible nature to perform special operations or store data permanently. 

Before this change, Bitcoin used standard locking scripts, such as the pay-to-public key hash (P2PKH) script, that stored transaction outputs in the Unspent Transaction Output (UTXO) set. However, this was a waste of space as the output was unspendable, thereby bloating the blockchain’s UTXO database. 

In contrast, the “nulldata” script does not create unnecessary UTXO entries, therefore serving as a more effective alternative for storing data on the Bitcoin blockchain. What’s more, it denotes a Bitcoin transaction output as invalid, implying that any BTC transaction included in an OP_Return transaction is lost forever. And since it creates a provably unspendable output, the opcode can be used for burning Bitcoins.

In addition, this opcode facilitates the creation and management of Bitcoin Runes, which are unique, fungible tokens directly issued on the Bitcoin blockchain. Runes uses this opcode to hold up to 80 bytes of the fungible token data, including the token ID, name, and symbol, in Runestones – messages stored in Bitcoin transaction outputs. 

Shamir Secret Sharing (SSS)

Shamir Secret Sharing (SSS) is a technique to break private information into smaller fragments to keep the information safe. Reconstructing the entire original data requires a certain amount of these shares.

Full definition

Ethereum 2.0

Ethereum 2.0 is an ongoing series of network upgrades aimed at addressing scalability, security, and accessibility

Full definition

Delegated Proof-of-Stake (DPoS)

Delegated proof-of-stake is a consensus mechanism which allows users of a network to vote and elect delegates who will validate transactions on that network.

Full definition