Withdraw

A withdrawal proves, on your device, that you hold an unspent note in a screened set, then pays the address you choose. Nothing in it points back to your deposit, but its amount and timing are still public.

3 min readReviewed [DOCS_REVIEW_DATE]

Before you withdraw

  • The note's deposit must be confirmed and included in an association set. See Wait for inclusion.
  • Choose the recipient. An address with no history that links it to you gives the most privacy. Withdrawing to the address you deposited from links the two in plain sight.
  • Think about amount and timing before you start; see the privacy model.

The proof, made on your device

To withdraw, your device needs your note plus a current view of the pool's Merkle tree and of the association set. From these it generates a zk-SNARK proof. Without revealing which deposit is yours, the proof shows that:

  • you know the secret behind a commitment in the pool's tree, under a root the contract recognises;
  • the same commitment is in the association set you chose;
  • the nullifier hash it publishes was derived from that note, so the note can only be spent once;
  • the amount, recipient and any relayer fee are the ones in this transaction.

In the standard design the secret stays on your device; only the proof and its public inputs are sent (where Kryphe keeps notes: [VAULT_MODEL]). Proving can take a while on slower hardware.

The contract then checks that the root is one it knows, verifies the proof, confirms the nullifier hash has not been used, records it, and pays the recipient.

Choosing an association set

Your proof names the set it proves membership in, and that choice is public. You hide among the deposits in that set, not the whole pool, so a larger set gives more cover.

Sets offered: [ASSOCIATION_SET]. Provider and criteria: [ASP_POLICY]. More in Screening.

Relayer or self-paid gas

A withdrawal is a transaction, and someone has to pay its gas.

Self-paidRelayer
Who sends the transactionAn address you controlThe relayer
Who pays gasThat addressThe relayer, recovered from its fee
A fresh recipient needs gas firstYes, and funding it can link it to youNo
CostElysium gasFee: [RELAYER_FEE]
Visible on-chainThe sending addressThe relayer's address and fee
Can be refusedNoYes; try another relayer or pay yourself

In the standard design the recipient and fee are bound into the proof, so a relayer can submit or decline a withdrawal but cannot change where it goes. Relayers on Kryphe: [RELAYER_SUPPORT].

Partial withdrawals and change notes

Some privacy-pool designs let you withdraw part of a note's value. The withdrawal spends the old note, recording its nullifier, and creates a commitment to a new note for the remainder. That change note has a fresh secret and goes into the tree like a new deposit, so it needs a backup like any other note.

On Kryphe: [PARTIAL_WITHDRAWAL].

Amounts matter here as well. Withdrawing a large, unusual deposit as several common amounts can blend in better than one exact match; leaving an unusual remainder can stand out later.

What the chain records

The amount, the recipient, the time, the association set used and the nullifier hash; plus the relayer and its fee, if one was used. Not which deposit paid for it.

If a withdrawal fails

  • The tree moved on. Pools accept proofs against a known root. If yours is no longer recognised, regenerate the proof against the current tree.
  • The nullifier has already been used. The note was spent before. If you did not spend it, assume the secret has leaked; see If the secret leaks.
  • Your deposit is not in the chosen set yet. Wait for inclusion, or choose a set that includes it.
  • The relayer declined. Try another relayer, or pay gas yourself.