Blob lifecycle services
The blob service turns application data into Celestia blobs and connects that data to the block height where it is included. It accepts prepared blobs for transaction submission, reads blob shares from committed block data, rebuilds and checks blobs by commitment, and exposes the result through RPC and namespace subscriptions. For blob encoding and proof-backed reads, see Blob submission and retrieval. For transaction submission and account state, see Transaction submission and account state.
Blob identity
Blob records
An application blob is binary data tied to a valid user namespace. The node also carries a commitment, which is a Merkle root over the blob's encoded shares. This commitment gives callers a stable value to use when they need to identify one blob among other blobs in the same namespace and block.
Retrieved blobs carry the first-share position in the extended data square (EDS). A newly created blob has no chain position yet. The position is therefore retrieval metadata, not part of the blob's application identity.
References: blob/blob.go• L20-25 blob/blob.go• L62-71 blob/blob.go• L73-100 blob/blob.go• L103-111
Share placement
The blob service relies on the share layer to read the EDS that a block header commits to. Blob shares remain in their row order and can span more than one row. Padding shares separate encoded blobs, so the service skips padding before it reads the blob length and collects the shares needed to rebuild one record.
This placement model lets the service recover more than one blob from a namespace. It also lets the parser continue after one blob and find the next one without treating padding as application data.
References: blob/parser.go• L12-22 blob/parser.go• L24-45 blob/parser.go• L48-70 blob/parser.go• L97-117 share/…/getter.go• L62-83
Submission lifecycle
Blob preparation
Submission starts with application data and a namespace. The blob value validates the namespace, encodes the data in the selected share version, and computes its commitment before the node sends anything to the chain. This keeps the identifier returned to the caller tied to the exact data that the caller prepared.
The command-line path can prepare one blob from arguments or several blobs from a JSON file. The public service accepts the resulting blob values and can submit several of them as one atomic request.
References: blob/blob.go• L73-100 nodebuilder/…/blob.go• L13-20 nodebuilder/…/blob.go• L114-167 nodebuilder/…/blob.go• L179-212
Pay-for-blobs transaction
The blob service hands prepared blobs to the state service as a pay-for-blobs transaction. The state boundary owns signer selection, account lookup, fee and gas handling, and Core submission. The blob service reports the committed transaction height rather than duplicating those account concerns.
The main submission path crosses these boundaries:
flowchart LR
A[Application data and namespace] --> B[Prepared blob and commitment]
B --> C[Blob service]
C --> D[State service]
D --> E[Signer account and fee checks]
E --> F[Pay-for-blobs transaction through Core]
F --> G[Included block height]
Submission is a write operation. A read-only client does not have a signer path and rejects blob submission. See Transaction submission and account state for the account and transaction boundary.
References: blob/service.go• L45-53 blob/service.go• L262-291 state/core_access.go• L151-221 api/…/wrappers.go• L19-42
Retrieval lifecycle
Header and namespace lookup
A blob read is anchored by a block height and a namespace. The service first obtains the extended header for that height. The header supplies the data-availability header (DAH), which identifies the committed EDS. The share getter then obtains the requested namespace data through its local or network retrieval paths.
The service uses the namespace result rather than a separate blob database. This allows a node to retrieve recent or retained block data through the same share boundary used by other data APIs. For a batch request, GetAll obtains the block header once and shares it across the namespace reads.
References: blob/service.go• L406-412 blob/service.go• L513-549 nodebuilder/…/share.go• L17-29 nodebuilder/…/share.go• L219-229 share/…/getter.go• L62-83 blob/service_test.go• L454-497
Blob reconstruction
The parser reads namespaced shares in row order. It skips padding, derives the required share count from the first data share, and passes complete share groups to the share library to rebuild one blob. It computes the rebuilt blob's commitment before the service returns it. Fuzz coverage checks that malformed share bytes cannot panic the parser and that blobs returned by a full namespace read remain retrievable by commitment.
Get stops when the rebuilt commitment matches the requested commitment. GetAll keeps parsing until the namespace data ends, so it returns every blob it finds. When several namespaces are requested, the service processes them in parallel but joins their results in the same namespace order supplied by the caller.
The retrieval flow connects the block commitment to the application result:
sequenceDiagram
participant C as Caller
participant B as Blob service
participant H as Header service
participant S as Share getter
participant P as Blob parser
C->>B: Height, namespace, commitment
B->>H: Get committed header
H-->>B: Extended header and DAH
B->>S: Get namespace data
S-->>B: Shares and row proofs
B->>P: Skip padding and collect share group
P-->>B: Rebuilt blob and commitment
B-->>C: Matching blob or not found
References: blob/service.go• L294-333 blob/service.go• L377-441 blob/service.go• L499-639 blob/parser.go• L24-94 blob/parser_fuzz_test.go• L48-121
Retrieval results
The service distinguishes an absent namespace or commitment from an internal retrieval error. Get returns ErrBlobNotFound when it cannot find the requested blob. GetAll returns an empty result for an absent namespace and can return found blobs together with an error when some namespace work fails. It preserves the requested namespace order for the results it does return.
References: blob/service.go• L294-333 blob/service.go• L377-441 blob/service.go• L642-672 nodebuilder/…/blob.go• L21-32
Proof and verification
Namespace inclusion
The blob service can return the proof material collected while it retrieves a blob. GetProof uses the same namespace read and commitment match as Get, then returns the NMT proofs that connect the namespace data to the relevant row roots. The current proof represents the whole requested namespace data in those rows, not an independently isolated proof object for only one blob.
Included checks both sides of the claim. It recomputes the blob commitment from retrieved shares and compares the supplied proof with the proof produced for that committed blob. If the namespace or commitment is absent, it reports that the blob is not included. A malformed or mismatched proof returns an invalid-proof error rather than causing a panic.
References: blob/service.go• L336-374 blob/service.go• L444-497 blob/blob.go• L20-60 blob/repro_test.go• L15-71
Commitment inclusion
The commitment-proof path gives a direct link from a blob commitment to the block data root. It locates the blob's complete share sequence in the original data square, builds subtree roots for the blob, and combines proofs from those subtree roots to row roots with the row proof to the data root. Matching the full sequence matters when two blobs share the same first share.
Consumers verify the returned proof against both the block data root and the blob commitment. Proof validation checks the proof shape, the blob namespace, and the commitment formed from all subtree roots. It also checks that the row proofs cover consecutive rows and that the subtree proofs describe one contiguous range of the original data square. Because a range proof alone does not identify the full tree width, validation also checks its proof-node layout against the row width before it checks the links to row roots and the data root. Every subtree root must be covered by a verified subtree proof. Malformed or rearranged proof entries are rejected as errors. This proof path is distinct from the namespace proof used by GetProof and Included.
References: blob/service.go• L675-753 blob/service.go• L755-873 blob/commitment_proof.go• L20-45 blob/commitment_proof.go• L56-183 blob/commitment_proof.go• L199-303 blob/commitment_proof_layout_test.go• L16-235 blob/verify_completeness_test.go• L19-68 blob/service_test.go• L1191-1373
Namespace exposure
RPC contract
The node exposes the blob service as the blob JSON-RPC namespace. Read methods cover single-blob lookup, namespace batch lookup, namespace proofs, inclusion checks, commitment proofs, and subscriptions. Submit is the write method because it can create a chain transaction.
The node builder connects the blob service to the header service, share getter, and state submitter. It also starts and stops the service with the node lifecycle, so header lookups and live subscriptions use the same managed service. The RPC server then registers the service with permission marks, while clients expose it as the typed Blob service. This keeps data reads separate from transaction authority.
References: nodebuilder/…/blob.go• L13-55 nodebuilder/…/blob.go• L57-103 nodebuilder/…/module.go• L15-51 nodebuilder/…/constructors.go• L17-36
Namespace subscriptions
A live blob subscription follows new header notifications for one namespace. For each header, the service retrieves all blobs in that namespace and sends the blobs with the header that contains them. An empty blob list means that the block had no blob in the subscribed namespace.
The service also supports a resume subscription. SubscribeFromStartHeight validates the start height, replays each available height in order, waits for later heights, and then continues with new blocks. This lets a caller recover missed history after a restart without changing the meaning of each response.
The subscription retries retrieval errors instead of sending an error item. The caller must read the channel promptly because a full response buffer closes the live subscription. Canceling the caller context or stopping the service closes either subscription.
References: blob/service.go• L105-216 blob/service.go• L219-260 nodebuilder/…/service.go• L225-249 nodebuilder/…/blob.go• L45-54
Change checklist
When these files or sections are changed, remember to consider these:
- Keep blob share encoding, commitment creation, parser share counts, and retrieved index calculation aligned across share versions.
- Keep the height and DAH passed from the header service aligned with the share getter. A mismatch can rebuild valid shares from the wrong block.
- Preserve the distinction between a namespace absence, a commitment mismatch, an invalid proof, and a retrieval failure. Clients use these outcomes differently.
- Keep
GetProofandIncludedaligned with the current proof scope. Changes from namespace-wide proofs to blob-specific proofs would change the client contract. - Keep commitment-proof share lookup aligned with the proof verifier. A lookup that matches only a first share can select the wrong blob when first shares collide.
- Keep commitment-proof construction aligned with the proof verifier at both the blob commitment and block data-root levels. All returned subtree roots must be covered by the proof links, and the links must describe the blob's namespace and contiguous placement in the original data square.
- Keep commitment-proof range validation tied to the original data-square width. An NMT range proof can otherwise be relabeled as a range in a differently sized tree.
- Reject malformed namespace and commitment proof entries without panics. The RPC boundary accepts proof data from clients and nodes that may not be trusted.
- Keep the blob RPC method signatures and permission marks aligned with the typed client and read-only client behavior.
- When changing subscriptions, preserve start-height validation, replay order, header order, retry behavior, buffer limits, and channel-close behavior.
- Keep the blob service lifecycle hooks aligned with its required header, share, and state services. A construction change can affect both startup and shutdown behavior.
Important failure modes
| Trigger | Consequence | Guard |
|---|---|---|
| A blob uses a namespace that is not valid for application data | Preparation or PFB submission fails before chain inclusion | Validate the namespace when the blob is created and again at the state submission boundary |
| The requested commitment does not match any rebuilt blob in the namespace | Get returns ErrBlobNotFound and no blob is returned | Recompute the commitment from the retrieved shares before returning a result |
| Namespace data contains only padding or an absence proof | No application blob can be reconstructed | Skip padding and treat empty namespaced results as not found |
| Retrieved shares are incomplete or malformed | Blob parsing fails or reports an incomplete blob | Require the share getter's verified namespace result and the parser's complete share count |
| Fuzz-shaped or Byzantine share bytes reach the parser | Parsing must fail or return no blob without crashing the node | Keep parser inputs bounded and require every returned blob to round-trip through commitment lookup |
| Two blobs in one namespace have identical first shares but different later shares | A commitment proof can point to the wrong blob and fail verification | Match the complete blob share sequence before building the proof |
| A supplied inclusion proof differs from the proof derived from the committed data | Included returns ErrInvalidProof | Compare proof ranges, nodes, and leaf hashes after commitment matching |
| A namespace or commitment proof contains truncated, extra, or null entries | Proof checking returns an invalid-proof error instead of proving inclusion | Validate proof shape and entries before dereferencing proof data |
| A commitment proof repeats or reorders rows, or claims non-contiguous blob shares | A forged proof can use valid pieces from the square but does not prove one blob | Require consecutive row indexes and a contiguous share range in the original data square |
| A commitment proof claims a different or invalid namespace | Proof verification fails even when its row and subtree proofs are otherwise genuine | Validate the blob namespace and require every subtree root to belong to it |
| A commitment proof has missing links, unverified extra roots, or does not connect subtree roots to the data root | Proof verification fails | Validate proof shape, recompute the commitment from all subtree roots, require all roots to be covered, and verify row proofs against the data root |
| A commitment proof relabels a genuine subtree proof to a scaled share range | Proof verification fails instead of accepting a range from a different tree width | Check the proof-node count against the original data-square width |
| The node has no Core endpoint or usable signer | Blob submission cannot create a PFB transaction | Use a full client with state access, a configured key, and suitable transaction settings |
| A resume subscription starts at zero or beyond the network head | Subscription creation fails before the response channel is returned | Check the start height through the header service before starting replay |
| A subscriber does not read responses fast enough | The live blob subscription closes after its buffer fills | Consume the channel promptly or create a new subscription |
| Blob RPC methods are registered with the wrong namespace or permission | Clients cannot call the service or receive unintended access | Keep registration, client mapping, API wrappers, and permission marks in sync |
| A required service is not available during blob service construction or lifecycle start | The node cannot start the blob service and blob RPCs are unavailable | Keep dependency wiring and start/stop hooks aligned with the service requirements |
Key files
| File | Why to read it |
|---|---|
| blob/service.go | Defines submission, retrieval, proof, inclusion, commitment-proof, and subscription behavior. |
| blob/service_test.go | Demonstrates retrieval order, index placement, replay subscriptions, and commitment-proof collision handling. |
| blob/blob.go | Defines blob identity, commitment creation, and retrieved-position metadata. |
| blob/parser.go | Shows how namespaced shares become one or more blobs. |
| blob/parser_fuzz_test.go | Shows the parser's no-panic boundary for malformed share bytes and the commitment round-trip expected from retrieval. |
| blob/commitment_proof.go | Defines the commitment-to-data-root proof and its verification contract, including namespace, layout, and tree-width checks. |
| blob/commitment_proof_layout_test.go | Shows that valid proof layouts work across blob positions and sizes and that forged row, namespace, share, and scaled-range layouts fail. |
| blob/verify_completeness_test.go | Shows that a proof must account for every subtree root used to form the commitment. |
| blob/repro_test.go | Shows that malformed proof inputs fail safely instead of being accepted or causing a panic. |
| blob/malformed_proof_test.go | Shows that malformed inclusion and commitment proofs must return errors without panics. |
| nodebuilder/…/blob.go | Defines the public blob module and RPC method permissions. |
| nodebuilder/…/module.go | Connects headers, shares, state, and blob service lifecycle management. |
| nodebuilder/…/share.go | Defines the share reads that supply namespace data and EDS data to blob retrieval. |
| state/core_access.go | Defines pay-for-blobs transaction validation and submission through Core. |
| nodebuilder/…/constructors.go | Shows where the blob service enters the node's RPC surface. |
| api/…/wrappers.go | Shows the boundary between read-only blob access and signed submission. |
| nodebuilder/…/blob.go | Shows the operator-facing submit, get, get-all, and proof commands. |