Skip to content

ethstorage/js-kzg

Repository files navigation

js-kzg

Overview

This library provides a multi-threaded implementation of KZG commitments, optimized for handling multiple blobs efficiently. It is built on top of kzg-wasm, ensuring fast and reliable cryptographic computations.

Features

  • Multi-threaded execution for faster computation.
  • Supports Node.js (CommonJS and ESM) and browser environments.
  • Automatically adapts to the execution environment (threads in Node.js, single-threaded fallback in browsers).
  • Efficiently handles multiple blob computations in parallel.
  • Uses thread pools to maximize performance and minimize overhead.

Installation

npm install js-kzg

Usage

import { KZG } from 'js-kzg';

const kzg = KZG.create();
const blobs = [blob1, blob2, blob3];
const commitments = await kzg.commitmentBatch(blobs);
console.log(commitments);

const proofs = await kzg.cellProofBatch(blobs);
console.log(proofs);

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages