Skip to main content
A deposit (a shield) moves tokens from a public wallet into the user’s private balance. It is the one flow the user’s wallet signs and pays for, because the funding wallet is public on the way in anyway.

Prerequisites

  • An opened createCloak object. See Quickstart.
  • The token in the wallet, plus a little SOL for the network fee.
  • At least the pool minimum: 0.01 SOL, or 1 USDC or USDT.

Shield from a Solana wallet

Expected output:
The wallet signs one transaction. Shields carry no protocol fee; the wallet pays the Solana network fee. The new note is recoverable from the chain with the account’s viewing key, so it survives a lost device.

What onProgress reports

A shield from Solana reports steps such as Validating transaction parameters..., Generating ZK proof..., Waiting for wallet signature..., Sending transaction... and Confirming transaction.... The first shield of a page load also reports Downloading circuit files (n of m MB).... Treat the text as display only; it is not an API. See Events and callbacks.

Shield from another chain

Pass an EVM or Sui wallet to createCloak, then name the chain:
The origin wallet sends one transfer and pays that chain’s gas. See Cross-chain.

Quote first

Common errors

With the low-level API

A deposit is transact with a zero input note and a positive externalAmount. Build the output with createRecoverableDepositUtxo and pass its salt as chainNoteSalt. The full example is in Low-level API.