System flow

Overview of the end-to-end system for verifying arbitrary data stored on Celestia inside Mina smart contracts.

We'll describe the overall system flow before taking you through the steps on the following pages. Each repository contains a default example which you can run to understand how the process works before providing your own Celestia data.

Step 1: Generate SP1 proofs

The first step is to generate two SP1 proofs: a Celestia blobstream proof, and a Celestia blob inclusion proof.

Celestia blobstream proof

From a valid blobstream proof, a trusted block, and a target block, the verifier can be convinced that the target block is the result of a valid state transition from the trusted block, and that said transition has been imbued with sufficient validity by the consensus mechanism of the Celestia blockchain.

Celestia blob inclusion proof

From a valid blob inclusion proof, a data root, a namespace, and a blob, the verifier can be convinced that the blob exists in the Celestia block range with said data root.

Step 2: Generate o1js proofs of validity of the blobstream and blob inclusion proofs

The next step is to generate o1js proofs of validity of the SP1 blobstream and blob inclusion proofs. Essentially, this is a process which involves the following steps:

  1. The generation of 24 o1js proofs, each of which is associated with a circuit that performs part of the verification of the SP1 proof. If all 24 o1js proofs are valid, a verifier can be convinced that the whole SP1 proof is valid.

  2. The compression of the 24 o1js proofs into a single proof. This is done using a Merkle tree with 5 layers such that with the final, single proof, a verifier can be convinced that the SP1 proof is valid (since all 24 o1js proofs are valid).

Step 3: Verify o1js proofs inside a Mina smart contract

Once the o1js proofs for blobstream and blob inclusion are generated, the next step is to incorporate their verification into your smart contract, such that when the state of your contract changes due to method execution, the data in the method call is guaranteed to be available on the Celestia blockchain.

Last updated