Keys, proofs and the server
Where your keys are, what runs in your browser, what the server sees, and what you have to trust.
Where your keys are, what runs in your browser, what this site's server does, and the assumptions the whole thing rests on.
Self-custody, stated precisely#
Every transaction is built, proved and signed in your browser. The server cannot move your funds, because it never has a key, and it cannot alter a transaction, because it never sees one before it is signed.
Your keys#
| Key | What it does | Where it is |
|---|---|---|
| Wallet key | Signs transactions and pays gas | Ghost wallet: encrypted in this browser. Extension: inside the extension. |
| Spending key | Proves a note is yours | Worked out in your browser, kept for the tab |
| Viewing key | Decrypts the notes sent to you | Worked out in your browser, kept for the tab |
| Passphrase | Unlocks the ghost wallet | Only in your head. It is never stored or sent. |
The ghost wallet's key is stored as ciphertext: PBKDF2-SHA256 with 310,000 rounds turns the passphrase into a key, and AES-256-GCM encrypts the wallet key with it. While unlocked, the key sits in the tab's session storage. Shielded keys come from the ghost key, or for an extension from its signature over a fixed message. The notes found so far are cached in this browser, encrypted with a key worked out from your viewing key.
How the pool works#
PrivacyPool is a multi-asset shielded pool. ETH and any ERC-20 are held as notes in one Poseidon Merkle tree of depth 20, room for 1,048,576 notes. The contract accepts proofs against any of the last 100 roots.
note = (asset, amount, publicKey, blinding)
commitment = Poseidon(asset, amount, publicKey, blinding)
publicKey = Poseidon(privateKey)
nullifier = Poseidon(commitment, leafIndex, Poseidon(privateKey, commitment, leafIndex))
Every transaction spends two notes and creates two. A Groth16 proof (13,339 constraints) shows that the spent notes are in the tree and belong to the sender, that the nullifiers are theirs, and that what goes in equals what comes out. When value crosses the boundary, the proof also ties the note's asset to the public one; when it does not, the asset stays out of the proof's public inputs, which is how a private transfer hides it. Each new note's contents are encrypted to its owner with x25519 and XChaCha20-Poly1305 and put on chain with it.
Proofs#
Proofs are made in your browser with snarkjs. The circuit files, about 11 MB, are downloaded from this site once and cached. Nothing secret leaves the tab to make a proof.
The trusted setup#
Groth16 needs a one-time setup that produces the proving and verifying keys.
- Phase 1 is the PSE Perpetual Powers of Tau, file ppot_0080 at size 2^17, built from many public contributions.
- Phase 2, the part specific to this circuit, had one contribution, made by this site, followed by a random beacon.
The files are published: /zk/transaction.wasm, /zk/transaction.zkey and /zk/vkey.json. With the compiled circuit and the phase-1 file, snarkjs zkey verify checks that the proving key was built from them, and the verifying key can be compared with the verifier contract on chain.
What the pool's owner can do#
Two things: change the cap on each ETH deposit, and hand ownership to another address. The owner cannot move, freeze or redirect anyone's funds, cannot change the verifier, and cannot spend a note. The contracts are not upgradeable: there is no proxy.
What this site's server does#
- Keeps a copy of public chain events: the pool's notes and nullifiers, and the trades on curves launched here. It is there for speed. Your browser checks it against the contract's root and falls back to reading the chain itself.
- Keeps the token listing and stores launch artwork.
- Sees your IP address and what your browser asks it for.
What the server never receives#
A secret key, a passphrase, a shielded key, or the contents of a note.
There are no accounts#
No sign-up, no email, no profile. A wallet is the only identity, and it lives in your browser.
If this site went away#
Your public balance is ordinary ETH and tokens in a wallet you hold the key to. Your private balance is in PrivacyPool on chain, encrypted to your keys. Reaching it without this site would need software that makes proofs for this circuit, and your key. The circuit files above and the note format on this page are what such software needs. That is the reason to back the key up.
These pages describe the site as it runs now: figures read from chain, such as the deposit cap, are filled in when the page loads. Something unclear or wrong? Tell us on X. The short version of all of it is on the Protocol page.