Skip to main content
This page is the first-run path with createCloak: open the account from a wallet, shield some USDC, send part of it privately, and withdraw.
Cloak runs on Solana mainnet only, and there is no test network. Test with small amounts: the smallest USDC deposit is 1 USDC, and a withdrawal pays the pool’s fee (see What this costs). Use a wallet you can afford to experiment with.

1. Install

You need Node 22 or later, or a browser bundler, and a mainnet RPC URL of your own: the default public endpoint is rate-limited.

2. Open the account

Pass the wallet the user connected. Its signature of a fixed message opens the account, the same one the Cloak mobile app shows for that wallet. The first time a wallet is seen on a device it signs twice, so the SDK can check it signs the same way each time:

3. Move money

Each call resolves with a receipt (status, amount, fee, txs) and throws a CloakCallError whose code says what happened and whose retryable says whether trying again can work. Sending to another network is the same call with a different to; see Other networks.

4. The same calls from a server script

A script signs with a key it holds instead of a connected wallet:
The wallet needs the USDC and a little SOL for the deposit transaction. The first proof downloads the circuit bundle (cached afterwards), so expect the first run to be slower. A long-running service passes a storage that outlives the process; see Business mode.

What this costs

Fees are charged by the on-chain program, only when value leaves the pool:
  • Shields and private sends carry no protocol fee (network fees only).
  • A withdrawal pays the pool’s fee. withdraw adds it on top, so exactly the amount you name arrives, and quote shows it before anything moves.
See Fee model for each pool’s figures.

Where to go next