Ghost Labs
How shielded pools work on Solana, explained simply
A shielded pool is a shared vault where many people deposit the same amount, and anyone can later withdraw to a new address by proving, with a zero-knowledge proof, that they own one of the deposits without saying which. Because the proof reveals nothing about which deposit is theirs, an observer cannot match withdrawals to deposits.
Short answer: Deposit, keep a secret, withdraw elsewhere with a proof. On deposit you publish a scrambled fingerprint of a secret (a commitment). On withdrawal you prove "my fingerprint is somewhere in this list" and publish a one-time tag (a nullifier) so you cannot withdraw twice. Ghost Shield does this for 1 USDC deposits on Solana with proofs built in your browser.
The coat-check analogy
Imagine a coat check where every coat is identical. You hand in a coat and keep a secret ticket. Later, anyone with a valid ticket can collect a coat at a different counter. The staff can confirm the ticket is real and has not been used, but the tickets are designed so they cannot tell which drop-off it matches. Watchers see coats go in and coats come out, and nothing more.
The "identical coats" part is important. If every coat were different, you could match them by look. That is why pools use fixed amounts.
The three building blocks
1. Commitments
When you deposit, your device picks two random numbers: a secret and a nullifier. It hashes them together into a commitment and publishes only the commitment. Ghost uses the Poseidon hash, which is efficient inside zero-knowledge circuits. The commitment reveals nothing about the two numbers.
2. A Merkle tree
All commitments are stored as leaves in a Merkle tree, a structure that lets you prove a leaf is in the tree with a short path of hashes. Ghost's tree has depth 10, so it holds 1,024 deposits per pool. Old roots are kept, so a proof built against an earlier state still works.
3. Zero-knowledge proofs
To withdraw, you prove three things at once without revealing your secret or your leaf:
- you know a secret and nullifier whose commitment is in the tree,
- the published nullifier hash comes from your nullifier,
- the withdrawal goes to the recipient you chose.
Ghost uses Groth16 proofs, generated in your browser with snarkjs. The nullifier hash is recorded on-chain, so the same deposit cannot be withdrawn twice.
Why the recipient is part of the proof
If the recipient were not bound into the proof, someone who saw your withdrawal request could swap in their own address. In Ghost Shield, the recipient is a public input, so changing it invalidates the proof. That protects against redirection and front-running.
The anonymity set
Your privacy depends on how many deposits you could plausibly be. In Ghost Shield, a withdrawal made after k deposits hides among those k, up to 1,024 per pool. A busy pool gives more cover than a new one. Waiting longer and using a fresh recipient helps. Withdrawing a minute after depositing, when only a few others have joined, helps much less.
How Ghost Shield puts it together
Ghost Labs is the team behind Ghost, an open-source privacy suite for USDC on Solana: Ghost Shield is a fixed-denomination zero-knowledge pool, and Ghost Gas is prepaid USDC gas for wallets with zero SOL.
- Commit
- Note hash
- Nullifier
- Spend once
- Merkle
- Anonymity
- Deposit: exactly 1 USDC, with your commitment stored on-chain. You save a Ghost Note.
- Withdraw: your browser fetches the Merkle path, builds the proof, and sends it to Ghost's relayer.
- Submit: the relayer verifies the proof, checks the root and recipient, and submits the withdrawal as fee payer.
- Settle: the program records the nullifier, pays 0.99 USDC to the recipient, and 0.01 USDC to the treasury.
The details, including the circuit statement, are in the litepaper and Shield docs.
Where today's design relies on trust
Not everything is enforced on-chain yet:
- On-chain: exact deposit amount, unique commitments, single-use nullifiers, the fee split and 10% fee cap, and that only the designated relayer can withdraw.
- In the relayer: Groth16 proof verification, root history, and the recipient check. On-chain verification using Solana's
alt_bn128syscalls is on the roadmap.
Our risk disclosure is direct: if the relayer is malicious or compromised, pool funds can be stolen. A multi-party trusted setup and an independent audit are also still ahead. More in Is Ghost Labs safe?.
Other shielded pools on Solana
Privacy Cash runs a live pool on Solana, and Helius has launched Solana Privacy Rings with encrypted balances. We compare approaches in Ghost vs Privacy Cash vs Elusiv vs Light Protocol.
FAQ
What is a shielded pool? A smart contract vault that many people deposit into. Withdrawals are proven with zero-knowledge proofs, so nobody can tell which deposit a withdrawal came from.
What is a commitment and a nullifier? A commitment is a hash of your secret, stored on-chain when you deposit. A nullifier is a value revealed when you withdraw that marks the deposit as spent without revealing which one it was.
Why are deposits a fixed amount? So the amount cannot identify you. If everyone deposits and withdraws exactly 1 USDC, amounts give no clue which deposit matches which withdrawal.
What is the anonymity set? The group of deposits your withdrawal could have come from. In Ghost Shield it is the deposits made before your withdrawal, up to 1,024 per pool.
Can a shielded pool be fully trustless? It can be designed that way with on-chain proof verification. Ghost Shield verifies proofs in its relayer today, with on-chain verification on the roadmap.
Learn more
Try a 1 USDC deposit at /app, then read How do I make a private USDC transfer on Solana?. The circuit, program, and SDK are open source on GitHub.