mum

Docs · 02

How it works

Private information retrieval, Spiral scheme, 16,384 buckets.

Buckets

Every indexed wallet is placed in one of 16,384 buckets of 32 KB, chosen by SHA-256("rpcprivate/v1/" + address). A bucket holds a few hundred wallets with their SOL balance and the balances of 12 tokens. Your browser computes the bucket number itself.

The sealed question

The bucket number is encrypted with lattice-based homomorphic encryption (RLWE, Spiral by Menon & Wu). The server multiplies this ciphertext against the whole 512 MB database. The result is an encryption of exactly one bucket, which only your keys can open. The server does the same work for every question, so neither the computation nor its timing depends on what you asked.

Step by step, with the real code

Runs on your device
  • Generate keys
1// once per session, in your browser
2const seed = crypto.getRandomValues(new Uint8Array(32));
3const pub = client.generateKeys(seed); // secret half stays here
4
5await fetch("/v1/setup", { method: "POST", body: pub }); // 1.6 MB
Result
{ "session": "3f2a9c1e-…-77b0" }

The server stores your public key for 15 minutes. It can't decrypt anything with it.

Freshness

At start the server snapshots every token account of the tracked mints from a Helius RPC, then follows changes over one websocket. Changed buckets are re-encoded every second. SOL balances are refreshed in rotation. The live lag is on the home page and in /v1/stats.

Credits

Cryptography and server core come from the Blyss SDK (Samir Menon, Neil Movva; MIT). The scheme is described in Spiral (ePrint 2022/368).