In the world of blockchain-backed applications, managing data storage effectively is a common business challenge. Blockchains, by design, are not optimized for storing large volumes of data. They excel in providing decentralization and immutability, but their limited storage capacity poses a problem for businesses handling extensive documents and sensitive information.
To address this, a combination of on-chain and off-chain storage is often employed. On-chain storage ensures data integrity and transparency, crucial for compliance with regulations like GDPR. Meanwhile, off-chain storage offers the scalability and efficiency needed to manage vast amounts of data while maintaining control over its privacy and visibility.
We maintain a connection between off-chain data and our state machine with a concept called ‘pinning’. Here, applications establish a cryptographic proof of the data object which can be transacted on-chain alongside the appropriate contextual metadata to reconcile what the data is to necessary parties.
To learn how to pin a document to a blockchain, watch this video or follow the steps outlined below.
Some options for off-chain storage can be found below:
In any case, the data storage implementation needs to meet only two requirements:
Pinning a document to the blockchain is almost always done by computing a one-way cryptographic hash of the document contents (such as SHA-256) and then storing that hash via a blockchain transaction (often alongside some other identifying information).
Here are some common examples of token standards that use this pattern:
Note, document pinning is not restricted to usage with tokens. Any smart contract can leverage this pattern by storing a hash and/or URI that references a document stored elsewhere.
Each network participant can subscribe to blockchain events pertaining to the smart contract(s) that they care about. From these subscriptions, they are made aware of new transactions and the contents, which can include these cryptographic hashes referenced in Step 2.
Once made aware of a new data object, they can leverage the cryptographic proof contained in the transaction to retrieve the data from their off-chain storage location.
Beyond the storage of the data, there typically needs to be a mechanism for delivering files off-chain from one party’s storage location to another, so that members of a network can access the data when necessary based on the data’s identifier.
The logic to evaluate these proofs is commonly contained within an application layer containing the knowledge of how to replicate the proof based on a data object input. Because open cryptographic standards are leveraged, this logic is not difficult to embed across various access points in your apps.
Document pinning is a common practice, and can take many forms, but the fundamentals of the process require reliable infrastructure components to maintain the linkage and serve relevant data objects when called upon. The benefits of this pattern for blockchain applications are immense, as it can unlock more flexible privacy models in multi-party use cases and allow for higher transaction throughput and more optimized storage on chain.
The Kaleido platform provides both the on- and off-chain data storage services as well as the smart contract management engine to rapidly build and deploy these use cases at scale. The platform’s robust API surface ensures developers can easily connect directly to their internal systems and enterprise applications for a seamless integration requiring no low-level blockchain expertise.
Kaleido makes storage click-button simple. Put our platform to work for you.
Try It FreeKaleido makes storage click-button simple. Put our platform to work for you.
Try It FreeKaleido makes storage click-button simple. Put our platform to work for you.
Try It FreeKaleido makes storage click-button simple. Put our platform to work for you.
Try It FreeYour guide to everything from asset tokenization to zero knowledge proofs
Download NowLearn how Swift, the world’s leading provider of secure financial messaging services, utilizes Kaleido in its CBDC Sandbox project.
Download Now