Skip to main content
A smart wallet is an account controlled by a program rather than by one private key: a Squads vault, a Swig account, a passkey wallet, or an ERC-4337 account on an EVM chain (including Privy smart wallets). Cloak has no direct support for these as the owner of a private balance. This page explains why, and the patterns that do work.

Why a smart wallet cannot shield directly

A Cloak shield from Solana has three requirements that a program-owned account cannot meet:
  • A top-level ed25519 signer that is also the fee payer. The shield’s first account is the payer, as a transaction signer. A PDA has no private key, so it cannot sign a top-level transaction.
  • A risk-assessment instruction at index 0 of the transaction. The program checks it by instruction introspection, so the shield cannot be wrapped in a vault program’s execute call.
  • No CPI. The program rejects its tree-appending instructions when another program invokes them (CpiNotAllowed, 0x10D8). See Custom program integration.

Why a smart wallet cannot open an account by signature

createCloak derives the account from a signature of CLOAK_ACCOUNT_MESSAGE, so the wallet must produce the same signature every time: A refused wallet throws StoredAccountRequiredError on the first open.

Pattern 1: a stored account key

For a wallet that cannot sign repeatably, createCloak can create a random account key, keep it in storage, and return its 24 backup words once. The wallet no longer opens the account. Whether it can still shield its own funds depends on whether it can sign a top-level shield transaction, which a program-owned account cannot.
The account key now lives in your storage, not in the wallet. Losing both the storage and the backup words loses the private balance. memoryStorage() and encryptedStorage(...) protect secrets; the browser default (localStorage) does not, so pass one of the first two.

Pattern 2: business mode

An organization that wants a treasury-style private balance can hold the account key itself and skip wallet signatures entirely:
Fund it by shielding from an ordinary wallet the organization controls, or by having anyone send to treasury.address. Spends need no wallet. Gate who may trigger them in your backend, since whoever holds the key can spend. See Backend integration.

Pattern 3: an operational hot key

Keep the multisig as the cold store, and give Cloak an ordinary key that the multisig funds:
  1. The multisig transfers USDC to a hot wallet with a normal ed25519 key.
  2. The hot wallet shields into its private balance with createCloak({ wallet: hotKey }).
  3. Withdrawals can go back to the vault’s address.
The multisig’s approvals control what enters the hot wallet. The private balance belongs to the hot key’s Cloak account.

Withdrawing to a program-owned address

Payouts to other networks refuse an address that is not a plain wallet. A withdrawal on Solana to a PDA is not something the SDK documents as supported. Withdraw to an ordinary address the vault controls, or test with a small amount first.

Summary