Off-Chain: How Crypto Works Beyond the Blockchain
A blockchain is designed to create a shared, final record. However, the requirement that everything needs to go through that record ends up creating a misalignment between what the blockchain is designed to settle and what applications might actually need to process.
Nick Szabo recognized the tension as early as 1998. In his Bit Gold proposal, Szabo theorized that the settlement process could be moved to a separate network for smaller, more frequent activity. This concept would later evolve into what we now refer to as off-chain activity.
1The Different Forms of Off-Chain Activity
Off-chain is not a category of assets or transactions. Rather, it describes where something is handled: outside the ledger and consensus mechanism of a blockchain.
Moving Transactions Beyond the Blockchain
A blockchain network doesn't necessarily have to record every single transaction as it happens. Some systems design their infrastructure to process multiple transactions "off-chain" before recording the aggregate results on-chain.
The Lightning Network is one such example, where users can open a payment channel and freely transact there. Their balances will be constantly updated within this channel as transfers take place. However, only after the channel is closed will the latest balances be recorded on-chain as a single transaction.
Another example could be a centralized exchange. When users trade on an exchange, the infrastructure can update its own records without putting every single trade on a blockchain. The ledger only comes into play when a user deposits or withdraws funds, at which point the exchange will record that transfer on a blockchain, again, as a single transaction.
Handling Computation Outside the Chain
Blockchain applications can also make use of computation or application logic outside the blockchain.
For instance, a game built on a blockchain could handle frequent in-game interactions off-chain while still using the blockchain to record information that needs to be verifiable on-chain, such as ownership of in-game assets.
Data Can Be Stored Off-Chain
An NFT is a good example of an application of this concept. When buying an NFT, the blockchain records information of who owns it on-chain. Meanwhile, the file itself (typically an image) can be stored somewhere else rather than on the blockchain directly. This can be done through services such as IPFS or Arweave.
Similar infrastructure can be used to store documents or files in general. Rather than putting the whole file on a blockchain, a system can put a hash or identifier of the file on-chain. Anyone with the information can later verify that the file they have is authentic and identical to the one that was stored on-chain.
2Why Do Crypto Applications Use Off-Chain Systems?
The off-chain infrastructure provides applications with much-needed flexibility. In practice, an application can make use of both on- and off-chain infrastructure simultaneously, with each handling different parts of the application's operations.
To Avoid Unnecessary On-Chain Costs
Every transaction that takes place on a blockchain network will typically use up a certain amount of resources, and hence, may require a fee. For operations that take place frequently, this can become extremely expensive.
A centralized exchange, for instance, can process trades through its own infrastructure without submitting every trade to a blockchain. The blockchain is only used when assets need to move on or off the platform.
This combination of on- and off-chain components is often referred to as a hybrid architecture.
To Handle Data and Activity More Efficiently
The cost of using a blockchain is not the only factor to be considered. Blockchains typically have limitations in terms of the amount of data they can store and the amount of activity they can handle.
This is why not every workload is well suited to on-chain infrastructure. Operations that involve large files, frequently-updating data, and intensive computations are examples of such cases.
In a hybrid architecture, these workloads can instead be handled by off-chain infrastructure, while the blockchain is reserved for the parts of the application that need to be recorded or verified on-chain.
To Keep Information Outside a Public Ledger
A blockchain creates a shared record that can be difficult to change or remove once information has been confirmed. The thing is, not every piece of information is suited to that kind of permanent, publicly accessible record.
An application, for example, may keep account details, user preferences, order information, or other operational records in its own database. Information such as page visits, clicks, referral sources, or wallet connection events may also need to be recorded for operational purposes.
These ever-changing data, most of the time, are being kept off-chain simply because the blockchain provides no useful role for them in the first place.
3What Are the Limitations of Off-Chain Data?
Off-chain systems, despite providing greater flexibility than blockchains, still come with their fair share of risks and limitations.
It Creates Reliance on a Central System
When information is kept off-chain, users will typically not have a way to independently verify that information. Rather, they will need to rely on the system that provides that information, be it the database of the application itself or an external service that it utilizes.
Unlike on-chain activity, off-chain information can generally be changed, replaced, or erased by the entity that hosts it. For example, if an exchange keeps track of its users' trade history in its own database, users will need to rely on the exchange to keep track of that information and make it available to them.
This presents a verification problem as well as an operational one. If the system is compromised, modified, or taken down, there will not be any blockchain (or simply independent for what matters) record to verify what happened.
Applications that rely on off-chain information will, therefore, have to deal with these limitations by implementing additional safeguards to keep track of information at certain points in time. This includes mechanisms such as cryptographic hashing, redundant storage, on-chain records, and so on.
It Still Carries Data Security Risks
Keeping information private does not eliminate the risks of it being exposed. A system that is storing personal or sensitive data is still at risk of being breached, hacked, or otherwise misused.
This is why organizations may have legal and operational obligations governing how such data is collected, stored, accessed, and protected.
4A Final Word on Off-Chain Activity
Coinminutes' final goal when writing this article is not to tell you to use or avoid off-chain systems. Rather, we hope to provide you with the information needed to understand how crypto applications utilize on- and off-chain infrastructure, and the trade-offs that come with it.
Now that you've somewhat grasped some of the main concepts of off-chain activity, perhaps a more in-depth look into how different crypto applications balance on-chain and off-chain components is in queue. Or maybe following how blockchain infrastructure continues to evolve is more so your cup of tea?
If those are the kinds of crypto coverage you are looking for, check out our website at https://coinminutes.com/ for more updates.