> ## 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.

# Wallet integrations

> Which wallets work with Cloak, what each one has to sign, and which page to follow for yours

Cloak works with the wallet your users already have. This page explains what Cloak asks a wallet to
do, so you can tell whether a given wallet architecture fits, and links to the guide for each one.

## Three kinds of wallet

| Kind | Examples | Who holds the key | Fits Cloak |
| - | - | - | - |
| **Externally connected** | Phantom, Solflare, Backpack, a Ledger through one of them | The user, in a browser extension, mobile app or hardware device | Yes |
| **Embedded** | Privy embedded wallets, server-held keys | A provider or your backend, on the user's behalf | Yes, when it signs messages deterministically |
| **Smart contract** | Squads vaults, Swig, ERC-4337 accounts (including Privy smart wallets) | A program; the address is a PDA or contract with no private key | No direct support. See [Smart wallets](https://docs.cloak.ag/wallets/smart-wallets.md) |

What matters is what the wallet can sign, not who hosts the key. Cloak needs
two capabilities, and a wallet can have one without the other.

## What Cloak asks a wallet to sign

With `createCloak`, a wallet signs at most two kinds of thing:

| Action | What the wallet signs | How often |
| - | - | - |
| Open the account | The fixed message `CLOAK_ACCOUNT_MESSAGE` (ed25519 `signMessage`) | Twice the first time this wallet is seen on a device, to check it signs the same way twice. Once on later sessions |
| Shield from Solana | One Solana transaction (a v0 versioned transaction with address lookup tables) | Once per shield |
| Private send, withdraw, payout | Nothing. A key derived from the account signs these requests | Never |
| Shield from Base, Polygon or Sui | One transfer on that chain, signed by that chain's wallet | Once per shield |

The account is derived from the signature, so a wallet must produce the same signature for the same
message every time. A standard ed25519 key does. Passkey wallets, ERC-1271 contract signatures and
some MPC schemes do not, and `createCloak` refuses them unless you opt into a stored account key.

The SDK never calls `signAllTransactions` or a wallet's send method. It submits every transaction
itself through your RPC.

> [!NOTE]
>
> The low-level API signs differently. With `transact`, `transfer`, `partialWithdraw` and the swap
> helpers, the user's wallet authenticates every submitted request with a message signature, so a send
> prompts the wallet once per submitted request. Keys come from a seed you store, not from a wallet signature. See
> [Solana wallet adapter](https://docs.cloak.ag/wallets/wallet-adapter.md) and [Request authentication](https://docs.cloak.ag/sdk/request-authentication.md).

## Who pays fees

| Flow | Fee payer |
| - | - |
| Shield from Solana | The user's wallet pays the network fee, so it needs a little SOL |
| Private send, withdrawal, swap | Paid for the user. The user's wallet needs no SOL and never appears as the sender |
| Shield from another chain | The origin wallet pays that chain's gas |

Deposits can be sponsored with the low-level API's `externalFeePayer` option. See
[Custom signers](https://docs.cloak.ag/wallets/custom-signers.md#sponsored-deposits). Wallet-provider gas sponsorship that
only works through the provider's own sign-and-send call does not apply, because the SDK submits
transactions itself.

## Pick your guide

> [card] [Phantom and Wallet Standard](https://docs.cloak.ag/wallets/phantom-and-wallet-standard.md)
>
> Phantom, Solflare, Backpack and every wallet that registers through Wallet Standard.

> [card] [Solana wallet adapter](https://docs.cloak.ag/wallets/wallet-adapter.md)
>
> `@solana/wallet-adapter-react` with `createCloak`, and the full low-level wiring.

> [card] [Privy](https://docs.cloak.ag/wallets/privy.md)
>
> Embedded Solana wallets created at login, plus external wallets connected through Privy.

> [card] [Smart wallets](https://docs.cloak.ag/wallets/smart-wallets.md)
>
> Squads, Swig, passkeys and ERC-4337 accounts: what works and what does not.

> [card] [EVM wallets](https://docs.cloak.ag/wallets/evm-wallets.md)
>
> Shield from Base and Polygon with MetaMask, Rabby, Coinbase Wallet or viem.

> [card] [Hardware wallets](https://docs.cloak.ag/wallets/hardware-wallets.md)
>
> Ledger and Trezor, which sign transactions but not arbitrary messages.

> [card] [Custom signers](https://docs.cloak.ag/wallets/custom-signers.md)
>
> Server keys, Privy server wallets, KMS signers and sponsored deposits.

## Compatibility at a glance

| Wallet | Open account by signature | Shield from Solana | Notes |
| - | - | - | - |
| Phantom, Solflare, Backpack | Yes | Yes | Driven through Wallet Standard, no `@solana/web3.js` needed |
| Privy embedded Solana wallet | Yes | Yes | Pass the wallet from `useWallets()` |
| Ledger, Trezor | No | Yes | Open the account with a Cloak Key, or use the low-level API |
| Server key (`signerFromSecretKey`) | Yes | Yes | Or skip the wallet with business mode |
| Privy server wallet | Yes | Yes | A `@solana/kit` signer; its send capability is ignored |
| EVM wallet | Yes | No, it shields from Base or Polygon | Opens the same account on any device |
| Squads, Swig, ERC-4337 | No | No | Use a member key or business mode |

`recognizeWallet(input)` tells you how the SDK sees a wallet before you open an account with it.


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