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.
Pattern 2: business mode
An organization that wants a treasury-style private balance can hold the account key itself and skip wallet signatures entirely: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:- The multisig transfers USDC to a hot wallet with a normal ed25519 key.
- The hot wallet shields into its private balance with
createCloak({ wallet: hotKey }). - Withdrawals can go back to the vault’s address.