Add bindings to readme (#154)
* Add bindings section to readme * Reorganize a little bit * Remove extra blank lines
This commit is contained in:
parent
1d3558cec2
commit
6b2ee20102
34
README.md
34
README.md
|
@ -1,21 +1,41 @@
|
|||
# C-KZG-4844: A minimal library for EIP-4844 Polynomial Commitments
|
||||
# C-KZG-4844
|
||||
|
||||
This is a copy of [C-KZG](https://github.com/benjaminion/c-kzg) stripped-down to support the
|
||||
[Polynomial Commitments](https://github.com/ethereum/consensus-specs/blob/dev/specs/eip4844/polynomial-commitments.md) API:
|
||||
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:
|
||||
|
||||
- `blob_to_kzg_commitment`
|
||||
- `compute_kzg_proof`
|
||||
- `verify_kzg_proof`
|
||||
- `compute_blob_kzg_proof`
|
||||
- `verify_kzg_proof`
|
||||
- `verify_blob_kzg_proof`
|
||||
- `verify_blob_kzg_proof_batch`
|
||||
|
||||
We also provide functions for loading/freeing the trusted setup:
|
||||
There are functions for loading/freeing the trusted setup:
|
||||
|
||||
- `load_trusted_setup`
|
||||
- `load_trusted_setup_file`
|
||||
- `free_trusted_setup`
|
||||
|
||||
## 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) |
|
||||
| Node.js | [README](bindings/node.js/README.md) |
|
||||
| Python | [README](bindings/python/README.md) |
|
||||
| Rust | [README](bindings/rust/README.md) |
|
||||
|
||||
## Installation
|
||||
|
||||
Initialize the blst submodule:
|
||||
|
@ -24,14 +44,14 @@ Initialize the blst submodule:
|
|||
git submodule update --init
|
||||
```
|
||||
|
||||
Build blst:
|
||||
Build the blst library:
|
||||
|
||||
```
|
||||
cd src
|
||||
make blst
|
||||
```
|
||||
|
||||
Build the C-KZG code:
|
||||
Build/test the C-KZG-4844 library:
|
||||
|
||||
```
|
||||
cd src
|
||||
|
|
|
@ -0,0 +1,15 @@
|
|||
# C# bindings
|
||||
|
||||
This directory contains C# bindings for the C-KZG-4844 library.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
These bindings require .NET 6.0 (not 7.0). This can be found here:
|
||||
* https://dotnet.microsoft.com/en-us/download/dotnet/6.0
|
||||
|
||||
## Build & test
|
||||
|
||||
Everything is consolidated into one command:
|
||||
```
|
||||
make
|
||||
```
|
|
@ -0,0 +1 @@
|
|||
build/
|
|
@ -1,8 +1,11 @@
|
|||
.PHONY: all
|
||||
all: install test ecc_test
|
||||
|
||||
../../src/c-kzg-4844.o:
|
||||
cd ../../src/ && make blst && make
|
||||
|
||||
.PHONY: install
|
||||
install: setup.py ckzg.c
|
||||
install: setup.py ckzg.c ../../src/c-kzg-4844.o
|
||||
python3 setup.py install
|
||||
|
||||
.PHONY: test
|
||||
|
|
|
@ -0,0 +1,26 @@
|
|||
# Python bindings
|
||||
|
||||
This directory contains Python bindings for the C-KZG-4844 library.
|
||||
|
||||
## Prerequisites
|
||||
|
||||
These bindings require `python3` and `py-ecc`.
|
||||
```
|
||||
sudo apt install python3 python3-pip
|
||||
python3 -m pip install py-ecc
|
||||
```
|
||||
|
||||
## Build & test
|
||||
|
||||
Everything is consolidated into one command:
|
||||
```
|
||||
make
|
||||
```
|
||||
|
||||
You should expect to see these messages at the bottom:
|
||||
```
|
||||
python3 tests.py
|
||||
tests passed
|
||||
python3 py_ecc_tests.py
|
||||
comparison to py_ecc passed
|
||||
```
|
|
@ -8,7 +8,8 @@ Generates the rust bindings for the c-kzg library.
|
|||
cargo build --release
|
||||
```
|
||||
|
||||
Build with `--features="minimal-spec"` to set the `FIELD_ELEMENTS_PER_BLOB` compile time parameter to the pre-determined minimal spec value.
|
||||
Build with `--features="minimal-spec"` to set the `FIELD_ELEMENTS_PER_BLOB`
|
||||
compile time parameter to the pre-determined minimal spec value.
|
||||
|
||||
## Test
|
||||
|
||||
|
|
|
@ -42,7 +42,7 @@ endif
|
|||
# Makefile Rules
|
||||
###############################################################################
|
||||
|
||||
all: c_kzg_4844.o
|
||||
all: c_kzg_4844.o test
|
||||
|
||||
%.o: %.c
|
||||
@$(CC) $(CFLAGS) -c $<
|
||||
|
|
Loading…
Reference in New Issue