Provides building and packaging of the Java bindings in C-KZG-4844.
repositories {
maven { url "https://artifacts.consensys.net/public/maven/maven/" }
}
dependencies {
implementation("tech.pegasys:jc-kzg-4844:<version>")
}
// load the library once at startup
CKZG4844JNI.loadNativeLibrary(Preset.MAINNET);
// once a trusted setup is loaded, all methods will use it
CKZG4844JNI.loadTrustedSetup("trusted-setup.txt");
byte[] blob = ...;
byte[] commitment = CKZG4844JNI.blobToKzgCommitment(blob);
byte[] proof = CKZG4844JNI.computeBlobKzgProof(blob, commitment);
boolean isValidProof = CKZG4844JNI.verifyBlobKzgProof(blob, commitment, proof);
// the current trusted setup should be freed before a new one is loaded
CKZG4844JNI.freeTrustedSetup();
There are two ways to load the trusted setup.
The file needs to be of the following format: trusted_setup.txt
Look at the loadTrustedSetup(byte[], long, byte[], long)
method.
- x86-64
- Windows
- Linux
- MacOS
- aarch64
- Linux
- MacOS