2023-02-23 15:53:08 +00:00
|
|
|
# C-KZG-4844
|
2022-11-01 14:24:02 +00:00
|
|
|
|
2023-02-23 15:53:08 +00:00
|
|
|
This is a minimal library for EIP-4844 that implements the [Polynomial
|
|
|
|
Commitments](https://github.com/ethereum/consensus-specs/blob/dev/specs/deneb/polynomial-commitments.md)
|
|
|
|
API. It was originally a stripped-down copy of
|
|
|
|
[C-KZG](https://github.com/benjaminion/c-kzg), but it has been heavily modified
|
|
|
|
since then.
|
|
|
|
|
|
|
|
## Interface functions
|
|
|
|
|
|
|
|
There are functions for KZG operations:
|
2022-11-04 23:56:16 +00:00
|
|
|
|
2022-11-01 14:24:02 +00:00
|
|
|
- `blob_to_kzg_commitment`
|
2023-01-24 18:23:42 +00:00
|
|
|
- `compute_kzg_proof`
|
2023-02-20 15:52:12 +00:00
|
|
|
- `compute_blob_kzg_proof`
|
2023-02-23 15:53:08 +00:00
|
|
|
- `verify_kzg_proof`
|
2023-02-20 15:52:12 +00:00
|
|
|
- `verify_blob_kzg_proof`
|
|
|
|
- `verify_blob_kzg_proof_batch`
|
2022-11-01 14:24:02 +00:00
|
|
|
|
2023-02-23 15:53:08 +00:00
|
|
|
There are functions for loading/freeing the trusted setup:
|
2023-01-17 20:58:45 +00:00
|
|
|
|
|
|
|
- `load_trusted_setup`
|
|
|
|
- `load_trusted_setup_file`
|
|
|
|
- `free_trusted_setup`
|
2022-11-04 23:56:16 +00:00
|
|
|
|
2023-02-23 15:53:08 +00:00
|
|
|
## Bindings
|
|
|
|
|
|
|
|
There are bindings for the following languages:
|
|
|
|
|
|
|
|
| Language | Link |
|
|
|
|
|----------|--------------------------------------|
|
|
|
|
| C# | [README](bindings/csharp/README.md) |
|
|
|
|
| Go | [README](bindings/go/README.md) |
|
|
|
|
| Java | [README](bindings/java/README.md) |
|
2023-03-08 13:04:30 +00:00
|
|
|
| Nim | [README](bindings/nim/README.md) |
|
2023-02-23 15:53:08 +00:00
|
|
|
| Node.js | [README](bindings/node.js/README.md) |
|
|
|
|
| Python | [README](bindings/python/README.md) |
|
|
|
|
| Rust | [README](bindings/rust/README.md) |
|
|
|
|
|
2022-11-04 23:56:16 +00:00
|
|
|
## Installation
|
|
|
|
|
2023-03-28 13:26:51 +00:00
|
|
|
### Prerequisites
|
2022-11-04 23:56:16 +00:00
|
|
|
|
2023-03-28 13:26:51 +00:00
|
|
|
The following must be installed:
|
2022-11-04 23:56:16 +00:00
|
|
|
|
2023-03-28 13:26:51 +00:00
|
|
|
* `git`
|
|
|
|
* `make`
|
|
|
|
* `clang`
|
2022-11-04 23:56:16 +00:00
|
|
|
|
2023-03-28 13:26:51 +00:00
|
|
|
### Build & test
|
2022-11-04 23:56:16 +00:00
|
|
|
|
2023-03-28 13:26:51 +00:00
|
|
|
To build `c_kzg_4844.o`, the object file that the bindings use, run `make` in
|
|
|
|
the `src` directory. This will ensure the `blst` submodule has been initialized,
|
|
|
|
build `blst`, build `c_kzg_4844`, and run the tests. From the project root, run
|
|
|
|
this:
|
2022-11-04 23:56:16 +00:00
|
|
|
|
|
|
|
```
|
2023-03-28 13:26:51 +00:00
|
|
|
cd src && make
|
2022-11-04 23:56:16 +00:00
|
|
|
```
|