For AI Agents

For AI Agents

Private payments for autonomous agents on Solana.

Why Agents Need Privacy

  • Spending patterns are public. Every SOL transfer on Solana is visible. If your agent pays for compute, APIs, or data, anyone can see what it’s buying.
  • Competitors can front-run. Visible transactions reveal strategy.
  • User privacy matters. Agents act on behalf of users — their transactions shouldn’t expose the user’s activity graph.

ZeroK solves this: deposit SOL, then send to any address privately. No link between deposit and payment.

Quick Start

git clone https://github.com/svhq/zerok-app.git
const { Keypair } = require('@solana/web3.js');
const { ZeroK } = require('./zerok-app/sdk/agent');
 
// 1. Initialize
const zk = new ZeroK({
  network: 'mainnet-beta',
  wallet: Keypair.fromSecretKey(/* your agent's keypair */),
});
 
// 2. Deposit SOL into private pool
await zk.deposit(2.3);
// -> 2Ă—1 SOL + 3Ă—0.1 SOL = 5 private notes
 
// 3. Send privately
await zk.send(1.0, 'RecipientAddress...');
// -> ZK proof generated, recipient gets 0.997 SOL
 
// 4. Check balance
zk.balance();
// -> { total: 1.3, notes: 4, breakdown: { '1 SOL': 1, '0.1 SOL': 3 } }

Three methods. That’s it.

API

new ZeroK({ network, wallet, rpc?, relay? })

Initialize the SDK. network is 'mainnet-beta' or 'devnet'. wallet is a Solana Keypair.

zk.deposit(solAmount)

Deposit SOL. Auto-splits into optimal denominations (0.1, 1, 10, 100, 1000 SOL).

zk.send(solAmount, recipient)

Send SOL privately. Auto-selects notes, generates ZK proof, submits via relay. Fee: 0.3% (min 0.002 SOL).

zk.balance()

Returns { total, notes, breakdown } of unspent private notes.

How It Works

  1. Deposit — SOL goes to a pool vault. A Poseidon commitment enters an on-chain Merkle tree. Note secrets are encrypted and stored as a transaction memo.
  2. Send — A Groth16 ZK proof is generated locally. It proves the agent owns a valid note without revealing which one. A relay submits the withdrawal — the recipient wallet has no link to the sender.
  3. Privacy — Same-denomination deposits are indistinguishable. The nullifier prevents double-spend. The relay pays gas, so the recipient has no prior transaction history.

Security

  • Non-custodial — wallet key never leaves your system
  • Note recovery — encrypted on-chain via memos, recoverable with the same wallet
  • Open source circuits — verifiable math
  • Protocol fee — 0.3% per send (min 0.002 SOL), relay pays gas