hackquest logo

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

Project image 1
Project image 2
Project image 3
Project image 4

Tech Stack

Next
Ethers
Node
Solidity
Noir
Barretenberg
0G Storage
Web3

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 PrivacyPool contract. The SDK generates a ZK proof that the commitment equals Poseidon2(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 @stealthpay/sdk

http://npmjs.com/package/stealthpay-sdk

Website

https://www.trystealth.xyz/

Playground

https://www.trystealth.xyz/playground

Contracts

Contract

Mainnet Address

Testnet Address

PrivacyPool (proxy)

0x154d75521D449974d18c85600149b885DA5bBA85

0x87fECd1AfA436490e3230C8B0B5aD49dcC1283F1

PrivacyPool (impl)

0x90AC4F119133559b37E4703E6ac30fFD4020c649

0x39A300779FdB4D021Df02a112C4289565362610a

ShielVerifier

0x3F2Fd4E070a333446FF0D8886F513a0419A0BAF5

0x89CD2172470C1aC071117Fe2085780DAA6e9656a

SpendVerifier

0x190314E281C7f92bBe0945a4a059Fa74883F0B9C

0xe1E73e47CcbDB78f70A84E8757B51807E1D42386

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.

Team Leader
SSumith Prabhu
Project Link
Deploy Ecosystem
0G0G
Sector
DeFi