From 9f05d9df989d0654dea352691023a0fa2c04483b Mon Sep 17 00:00:00 2001 From: Felix Lange Date: Wed, 22 Apr 2026 18:22:00 +0200 Subject: [PATCH] crypto/kzg4844: add comment about cells and cellIndices layout --- crypto/kzg4844/kzg4844.go | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/crypto/kzg4844/kzg4844.go b/crypto/kzg4844/kzg4844.go index f99fe593e4..34966828ff 100644 --- a/crypto/kzg4844/kzg4844.go +++ b/crypto/kzg4844/kzg4844.go @@ -209,6 +209,13 @@ func IsValidVersionedHash(h []byte) bool { } // VerifyCells verifies a batch of proofs corresponding to the cells and commitments. +// +// For this function, it is sufficient to only provide some of the cells. +// For each blob being proven, the cells slice must contain at least 64 items. +// +// The `cellIndices` specify which of the 128 cells of each blob are given. +// Thus, `len(cellIndices)` must be >= 64 and <= 128 to be valid, and +// `len(cells)` must be a multiple of `len(cellIndices)`. func VerifyCells(cells []Cell, commitments []Commitment, proofs []Proof, cellIndices []uint64) error { if useCKZG.Load() { return ckzgVerifyCells(cells, commitments, proofs, cellIndices) @@ -225,6 +232,8 @@ func ComputeCells(blobs []Blob) ([]Cell, error) { } // RecoverBlobs recovers blobs from the given cells and cell indices. +// +// For the layout of cells and cellIndices, please see [VerifyCells]. func RecoverBlobs(cells []Cell, cellIndices []uint64) ([]Blob, error) { if useCKZG.Load() { return ckzgRecoverBlobs(cells, cellIndices)