Provides building and packaging of the Java bindings in C-KZG-4844.
dependencies {
implementation("io.consensys.protocols:jc-kzg-4844:<version>")
}
// load the library once at startup
CKZG4844JNI.loadNativeLibrary();
// 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