Introducing a new way to review your PRs.

Read the announcement

celestiaorg / celestia-node

Celestia Data Availability Nodes

View on GitHub

22 documents · Updated Nov 23, 2026

docs / blob-submission-and-retrieval

Blob submission and retrieval

Blob services let applications publish binary data to Celestia and later identify, recover, and verify that data at a block height. The service turns blob data into namespaced shares for submission, then uses the block header and share retrieval system to find the right shares and check their commitment and proofs. This page is part of blob services and relates to transaction state.

Blob lifecycle

Blob construction

The blob model joins application data with its namespace, share format, signer when required, and commitment. Construction validates that the namespace is allowed for blob data and computes the commitment from the shares that represent the blob.

The service supports version 0 blobs and version 1 blobs. Version 1 also carries signer data. A blob can be converted to shares for a transaction or parsed back from a complete share sequence after retrieval.

References: blob/blob.go• L62-100 blob/blob.go• L108-130 blob/helper.go• L11-25

Submission path

Submission sends one or more constructed blobs as a single PayForBlob transaction. The blob service passes the share-ready form to the state service, which checks the namespaces, selects the transaction author, applies gas and fee settings, and waits for the transaction result.

The returned height identifies the block that included the transaction. The caller should keep each returned commitment with that height and namespace because the commitment is the stable lookup key for one blob. Fibre blobs use a separate submission path and are rejected by this operation.

flowchart LR
    A[Application data and namespace] --> B[Construct blob]
    B --> C[Compute commitment]
    C --> D[Submit PayForBlob transaction]
    D --> E[Included block height]
    C --> F[Commitment used for later lookup]

References: blob/service.go• L262-291 state/core_access.go• L151-221 state/…/tx_client.go• L162-276

Retrieval path

Retrieval starts with a block height and namespace. The blob service gets the extended header for that height, uses the data-availability header to find rows that may contain the namespace, and asks the share getter for namespaced row data. The share getter may use local data or peer retrieval as described in the parent blob services page.

The blob parser skips padding, reads the share sequence length, collects exactly the shares for one blob, and rebuilds the blob. Get stops when the rebuilt commitment matches the requested commitment. GetAll loads the header once, retrieves each requested namespace in parallel, and combines complete blobs in the order of the requested namespaces. Fuzz coverage checks that arbitrary share bytes from a byzantine proposer do not make parsing panic and that every blob returned by GetAll can be found again by its commitment.

sequenceDiagram
    participant C as Caller
    participant B as Blob service
    participant H as Header service
    participant S as Share getter
    participant V as Commitment check

    C->>B: Get(height, namespace, commitment)
    B->>H: Load extended header
    H-->>B: Header with DAH
    B->>S: Get namespace data
    S-->>B: Shares and row proofs
    B->>V: Parse shares and recompute commitment
    V-->>B: Matching blob or not found
    B-->>C: Blob or error

References: blob/service.go• L294-333 blob/service.go• L377-442 blob/service.go• L499-639 blob/parser.go• L24-95 blob/parser_fuzz_test.go• L48-121 share/…/getter.go• L62-72

Subscription path

Subscriptions turn header events into a stream of blob results for one namespace. For each header, the service retrieves all blobs in that namespace and sends them with the header that carried them; an empty result means that the height had no blob in that namespace.

The service also supports replay from a start height. It validates the height, waits for each height in order, and then continues until the caller or service stops. Both live and replay subscriptions retry blob retrieval failures until the operation succeeds.

A caller that does not read the channel can cause the stream to close after its bounded buffer fills. A canceled context or service shutdown closes the channel.

References: blob/service.go• L105-216 blob/service.go• L219-260

Blob identity

Share encoding

Share encoding is the boundary between application data and square data. A blob becomes a sequence of shares that carries its namespace and enough sequence information for a reader to know where the blob ends. Multiple blobs are ordered by namespace when the service combines them for share conversion.

The JSON form preserves the data needed to reconstruct a blob: namespace, data, share version, commitment, optional signer, and retrieval index. The index is meaningful for blobs read from a block because it marks the first share position in the extended data square; newly built blobs use no on-chain position.

References: blob/blob.go• L62-70 blob/blob.go• L114-125 blob/blob.go• L137-178 blob/helper.go• L11-25

Namespace identity

A namespace groups shares so that applications can retrieve data without scanning unrelated application data. The data-availability header records namespace bounds in each row root, so retrieval first rejects rows whose committed range cannot contain the requested namespace.

Namespace data returns one result per relevant row. A result contains matching shares and an inclusion proof, or no shares with an absence proof when the namespace is not present in that row. These two cases let the blob service distinguish “no blob exists here” from incomplete or invalid data. A namespace on a shared row boundary can match both adjacent rows, while a malformed row root stops lookup with an error.

References: share/root.go• L59-71 share/root.go• L82-122 share/root_test.go• L12-69 share/…/row_namespace_data.go• L24-28 share/…/row_namespace_data.go• L163-207

Commitment identity

A commitment is the Merkle root of the subtree roots made from one blob’s shares. It identifies the exact data within a namespace, which is necessary because one namespace can contain more than one blob.

The service recomputes a commitment after parsing retrieved shares. A mismatch means that the shares belong to another blob or that the requested blob was not found. The commitment is also the input that links a blob-level proof to the block data root.

References: blob/commitment_proof.go• L24-53 blob/blob.go• L85-100 blob/service.go• L328-333 blob/service.go• L705-752

Proof model

Namespace inclusion proofs

The blob Proof is a set of namespaced Merkle tree proofs for the rows that contain the blob’s shares. It links the shares to the row roots in the data-availability header. A blob that spans several rows has one proof entry for each relevant row.

GetProof uses the same namespace retrieval and commitment matching path as Get, so the proof is returned only for the requested blob. Included retrieves the namespace again, recomputes the blob commitment, and compares the resulting proof with the supplied proof. It therefore provides a service-level inclusion check rather than a check that uses only the proof bytes locally.

Proof input can come from an untrusted client or node. The inclusion path treats malformed row proofs, missing proof entries, and inconsistent proof nodes as invalid proof errors instead of allowing malformed input to stop the process.

References: blob/blob.go• L20-60 blob/service.go• L336-375 blob/service.go• L444-497 blob/malformed_proof_test.go• L16-76

Commitment proofs

CommitmentProof proves that a blob commitment is represented in a block’s data root. It carries the blob subtree roots, proofs for those roots inside the row roots, and a row proof that connects the row roots to the data root.

The service creates this proof by locating the full contiguous blob share sequence in the original data square. It checks the complete sequence so that blobs with the same first share do not produce a proof for the wrong location. Valid proofs cover blobs at different sizes and positions, including blobs that begin partway through a row or span several rows. The public API first locates the blob by height, namespace, and commitment, then obtains the extended data square and builds the proof for that exact share range.

Before cryptographic checks, verification confirms that the namespace is valid and that each subtree root belongs to it. It also confirms that row proofs cover consecutive original rows and that each subtree proof has the expected range and tree shape for the original row width. These checks prevent genuine proofs from being repeated, reordered, moved to another namespace, or relabeled as a different share range.

References: blob/commitment_proof.go• L29-45 blob/commitment_proof.go• L56-183 blob/service.go• L675-753 blob/service.go• L755-873 blob/service_test.go• L1235-1359 blob/commitment_proof_layout_test.go• L16-68 blob/commitment_proof_layout_test.go• L66-235

Proof completeness

Proof verification checks both membership and coverage. It validates the proof shape, namespace, and square layout, recomputes the commitment from the listed subtree roots, verifies each subtree-root proof against its row root, and verifies the row roots against the block data root. It also requires that all listed subtree roots are consumed by the proofs.

This last check prevents a proof from appending an unverified subtree root, changing the commitment, and still passing verification. The layout checks prevent repeated or reordered rows and non-contiguous share ranges from passing as a valid proof. The two proof levels serve different needs:

  • Proof connects retrieved namespaced shares to row roots for blob inclusion.
  • CommitmentProof connects the blob commitment through row roots to the block data root.

Commitment proof validation also rejects missing proof entries and invalid proof shapes before it checks cryptographic membership. This gives callers a normal verification error for malformed JSON or other untrusted proof data.

References: blob/commitment_proof.go• L56-106 blob/commitment_proof.go• L178-303 blob/service.go• L444-497 blob/service.go• L771-873 blob/verify_completeness_test.go• L19-68 blob/commitment_proof_layout_test.go• L66-235 blob/malformed_proof_test.go• L78-125

Service interface

Blob operations

The public blob module exposes write, read, proof, and live-stream operations through one interface. Read calls take a height and namespace, while commitment-based calls add the commitment needed to select one blob from that namespace.

OperationPurposeResult
SubmitPublish one or more blobs as one transactionIncluded block height
GetFind one blob by namespace and commitmentBlob data and identity
GetAllFind all blobs in one or more namespacesBlobs in requested namespace order
GetProofObtain row-level inclusion proof for one blobNamespaced row proof set
IncludedCheck a blob and proof against a heightBoolean result and error when verification fails
GetCommitmentProofBuild a proof from blob commitment to data rootCommitment proof
SubscribeReceive blobs as new headers arriveStream of blobs with the including header
SubscribeFromStartHeightReplay blobs from a known height and then follow new headersOrdered stream of blobs with the including header

References: nodebuilder/…/blob.go• L13-47 blob/service.go• L262-497 blob/service.go• L675-753

Client boundary

The nodebuilder exposes the service through JSON-RPC. A read client can use all blob read and proof operations but rejects submission. A write-capable client forwards submission to the local service after a signer is available.

The command line client follows the same boundary. It supports single or file-based submission and exposes lookup, namespace-wide lookup, and proof retrieval. Namespaces and commitments are represented as hexadecimal values at this boundary.

References: api/…/read_client.go• L29-111 api/…/wrappers.go• L17-42 nodebuilder/…/blob.go• L33-78 nodebuilder/…/blob.go• L81-111 nodebuilder/…/blob.go• L239-277

Verification boundaries

Header and share roots

The extended header supplies the trusted block identity and data-availability header for blob retrieval. The DAH supplies row roots that locate a namespace and anchor the row-level proofs. The share getter is responsible for obtaining namespace data that can be checked against those roots.

This separates locating a blob from interpreting its payload. The header path identifies the square, the share path returns proof-bearing data, and the blob path parses only data whose namespace and commitment match the request. For full EDS retrieval, the shrex path streams row-major ODS shares, rebuilds the square after the stream closes, and checks its data hash against the DAH before returning it. A stream that ends between shares is rejected; a share-aligned short stream is completed with tail padding and then still must pass the root check. See the parent blob services page for the wider retrieval path.

References: blob/service.go• L513-549 share/…/read.go• L15-39 share/…/getter.go• L29-83 share/…/eds_response.go• L15-51 share/…/shrex.go• L205-309 header/header.go• L1-80

Failure semantics

The service distinguishes absence from invalid or incomplete data. A missing namespace or commitment returns ErrBlobNotFound; a namespace absence proof is treated as a normal not-found result. A malformed proof, root mismatch, or incomplete share sequence returns an error because the data cannot be trusted.

For GetAll, a namespace with no blobs does not by itself produce an error. If another requested namespace has an internal retrieval failure, the result can include successful blobs together with the combined error. This lets callers keep valid results without hiding a real verification or retrieval failure.

SubscribeFromStartHeight rejects invalid start heights before it creates the stream. Once the stream starts, a canceled context or service stop ends the stream rather than returning a partial error through the channel.

References: blob/service.go• L34-36 blob/service.go• L159-216 blob/service.go• L499-639 share/…/read.go• L42-73 share/…/shrex.go• L405-483

Change checklist

When these files or sections are changed, remember to consider these:

  • Changes to share versions or sequence length rules must keep blob construction, parser completeness, commitment creation, and JSON round trips aligned.
  • Changes to namespace validation or namespace bounds must preserve both transaction rejection and row selection for retrieval.
  • Changes to EDS stream reading or reconstruction must preserve row-major share order, share-boundary truncation rules, and data-root verification for both local reads and shrex responses.
  • Changes to commitment construction must stay aligned between submitted blobs, parsed blobs, Get, and commitment proofs.
  • Changes to row-root namespace bounds must preserve inclusive boundary lookup and errors for malformed roots.
  • Changes to row or namespace proof formats must preserve the link from namespace shares to row roots and from row roots to the data root.
  • Changes to commitment-proof namespace or layout validation must preserve the link between each subtree root, its namespace, its original row, and its contiguous share range.
  • Changes to proof validation must preserve safe errors for malformed or nil proof entries at both inclusion-proof and commitment-proof boundaries.
  • Changes to the shwap.Getter namespace contract must preserve absence proofs as distinct from missing or invalid data.
  • Changes to client permissions or RPC method names must keep read-only clients unable to submit while preserving all read and proof operations.
  • Changes to subscription buffering or header delivery must preserve the relationship between each response and its including header.
  • Changes to replay subscriptions must preserve start-height validation, sequential height delivery, and cancellation while waiting for a future header.
  • Changes to parser bounds or share-sequence handling must preserve no-panic behavior for arbitrary share bytes and the ability to retrieve every GetAll result by its commitment.
  • Changes to submission routing must keep Fibre blobs on their dedicated submission path rather than sending them through Submit.

Important failure modes

TriggerConsequenceGuard
A blob uses a namespace that is not valid for blob dataConstruction or transaction submission failsValidate the namespace during blob construction and before PayForBlob submission
A Fibre blob is passed to SubmitNo PayForBlob transaction is sentReject Fibre blobs and direct callers to Fibre submission
A requested namespace is absent from the DAHNo blob can be located for that namespaceUse row namespace absence proofs and return ErrBlobNotFound
A row root has invalid namespace-bound bytesCandidate row selection cannot be trustedReject the lookup before requesting or parsing row data
Retrieved shares end before the blob sequence is completeThe service cannot reconstruct a trustworthy blobRequire the share count implied by the first share before parsing
Retrieved shares contain arbitrary or byzantine bytesParsing must not crash the service and invalid data must not yield an unusable resultBound parsing to the available share sequence and verify each returned blob through its commitment
Retrieved shares reconstruct to another commitmentThe result does not match the requested blobRecompute the commitment and compare it before returning the blob
A namespace or row proof does not match its row rootRetrieved data is rejected as invalidVerify proof-bearing namespace data against the DAH
A supplied inclusion or commitment proof is malformedVerification returns an invalid-proof errorValidate proof shape and reject nil or incomplete proof entries before verification
A commitment proof uses an invalid namespace or subtree rootVerification can claim data from a different namespaceValidate the namespace and require every subtree root to carry the same namespace bounds
A commitment proof repeats or reorders rows, or uses a non-contiguous share rangeGenuine proofs can be assembled into a false blob locationRequire consecutive original rows and a valid contiguous subtree-proof layout
A subtree proof is relabeled for a wider or narrower row rangeThe same hash path could claim a different share positionCheck the proof node count against the original row width
A shrex EDS stream ends in the middle of a shareThe EDS cannot be reconstructed safelyReject the stream instead of treating partial bytes as padding
A reconstructed EDS does not match the DAH data rootThe full square cannot support later blob or proof workVerify the data hash before exposing the EDS to callers
Two same-namespace blobs have identical first sharesA first-share-only search can select the wrong blob rangeMatch the complete contiguous share sequence before building a commitment proof
A commitment proof contains subtree roots that its proofs do not consumeA forged commitment could appear linked to the data rootRequire the proof cursor to consume every listed subtree root
A commitment proof does not connect all subtree roots to the data rootInclusion cannot be established for the supplied commitmentValidate proof shape and verify every subtree root and row root
A read-only client calls SubmitNo transaction is sentReturn the read-only mode error at the client boundary
A subscription reader falls behind the response bufferThe subscription closes and later headers are not deliveredConsume the response channel or create a new subscription
A replay subscription starts at an invalid heightThe subscription is not createdValidate the start height through the header service before opening the channel

Key files

FileWhy to read it
blob/blob.goDefines blob identity, construction rules, share versions, commitments, JSON form, and proof input checks.
blob/parser.goShows how namespaced shares become complete blobs during retrieval.
blob/parser_fuzz_test.goShows the parser’s no-panic and GetAll-to-Get consistency guarantees for arbitrary share bytes.
blob/helper.goShows the conversion between node blobs and share sequences.
blob/service.goDefines submission, lookup, proof, inclusion, commitment-proof, and subscription behavior.
blob/commitment_proof.goDefines commitment proofs and the namespace, layout, coverage, and root checks that connect them to the data root.
blob/verify_completeness_test.goDemonstrates the proof-completeness guard against unverified trailing subtree roots.
blob/commitment_proof_layout_test.goDemonstrates valid proof positions and rejection of repeated, reordered, foreign-namespace, non-contiguous, or rescaled layouts.
blob/malformed_proof_test.goShows that malformed inclusion and commitment proofs return errors without panicking.
share/root.goDefines how namespace bounds and row roots locate candidate data.
share/…/read.goDefines how row-major ODS bytes become an EDS and how imported data is checked against its root.
share/…/getter.goDefines the share retrieval contract used by the blob service.
share/…/row_namespace_data.goShows inclusion and absence results for one namespace in one row.
share/…/eds_response.goConnects streamed ODS responses to EDS reconstruction and data-root verification.
share/…/shrex.goShows peer-backed retrieval and validation for samples, rows, namespaces, and full EDS data.
state/core_access.goConnects blob submission to the state transaction path and committed height.
state/…/tx_client.goShows transaction validation, signing, gas, and fee handling for blob submission.
nodebuilder/…/blob.goDefines the public blob API and its read/write permissions.
api/…/read_client.goShows the remote read-client boundary for blob operations.
nodebuilder/…/blob.goShows the command-line paths for submit, lookup, and proof retrieval.