Skip to main content

ZKSDK Pools

Private liquidity pools built on ZKSDK's Privacy Coprocessor.

ZKSDK Pools lets teams create private liquidity pools where balances and transfers stay encrypted, while the chain only sees a CID pointer to encrypted state.

What it is

  • A UI + API to create and manage private liquidity pools
  • Built on Private Token Slots (FHE)
  • Same infrastructure an external developer would use

Components

On-chain:

  • Pool vault contract/program (holds pool config + CID)
  • Coprocessor contract/program (receives results and updates vault)

Off-chain:

  • Oracle listener (watches vault events)
  • TFHE worker (Zama) (runs encrypted circuits)
  • Encrypted storage (stores slot state by CID)

The coprocessor is the on-chain contract/program plus the off-chain operator (listener + worker) that executes the encrypted compute.

End-to-end flow

Deposit

  1. User app encrypts a deposit request locally (keys stay with the user).
  2. User submits deposit to the vault.
  3. Vault emits an event with the current CID.
  4. Listener calls the worker at POST /api/v1/execute.
  5. Worker updates encrypted slots, stores the new blob, returns a new CID.
  6. Listener submits the result to the coprocessor contract/program.
  7. Coprocessor updates the vault's CID.

Transfer

  1. User app encrypts a transfer request (sender slot, receiver slot, amount).
  2. Vault emits an event; listener triggers the worker.
  3. Worker runs the transfer circuit so all slots are touched.
  4. New encrypted blob is stored; new CID is returned and saved on-chain.

Withdraw

  1. User app encrypts a withdraw request.
  2. Vault emits an event; listener triggers the worker.
  3. Worker validates and updates encrypted slots.
  4. Coprocessor updates the vault CID and releases tokens on-chain.

Decrypt (view balance)

  1. User app reads the CID from the vault.
  2. User downloads the encrypted blob from storage.
  3. User decrypts locally with their secret key.

What is public vs private

Public:

  • Pool totals
  • Current CID
  • Transaction metadata

Private:

  • Slot ownership
  • Slot balances
  • Transfer amounts

API surface (same as coprocessor)

  • GET /api/v1/health - worker health
  • POST /api/v1/execute - run encrypted circuits
  • Storage by CID (see Storage)