ckzg is a Python library providing bindings for the C-KZG-4844 library, which implements the Polynomial Commitments API for Ethereum's EIP-4844 and EIP-7594. The library is currently at version 2.1.7 and sees active development with frequent minor releases and occasional major updates.
pip install ckzgVerified import paths — ran on the pinned version, not inferred.
This quickstart demonstrates how to load a KZG trusted setup and generate a KZG commitment for a random blob. It requires the `trusted_setup.txt` file, which can be provided via the `KZG_TRUSTED_SETUP_PATH` environment variable or a direct path. This file is essential for all cryptographic operations.
Download the new `trusted_setup.txt` from the official c-kzg-4844 GitHub repository (e.g., `https://github.com/ethereum/c-kzg-4844/blob/main/trusted_setup.txt`) and ensure your application uses this updated file when loading the trusted setup.
Upgrade to `ckzg` version 2.1.5 or later to mitigate this vulnerability and ensure correct challenge computation.
Upgrade to `ckzg` version 2.1.3 or later to ensure the correctness of batch KZG proof verification.
Upgrade to `ckzg` version 2.1.4 or later to benefit from the stable `blst` dependency and improved correctness safeguards.
Users on macOS x86 systems should consider targeting earlier `ckzg` versions or migrating to ARM-based macOS machines for continued official package support.
Ensure you have necessary build tools installed (e.g., `build-essential` on Linux, Xcode command line tools on macOS). You might also need to install `rust` if it's a dependency for `pyo3` or related components, and ensure `setuptools` and `wheel` are up to date: `pip install --upgrade setuptools wheel`.
Verify `ckzg` was successfully installed by checking `pip list | grep ckzg`. If not, re-run `pip install ckzg` and address any installation errors. Ensure you are using the correct Python interpreter where `ckzg` was installed.
Use a Python version that satisfies the library's requirements (e.g., Python 3.8+). You can manage Python versions using tools like `pyenv` or `conda`, or ensure your system's default `python` or `python3` command points to an appropriate version.