Privy enables you to import wallet private keys for use via the Privy API. This allows you to migrate wallets from external sources to Privy, including from a different wallet provider. Or, your app can enable users to bring an existing external wallet into your application in order to access and manage their assets within your app seamlessly.

Importing a wallet

To import a private key wallet with the NodeJS SDK, use the importWallet method from the Privy client’s walletApi class. The Privy client will encrypt your private key for secure transmission to the TEE. See architecture for more details.
For EVM wallets, the Privy client accepts a hex-encoded private key, with or without a 0x prefix.
import {PrivyClient} from '@privy-io/server-auth';

const privy = new PrivyClient('your-app-id', 'your-app-secret');

const wallet: WalletApiWalletResponseType = await privy.walletApi.importWallet({
  address: '<your-wallet-address>',
  chainType: 'ethereum',
  entropy: '<your-hex-encoded-wallet-private-key>',
  entropyType: 'private-key'
});
The returned wallet is type WalletApiWalletResponseType. See get wallet by ID for type definition.

Using imported wallets

Imported wallets function the same way as Privy-generated wallets. See the API reference for Ethereum or Solana for information about how to send transactions and execute other wallet operations.