Stealth Pay
Private payments on-chain. ZK proofs, no relayer, no trusted setup. shield() => privateSend() => unshield(). Three calls. Complete privacy stack on 0G Chain.
Videos




Tech Stack
Description
A privacy layer for 0G Chain, private token transfers enforced by Zero-Knowledge proofs, with no trusted server and no TEE.
What is Stealth Pay?
StealthPay lets anyone shield tokens into a private pool, transfer privately between wallets, and unshield back to a public address all on 0G Chain. Privacy is enforced by ZK proofs generated entirely client-side using Noir circuits and the Barretenberg proving backend. The chain only ever sees: "a valid private action happened." Amounts, senders, and receivers stay hidden inside encrypted notes stored on 0G Storage.
How It Works
Shield — public → private The user deposits tokens into the
PrivacyPoolcontract. The SDK generates a ZK proof that the commitment equalsPoseidon2(pubkey, token, amount, salt). The contract verifies the proof, pulls the tokens, and inserts the commitment into an on-chain Merkle tree.Private Transfer — private → private The SDK selects input notes, fetches their Merkle inclusion paths, and generates a spend proof: Merkle membership + correct nullifier derivation + value conservation. The contract verifies the proof, marks nullifiers spent, and inserts new commitments for the receiver and change. The receiver's encrypted note lands on 0G Storage. The explorer sees one generic event — no amounts, no addresses.
Unshield — private → public The SDK generates a spend proof with a public output amount and recipient address. The contract verifies the proof, marks the nullifier spent, and releases tokens to the recipient.
Components
Component | Link |
|---|---|
SDK | |
Website | |
Playground |
Contracts
Contract | Mainnet Address | Testnet Address |
|---|---|---|
PrivacyPool (proxy) |
|
|
PrivacyPool (impl) |
|
|
ShielVerifier |
|
|
SpendVerifier |
|
|
Progress During Hackathon
1. ZK Circuit Design
Designed and implemented Noir circuits for shield and spend proofs using UltraHonk / Barretenberg. Commitment scheme built on Poseidon2 hash — computationally efficient and ZK-friendly.
2. Smart Contracts
Deployed PrivacyPool, ShieldVerifier, and SpendVerifier contracts on 0G Mainnet and Galileo testnet. Contracts handle on-chain Merkle tree insertion, nullifier tracking, and ZK proof verification.
3. TypeScript SDK
Built and published stealthpay-sdk on npm. Abstracts all ZK complexity into three calls — sdk.shield(), sdk.privateSend(), and sdk.unshield(). Handles client-side proof generation, Merkle tree sync, and encrypted note management.
4. 0G Storage Integration
Integrated 0G Storage for encrypted note hints using ECIES. Receivers auto-discover notes sent to them by scanning on-chain events and decrypting hints with their spending key.
5. Frontend: Docs and Playground
Built a full Next.js frontend with an interactive SDK Playground for live proof generation and on-chain execution, and a comprehensive documentation site covering architecture, SDK reference, and a builder checklist.
6. Payroll Demo
Built an end-to-end private payroll demo at /playground/v1 — StealthCorp shields USDC, pays employees privately via ZK proofs, employees withdraw to their wallets. Demonstrates a real enterprise use case with MetaMask signing.