Skip to content

Blobs.toProofs

Compute the proofs for a list of Blobs.Blobs and their commitments.

Imports

Named
import { Blobs } from 'ox'

Examples

import { Blobs } from 'viem'
import { kzg } from './kzg'
 
const blobs = Blobs.from('0xdeadbeef')
const commitments = Blobs.toCommitments(blobs, { kzg })
const proofs = Blobs.toProofs(blobs, { commitments, kzg })

Definition

function toProofs<blobs, commitments, as>(
  blobs: blobs | Blobs<Bytes.Bytes> | Blobs<Hex.Hex>,
  options: toProofs.Options<blobs, commitments, as>,
): toProofs.ReturnType<as>

Source: src/core/Blobs.ts

Parameters

blobs

  • Type: blobs | Blobs<Bytes.Bytes> | Blobs<Hex.Hex>

The Blobs.Blobs to compute proofs for.

options

  • Type: toProofs.Options<blobs, commitments, as>

Options.

options.as

  • Type: "Bytes" | "Hex" | as
  • Optional

Return type.

options.commitments

  • Type: (readonly 0x${string}[] | commitments | readonly Uint8Array[]) & (commitments extends blobs ? {} : "commitments must be the same type as blobs")

Commitments for the blobs.

options.kzg

  • Type: Pick

KZG implementation.

Return Type

The Blob proofs.

toProofs.ReturnType<as>