This repository is the Ethereum Foundation grant collaboration for the
zkAPI project. ef-collaboration is the grant-delivery workspace for the
zkAPI stack, developed under an Ethereum Foundation grant awarded to
OpenAnonymity.
The protocol implementation lives in the protocol/ submodule. This outer repo adds the app-facing pieces that were missing from the protocol-only repository:
zkapi-cli: operator and local-user CLIzkapi-clientd: local client daemon with/request, OpenAI-compatible, OpenResponses-compatible, and Ollama-compatible endpointszkapi-serverd: server daemon — proof verification, nullifier storage, API execution, state signingzkapi-indexerd: indexer daemon — mirrors on-chain events into a local Merkle tree viewfunding-page/: static local deposit UIzkapi-integration-tests: end-to-end Rust test harness- CI, deployment docs, Docker packaging, and demo scripts
ef-collaboration/
├── protocol/ # git submodule: curryrasul/zkAPI (libraries + on-chain)
├── crates/
│ ├── zkapi-cli/
│ ├── zkapi-clientd/
│ ├── zkapi-serverd/
│ ├── zkapi-indexerd/
│ └── zkapi-integration-tests/
├── funding-page/
├── docs/
├── docker/
├── scripts/
└── .github/workflows/
git submodule update --init --recursive
cargo build
cargo test --workspace --exclude zkapi-integration-tests
cargo test -p zkapi-integration-tests --all-features -- --test-threads=1
cargo test --manifest-path protocol/rust/Cargo.toml --workspaceprotocol/ is explicitly excluded from the outer Cargo workspace. The outer crates consume protocol crates through direct path dependencies, so workspace = true metadata inside protocol/rust/ still resolves against the protocol sub-workspace rather than the outer one.
Generate a deposit secret/commitment:
cargo run -p zkapi-cli -- keygenRun the protocol indexer:
cargo run -p zkapi-cli -- \
--contract-address 0xdeadbeef \
indexer \
--contract-address 0xYourVault \
--rpc-url http://127.0.0.1:8545Run the protocol server:
cargo run -p zkapi-cli -- \
--contract-address 0xdeadbeef \
server \
--provider echo \
--indexer-url http://127.0.0.1:3001Run the local auth daemon:
cargo run -p zkapi-cli -- \
--contract-address 0xdeadbeef \
auth \
--listen 127.0.0.1:11434Inspect server health and published roots:
curl http://127.0.0.1:3000/health
curl http://127.0.0.1:3000/v1/attestationPrepare and confirm a deposit:
cargo run -p zkapi-cli -- prepare-deposit --amount 1000000
cargo run -p zkapi-cli -- confirm-deposit \
--secret 0x... \
--note-id 0 \
--amount 1000000 \
--expiry-ts 4102444800Send an authenticated request through the daemon:
cargo run -p zkapi-cli -- request \
--path /v1/chat/completions \
--json '{"model":"zkapi-echo","messages":[{"role":"user","content":"hello"}]}'- Docker image:
docker build -f docker/Dockerfile . - Compose auth daemon:
docker compose -f docker/docker-compose.yml up --build - Compose local dev stack:
docker compose -f docker/docker-compose.yml -f docker/docker-compose.dev.yml up --build - End-to-end demo:
./scripts/e2e-demo.sh
The current Rust runtime still uses mock proof envelopes for request/withdrawal roundtrips. The Cairo circuits in protocol/cairo/ are the real proving logic and are tested independently with scarb test. See docs/roadmap.md for the runtime prover bridge gap.
- Outer app crates:
cargo test --workspace --exclude zkapi-integration-tests - Outer integration tests:
cargo test -p zkapi-integration-tests --all-features -- --test-threads=1 - Protocol Rust crates:
cargo test --manifest-path protocol/rust/Cargo.toml --workspace - Protocol Solidity:
cd protocol/contracts && forge test -vvv - Protocol Cairo:
cd protocol/cairo && scarb test