Base Batches 003·Finalist ★Groth16·On-chainProtocol·ASP-compliantStandard·x402Fork of·Privacy PoolsChains·Base + SolanaLicense·MITVersion·0.1.0Base Batches 003·Finalist ★Groth16·On-chainProtocol·ASP-compliantStandard·x402Fork of·Privacy PoolsChains·Base + SolanaLicense·MITVersion·0.1.0
v0.1.0 — Ethereum · live

Private payments
for your agents_

React hooks for zero-knowledge private payments via the ZAPP Protocol. Deposit → prove → withdraw. No on-chain link between sender and receiver. Fully on-chain — no server, no custody.

npm install use-zappread the docs →

payment flow

01

Deposit

USDC enters the shielded pool. Your commitment hash joins the Merkle tree.

02

Prove

ZK proof of Merkle membership generated locally. No server sees your keys.

03

Withdraw

Funds land at recipient. Zero on-chain link between sender and receiver.

PLONKPoseidonx402EthereumERC-20
0
phases
deposit · prove · withdraw
0
chains
base · base-sepolia · solana · devnet
0%
ASP-compliant
clean subset by construction
0
on-chain links
between sender and receiver
001What you get
01

useZappPayment()

Full approve → deposit → prove → withdraw flow in one hook. Status, errors, and ZK proof — all typed and reactive. Abort on unmount included.

02

useX402Payment()

Drop-in fetch wrapper. Detects 402 responses, pays via the shielded pool privately, and retries with X-Payment-Proof. Agents pay APIs without revealing identity.

03

ZappProvider

Context-based config. Pass your contract addresses and wallet adapter once, use hooks anywhere in the tree. Works with wagmi, viem, and custom adapters.

04

On-chain only

No backend, no custody, no API keys. Every interaction goes directly to the ShieldedPool contract on Ethereum. Immutable and unstoppable by design.

05

PLONK verified

Every withdrawal is verified on-chain by the PlonkVerifier contract. Proofs are generated client-side via WASM — your nullifier and secret never leave the browser.

06

Fully typed

End-to-end TypeScript. ZKProof, CommitmentHash, Nullifier, and all request/result types exported. ZappConfig enforces your contract addresses at compile time.

002 · basic usage

One hook.
Fully private.

Wrap your app in ZappProvider with your deployed contract addresses, connect your wallet adapter, call pay(). Approve, deposit, prove, and withdraw happen under the hood — all on-chain.

TypeScriptReact 18+wagmi v2viem
PayButton.tsx
import { useZappPayment } from "use-zapp"

export function PayButton() {
  const {
    pay, status, isLoading, result
  } = useZappPayment()

  const handlePay = async () => {
    await pay({
      amount:    "10.00",     // USDC
      recipient: "0xFresh…", // any address
      asset:     "USDC",
    })
  }

  return (
    <button onClick={handlePay} disabled={isLoading}>
      {isLoading ? status : "Pay 10 USDC privately"}
    </button>
  )
}

003 · x402 endpoints

Pay APIs
privately.

fetchWithPayment() wraps fetch. On HTTP 402, pays via the shielded pool and retries with X-Payment-Proof. The API never learns which wallet paid.

x402 protocolX-Payment-Proofauto-retryzero identity
AgentFetcher.tsx
import { useX402Payment } from "use-zapp"

export function AgentFetcher() {
  const { fetchWithPayment, isPaying }
    = useX402Payment()

  const fetchData = async () => {
    // 402 → auto-pay → retry
    const res = await fetchWithPayment(
      "https://api.example.com/premium"
    )
    const data = await res.json()
    console.log(data)
  }

  return (
    <button onClick={fetchData}>
      {isPaying ? "paying…" : "fetch data"}
    </button>
  )
}

004 · setup

One provider.
Your contracts.

Pass your deployed shieldedPoolAddress and verifierAddress once. The SDK talks directly to those contracts — no intermediary.

immutable contractswagmi v2viemEthereum mainnet
layout.tsx
import { ZappProvider } from "use-zapp"
import { myWalletAdapter } from "@/lib/wallet"

export default function Layout({ children }) {
  return (
    <ZappProvider
      config={{
        shieldedPoolAddress: "0x…",
        verifierAddress:     "0x…",
        walletAdapter: myWalletAdapter,
        defaultChain:  "ethereum",
        defaultAsset:  "USDC",
        debug: true,
      }}
    >
      {children}
    </ZappProvider>
  )
}
005$ZAPP bonding curveImmutable · no owner · reserve earns sUSDS yield

ratio Pf/P0

100x

price at 50% supply

$0.100

max reserve

$2.1M

token cap

10M

current price

$0.0229

collateral ratio

68%

P0 — initial price$0.010
Pf — final price$1.00
token cap10M
fee burn %0.50%
ZAPPzero1.cash (ref)current supply
ZAPP bonding curve chart

ZAPP

First token$0.010
Last token$1.00
Cap10M tokens
Fee burn0.50%
Reserve assetsUSDS

zero1.cash

First token$0.0152
Last token$0.303
Cap21M tokens
Fee burn0.25%
Reserve assetsUSDS
you paybalance: —
USDC
you receive
ZAPP

Contracts not yet deployed · testnet coming soon

minted supply1.78M / 10M
reserve$0.028M USDS
floor price$0.0156
bondedno
005Live demoBase Sepolia

Connect your wallet

Try it now.

Connect a wallet with Base Sepolia testnet funds and send a private payment. Watch the three phases in real time — deposit, prove, withdraw.

Need testnet funds?faucet.base.org ↗