Overview

Data availability in Mina contracts

Mina contracts are limited by a small number of state elements - 8 field elements of size 32 bytes each. To support a greater range of use cases for the Mina blockchain, it is necessary to find a way to allow developers to access a larger state, while retaining strong cryptographic guarantees.

Merkle trees are the recommended solution for storing larger state in Mina contracts, allowing a small root hash to be stored instead of the app's full state. When using merkle trees this way, it's important that the leaves be published on a DA layer whenever the root is updated.

This project's solution allows o1js developers to utilize Celestia for data availability. By generating SP1 proofs of Celestia blob inclusion, as well as SP1 proofs of Celestia's state by verifying its consensus algorithm execution, and finally compressing said proofs into a single o1js proof, Mina contracts can verifiably refer to arbitrary data published on Celestia, solving the problem of limited state on Mina.

We rely on the Blobstream X work done by Succinct, as well as proof-of-concept code of blob inclusion done by c-node.

The challenge of verifying non-native proofs in Mina

Mina is well-optimised for verifying recursive proofs, as long as you verify proofs generated by o1js.

This presents a challenge when you want to verify proofs from other proving systems, such as Groth16 and PLONK, especially if they were created using different elliptic curves, such as the popular BN254.

Combining the high-cost of executing operations on other elliptic curves inside o1js proofs with the limit of 2162^{16} constraints per proof, it becomes even harder.

To cope with those, this codebase uses a parallel and recursive architecture. This will be described in more detail in a later section.

General uses of data availability proofs

Data availability has become an important piece of blockchain applications. While execution can be compressed using ZK or optimistic methods, data still has to be available for users and operators to be able to perform future transactions.

The most prevalent example of applications that require this today is rollups, where large batches of transactions are executed, and transaction data or state diffs are posted to the verifying blockchain. Generally, every stateful off-chain computation that is trust-minimized needs some form of data availability. This includes games, DeFi and many other uses.

The cost of posting data on blockchains is increasing as demand goes up, leading to a modular architecture, where specialized chains such as Celestia can provide data availability at lower cost. To learn more, the Celestia Data Availability FAQ is useful.

Last updated