> ## Documentation Index
> Fetch the complete documentation index at: https://docs.crossmint.com/llms.txt
> Use this file to discover all available pages before exploring further.

# Migrate from Embedded Wallets

> Plan a migration from Privy or Turnkey embedded wallets to Crossmint smart wallets

Crossmint supports migrating your application from an embedded wallet provider such as Privy or Turnkey to Crossmint smart wallets.

A migration creates a new Crossmint smart wallet for each user and moves the assets from their existing embedded wallet into it. The user ends up with a new address — a smart contract wallet controlled by the signers attached to it. The plan is the same for Privy and Turnkey.

> [!NOTE]
>
> This page covers migration planning and the available paths. Contact [Crossmint](https://www.crossmint.com/contact/sales) before you start — migration requires configuration on the Crossmint side.

## What Every Migration Has in Common

1. **Authentication** — for client-side wallets only. Today Privy or Turnkey signs your users in. Crossmint wallets need your own auth provider instead, such as Auth0 or Firebase (see [Migrate User IDs](#migrate-user-ids)).
2. **Wallet provisioning** — you create a Crossmint smart wallet for the user, with the signers you choose (device, passkey, email or phone OTP, server, or external wallet — see [Signer Types](https://docs.crossmint.com/wallets/concepts/signer-types.md)).
3. **Asset transfer** — assets move from the old wallet to the new one (see [Moving the Assets](#moving-the-assets)).
4. **Cutover** — you stop creating wallets with the old provider, keep it running until every user is migrated, then switch it off.

## Choose a Migration Path

Your path depends on who can sign for the old wallets. If only the user can sign (non-custodial), each user is migrated the next time they log in. If your backend can sign without the user (custodial), you can migrate everyone in one batch. Server wallets your app controls are custodial; wallets only the user's session can sign for are non-custodial.

### A. Migration on Login

1. The user logs in with Privy or Turnkey.
2. Your app creates the user's Crossmint wallet in the background, using a JWT from your own auth provider (see [Migrate User IDs](#migrate-user-ids)), or your backend pre-creates it.
3. Your app signs a transfer from the embedded wallet. Whether the user sees a confirmation is up to you; for a fully silent flow, hide the provider's wallet UI (for example, Privy's `showWalletUIs: false`).
4. Once the transfer is confirmed onchain, your app marks the user as migrated. From then on, the user signs in only with your own auth provider and uses the Crossmint wallet.

To pre-create the wallets, your backend creates one per user with the locator `userId:<user-id>` and the user's email as the recovery method. The wallet has no device signer yet: on the user's first transaction, they confirm an email code and the SDK adds one (see [Server-Side Wallet with Device Signer](https://docs.crossmint.com/wallets/guides/signers/device-signer-server-wallet.md#new-device-recovery)).

**What the user sees:** a normal login, and a new wallet address in the app.

**What it costs you:** you keep the Privy or Turnkey SDK next to Crossmint's during the migration, and track which users have migrated. Crossmint handles the transfer itself (see [Moving the Assets](#moving-the-assets)).

**Limits:**

* Only users who log in during the migration window are migrated.
* The address changes. If you exposed it in your app and your user shared it elsewhere, they will need to update the address in those places.

### B. Backend Batch Migration

This path works only for custodial wallets, where your backend can sign for the old wallets.

1. Export your user list from Privy or Turnkey.
2. Create a Crossmint wallet for each user from your backend, keyed by the [wallet locator](https://docs.crossmint.com/wallets/concepts/wallet-locators.md) `userId:<user-id>`, using the user ID from your auth provider.
3. Sign a transfer from each old wallet with your provider credentials.
4. Confirm each transfer landed and the old wallet is empty before marking the user migrated.

**What the user sees:** nothing. On their next login they land on the Crossmint wallet.

**What it costs you:** a one-off backend script, run in batches. No client-side migration code.

## Moving the Assets

The recommended move for every path is a plain transfer: assets go from the old wallet to the new Crossmint smart wallet, which gets a new address.

On every chain, the transfer follows the same steps:

1. The old wallet approves the migration once — signed by the user, or by your backend for custodial wallets.
2. All its tokens and NFTs move to the new wallet in a single batch.
3. Crossmint's fee payer pays the network fees, so the old wallet does not need to hold any native token.

## Migrate User IDs

Two questions decide what you migrate:

* **Do Privy or Turnkey sign your users in?** Move them to your own auth provider and keep their original user IDs (steps below).
* **Does your database link users to wallets?** Once a user's assets have moved to their new Crossmint wallet, update the wallet address you store for them.

The typical setup when Privy or Turnkey signs your users in:

1. Export your users from the source provider, with their user IDs (the Privy DID, or the Turnkey user ID).
2. Create matching accounts in your auth provider (for example, Auth0), storing the original user ID in the user's metadata.
3. On login, put that original user ID into a claim of the JWT (for example, `https://crossmint.com/user_id`), so the same user resolves to the same Crossmint wallet.
4. In the Crossmint Console, [set your auth provider as the JWT authentication method](https://docs.crossmint.com/wallets/guides/bring-your-own-auth.md), with that claim as the user ID.

Once every user is migrated, you retire the source provider integration. For a detailed guide on this setup, reach out to [Crossmint](https://www.crossmint.com/contact/sales).

## See Also

> [card] [Signers](https://docs.crossmint.com/wallets/concepts/signers.md)
>
> The full signer type reference and recommended configurations

> [card] [Custody Models](https://docs.crossmint.com/wallets/concepts/custody-models.md)
>
> How signer choices map to custody architectures

> [card] [Use Your Own Auth Provider](https://docs.crossmint.com/wallets/guides/bring-your-own-auth.md)
>
> Use your own auth provider with Crossmint wallets

> [card] [External Wallet Signer](https://docs.crossmint.com/wallets/guides/signers/external-wallet.md)
>
> Delegate signing to a wallet the user already controls
