Skip to main content

Function Signature

Description

Imports an existing Solana private key into the MPC wallet system. The private key is split into shares according to the specified threshold signature scheme. Returns a walletMetadata object (non-sensitive identity + backup pointers) alongside the sensitive externalServerKeyShares. Persist bothwalletMetadata in your cache and externalServerKeyShares in a secrets vault.

Parameters

Required Parameters

  • privateKey (string) - The private key to import
  • chainName (string) - The chain name (use 'SVM' for Solana)
  • thresholdSignatureScheme (ThresholdSignatureScheme) - The threshold signature scheme

Optional Parameters

  • password (string) - Required when backUpToDynamic is true.
  • onError ((error: Error) => void) - Error callback function
  • backUpToDynamic (boolean) - Whether to back up the first key share to Dynamic. When true, a password must be provided.

Returns

  • Promise<object> - Object containing wallet information:
    • walletMetadata (WalletMetadata) - Persist in cache.
    • rawPublicKey - Raw public key
    • externalServerKeyShares (ServerKeyShare[]) - Store in secrets vault.
    • externalKeySharesWithBackupStatus - Array of key shares with their backup status

Example

Last modified on May 21, 2026