Class BlobUtils

java.lang.Object
org.web3j.crypto.BlobUtils

public class BlobUtils extends Object
  • Constructor Summary

    Constructors
    Constructor
    Description
     
  • Method Summary

    Modifier and Type
    Method
    Description
    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 using CKZG4844JNI.verifyCellKzgProofBatch(byte[], long[], byte[], byte[]).
    static boolean
    checkProofValidity(Blob blobData, org.apache.tuweni.bytes.Bytes commitment, org.apache.tuweni.bytes.Bytes proof)
     
    static List<org.apache.tuweni.bytes.Bytes>
    Computes the EIP-7594 cell proofs for multiple blobs as a single flat list in blob-major order: [blob0.proof0..127, blob1.proof0..127, ...], total CELLS_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 of CELLS_PER_EXT_BLOB (128) 48-byte KZG proofs, one per cell of the extended blob.
    static org.apache.tuweni.bytes.Bytes
    getCommitment(Blob blobData)
     
    static org.apache.tuweni.bytes.Bytes
    getProof(Blob blobData, org.apache.tuweni.bytes.Bytes commitment)
     
    static org.apache.tuweni.bytes.Bytes
    kzgToVersionedHash(org.apache.tuweni.bytes.Bytes commitment)
     

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • BlobUtils

      public BlobUtils()
  • Method Details

    • getCommitment

      public static org.apache.tuweni.bytes.Bytes getCommitment(Blob blobData)
    • 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

      public static List<org.apache.tuweni.bytes.Bytes> getCellProofs(Blob blobData)
      Computes the EIP-7594 (PeerDAS) cell proofs for a single blob: a flat list of CELLS_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

      public 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, ...], total CELLS_PER_EXT_BLOB * blobs.size() proofs. This is the exact layout the EIP-7594 network wrapper expects for its flat cell_proofs field.
      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 using CKZG4844JNI.verifyCellKzgProofBatch(byte[], long[], byte[], byte[]). The cells are recomputed from the blobs.
      Parameters:
      blobs - the blobs
      commitments - one 48-byte KZG commitment per blob
      cellProofs - the flat CELLS_PER_EXT_BLOB * blobs.size() cell proofs in blob-major order (as produced by getCellProofs(List))
      Returns:
      true if every cell proof verifies
    • kzgToVersionedHash

      public static org.apache.tuweni.bytes.Bytes kzgToVersionedHash(org.apache.tuweni.bytes.Bytes commitment)