@0gzk/cli
v0.2.1
Published
0gzk CLI: publish circuit bundles to 0G Storage, fetch them back, and prove locally
Maintainers
Readme
@0gzk/cli
Command-line tool for the 0gzk ZK Proof-as-a-Service platform on 0G Storage. Publish a circuit bundle to 0G, fetch it back by root hash, and generate Groth16 proofs locally — witness data never leaves your machine.
Install
npm install -g @0gzk/cliProvides the 0gzk binary.
Configuration
Uploads require a funded wallet on the chosen 0G network. Defaults target the Galileo testnet (chain ID 16602):
export OG_PRIVATE_KEY=0x... # required for `0gzk publish`
export OG_NETWORK=testnet # or mainnet (default: testnet)
# Optional overrides:
# export OG_RPC_URL=https://evmrpc-testnet.0g.ai
# export OG_INDEXER_URL=https://indexer-storage-testnet-turbo.0g.ai
# export OGZK_CACHE_DIR=$HOME/.0gzk/bundles # bundle cache for `0gzk prove --root-hash`Get testnet 0G from the official faucet. Downloads do not require a key.
Commands
0gzk publish <bundleDir>
Pack a circuit_bundle/ directory and upload it to 0G Storage.
0gzk publish ./circuit_bundle
# -> rootHash, txHash, txSeq, explorer link
# -> writes .published.json receipt into the bundle dir (suppress with --no-receipt)0gzk fetch <rootHash> [outputDir]
Download a bundle by root hash and untar it.
0gzk fetch 0x5aa4e2... /tmp/0gzk-fetched0gzk prove <inputFile>
Validate inputs against the circuit's metadata.inputs, run snarkjs.groth16.fullProve in-process, then verify locally. Writes proof.json, public.json, and a result.json summary.
# Local bundle
0gzk prove --bundle ./circuit_bundle ./example_input.json
# Remote bundle (cached on first run, reused after)
0gzk prove --root-hash 0x5aa4e2... ./example_input.jsonUseful flags:
--out <dir>— output dir (default./proof-<timestamp>/).--no-verify— skip local verification.--network <testnet|mainnet>— override the 0G network for--root-hash.--indexer-url <url>— override the indexer endpoint.
The emitted proof.json and public.json are byte-compatible with the standalone snarkjs CLI, so any third party can verify them with snarkjs groth16 verify.
