5 releases

0.2.3 Aug 30, 2024
0.2.2 Aug 28, 2024
0.2.1 Aug 27, 2024
0.2.0 Aug 27, 2024
0.1.0 Jun 22, 2024

#254 in Math

Download history 4562/week @ 2024-07-23 5029/week @ 2024-07-30 7565/week @ 2024-08-06 7172/week @ 2024-08-13 7515/week @ 2024-08-20 8085/week @ 2024-08-27 7894/week @ 2024-09-03 5019/week @ 2024-09-10 3898/week @ 2024-09-17 3721/week @ 2024-09-24 3952/week @ 2024-10-01 3827/week @ 2024-10-08 3828/week @ 2024-10-15 5974/week @ 2024-10-22 5587/week @ 2024-10-29 5099/week @ 2024-11-05

21,126 downloads per month
Used in 4 crates (2 directly)

MIT license

9.5MB
2K SLoC

kzg-rs Rust

An endpoint for verify_kzg_proof in c-kzg-4844 using bls12_381. Passes all of the verify_kzg_proof tests in c-kzg-4844/verify_kzg_proof.

Cycle Counts in SP1

Test Cycle Count
Verify blob KZG proof 27,166,173
Verify blob KZG proof batch (10 blobs) 196,571,578
Evaluate polynomial in evaluation form 59,370,556
Compute challenge 57,341,532
Verify KZG proof 9,390,640

This crate has been used in a fork of SP1's patch of revm, which passes all tests. kzg-rs is based on this slightly modified fork of bls12_381. This crate works in [no_std] mode.

Usage

cargo add kzg-rs

Or add

kzg-rs = { version = "0.2.3" }

You can rebuild roots_of_unity.bin, g1.bin, and g2.bin by running

cargo build

Dependencies

~3–4MB
~89K SLoC