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.

Author

Sam Blackshear

Co-Founder, CTO, Mysten Labs, Creator of Move Language

CTO of Mysten Labs and inventor of Move language. Former Principal Engineer at Meta.

Read more like this

Move 2024: Macro Functions Guide

Move 2024 beta edition now gives developers the ability to replace common loops with macro functions.

11min read
Sam Blackshear

5 Reasons to Attend Sui’s Vietnam Builder House

The Sui Builder House in Vietnam presents a unique opportunity to meet Sui founders and expert developers.

2min read
Sui Foundation

One SUI Coin Will Soon Equal a Billion MIST

MIST is the smallest unit of SUI, equal 10^-9 of a SUI. One billion MIST equals one SUI.

1min read
Sui Foundation

Introducing DeepBook Margin: The Next Evolution of Sui’s Liquidity Layer

DeepBook Margin transforms DeepBook from a spot trading engine into a programmable financial layer for Sui

5min read
Sui Foundation

Stardust Enables Game Builders on Sui

Stardust brings its wallet-as-a-service infrastructure and user acquisition platform to Sui.

1min read
Sui Foundation

Confidential by Design: Why Privacy Is the Next Phase of Blockchain Adoption

A conversation with Liam Glennon, Head of North America Financial Institutions and Privacy at TRM Labs, on why institutional privacy is becoming essential to the future of blockchain-based finance.

10min read
Sui Foundation