Private balance
How it is read, why notes get merged, and what stays public beside it.
Your private balance is what you hold inside PrivacyPool. This page covers how it is read and how it behaves.
How it is read#
A private balance is not a number stored somewhere. It is the sum of the notes on chain that your viewing key can open. To show it, your browser:
- downloads every note in the pool: its commitment and its ciphertext, from this site's copy of the chain's events, then the newest blocks straight from the chain;
- rebuilds the pool's Merkle tree and asks the contract whether that root is one it knows;
- tries your viewing key on each ciphertext, and checks that what opens matches its commitment;
- drops the notes whose nullifiers are already on chain.
Every browser downloads every note, so nobody can tell from the download which notes are yours. If this site's copy disagrees with the contract's root, the browser throws it away and reads everything from the chain itself.
What has been found is kept in this browser's storage, encrypted with a key worked out from your viewing key, so the next read only looks at new notes.
A key alone restores it#
Each note's contents are encrypted to its owner (x25519 and XChaCha20-Poly1305) and stored on chain in the transaction that made it. Nothing about a private balance lives only in a browser or on this site. Your wallet's key, on any device, finds it again.
Registration#
Registering publishes your shielded public keys in the pool contract, next to your 0x address, so that others can send to that address privately. It is public, and it is needed once. Your first shield into your own balance includes it; Register on the Wallet page does it on its own.
Someone who has not registered can still be paid privately at their private address, the pp… string under Receive.
Notes, and merging#
Each shield, each incoming transfer and the change from each spend is its own note. A proof spends at most two notes. When an action needs more than two of yours, the page first merges them two at a time, each merge a private transfer from you to yourself, and then does what you asked. Each merge is a transaction of its own, with its own gas. It shows the chain that your wallet used the pool, and nothing else.
What stays public#
A private balance always needs a public one beside it: gas is paid from public ETH. A private transaction uses about 1.1 million gas, a shielded trade about 2.2 million.
What you can hold privately#
ETH and ERC-20 tokens, including every token launched here. A token that takes a fee on transfer is refused, because the pool must receive exactly the amount a note records.
Private history#
The Activity tab on the Wallet page lists the notes your keys have opened: what each holds, whether it is spent, and the block it came in. It is decrypted in your browser and exists nowhere else.
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.