Introducing zkAPI: Zero-Knowledge Private Usage Credits for Metered API Access
Ethereum Foundation and Open Anonymity Project launch zero-knowledge credits decoupling identity from payments.
1Decoupling Identity from API Consumption
Modern AI API interactions expose personal data by tethering prompts directly to user accounts and payment methods. The Open Anonymity Project and Ethereum Foundation launched zkAPI on Ethereum Mainnet to break this persistent tracking vector, enabling users to pay for metered APIs without revealing their identity to providers.
2Deposit Mechanics and Private Notes
Users deposit ETH or USDC into an onchain vault contract on Ethereum through a single transaction. This balance converts into a private note that functions like digital cash. Cryptographic mechanisms ensure this balance can only be spent by the owner, with zero traceable links back to the original deposit transaction.
3Zero-Knowledge Proof Architecture
Local client software generates compact zero-knowledge proofs to authorize metered usage without disclosing note origins. The system uses Groth16 proofs on the BN254 curve alongside Poseidon hashing. Notes reside in a 32-level Merkle tree, allowing proof generation that validates balance sufficiency without exposing specific account details.
4Double-Spend Prevention via Nullifiers
To prevent double-spending without revealing identities, zkAPI publishes a deterministic nullifier derived from the secret note for each transaction. If an actor attempts to reuse the same balance, a duplicate nullifier is revealed immediately, flagging the fraudulent attempt while preserving complete unlinkability for legitimate users operating within balance limits.
5Runtime Keys and Session Receipts
The protocol issues short-lived runtime keys with pre-authorized spending caps for entire user sessions. When sessions end, providers create cryptographically signed usage receipts to deduct exact balances offchain. This decoupling ensures the payment verification server never inspects request payloads, while inference providers never observe underlying billing credentials.
6Self-Custody and Client Compatibility
Funds remain fully self-custodial within Ethereum smart contracts, enabling unilateral user withdrawals even if zkAPI routing servers go offline. The local client exposes standard OpenAI and Ollama API endpoints locally, allowing developers to integrate existing applications, developer tools, and chat interfaces without rewriting their underlying networking code.
7Metadata Leakage and Network Bounds
zkAPI isolates billing identities but does not natively prevent network-level tracking or content fingerprinting. Providers can still observe source IP addresses, request timing, and stylistic writing patterns inside prompts. Mitigations require combining zkAPI with network routing layers like Tor, alongside confidential compute environments or Trusted Execution Environments.
8Origins and Implementation Path
zkAPI realizes the theoretical architecture proposed by Davide Crapis and Vitalik Buterin on Ethereum Research. Live on mainnet, the framework enables API providers to replace persistent account ledgers with cryptographic usage proofs, eliminating user profiling while preserving standard pricing models, rate limits, and existing operational margins.