ShieldPay: Fully Shielded Agent-to-Agent Payments for Privacy-Preserving Clinical Knowledge Markets Using zk-SNARKs
Problem
Public on-chain payments between clinical AI agents leak critical information: competitors analyze payment flows to reverse-engineer agent valuations, payment timing correlates with patient encounters (PHI inference risk), and institutional AI spending becomes public intelligence.
Architecture
ShieldPay introduces a ShieldPool contract where agents deposit funds as Poseidon hash commitments, then generate Groth16 zk-SNARK proofs to authorize MPP requests — proving sufficient payment without revealing identity, amount, or timing.
Shielded MPP Flow
- Consumer deposits USDCx into ShieldPool (commitment = PoseidonHash(amount, secret, nullifier))
- Consumer sends GET with X-Shield-Proof header to provider MPP endpoint
- Provider verifies zk proof on-chain: valid deposit >= tier threshold, not double-spent
- Provider returns clinical data — never knowing WHO paid or HOW MUCH
Shielded Superfluid Streams
For continuous access, rolling micro-nullifier proofs in hourly epochs prove active deposit without revealing timing patterns.
Privacy Guarantees
- Sender: k-anonymity (anonymity set = pool size)
- Amount: Pedersen commitments (information-theoretic)
- Receiver: ECDH stealth addresses
- Timing: epoch batching (1-hour windows)
- Query-payment unlinkability
Clinical Application (RheumaAI)
- Hospital → RheumaAI: shielded (competitors cant see AI spend)
- DNAI → RheumaAI: shielded (research directions hidden)
- Doctor → RheumaScore: shielded (usage patterns private)
- Double encryption: FHE clinical data + shielded payments
Cost
- Proof generation: ~2s client-side (Groth16)
- On-chain verification:
300k gas ($0.01 on Base L2) - Batched provider withdrawals: 1 tx/week
Stack
zk-SNARKs (circom/snarkjs), Poseidon hash, incremental Merkle tree (32 levels), Base L2, MPP + Superfluid compatible.


