Off-Chain vs. On-Chain NFTs: The difference and which ones to choose
Off-Chain vs. On-Chain NFTs: what is the difference between these two solutions?
Is there a better choice than the other?
In this article we want to answer these questions, with the purpose of helping you choose the best solution for your NFT project. To do so, we asked Scaling Parrots Senior Blockchain Developer Daniele Primasso for help. Daniele is an expert in this field: thanks to his studies we were able to find the perfect solution for our Play-to-Earn “Planet Wars” (which we will discuss with you later).
Are all NFTs saved on Blockchain the same?
Those most familiar with this world know that an NFT (Non-Fungible token) is a certificate of ownership on digital works, whose ownership is settled through a smart contract saved on Blockchain.
But what is really saved within the Blockchain and what is sent back to external services?
There are several answers to this question, but they mainly fall into two categories, which we will now summarize.
Most NFT projects are of the “Off-Chain” type. They are usually represented by a unique token stored within the smart contract, with an associated link to an external service where metadata and the image itself are stored.
These “Off-Chain” storage spaces are usually centralized servers within the company, thus totally controlled by the project creators or an InterPlanetary File System (IPFS), a protocol for data storage and distribution.
These NFTs, having most of their data saved on services external to the Blockchain, are therefore tightly coupled to the latter.
Obviously, this could be the cause of broken targets for some NFTs, thus finding the services they refer to turned off or attacked and being directly affected.
The most possible and easiest scenario to analyze would be an NFT that refers to a centralized server external to the Blockchain, which for whatever reason closes its doors and ceases to exist.
The owners of these NFTs will then be unable to view both the metadata and the image, as all their links will point to servers that are no longer functioning.
Hence, a major security problem is inferred that can certainly create quite a few problems in the future.
On-Chain NFTs: What are they?
Moving on now to the “On-Chain” typology. The main problem this category faces is the huge amount of information that needs to be saved to store images within a smart contract.
Due to the performance limitations and storage costs of the Blockchain this is a task that is far from easy and could make it expensive to use.
There are several solutions presented around the web but the most interesting one is the use of SVG files, a scalable and vector file format which is written via tags in xml format.
This format also turns out to be much more lightweight and readable than the more widely used jpeg or png, allowing complex drawings with relatively few lines of code.
So, what is the best option to choose between NFT Off-Chain vs. On-Chain, considering these descriptions?
On-Chain NFTs applied to a project – The case study “Planet Wars”
One of the projects where we had to carefully consider the best choice for NFTs is Planet Wars, a Play-To-Earn game developed in-house by Scaling Parrots.
Faced with the choice between Off-Chain vs. On-Chain NFTs, On-Chain development is the path we chose to follow. This is because we believe first in the benefits (already explained) of this approach: the security derived from saving the image On-Chain, thus making it eternal and not tied to an external entity; but also, in the possible developments and improvements that using the SVG format allows us.
It in fact being directly written inside the smart contract, it will also be able to communicate to it, as the Uniswap Periphery project shows us an example, moreover it is a format that allows you with a few lines of code to make beautiful representations.
In fact, our idea of NFT is to supply an image in SVG which will be influenced in part by the metadata assigned during creation (and therefore immutable) and in part by the development of the game around the planet, which will vary from time to time according to the play style of its owner.
What will appear will thus be a potentially eternal NFT, tied only to the security of the blockchain itself and whose appearance will be partly unique and partly influenced by its use within the game that will be developed over the years. This is certainly a delicate mix to manage but we believe may prove to be the next trend in the future of NFTs.
Off-Chain vs. On-Chain NFTs: which ones to choose?
Therefore, let’s do a comparison of Off-Chain vs. On-Chain NFTs. First, however, it is only fair to give a quick recap, to get an overview of the pros and cons of both.
Low data usage on the chain (and thus better performance and cheaper transactions)
Image is modifiable at any time: more control over possible updates
Two levels of risk: that of the chain and that of the centralized server
High possibility of corrupt files in the long term
Only one level of risk: related to the chain to which it belongs
Truly immutable image: it is imprinted on the Blockchain throughout
SVG/smart contract dialogue for future developments
Image not modifiable afterwards
File must be small in size to ensure chain efficiency (that is why SVG format is ideal)
Then, which ones to choose? Well, the answer would seem to lean more toward an On-Chain solution, but it is good to consider so many factors, foremost among them the most crucial: the weight of the image.
So, as we have always professed at Scaling Parrots, there is not a best or worst choice a priori. Rather, there is a reasoned and strategic choice based on the needs of the project.
If you have an NFT project in mind, we can help you out: we have field-tested both solutions and can give you an unbiased view on which is the best way to go. You can book your first hour of free Blockchain consulting in the button below.
Now that you have a clearer understanding of the differences and the pros and cons of Off-Chain vs. On-Chain NFTs, you can make a more efficient decision about your Non-Fungible Token project.
Speaking of Blockchain: sign up for our “Juicy Jungle” newsletter! We’ll send you our free eBook “Blockchain for Business” right away and you’ll receive the most important news from the Blockchain world every week, carefully selected by our team.