Overview

This guide shows you how to import existing Ethereum private keys into Dynamic’s MPC wallet system. This is useful when migrating from traditional wallets or integrating with existing systems.

Prerequisites

Import Your Private Key

import { authenticatedEvmClient } from './client';
import { ThresholdSignatureScheme } from '@dynamic-labs-wallet/node';

const evmClient = await authenticatedEvmClient();

const wallet = await evmClient.importPrivateKey({
  privateKey: '0xYourPrivateKey' as `0x${string}`,
  chainName: 'EVM',
  thresholdSignatureScheme: ThresholdSignatureScheme.TWO_OF_TWO,
  password: 'your-secure-password'
});

console.log('Wallet imported:', wallet.accountAddress);
console.log('Public key:', wallet.publicKeyHex);

Security Considerations

  • Private Key Format: Must be 64 hex characters with 0x prefix
  • Password Security: Use a strong, unique password
  • Key Storage: Never store private keys in plain text after import
  • Backup: Ensure you have a secure backup of your original private key

Threshold Signature Schemes

Choose based on your security and availability needs:
  • TWO_OF_TWO: Maximum security, requires both server and Dynamic
  • TWO_OF_THREE: Balanced security and availability
  • THREE_OF_FIVE: High availability, can tolerate 2 parties offline

Next Steps