Package org.web3j.crypto
Class BlobUtils
java.lang.Object
org.web3j.crypto.BlobUtils
-
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic booleancheckCellProofsValidity(List<Blob> blobs, List<org.apache.tuweni.bytes.Bytes> commitments, List<org.apache.tuweni.bytes.Bytes> cellProofs) Verifies a flat, blob-major list of EIP-7594 cell proofs against the blobs and their commitments usingCKZG4844JNI.verifyCellKzgProofBatch(byte[], long[], byte[], byte[]).static booleancheckProofValidity(Blob blobData, org.apache.tuweni.bytes.Bytes commitment, org.apache.tuweni.bytes.Bytes proof) static List<org.apache.tuweni.bytes.Bytes> getCellProofs(List<Blob> blobs) Computes the EIP-7594 cell proofs for multiple blobs as a single flat list in blob-major order:[blob0.proof0..127, blob1.proof0..127, ...], totalCELLS_PER_EXT_BLOB * blobs.size()proofs.static List<org.apache.tuweni.bytes.Bytes> getCellProofs(Blob blobData) Computes the EIP-7594 (PeerDAS) cell proofs for a single blob: a flat list ofCELLS_PER_EXT_BLOB(128) 48-byte KZG proofs, one per cell of the extended blob.static org.apache.tuweni.bytes.BytesgetCommitment(Blob blobData) static org.apache.tuweni.bytes.Bytesstatic org.apache.tuweni.bytes.ByteskzgToVersionedHash(org.apache.tuweni.bytes.Bytes commitment)
-
Constructor Details
-
BlobUtils
public BlobUtils()
-
-
Method Details
-
getCommitment
-
getProof
public static org.apache.tuweni.bytes.Bytes getProof(Blob blobData, org.apache.tuweni.bytes.Bytes commitment) -
checkProofValidity
public static boolean checkProofValidity(Blob blobData, org.apache.tuweni.bytes.Bytes commitment, org.apache.tuweni.bytes.Bytes proof) -
getCellProofs
Computes the EIP-7594 (PeerDAS) cell proofs for a single blob: a flat list ofCELLS_PER_EXT_BLOB(128) 48-byte KZG proofs, one per cell of the extended blob.- Parameters:
blobData- the blob to compute cell proofs for- Returns:
- the 128 cell proofs for this blob, in cell-index order
-
getCellProofs
Computes the EIP-7594 cell proofs for multiple blobs as a single flat list in blob-major order:[blob0.proof0..127, blob1.proof0..127, ...], totalCELLS_PER_EXT_BLOB * blobs.size()proofs. This is the exact layout the EIP-7594 network wrapper expects for its flatcell_proofsfield.- Parameters:
blobs- the blobs to compute cell proofs for- Returns:
- the flat, blob-major list of cell proofs
-
checkCellProofsValidity
public static boolean checkCellProofsValidity(List<Blob> blobs, List<org.apache.tuweni.bytes.Bytes> commitments, List<org.apache.tuweni.bytes.Bytes> cellProofs) Verifies a flat, blob-major list of EIP-7594 cell proofs against the blobs and their commitments usingCKZG4844JNI.verifyCellKzgProofBatch(byte[], long[], byte[], byte[]). The cells are recomputed from the blobs.- Parameters:
blobs- the blobscommitments- one 48-byte KZG commitment per blobcellProofs- the flatCELLS_PER_EXT_BLOB * blobs.size()cell proofs in blob-major order (as produced bygetCellProofs(List))- Returns:
- true if every cell proof verifies
-
kzgToVersionedHash
public static org.apache.tuweni.bytes.Bytes kzgToVersionedHash(org.apache.tuweni.bytes.Bytes commitment)
-