Skip to main content
A withdrawal (an unshield) moves value out of the private balance to a public Solana address. It is submitted for the user, so the user’s wallet is not asked to sign and needs no SOL, and it does not appear as the sender.

Prerequisites

  • An opened createCloak object with a private balance. See Quickstart.

Withdraw an exact amount

amount is what arrives. The pool’s fee is added on top and taken from the private balance:
The fee is the pool’s fixed fee plus 0.3% of the amount leaving the pool, read live from the pool’s on-chain config. For USDC that is 0.45 USDC plus 0.3%, and for BRS 2.3 BRS plus 0.3%. See Fees.

Withdraw versus send

withdraw to a cloak_ address throws route.private: use send.

Privacy when withdrawing

The recipient address and the amount are public. Withdrawing exactly what was deposited, shortly after depositing, is the easiest case for an observer to link. See Privacy guarantees.

Common errors

With the low-level API

partialWithdraw(inputs, recipient, gross, options) and fullWithdraw(inputs, recipient, options) take the gross amount; the fee comes out of it. Keep inputs at two notes or fewer. See Low-level API.