Documentation Index
Fetch the complete documentation index at: https://docs.dynamic.xyz/docs/llms.txt
Use this file to discover all available pages before exploring further.
Function Signature
Description
Exports the private key for the wallet identified by the suppliedwalletMetadata. The private key is reconstructed from the distributed key shares using password for backup decryption if shares are not provided.
Parameters
Required Parameters
walletMetadata(WalletMetadata) - Non-sensitive wallet metadata persisted fromcreateWalletAccount()/importPrivateKey().
Optional Parameters
password(string) - Required if the wallet was created withbackUpToDynamic: true. Used for backup decryption whenexternalServerKeySharesis not provided.externalServerKeyShares(ServerKeyShare[]) - Caller-supplied plaintext shares.
Returns
Promise<{ derivedPrivateKey: string }>- Object containing the exported private key
Example
Error Handling
Security Considerations
- Private Key Security: Never store private keys in plain text
- Key Share Security: Keep external server key shares secure
- Session Management: Implement proper session management
- Password Protection: Use strong passwords for wallet encryption
Related Functions
importPrivateKey()- Import existing private keygetEvmWallets()- Get all EVM wallets