Skip to content

Build with AI

View Markdown

ZeroJ is young, so AI models have little or no training data about it. Without context, an assistant will happily invent classes, reach for BN254 or MiMC, skip range checks, or treat a dev-only trusted setup as production-ready. This site ships everything an agent needs to get ZeroJ right on the first try.

Point your assistant at the AI Starter Pack — or at llms.txt, and let it pull what it needs.

ArtifactUse it when
/ai/starter-pack.mdStart here. One file with the rules, idioms, anti-patterns, error→fix table, canonical code and a generated circuit API catalog. Save it as CLAUDE.md, AGENTS.md or a Cursor rule.
/llms.txtA compact index of the whole site (llmstxt.org convention) with the key facts an agent must not get wrong.
/llms-full.txtEvery documentation page concatenated into one Markdown file, for tools that ingest a single URL.
/ai/catalog.jsonMachine-readable catalog of the symbolic circuit API — annotations, Zk* types and gadget adapters — extracted from the Java sources at build time.
/ai/manifest.jsonZeroJ, JuLC and Cardano Client Lib versions, the source revision, and a SHA-256 for every exported file.
/ai/pages/<page>.mdA Markdown twin of every page. Use View Markdown or Copy page for AI under any page title.

All of these are regenerated on every build from the same sources as the HTML pages, so they never drift from what you read here.

Save the starter pack as your project’s CLAUDE.md (Claude Code reads it at the start of every session):

Terminal window
curl -o CLAUDE.md https://zeroj.dev/ai/starter-pack.md

Already have a CLAUDE.md? Keep the pack beside it and import it:

Terminal window
curl -o docs/zeroj-starter-pack.md https://zeroj.dev/ai/starter-pack.md
echo '@docs/zeroj-starter-pack.md' >> CLAUDE.md

Codex, Jules, Aider and other AGENTS.md tools

Section titled “Codex, Jules, Aider and other AGENTS.md tools”
Terminal window
curl -o AGENTS.md https://zeroj.dev/ai/starter-pack.md
Terminal window
mkdir -p .cursor/rules
curl -o .cursor/rules/zeroj.mdc https://zeroj.dev/ai/starter-pack.md
Terminal window
mkdir -p .github
curl -o .github/copilot-instructions.md https://zeroj.dev/ai/starter-pack.md

Add the full docs as a URL context provider in your Continue config:

{
"contextProviders": [
{ "name": "url", "params": { "url": "https://zeroj.dev/llms-full.txt" } }
]
}

ChatGPT, Claude.ai and other chat assistants

Section titled “ChatGPT, Claude.ai and other chat assistants”

Start the conversation with:

I'm building with ZeroJ, a Java zero-knowledge proof toolkit for Cardano.
Before writing any code, read https://zeroj.dev/llms.txt and
https://zeroj.dev/ai/starter-pack.md and follow them strictly:
Groth16 on BLS12-381, annotation-style circuits (@ZKCircuit),
Poseidon with PoseidonParamsBLS12_381T3.INSTANCE, dev-only trusted
setup behind -Dzeroj.allowInsecureTrustedSetup=true, and no APIs that
are not in the docs or the circuit API catalog.

If the assistant can’t browse, paste the starter pack (or use Copy page for AI on the pages you need).

Be specific about the statement, what’s secret, what’s public, and ask for tests that try to cheat:

Using ZeroJ, write a @ZKCircuit proving that a secret balance (64-bit)
is at least a public threshold. Add JUnit 5 tests with one valid witness
and at least two invalid ones (balance below threshold, balance that
overflows 64 bits). Then prove with Groth16Keys and verify with
Groth16BLS12381PureJavaVerifier. Use only APIs from the starter pack.
Review this ZeroJ circuit for soundness: list every relation the
application relies on and point to the constraint that enforces it.
Flag any value that is computed but never constrained, any ZkUInt
without @UInt(bits), and any Java control flow over secret values.
I verify this proof on Cardano with ZeroJ's on-chain Groth16BLS12381Verifier
validator (org.zeroj.onchain.julc.groth16.validator).
Explain how a third party could replay it, and change the design so the
proof is bound to the spent UTxO and each user can claim only once.

AI assistants make the same mistakes in ZK code that humans do — just faster. Before you trust generated code:

  • Constraints, not just outputs. A circuit that returns the right answer for honest inputs can still accept a cheater. Insist on invalid-witness tests. See Test your circuits for soundness.
  • Ranges. Every ZkUInt needs @UInt(bits = N); field arithmetic wraps around.
  • Curves and hashes. BLS12-381 and Poseidon with explicit BLS12-381 parameters for anything headed to Cardano.
  • Setup. -Dzeroj.allowInsecureTrustedSetup=true belongs in tests and local demos only. Real keys come from a ceremony.
  • On-chain policy. A valid proof is not authorization. Check replay protection, nullifiers and ScriptContext binding against Secure your ZK application.
  • PlonK. It is experimental in ZeroJ. If an agent picks PlonK, ask why — Groth16 is the supported path.

These are static context files. There is no hosted MCP server, no remote prover and no signing service. Your proofs, witnesses and keys never leave your machine unless your own code sends them somewhere.

If your agent keeps getting a ZeroJ pattern wrong, open an issue with the prompt and the bad output. The fix usually belongs in the starter pack, so the next agent doesn’t repeat it.