MCPcopy Index your code
hub / github.com/crate-crypto/rust-eth-kzg

github.com/crate-crypto/rust-eth-kzg @v0.10.0

Chat with this repo
repository ↗ · DeepWiki ↗ · release v0.10.0 ↗ · + Follow
805 symbols 1,920 edges 119 files 188 documented · 23% updated 8mo agov0.10.0 · 2025-10-27★ 3220 open issues
What it actually does AI analysis from the code graph — generated when you open this
loading…
README

Rust Eth KZG

Overview

What

A cryptographic library that is compatible with the KZG commitment scheme used in the Ethereum blockchain for PeerDAS.

Why

The cryptography implemented in this library is the prerequisite needed for Ethereum's version of Data Availability Sampling(DAS). The library has been implemented in a modular way, so one can also use the underlying polynomial commitment scheme, for a different purpose.

Installation

Rust

cargo add rust_eth_kzg

Node

npm i @crate-crypto/node-eth-kzg

Java

pkg:maven/io.github.crate-crypto/java-eth-kzg@X.Y.Z

CSharp

dotnet add package EthKZG.Bindings

Nim

Use the github URL for Nim.

Building the source

This library is written in Rust and offers bindings to C, C#, node.js, golang, Java and Nim. These bindings can be found in the bindings folder. The bindings expose an API that is compatible with the API needed for Ethereum.

If you only intend to modify the cryptography, then a Rust compiler will be needed. For the bindings, one should check the respective language's README file to find out additional requirements.

Building everything

To build everything including the artifacts needed for the bindings, you can run:

./scripts/compile.sh

To only build the native Rust code, you can run:

cargo build

Benchmarks

Benchmarks can be run by calling:

cargo bench

Note: This will benchmark the underlying Rust library. It will not account for (if any) discrepancies due to calling the library via a particular language. An example of this is the CGO overhead when calling a foreign language from Golang; in our case, this overhead is negligible compared to the actual computations being performed.

Consensus Specs

This library conforms and is tested against commit 13ac373a2c284dc66b48ddd2ef0a10537e4e0de6.

License

Licensed and distributed under either of

MIT license: LICENSE-MIT or http://opensource.org/licenses/MIT

or

Apache License, Version 2.0, (LICENSE-APACHEv2 or http://www.apache.org/licenses/LICENSE-2.0) at your option. These files may not be copied, modified, or distributed except according to those terms.

Extension points exported contracts — how you extend this code

FFTElement (Interface)
(no doc) [2 implementers]
crates/cryptography/polynomial/src/fft.rs
MaybeParallelExt (Interface)
(no doc) [1 implementers]
crates/maybe_rayon/src/single_threaded.rs
DasContextOptions (Interface)
(no doc)
bindings/node/index.d.ts
MaybeParallelRefExt (Interface)
(no doc) [1 implementers]
crates/maybe_rayon/src/single_threaded.rs
TestMeta (Interface)
(no doc)
bindings/node/__test__/index.spec.ts
MaybeParallelRefMutExt (Interface)
(no doc) [1 implementers]
crates/maybe_rayon/src/single_threaded.rs
MaybeParallelSliceMut (Interface)
(no doc) [1 implementers]
crates/maybe_rayon/src/single_threaded.rs
MaybeParallelExt (Interface)
(no doc) [1 implementers]
crates/maybe_rayon/src/multi_threaded.rs

Core symbols most depended-on inside this repo

slice_to_array_ref
called by 21
bindings/java/rust_code/src/lib.rs
slice_to_array_ref
called by 21
bindings/node/src/lib.rs
join
called by 18
crates/maybe_rayon/src/single_threaded.rs
reverse_bit_order
called by 18
crates/cryptography/kzg_multi_open/src/fk20/cosets.rs
g1_lincomb
called by 17
crates/cryptography/bls12_381/src/lincomb.rs
fft_scalars
called by 16
crates/cryptography/polynomial/src/domain.rs
commit_g1
called by 12
crates/cryptography/kzg_multi_open/src/commit_key.rs
g1_batch_normalize
called by 12
crates/cryptography/bls12_381/src/lib.rs

Shape

Function 364
Method 299
Class 113
Enum 17
Interface 11
Struct 1

Languages

Rust75%
Java15%
C#9%
TypeScript1%
Go1%

Modules by API surface

bindings/csharp/csharp_code/EthKZG.test/RefTests.cs32 symbols
bindings/node/src/lib.rs28 symbols
bindings/java/rust_code/src/lib.rs28 symbols
crates/serialization/src/lib.rs27 symbols
crates/cryptography/polynomial/src/fft.rs24 symbols
bindings/c/src/lib.rs24 symbols
crates/cryptography/kzg_multi_open/src/fk20/cosets.rs21 symbols
crates/cryptography/polynomial/src/poly_coeff.rs20 symbols
crates/cryptography/erasure_codes/src/reed_solomon.rs20 symbols
bindings/java/java_code/src/main/java/ethereum/cryptography/LibEthKZG.java20 symbols
bindings/csharp/csharp_code/EthKZG.bindings/native_methods.g.cs20 symbols
crates/cryptography/polynomial/src/domain.rs19 symbols

For agents

$ claude mcp add rust-eth-kzg \
  -- python -m otcore.mcp_server <graph>

⬇ download graph artifact

Ask about this repo answers extend the page