Loch
Install

How the Loch keeps a payment private.

The technical version: what is hashed, what is proved, what is encrypted, and what an observer still sees. The plain version is on the start page.


v0.2, on mainnet

This page describes what is built. What can go wrong with it is on the start page, under Cautions. Read them before you use it.

The model

The Loch began as a shielded pool of SOL held by one Solana program, loch_pool. Value in the pool exists as notes. A note is spent whole, and what is left over comes back as a new note. This is the unspent-output model that Zcash introduced, here with two inputs and two outputs in every transaction: a 2-in, 2-out join-split.

One instruction, transact, does everything. Its proof enforces one equation over the BN254 scalar field, whose modulus is r:

sum(inputs) + (ext_amount - fee) = sum(outputs)        (mod r)

The sign of ext_amount is the type of the transaction. The fee comes out of the shielded value in every type.

Typeext_amountLamports the program movesSigned by
Dive in (deposit)positiveThe amount, from the depositor to the vaultThe depositor and the screening authority
Send privately (transfer)zeroThe fee, from the vault to the relayerThe relayer
Surface (withdrawal)negativeThe amount, from the vault to the destination. The fee, from the vault to the relayerThe relayer

Clients follow three rules so that all transactions look alike. There are always two inputs: an unused one is a dummy note of amount zero with a fresh random key. There are always two outputs: an unused one is a zero-amount note to the sender’s own address, encrypted like any other. The order of the outputs is random.

The new pool

Since v0.2 the same program holds a second pool beside the first. The earlier pool is unchanged and its notes stay spendable. The other sections describe the earlier pool; the new pool differs from it in these ways.

  • Several tokens in one pool: SOL, USDC and every other token share one tree, one circuit and one crowd. A note carries its asset, sha256("loch-asset-v2" || mint) with the first byte cleared, and every note of a transaction has the same one. A private transfer does not show which token moved.
  • Any token. Whoever first dives in with a token brings it in, in the same transaction, and pays the rent of its two accounts, about 0.0026 SOL, which the pool keeps. A swap into a token that is not in yet brings it in too, and its relayer fee covers that rent. Tokens of the Token-2022 program are taken when they carry nothing but a name and group data: a token with a transfer fee, a transfer hook, a permanent delegate, a pause or a close authority is refused, because each of those would let someone take, stop or tax what the pool holds of it. Each token has its own vault, so what one token’s issuer can do reaches only the notes of that token. A wallet learns which tokens are in the pool from the deposits and swaps it reads, and finds its notes in any of them.
  • Two inputs and three outputs. The relayer is paid with the third: a shielded note in the token being sent, so no public fee names the token. The relayer itself learns the token from that note, and nothing about the sender or the recipient. Its fee is 0.0014 SOL or 0.20 USDC, and 0.20 USDC more when it has to open the recipient’s USDC account. In any other token it is what 0.0028 SOL buys of that token at Jupiter’s price, plus a tenth for the price moving; that covers the transaction and the relayer swapping its fee back to SOL later. A token Jupiter cannot sell for SOL cannot pay a relayer, so it cannot be sent, swapped or surfaced through one.
  • Swaps inside the pool. One transaction spends notes of one token, swaps them through Jupiter, and puts the result back as a new note. The tokens and the amounts are public, the owner is not.
  • Earn. SOL in the pool can earn staking rewards as JitoSOL, Jito’s staked SOL: Earn is a swap from SOL into JitoSOL inside the pool, and Stop earning swaps it back. JitoSOL is worth more SOL each epoch. Loch reads what it is worth and about what it earns a year from Jito’s stake pool account through your RPC endpoint, and asks nobody else. One token for everyone, so that everyone who earns hides among the others.
  • Separate keys, still from the one signature on “Loch key derivation v1”: one to spend, one for nullifiers, one to read. The spending key no longer determines the key that reads.
  • Up to 4 294 967 296 addresses per wallet, which nobody can link to each other. Every payment code is an address of its own, so two payers cannot tell they pay the same wallet: stealth receive.
  • Viewing keys: a full one shows the balance and the history, an incoming one shows what arrived but not what was spent. Neither can spend.
  • A tree of depth 26: 16 777 216 transactions, four leaves each.

No proof connects the two pools. A move takes up to two notes out of the earlier pool to your own wallet and puts the same amount into the new one, in one transaction: your wallet approves it, the screening service checks it as a deposit, and the relayer pays the network fee and all the rent, so the move costs you nothing. Nothing passes through the relayer: the withdrawal is made out to your wallet, and the deposit is signed by it. An observer sees your address and the amount leave one pool and enter the other. Depth proofs, receipts and source-of-funds reports work in the earlier pool only; claim links work in both. A pay link made since v0.2 is paid into the new pool, in SOL.

Other chains

You can dive into the new pool from Ethereum, Base, Arbitrum, Optimism, Robinhood Chain, BNB Chain or Polygon, and surface to any of them, in their own currency or their dollar token. The bridge is Relay. Your Solana wallet appears on neither chain: each bridged transaction goes through a Solana address of its own, made from your keys for that one transaction and used once.

  • Diving in. Choose the chain, what you send and what arrives (SOL or USDC), and give your own address on that chain for refunds. The extension asks Relay for an address to send to; send any amount to it, from a wallet or an exchange. Within seconds Relay delivers SOL or USDC to the one-time address, and the extension dives it in: one transaction that the screening service checks and the relayer pays for, the fee coming out of what arrived. The screening service also asks Relay who sent the funds on the other chain and refuses addresses on the US Treasury’s sanctions list.
  • Surfacing. Choose the chain, the currency and the address. The extension asks Relay for a quote and shows what will arrive. Then one Solana transaction takes your notes’ amount out of the pool to the one-time address and on into Relay, at once; if Relay’s part fails, nothing happens. Relay pays on the other chain within seconds. If it cannot, it refunds to the one-time address, and the extension dives the refund back in. The relayer’s fee is the same as for a surface on Solana; Relay takes its own, shown before you confirm.
  • Who asks the bridge. Relay decides where a bridged payment goes, by the quote or the address it gave. So the extension asks Relay itself, not through any server of ours: nobody between you and Relay could send your funds elsewhere. It is the one request the extension makes outside this project, only when you bridge.

Both ends are public, as diving in and surfacing on Solana are: the amount and the time leave one chain and arrive on the other, and the address on the other chain is public there. An amount that dives in and surfaces unchanged a minute later links the two ends as plainly as it would on Solana.

Keys

Every shielded key follows from one message signed by the wallet the user already has.

message          = "Loch key derivation v1"
signature        = wallet.signMessage(message)                  64-byte Ed25519 signature
seed             = sha256(signature)
privateKey       = seed mod r                                   spends notes
publicKey        = Poseidon(privateKey)
encryptionSecret = sha256("Loch note encryption v1" || seed)    an X25519 key: reads notes
encryptionPublic = X25519(encryptionSecret, base point)
selfNoteKey      = sha256("Loch self note v1" || seed)          reads the wallet’s own notes
paymentCodeRoot  = sha256("Loch payment code v1" || seed)       reads notes paid to its codes

address          = bech32m("loch", publicKey || encryptionPublic)
payment code     = bech32m("lochpay", publicKey || encryptionPublic || sha256(paymentCodeRoot || index))

A shielded address is 114 characters and starts with loch1. It carries both public keys: one to own notes, one to encrypt them to. A payment code is the address with a secret for one payer added: 168 characters, starting with lochpay1.

Ed25519 signatures are deterministic, so the same wallet derives the same keys again. That is why there is no new seed phrase. It is also the weak point. The message is not bound to a site, and a wallet shows it as ordinary text: whoever obtains that one signature holds both keys for good, and the keys cannot be rotated without moving the funds.

The spending key determines the decryption key. privateKey is seed mod r, so seed is one of at most six values, and the right one is recognised from the address. A prover that ran anywhere but on the user’s device would therefore hold the whole wallet, and not one transaction. The reverse does not hold: the three keys that read say nothing about privateKey. Separating the two fully would change every address, and has not been done.

Notes and commitments

note       = (amount, publicKey, blinding)
commitment = Poseidon(amount, publicKey, blinding)

The amount is in lamports. The blinding is 31 random bytes. Only the commitment goes on chain: it says nothing about the amount or the owner, and it cannot be opened as a different note. Poseidon is circomlib’s, over BN254. Solana offers the same hash as a syscall, so the program and the circuit compute it identically.

Commitments are the leaves of a Merkle tree of depth 20, with Poseidon at every node, kept in one account. Leaves are appended left to right, two per transaction. The program keeps the 64 most recent roots and accepts a proof against any of them, so a proof made a few transactions ago still verifies.

The tree is finite. It holds 1 048 576 leaves, which is 524 288 transactions for the life of the pool. A full tree refuses every transaction, withdrawals included. A deeper tree or a rollover to a new one both change the circuit, and neither is decided.

Nullifiers

nullifier = Poseidon(commitment, leafIndex,
                     Poseidon(privateKey, commitment, leafIndex))

Spending a note publishes its nullifier. The program creates an account at an address derived from it, ["nullifier", nullifier], and creating an account that exists fails. That is the whole double-spend protection.

The private key is inside the hash. Only the owner of a note can compute its nullifier, and nobody else can match a nullifier to a commitment. Someone who sent you a note knows its amount and blinding, and still cannot tell when you spend it.

The program refuses a nullifier that is not below r. A value N and N + r are the same field element and two different account addresses, so without that check one note could be spent twice.

The two nullifier accounts of a transaction cost rent that is never returned. Whoever signs the transaction pays it.

The proof

The proof system is Groth16 over BN254. The circuit is written in Circom, compiled with circom 2.2.3, and has 12 698 constraints. A proof is 256 bytes: three curve points of 64, 128 and 64 bytes.

For one transaction the circuit proves all of the following, and shows none of the private values:

  • each input note with a non-zero amount is a leaf of the tree with the given root;
  • the prover knows the private key that owns each input note;
  • each nullifier is the one that belongs to its note, its leaf and that key;
  • each output commitment is the hash of a note whose amount is in range;
  • the inputs, the outputs and the public amount balance.

It has seven public inputs, in this order.

InputWhat it isWhere the program gets it
rootA root of the treeFrom the client. It must be one of the 64 recent roots
publicAmountext_amount - fee, modulo rIt works it out again from the instruction
extDataHashA hash of everything public about the transactionIt works it out again from the instruction
inputNullifier, twoThe nullifiers of the two inputsFrom the client. Each becomes an account
outputCommitment, twoThe commitments of the two outputsFrom the client. Each becomes a leaf

The ext data are the recipient, the relayer, ext_amount, the fee and the two encrypted notes. Their hash is sha256 over their Borsh encoding, with the first byte set to zero so that it fits in the field. The program recomputes it from what it was actually sent. Change the recipient, the fee or an encrypted note, and the proof no longer verifies. This is what stops a relayer from redirecting a payment.

The program verifies the proof with Solana’s alt_bn128 syscalls. One transact took between 159 241 and 175 768 compute units on a local validator. The verifier refuses a public input that is not below r, and a proof with a part that is all zero.

The proof is made on the user’s device. In the extension that takes about 3.5 seconds, on one thread.

The setup has one contributor

Groth16 needs a setup for each circuit, and whoever keeps the randomness of that setup can forge proofs. Loch’s proving key comes from a development setup with a single contributor, who could therefore drain the pool. A public ceremony with many contributors has to replace it. It has not been held.

Encrypted notes

Each output is published with an encrypted copy of its note, so that the recipient can find it and spend it. An encrypted note is exactly 87 bytes.

encrypted       = ephemeralPublic (32) || ciphertext (39) || tag (16)

ephemeralSecret = 32 random bytes, fresh for every note
ephemeralPublic = X25519(ephemeralSecret, base point)
shared          = X25519(ephemeralSecret, recipient.encryptionPublic)
salt            = ephemeralPublic || recipient.encryptionPublic
key             = HKDF-SHA256(shared,        salt, info = "loch-note-v1")        address note
key             = HKDF-SHA256(shared || psk, salt, info = "loch-note-psk-v1")    keyed note
plaintext       = amount (8) || blinding (31)
ciphertext||tag = ChaCha20-Poly1305(key, nonce = 0, plaintext)

There are two ways to derive the key, and on chain they look the same. An address note is keyed by the X25519 exchange alone: that is a payment to a plain address. A keyed note also takes a 32-byte secret, so that reading it takes the recipient’s X25519 key and the secret, both. Every note a wallet keeps is keyed with its own selfNoteKey: the note of a deposit, the change of every payment, every empty output. A payment to a payment code is keyed with the secret in the code.

The nonce is constant. That is safe here because every key encrypts exactly one message: a fresh ephemeral secret is drawn for every note.

To receive, a wallet tries to decrypt the encrypted note beside every new commitment in the pool. That costs one X25519 operation per output, then one cheap attempt per key: the wallet’s own, the plain one, and one for each payment code it is looking for. There are no view tags. A note that decrypts is accepted only if its commitment, computed again with the wallet’s own public key, equals the one on chain.

The plaintext holds the amount and the blinding, and nothing about the sender. The encrypted notes are part of the ext data, so the proof binds them and a relayer cannot swap them. There is no forward secrecy: the keys are long-lived, and whoever learns them later can read what they read.

The relayer

To send privately or to surface, the user’s wallet signs nothing on chain. The proof authorises the spend, and a relayer signs and pays for the transaction. A public wallet that paid its own network fee would be named beside the payment.

The relayer pays the network fee and the rent of the two nullifier accounts, and is paid a fee out of the vault. That fee is part of what the proof fixes. The relayer names its own fee, and a client refuses to prove above a maximum the user has set. Loch’s relayer asks what a transaction costs it, 0.0014 SOL: nearly all of it is the rent of the two nullifier accounts, which is never returned.

The relayer cannot change the recipient, an amount or the fee. It can refuse a transaction, or delay it. It sees the client’s IP address and the moment of a transfer or a withdrawal, and can tie both to the transaction it then sends.

Deposit screening

A deposit goes through only with a second signature, from the screening authority named in the pool’s configuration, and only up to the cap per deposit set there. Without that signature the program refuses it.

The screening service decides on the public facts of a deposit: the address it comes from and the amount. It also sees the client’s IP address. It cannot see inside the pool, so it bounds who can put funds in and not who ends up with them.

The pool can be paused. The pause stops deposits and nothing else: the program has no instruction that stops a withdrawal. In the new pool it stops swaps too, and deposits can also be stopped for one token; transfers and withdrawals never stop.

Reading the chain

A wallet has to read the pool before it can pay: the tree, the new commitments, the nullifiers already spent. A sync asks only for what every client asks for, the history of the tree account. It does not name the wallet’s own notes.

The RPC endpoint still sees the client’s IP address and everything it asks. The Loch RPC proxy keeps no record of either. That is a statement about software this project runs, and a client cannot check it.

Oblivious HTTP (RFC 9458) is the way to stop depending on that statement. The client encrypts each request to the proxy’s key and sends it through a relay run by someone else. The relay sees who is asking and not what; the proxy sees what and not who. The key exchange is X-Wing, a hybrid of ML-KEM-768 and X25519, so a recording of the relay’s traffic does not open if X25519 is broken later. The gateway and the client are built. No independent relay exists yet, so this path is not in use. Either way, the RPC provider behind the proxy sees every query, coming from the proxy.

Claim links

A claim link pays someone who has no shielded address yet. The payer’s wallet draws a 32-byte secret, derives a whole key set from it, and pays that key set’s address like any other. On chain it is an ordinary private payment.

claimSeed = sha256("Loch claim v2" || secret)
claimKeys = the key set that follows from claimSeed, as a wallet's follows from its seed

code      = bech32m("lochclaim", secret (32) || token (32) || amount (8) || blinding (31) || leafIndex (4))
link      = https://lochlayer.com/claim#code

The code holds everything that spends the note: the keys follow from the secret, and the amount, the blinding and the leaf index open the commitment. Whoever has the link collects it with one private transfer to an address of their own, through the relayer, whose fee comes out of the note. The payer adds that fee on top, so the recipient ends up with the round amount.

A claim link is a bearer secret, like cash in an envelope. Until it is collected, anyone who saw it can take the payment, and so can the payer, who can take it back. The code travels after the # of the link, which a browser does not send to a server, and the page it opens makes no request with it.

A link is paid in SOL or USDC, whose relayer fee is fixed: the fee for collecting it is known when it is made. A link from the earlier pool ("Loch claim v1", without the token) is shorter, and is still collected there.

Paying several people

Under Send, Pay several people takes a list, one payment per line, in one token, and makes the payments one after another, each its own transaction. A line is a shielded address or payment code, the word link, or a public Solana address, then the amount, then a name if you like. The list is kept in your wallet: closing the window does not lose it, and a payment that fails stops the list until you try it again or skip it.

How each person is paid decides what it shows. To a shielded address or a payment code: nothing about them appears on chain. With a link: they collect when they choose, so the moments money leaves the Loch are theirs, not yours. To a public address: the payment is a withdrawal, and anyone can see what arrived. Withdrawals made one after another are easy to tie together while few people use the Loch, so before a list with public addresses starts, the extension says how many transactions the pool saw in the last day. Payments are never put in one transaction: that would prove they belong together, and would not cost less.

Pay links

A pay link lets anyone pay you from an ordinary Solana wallet, without Loch and without learning your wallet’s address. It is a payment code of yours in an address on this site. Make one in the extension under Receive, at Your pay link, and post it wherever people should be able to pay you.

link = https://lochlayer.com/pay/<payment code, lochpay1...>

Wallets that open Blinks, such as Phantom, show a pay button for the link. The payer picks an amount and approves one transaction: a deposit into the Loch from their wallet whose shielded note is made out to your payment code. Loch’s server puts that transaction together, proof included, and the screening authority signs it, as it does every deposit. In a browser the link opens a page on this site that gives a Loch user the code to paste into Send privately.

Public
The payer’s wallet, the amount and the time: a deposit is an ordinary public transaction. The payer also pays about 0.0014 SOL in network costs.
Not on the chain
Who was paid. The note arrives in your shielded balance like any other payment to your code, and only your wallet can read or spend it.
Seen by our server
To build the transaction, the server reads the payment code in the link and the payer’s wallet address. It keeps no record of either.
A code in public
Anyone who sees the link can pay you, and everyone who does pays the same code. Its secret is no secret once it is posted, so the notes paid to it are protected by your address’s key alone, as notes paid to a plain address are. Give a private payment code to whoever should not share a link with the world.

Receipts, reports and viewing keys

A wallet can choose to show something about its own transactions, and whoever is shown it can check it against the chain on the verify page. None of it involves the circuit or the program. It rests on the two hashes above.

commitment = Poseidon(amount, publicKey, blinding)
nullifier  = Poseidon(commitment, leafIndex, tag)
tag        = Poseidon(privateKey, commitment, leafIndex)

Giving the amount, the owner key and the blinding of a note shows what a commitment on chain holds. Giving its tag as well shows which nullifier spent it, and so in which transaction. The tag is a hash of the spending key that is good for that one note: it spends nothing and says nothing about any other note.

A payment receipt
Opens one output of one transaction. It shows that the transaction created a note of a stated amount that only the holder of a stated shielded address can spend. It does not show who paid: the payer and the recipient can both make it, and nobody else can.
A source-of-funds report
Opens both inputs of a withdrawal, and of the wallet’s earlier transactions that created those notes, back to the deposits. Each step is checked against the nullifiers on chain. An input of amount zero carried nothing in. Where the path reaches a note that came from another wallet, it stops there and says so. It lists where the money entered the pool; it does not divide the withdrawn amount among those deposits.
A viewing key
The three secrets that read a wallet’s notes, without the one that spends. Its holder sees every payment the wallet receives, its own deposits and change included, for good. A nullifier takes the spending key, so the holder sees no spend and no balance. It cannot be revoked.

These are disclosures, not zero-knowledge proofs: whoever holds a receipt or a report sees what it opens. A wallet can only open what it kept. Loch records what a report needs when it makes a transaction, so a report covers transactions made with a version that has this feature, on the device that made them.

Depth proofs

A depth proof answers one question: does this wallet hold at least so much in the Loch? It is a zero-knowledge proof, so it shows that and nothing else: not the balance, not which payments, not any address. A seller, a desk or a landlord who asks for proof of funds can have it without a view into the wallet. Whoever is shown one checks it on the verify page.

The proof covers up to four of the wallet’s notes, with the commitments and nullifiers above. It proves that each note is in the pool’s tree under a recent root, that all of them belong to one key, that their amounts add up to at least the stated threshold, and what their nullifiers are. It is a Groth16 proof from a small circuit of its own, checked in the verifier’s browser; the program never sees it, and it moves nothing.

public:  root, threshold, challenge, nullifier[4]
proves:  sum(amount[i]) >= threshold, every note in the tree under root, one key
It answers a challenge
The person checking gives a challenge first, any short text, and the proof is made for it: the text is hashed into the proof, together with the network. A proof made earlier, or for someone else, answers another challenge and is turned away.
Unspent, read from the chain
The proof cannot say by itself that its notes are unspent. The checking page asks the chain, at one slot, whether the proof’s root is still among the pool’s 64 most recent roots, and whether any of its nullifiers has been recorded. A proof stops checking out when one of its notes is spent, or after 64 more pool transactions.
What it costs you
The nullifiers in the proof are public from then on. Whoever holds the proof can see when each of those notes is spent, and in which transaction; if that transaction is a withdrawal, where the money went. Before you surface from notes you have shown, move them to fresh ones with a transfer to yourself: the trail then ends at that transfer.
Four notes at most
The proof shows the fewest notes that reach the amount. If it would take more than four, merge notes first with a transfer to yourself.
How to make one
In the extension, choose “Prove depth”, give the amount to prove and the challenge you were sent, and hand over the code or the link it gives you. The proof is made on your device; the code holds nothing secret.

Leaks outside the Loch

A shielded balance does nothing for the history a public wallet already has. The leak scanner reads that history and scores it out of 100, with six checks.

FindingIt fires when
Funding source is publicThe wallet ever received anything
Linked to identified servicesA counterparty carries a known label
Recurring counterpartiesA counterparty appears three times or more
Your time zone is guessableThe quietest six hours of the day hold under 5% of at least 20 timed transfers
Exact amounts passed straight throughAn outgoing amount equals an incoming one that arrived less than 600 seconds earlier
Balance is visible to everyoneThe wallet holds over 10 SOL, or more than 10 token accounts

The extension uses the same analysis before a public payment. A plain SOL transfer or a token transfer from the user’s wallet is assessed against the last scan, and a finding of medium severity or higher interrupts with a dialog: cancel, or send anyway. The extension also refuses to pass on a request to sign the key-derivation message.

These checks are help and not a barrier. They see only the requests that come through the Loch wallet a site was offered. A site can ask the real wallet directly, and then the wallet’s own prompt is all there is.

What an observer sees

Everything in the left column is on chain for anyone to read. The right column is what stays with the people involved.

TransactionPublicShielded
Dive inThe depositing address, the exact amount and the time. That the screening authority signed. Two new commitments, each with an encrypted noteWhich notes the deposit became, and what is done with them afterwards
Send privatelyThat it is a transfer. The root it was proved against, two nullifiers, two new commitments, two encrypted notes, the fee and the relayerThe sender, the recipient and the amount
SurfaceThe destination, the exact amount and the time. Two nullifiers, two new commitments, the fee and the relayerWhich deposit, or which payments, the funds came from

Amounts and times correlate. Diving in with 3.1337 SOL and surfacing 3.1337 SOL an hour later links the two for any observer. The crowd a withdrawal hides in is the set of deposits that could plausibly have funded it, and today that set is tiny.

What this version does not protect

The signature is the wallet
Any site that gets the user to sign the key-derivation message obtains the shielded keys for good. Whoever holds the wallet’s seed phrase holds the shielded balance too. There is no separate recovery and no rotation.
One key spends and reads
Anything given the spending key can read the wallet’s whole history and everything it will receive. There are no viewing keys to hand to a third party. In the new pool the keys are separate and viewing keys exist, but none can be revoked.
Dive in and surface are public
The address, the exact amount and the time are on chain, and so are the type of every transaction, its fee and its relayer. Only the link between a deposit and what follows is hidden.
One address for each person
A shielded address is a stable identifier. Everyone who is given it knows they are paying the same recipient, and two people can compare. A payment code starts with the same address, so it does not change this. Anyone who knows the address can send notes to it, wanted or not. In the new pool every payment code is an address of its own.
The network sees you
The relayer, the screening service and the RPC endpoint each see the client’s IP address. The RPC endpoint is also trusted for what the chain contains: it can hide a spend or invent one until the wallet syncs elsewhere. Neither moves funds.
A one-person setup, and no audit
Each pool’s circuit has its own development setup, and whoever ran it could forge proofs and drain that pool. Neither the circuits nor the program has had an external audit.
An admin key
The program’s upgrade authority can replace the program, and with it every rule here. The pool’s admin can replace the screening authority, change the deposit cap and pause deposits. In the new pool the admin also adds tokens and chooses the program that swaps go through. The admin key cannot be rotated.
A finite tree
After 524 288 transactions the earlier pool is frozen, withdrawals included; the new pool after 16 777 216. A transaction of zero value is valid and needs no screening, so capacity can be used up for the price of rent and fees.

A quantum computer

No machine exists that breaks today’s public-key cryptography. The chain is permanent, though, so the question is what someone who records it now could read with such a machine later. Forging is different: it needs the machine at the time, and cannot reach back.

Stays unreadable
Everything a wallet keeps: its deposits, its change, its balance. Those are keyed notes, and their second key is in no address. So is what a payer sends to a payment code, as long as the code itself stayed private. Proofs already on chain say nothing to anyone, whatever they can compute, and commitments and nullifiers are hashes.
The shielded keys
They do not follow from the wallet’s public key. A quantum computer gets the signing key from it, but the keys come from one exact signature, and making that signature again takes a second secret that is behind a hash. This argument has not been reviewed.
Becomes readable
A payment to a plain loch1 address, for anyone who knows the address: the amount, and which commitment it is. Not who paid, and not when it was spent. Ask for a payment code if that matters.
Can be forged, from then on
Proofs, and with them a withdrawal of whatever the pool holds. And every Solana signature, the program’s upgrade authority included. Funds here are exactly as safe from a quantum computer as Solana is.

A post-quantum key exchange does not fit in a note: its smallest ciphertext is 1088 bytes, and a deposit has 24 bytes to spare. A secret shared in advance costs nothing on chain. Its price is that the recipient has to get the code to the payer privately.

Not built yet

  • The public setup ceremony that replaces the development proving key.
  • Two external audits, one of the circuit and one of the program.
  • Stealth receive in the earlier pool, where a payment code names the same owner every time. The new pool has it.
  • A way to revoke a viewing key.
  • An independent Oblivious HTTP relay.
  • Depth proofs, claim links, receipts and source-of-funds reports for the new pool.
  • Checking the wallet’s own Ed25519 signature inside the proof, so that no derived key has to exist. This is research: Ed25519 is expensive to verify in a BN254 circuit, and a quantum computer forges that signature, which it cannot do to the derived key.

The numbers

Measured on a local validator with real proofs. The new pool’s compute units and proving time have not been measured the same way yet.

WhatEarlier poolNew pool
Constraints in the circuit12 69816 875
Public inputs79
Proof, bytes256256
Encrypted note, bytes87103
Shielded address, characters114139
Payment code, characters168194
Depth of the tree2026
Transactions the tree holds524 28816 777 216
Recent roots accepted6464
Compute units for one transact159 241 to 175 768not measured
Largest transaction, of 1232 bytes allowed1208not measured
Proving time in the extension, secondsabout 3.5not measured
Loch’s relayer fee0.0014 SOL0.0014 SOL or 0.20 USDC

This website

What this site does in your browser, and what it does not.

A policy the browser enforces
Every page is sent with a Content-Security-Policy that allows no inline style, no script from anywhere but this site, and only the few places a page may connect to. The few scripts written into a page itself each carry a random value made for that one response, which the policy names. Nothing else written into a page can run.
Nothing from anyone else
The fonts, the styles, the scripts and the drawings are this site’s own files. A page makes no request to another server until you start a scan.
It reads without scripts
The text, the cautions and these docs work with JavaScript off. Only the live leak scan, the checks on the verify page, reading a claim link, the copy button of a pay link and the palette switch need it.
What runs behind the pages
A program of ours puts each page together when it is asked for. It is told which page, and nothing about who asks: the web server in front of it does not pass your IP address on. It sets no cookie, keeps no record of a request, and holds nothing but the site’s own text. That is a statement about software we run, and you cannot check it from where you are.

Back to the start page