packages/ contains the zk circuit toolchain used by Cloak.
Canonical transaction circuit
- File:
packages/circuits/transaction.circom - Template:
Transaction(32, 2, 2) - Public signals:
root,publicAmount,extDataHash,mintAddress,inputNullifier,outputCommitment,chainNoteHash
Build pipeline
packages/justfile orchestrates:
- circom compile
- Groth16 setup/beacon
- verification key export
- artifact copy for SDK/web consumers
- vkey conversion for on-chain binary include
Important scripts
packages/scripts/convert-vkey.ts: transforms JSON vkey into verifier binary layoutpackages/scripts/publish-circuits-s3.mjs: publishes artifacts and manifest to S3
Consumer surfaces
- SDK proof generation reads circuit artifacts for witness/proof generation
- Program build includes converted verifier key binary
- Tests and integration fixtures depend on artifact consistency
Operational note
Keep artifact paths and copy steps synchronized acrosspackages, sdk, and programs; mismatched paths are a common source of runtime proof-loading failures.