You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
Repository navigation
[Tools] Provide CLI utility in zeroj-tools for converting .zkey files to sparse mmap store format #39
ZeroJ supports loading proving keys via memory-mapped sparse stores (Groth16PkStore, ADR-0029/ADR-0035/ADR-0036). Converting a standard snarkjs .zkey into ZeroJ’s sparse .bin store format allows instant memory-mapped startup for provers without re-parsing large .zkey files on every run.
Scope & Tasks
Add a CLI command in zeroj-tools (e.g. zeroj-tools convert-zkey --in <circuit.zkey> --out <dir> --sparse).
Support dense and sparse point encoding outputs.
Output verification key metadata and circuit fingerprint for instant pipeline validation.
Mostly already done — suggest rescoping to just the CLI wrapper.
The substantive converter exists: ZkeyPkStoreImporter (zeroj-crypto/.../groth16/ZkeyPkStoreImporter.java), delivered under ADR-0031 M2. From its class doc:
Streaming importer for large snarkjs Groth16 .zkey files: converts a ceremony proving key directly into a Groth16PkStore directory without materializing point object arrays — the path for MPC ceremony keys at real scale (a 19M-constraint key is ~30 GB, far past ZkeyImporterBLS381's strict in-memory limits).
It already raw-copies the four G1 sections (the .zkey Montgomery layout is byte-identical to the store's flat-limb layout on little-endian), converts and validates G2, writes VK parts into aux.bin/manifest, and validates in parallel. Groth16PkStore.load(dir) then memory-maps it — which is the "instant memory-mapped startup" this issue asks for.
What is genuinely missing is only the CLI surface. Note zeroj-tools currently has no CLI at all — three library classes (ZkeyContributor, SnarkjsHashToG2, ChaChaRng), no picocli. The only CLI in the repo is CeremonyCli in zeroj-ceremony.
So this is blocked on / must be sequenced with #36, which proposed moving CeremonyCli into zeroj-tools. Both issues add a CLI to the same module; pick one entry point.
Suggested rescope: "Expose the existing ZkeyPkStoreImporter as a zeroj-tools CLI command" — R0/R1, small. Also worth checking task 2 ("dense and sparse point encoding outputs") against what Groth16PkStore already writes before estimating.
Activity
satran004 commentedon Aug 18, 2026
Mostly already done — suggest rescoping to just the CLI wrapper.
The substantive converter exists:
ZkeyPkStoreImporter(zeroj-crypto/.../groth16/ZkeyPkStoreImporter.java), delivered under ADR-0031 M2. From its class doc:It already raw-copies the four G1 sections (the
.zkeyMontgomery layout is byte-identical to the store's flat-limb layout on little-endian), converts and validates G2, writes VK parts intoaux.bin/manifest, and validates in parallel.Groth16PkStore.load(dir)then memory-maps it — which is the "instant memory-mapped startup" this issue asks for.What is genuinely missing is only the CLI surface. Note
zeroj-toolscurrently has no CLI at all — three library classes (ZkeyContributor,SnarkjsHashToG2,ChaChaRng), no picocli. The only CLI in the repo isCeremonyCliinzeroj-ceremony.So this is blocked on / must be sequenced with #36, which proposed moving
CeremonyCliintozeroj-tools. Both issues add a CLI to the same module; pick one entry point.Suggested rescope: "Expose the existing
ZkeyPkStoreImporteras azeroj-toolsCLI command" — R0/R1, small. Also worth checking task 2 ("dense and sparse point encoding outputs") against whatGroth16PkStorealready writes before estimating.