All About Onchain Storage

Storing data on Sui powers unique product abilities while remaining economically feasible.

All About Onchain Storage

In the ever-evolving landscape of blockchain technology, onchain storage solutions play a crucial role in ensuring a secure and censorship-resistant ecosystem. Onchain storage refers to the practice of storing data directly on a blockchain rather than relying on external storage solutions.

While there are benefits to networks built solely for the purpose of data storage, opting to store data directly on a blockchain enhances composability, providing greater utility. Storing data on general-purpose blockchains can often incur high costs, but Sui was designed at the outset to make onchain storage economically feasible.

Data storage on Sui

Sui's distinctive economic model introduces a powerful storage fund, providing the option to store data onchain indefinitely. The storage fund compensates validators for ensuring the continuous availability of data posted to the blockchain. From a user's perspective, the storage fund is straightforward as it seamlessly accumulates storage fees along with each transaction's gas fee. A noteworthy feature of Sui's storage fund is the user's ability to deactivate an object, removing it from the active blockchain state, thereby releasing the remaining SUI locked in the storage fund associated with that object.

In contrast to the convoluted methods often required for storing data on general-purpose blockchains, Sui simplifies the process. It eliminates the need for workarounds that partition data from the underlying network's data model, resulting in increased utility for onchain data. In Sui, arbitrary data storage is treated the same as data used for smart contracts and other typical purposes. Validators store any file, including image data, that a project indicates should be stored onchain, on their servers. This seamless integration is facilitated by Sui's unique data model and economic design, allowing for cost-effective data posting and the option for updates as desired.

Files stored onchain in this manner become available indefinitely, as opposed to a model where a smart contract may point to a file stored on an external server. Builders can create complex object associations that also store important information on Sui without fear that part of their project might disappear and users can rest assured knowing that data is stored immutably onchain.

Onchain storage demands

The fees associated with maintaining data storage are a critical aspect of any viable storage solution. Sui's economic model excels in keeping fees at a minimum, with the average transaction costing less than $0.01. Equally important, if not more so, is Sui's capacity to manage spikes in throughput demand without causing abrupt spikes in gas fees. 

The recent surge in inscription-related activity demonstrated Sui's ability not only to handle high levels of throughput but also to maintain stability in gas fees during such periods. This resilience is particularly crucial for the viability of arbitrary data storage on Sui, emphasizing its capability to handle sustained throughput demands.

Summing it up

The objective of onchain storage is to diminish dependence on centralized entities for data storage and management while ensuring it remains within the protocol where it is required. Sui, with its distinctive features, emerges as a compelling alternative to centralized and other decentralized storage solutions. This empowers developers to advance decentralization, integrity, and accessibility of data, all while keeping it within the protocol. Sui stands as a viable solution for those seeking to foster a decentralized and robust approach to data storage and management.