Blockchain technology has introduced new ways to transact. Every transaction on a blockchain is verified by a network of nodes and stored forever on an immutable ledger. This technology has given rise to a booming ecosystem of DeFi, NFT platforms and dApps that make use of these on chain transactions to deliver services.
But even in the blockchain ecosystem, not every interaction is recorded on the blockchain – and for good reason. In this article, we will break down the differences between on-chain and off-chain transactions, their advantages, disadvantages, and their implications in the world of NFTs.
An on-chain transaction is a type of transaction that occurs directly on the blockchain and is verified and recorded by the network’s nodes. Once confirmed, the transaction becomes part of the blockchain’s permanent ledger. Its is stored on the blockchain, and is accessible to anyone.
Transactions carried out directly on the blockchain offer several benefits. These include:
But there are disadvantages as well:
Off-chain transactions refer to transactions that happen off the blockchain. The data of the interaction is not recorded on the blockchain itself, and is instead noted on a secondary system such as a different network or a website database. The data on the blockchain does not change, the transaction does not require to be processed by the network’s nodes and it is likely reversable.
There are a number of advantages to executing a transaction off the blockchain, even within the dApps and DeFi ecosystem:
Despite these advantages, off-chain transactions come with certain trade-offs:
Both on- and off-chain transactions have their respective benefits and drawbacks. Here is a comparison:
Element | On-Chain Transactions | Off-Chain Transactions |
---|---|---|
Security | High due to blockchain consensus mechanisms | Lower; reliant on trusted third parties |
Immutability | Fully immutable once confirmed | Not immutable until reconciled on-chain |
Costs | High, especially during periods of network congestion | Low or negligible transaction costs |
Scalability | Limited by blockchain network capacity | Highly scalable; can process large volumes fast |
The discussion of on- and off-chain interactions extends beyond just transactions: It also plays a key role in the world of NFTs and their metadata.
NFTs consist of two major components, the non-fungible token itself and the media file behind it. Since humans are visual beings, this file is usually what sets the NFT apart. It can be an image, a video, artwork and so on. For example, the metadata of Beeple’s famous “Everydays: the First 5000 Days” (sold for $69 million in 2021) is the artwork you can see below.
Non-fungible tokens can have their metadata stored either on-chain or off-chain, affecting the security, value, and longevity of the asset.
On-chain metadata refers to storing all the data related to an NFT directly on the blockchain. This includes information such as the artwork, ownership history, and transaction records. Keeping metadata on the blockchain guarantees that the data remains immutable and secure, increasing the value of the NFT.
For instance, an NFT with all its metadata stored on the blockchain is highly secure, as no third party can modify or remove the information. On the downside, storing metadata on-chain can be costly because every transaction or update requires gas fees. The more data stored, the higher the costs will be, making complex or large NFTs expensive.
The CryptoPunks NFT collection stores all relevant metadata directly on Ethereum. As a result, CryptoPunks are considered highly valuable and secure because they do not rely on external servers for their data.
The vast majority of NFTs use off-chain storage for metadata. This means they store their metadata on external servers such as cloud storage or decentralized file systems like IPFS (InterPlanetary File System). While the NFT itself is minted on the blockchain, the actual data (such as an image or video) is stored off-chain.
Storing metadata off-chain significantly reduces the transaction costs associated with creating and trading NFTs. The tradeoff is that off-chain NFTs carry higher risks because the asset’s data can change. If the off-chain storage system fails or is compromised, the NFT’s value could plummet.
An example of an off-chain NFT is the Bored Ape Yacht Club. The ownership and sale records are kept on the Ethereum blockchain but the actual images are stored off-chain.
On and off-chain transactions both have valuable functions in the dApp, NFT and DeFi ecosystem. Both approaches offer advantages that fit different use cases, be it security, transparency, and immutability, or simplicity, speed and lower costs. Nonetheless, understanding the implications of each type of transaction will help you to navigate the space more securely and with confidence.