Data availability proofs
Celestia data availability proofs let a client show that selected shares belong to selected rows and that those rows belong to a block data root. The proof connects namespace-scoped share data to the commitment carried by the block, so a verifier can check the data without receiving the full data square. See the core data model for the place of the block data root in the wider block model.
Proof model
Row proofs
A row proof shows that one or more row roots belong to the Merkle tree whose root is the block data root. A row range is inclusive at both ends, so the number of row roots must equal EndRow - StartRow + 1. The proof carries one Merkle proof for each row root and uses the supplied block data root as its trust anchor.
RowProof.Validate checks the range, the number and order of the row proofs, and the shape of the data-root tree before it verifies the roots. It rejects missing proofs, inconsistent tree sizes, and indexes outside the row-root half. The tree must have a power-of-two number of leaves with at least four leaves. VerifyProof performs only the cryptographic checks, so callers that use row metadata must call Validate first.
References: types/row_proof.go• L12-84 types/row_proof_test.go• L13-86
Share proofs
A share proof adds the next level of the Celestia commitment tree. It contains the raw shares, one namespace Merkle tree (NMT) proof for each row that contains those shares, and the row proof that binds those row roots to the block data root.
The namespace is formed from a namespace version and namespace ID. Verification checks that the supplied shares match the requested namespace and the NMT root represented by the corresponding row root. This makes a share proof a compound inclusion proof rather than a separate commitment.
Share ranges describe one contiguous span across consecutive rows in the original data square. A proof may start or stop inside the first or last row, but each intermediate row must cover its full width. It cannot prove shares from a parity row or column as if they were data shares.
References: types/share_proof.go• L16-30 types/share_proof.go• L68-128 types/share_proof_position_test.go• L75-175 proto/…/types.proto• L220-259
Proof construction
Share proof requests
The Celestia RPC exposes share proof construction by block height and an end-exclusive share range. The node loads the block and asks the application for the proof. The application returns the share data and its proof parts in the protobuf form, which the node converts to the public ShareProof response.
The newer prove_shares_v2 route wraps the same proof in a named result type. The older prove_shares route remains available for compatibility and is marked deprecated in the client interface.
References: rpc/…/tx.go• L238-275 rpc/…/tx.go• L358-371 rpc/…/routes.go• L55-62 libs/…/consts.go• L13-15
Transaction proof requests
Transaction query results can include a share proof for the transaction's encoded shares. The node identifies the transaction by its block height and index, then asks the application for the transaction inclusion proof. This path gives transaction users the same link from application data to the block data root as a direct share-range request.
References: rpc/…/tx.go• L211-235 rpc/…/responses.go• L198-208 libs/…/consts.go• L7-11
Proof verification
Verification sequence
Verification moves from the innermost data to the block commitment. The following sequence shows the relationship between the two proof layers.
flowchart TD
A[Raw shares] --> B[NMT inclusion proof]
B --> C[Row root]
C --> D[Row Merkle proof]
D --> E[Block data root]
When a caller validates a ShareProof, it first checks its shape and share positions. It then verifies every row proof against the supplied root and verifies every share group against the matching row root. The number of share proofs must match the number of row roots, and the raw share count must match the ranges described by the NMT proofs.
ShareProof.VerifyProof checks only the NMT proofs against the row roots. It does not check share positions or the row proof. ShareProof.Validate is the complete check because it also validates the row proof and the relationship between the ranges and the original square.
References: types/share_proof.go• L68-128 types/share_proof.go• L131-170 types/row_proof.go• L28-84 types/share_proof_position_test.go• L177-191
Verification inputs
The verifier needs the proof object, the block data root, and the namespace identity. The namespace version is limited to one byte because Celestia's NMT namespace is built from that byte followed by the namespace ID.
The proof data is ordered by row. Each NMT proof consumes an end-exclusive share range from the ordered Data list, and that group is checked against the row root at the same position. A changed share, namespace, row root, or data root causes verification to fail.
References: types/share_proof.go• L19-29 types/share_proof.go• L131-170
Block data commitments
Block data roots
The block header carries DataHash, the commitment used to identify the block's data. During proposal processing, the application supplies the data root and square size with the proposed data. The block keeps the square size so later proof responses can be tied to the same Celestia square model without rebuilding the erasure data.
For a row or share proof, this block data root is the final root in the verification sequence. A valid proof therefore proves membership under a particular block commitment; it does not by itself prove that a different block or height has the same data.
References: types/block.go• L363-366 types/block.go• L1325-1358 state/execution.go• L214-220 state/execution.go• L248-267
Multi-block data commitments
The data commitment API builds a higher-level Merkle root from ordered (height, data root) tuples over an end-exclusive block range. A data-root inclusion proof proves that one block's data root is one leaf in that aggregate commitment.
This creates two separate proof links:
- A share proof links selected shares to one block data root.
- A data-root inclusion proof links that block data root to a multi-block commitment.
The two proofs can be checked in sequence when an external system trusts the aggregate commitment and needs to verify data from one block.
References: rpc/…/blocks.go• L310-327 rpc/…/blocks.go• L369-375 rpc/…/blocks.go• L445-460 rpc/…/blocks.go• L481-516 rpc/…/blocks.go• L519-550 proto/…/types.proto• L61-65
Proof interfaces
RPC responses
The proof interfaces expose both the data proof and the commitment proof. JSON RPC provides prove_shares_v2, data_root_inclusion_proof, and data_commitment. The gRPC Blobstream interface provides the data-root inclusion proof for a block inside a selected range.
These interfaces return proof material for independent verification. They do not replace the block header or the external commitment that supplies the expected root.
References: rpc/…/routes.go• L55-62 rpc/…/responses.go• L316-327 rpc/…/api.go• L475-491 proto/…/types.proto• L61-65
Change checklist
When these files or sections are changed, remember to consider these:
- Keep the row range convention aligned across
RowProof, its protobuf fields, and all callers.RowProofranges are inclusive and must match proof indexes, while share and block commitment query ranges are end exclusive. - Keep the namespace version and namespace ID encoding aligned between proof construction and verification. A change in either side can make all valid proofs fail.
- Keep the order and count of
Data,ShareProofs, andRowProof.RowRootsaligned. These arrays are matched by position during verification. - Keep share range rules aligned with the original square width. A change can allow parity data or a non-contiguous cross-row range to pass validation.
- Keep the block data root used by application proposal data, the block header, and commitment tuple generation consistent.
- If a proof field changes, update both the protobuf representation and the JSON/RPC result that carries it.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A row proof has no row roots, mismatched counts, an invalid range, a nil proof, inconsistent tree sizes, or a proof index outside the row-root half. | The proof is rejected before cryptographic verification. | RowProof.Validate checks the range, proof indexes, tree size, proof presence, and row-root count. |
| The supplied block data root does not match the row proofs. | The share proof cannot establish membership in the requested block. | Validate the row proof against the block's expected data root. |
| The namespace version is greater than one byte or the namespace does not match the shares. | NMT verification fails. | Use the namespace identity that was used to construct the shares and keep the version within the supported range. |
| The share ranges do not match the raw share list or do not form one valid span in the original square. | The proof is rejected or the wrong data is checked against a row. | Validate share counts, square positions, and row order before relying on the proof. |
| A data-root inclusion request uses an empty, invalid, or out-of-range block interval. | No aggregate commitment or inclusion proof is produced. | Use a non-empty end-exclusive interval within the stored chain and include the target height in it. |
Key files
| File | Why to read it |
|---|---|
| types/row_proof.go | Defines the row-level link from row roots to a block data root and its structural checks. |
| types/share_proof.go | Defines the compound share and row proof and separates complete validation from NMT-only verification. |
| types/share_proof_position_test.go | Shows the valid contiguous share span and the data-square position rules. |
| proto/…/types.proto | Defines the wire shape for share, row, and NMT proofs. |
| rpc/…/tx.go | Shows how the node obtains share proofs from the application and exposes them through RPC. |
| rpc/…/blocks.go | Shows how block data roots become multi-block commitments and inclusion proofs. |
| types/block.go | Defines the block data root and square metadata that anchor the proof model. |
| state/execution.go | Shows where the application-provided data root enters block processing. |
| proto/…/types.proto | Defines the gRPC interface for data-root inclusion proofs. |