Should you Add Metadata to your Cryptocurrency Transactions

Written by alexFR | Published 2019/08/16
Tech Story Tags: latest-tech-stories | adding-metadata-to-crypto | crypto | cryptocurrency | op_return | what-is-op_return | dash | litecoin

TLDR Bitcoin has radically changed the way we view transactions of digital assets and value. The decentralised nature of the blockchain is the base for its main strengths: security, transparency, trustworthiness and immutability. The game changed after the Bitcoin Core version 0.9.0 update in March 2014 when the OP_RETURN field was added. The OP RETURN field is an instruction of the Bitcoin scripting language which allows users to attach metadata to a transaction and therefore save it on the blockchain.via the TL;DR App

The Beginnings

Bitcoin has radically changed the way we view transactions of digital assets and value. The decentralised nature of the blockchain is the base for its main strengths: security, transparency, trustworthiness and immutability.
Just as Satoshi inscribed a message in the very first block of the Bitcoin blockchain, the adopters also realised that these inherent attributes of the blockchain technology could have advantages that go way beyond the simple transaction of currency. 
This is why different methods to store data on the blockchain were practised, causing dissatisfaction amongst many, mostly due to the inefficiencies of these methods. 
The game changed after the Bitcoin Core version 0.9.0 update in March 2014 when the OP_RETURN field was added.

What is OP_RETURN?

OP RETURN  is an instruction of the Bitcoin scripting language which allows users to attach metadata to a transaction and therefore save it on the blockchain. There can only be one OP_RETURN per transaction. They are stored in blockchain, but they are not UTXOs (unspent output from bitcoin transactions) so they will not consume RAM, but only disk space, resolving the issues and inefficiencies that the previously used methods had.
The OP RETURN became standard only after the release of the Bitcoin Core version 0.9.0 update although it had been part of the scripting language since the first releases of Bitcoin. The 0.9.0 release had a 40 bytes limit for storing data, which was increased to 80 bytes in the 0.11.0 release and to the current 83 bytes in the 0.12.0 release in February 2016.
Despite the doubling of the bytes available, 83 bytes still is still a quite small amount of data. There are two strategies to overcome this issue:
The first is to compress the data as much as possible and possibly fit it in the limit, or split it into several parts – this option limits the user to stay within the 83 bytes limit or to pay a transaction fee for each part the metadata is split into, but you have the guarantee that the information will be forever stored complete.
The second is to store a hash of the data, but keep the data itself on an external storage. The hash is the key to retrieve the data and to verify that it hasn’t been altered or tampered with. This option therefore cannot guarantee the integrity of the data, as the external storage could be damaged, but allows the user to overcome the 83 byte limit.


What are the uses of metadata in transactions? OP_RETURN use cases

Probably the most obvious application of metadata in transactions is the possibility to store or send messages and memos, just as Satoshi did in his Genesis block, but the possibilities go way beyond that.
The metadata could store instructions on how to utilise a specific asset: certify ownership and exchange of assets (who were the owners and who is the owner now), and the value and amount of the assets transferred.
The certification of documents – validating its ownership and timestamp by making the hash of a document public in a transaction, and therefore proving its existence and integrity. The same can be done to certify signatures. 
Declaring access rights and copyrights on digital arts files, like photos or music.
Stealth addresses allow for payments to be received without revealing publicly the receiver’s public key or address.
There are two lines of thought on whether op_return should be used to store metadata on the blockchain. The adopters that want to see it in use, believe that the presence of these new applications that can be provided on the blockchain will ensure Bitcoin’s long-term relevance. 
The people that are against it, believe that the blockchain should be exclusively used to store currency data transaction. Back in 2014 Bitcoin developers said that “storing arbitrary data in the blockchain is a bad idea” and recommended users store “non-currency data elsewhere.” The main issues are that the usage of metadata will bring scalability issues in the future and that there will be a higher cost for the network maintenance due to the increased amount of data stored.

OP_RETURN for Litecoin, Bitcoin cash and Dash

The OP_RETURN option is also available for the Litecoin, Bitcoin Cash and Dash blockchains. 
Although the principle is the same, there are some differences between these currencies and Bitcoin. For example Bitcoin Cash has a much higher capacity for storing data of 220 bytes, instead of Bitcoin’s 83 byte limit. 
There is also an argument about the fact that these blockchains are better positioned to handle metadata, therefore limiting the downsides of using OP_RETURN for storing data. 
With Crypto APIs you can add metadata to your transactions!
The feature is already added to the Blockchain APIs for Bitcoin, Bitcoin Cash, Litecoin and Dash. 
Take a look at our documentation to find out more: 
Disclosure: I work for Crypto APIs


Published by HackerNoon on 2019/08/16