> ## Documentation Index
> Fetch the complete documentation index at: https://docs.cloak.ag/llms.txt
> Use this file to discover all available pages before exploring further.

# Withdraw to a public address

> Move funds from the private balance to any Solana address, with the fee added on top

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](https://docs.cloak.ag/get-started/quickstart.md).

## Withdraw an exact amount

`amount` is what arrives. The pool's fee is added on top and taken from the private balance:

```ts theme={null}
const quote = await cloak.quote({ to: "<a Solana address>", token: "USDC", amount: "20" });
console.log(`${quote.arrives.atLeast} USDC arrives, fee ${quote.fee} USDC`);

const receipt = await cloak.withdraw({
  to: "<a Solana address>",
  token: "USDC",
  amount: "20",
  ref: "withdrawal-8841", // optional: never withdraws twice for the same ref
  onProgress: (step) => console.log(step),
});
console.log(receipt.status, receipt.amount, receipt.fee, receipt.txs.solana);
// "withdrawn", "20", "<the fee>", "<signature>"
// Observed on 2026-11-30: withdrawing 10 USDC quoted a fee of 0.481444 USDC.
```

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](https://docs.cloak.ag/concepts/fees.md).

## Withdraw versus send

| Call | `to` | Result |
| - | - | - |
| `withdraw` | A Solana address | Public tokens at that address; fee applies |
| `send` | A `cloak_` address | A private note in the recipient's balance; no fee |
| `send` | A Solana address | Same as `withdraw` |
| `send` | A Base, Polygon, Sui or Tron address | A payout on that chain. See [Cross-chain](https://docs.cloak.ag/guides/cross-chain.md) |

`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](https://docs.cloak.ag/concepts/privacy-guarantees.md).

## Common errors

| Code | Cause | Fix |
| - | - | - |
| `balance.insufficient` | The private balance cannot cover the amount plus the fee | Lower the amount; `quote` shows the fee |
| `withdraw.failed` | The withdrawal did not complete; retryable | Retry. `moneyAt` says where the money is |
| `route.private` | `to` is a `cloak_` address | Use `send` |
| `ref.unsettled` | An earlier call with this `ref` started and never recorded its end | Reconcile before retrying |

## 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](https://docs.cloak.ag/sdk/low-level-api.md#withdraw-and-transfer-helpers).

## Related

* [Deposit](https://docs.cloak.ag/guides/deposit.md)
* [Payment links](https://docs.cloak.ag/guides/payment-links.md): let someone else claim to their own address.


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.