Blockchain, at its core, is valuable because it’s a secure method for storing data. Bitcoin functions as a currency because its immutable ledger records data on every transaction, ensuring that no one can claim to own a token they’ve already spent. Industries ranging from healthcare to logistics to energy generation are exploring blockchain because it serves as a source of shared, agreed-upon truth via data stored on the blockchain network.
However, data can also be a hindrance to blockchain users and developers. Decentralized applications (DApps) built on Ethereum often need to access vast amounts of data, but an October 2017 analysis determined that storing one gigabyte of data on Ethereum would cost about $5 million.
In most blockchain networks, all nodes must re-verify the state of the network after each transaction–which means the more data the network contains, the slower and more resource-intensive each transaction becomes. Increasing the speed at which the Bitcoin network can verify data is one of the main arguments proponents for increasing block size limits offer.
Opponents of increasing Bitcoin block sizes, and many other players spread across the blockchain world, instead turn to off-chain solutions. Off-chain data storage and processing may sound antithetical to blockchain’s principles of decentralization. Yet, many projects have found ways to combine the unique qualities of blockchain networks with the freedom of off-chain storage, below you will find few of these projects:
Lightning uses off-chain interactions to enable quick transactions between nodes. When two users want to initiate a lightning transaction, they can open up an off-chain lightning channel by creating a two-signature wallet and writing the wallet’s address to the blockchain. Users send and receive funds through the wallet while signing balance sheets attesting to who owns portions of the wallet’s contents. When they are ready to close the payment channel, the wallet’s balance is recorded on the blockchain. This system effectively defers writing transactions to the blockchain until a financial relationship between parties has paused or closed, then recording the result of those transactions.
Dispatch Labs’ new protocol combines an off-chain storage system (the Dispatch Artifact Network) with a dedicated, lean blockchain to manage it. Uploaders can share data through the Dispatch system by writing a cryptographic hash to the Dispatch blockchain. The hash also attaches to the uploaded data artifact (e.g., a database or a video file). The uploader can keep the artifact on their computer or, if it’s a particularly popular object, hire the storage and distribution services of a “farmer.” Because of its hash, the only possible way to access the artifact is to gain access to its on-chain hash through legitimate transactions. A musician using Dispatch to sell and distribute mp3s of their work, for example, could accept payments on-chain in exchange for access to the hash, which would let listeners access and download the file.
Plasma is a promising scalability solution for Ethereum Dapps, which require even more data than Bitcoin’s transaction logs. With Plasma, developers can build smart contract “roots” for child chains, which can break off from the main Ethereum blockchain. Child chains do not have to re-verify with the Ethereum main chain after every transaction and can have different consensus protocols from the main chain. A child chain could contain complete, running Dapp nodes while having minimal interaction with the main chain, dramatically increasing scalability. The child chain would periodically re-validate to the main chain.
Enigma, like Dispatch Labs, uses a distributed hash table stored on the blockchain to reference data stored off the blockchain. Data stored off-chain isn’t just protected by hashes but also gets split among multiple nodes. Users accessing their data have private keys to re-assemble the whole object from this landscape of data fragments. Nodes don’t store the entire contents of the network simultaneously, as they would in a true blockchain. Instead, a network reduction technique selects nodes best suited for the job. Enigma will prove useful both for blockchain users seeking highly private storage and those looking for secure off-chain storage.
Swarm uses blockchain to re-invigorate an old internet concept: file sharing over peer-to-peer networks (what lead developer Viktor Tron calls “BitTorrent on steroids.” Users can upload data files to the peer-to-peer system and create a “proof of custody” agreement that exchanges payment for data storage services. A smart contract, called a “judge contract,” regularly tests whether the data is stored as promised, while a “swear contract” penalizes users for breaking storage agreements by withdrawing payments from the storage node’s security deposit. Swarm’s developers claim that it will be censorship-resistance and highly private.
The role of off-chain versus on-chain processes will likely continue to be a topic of debate in the crypto sphere, but no one’s arguing that off-chain storage is going away. These projects show how protocols can balance the scalability benefits of off-chain storage with the security of blockchain.