Function Signature
Description
Exports the private key for a specific wallet address. This function requires external server key shares and authentication. The private key is reconstructed from the distributed key shares.Parameters
Required Parameters
accountAddress
(string
) - The wallet address to export private key for (must include0x
prefix)
Optional Parameters
password
(string
) - Wallet password (if wallet is password-protected)externalServerKeyShares
(ServerKeyShare[]
) - Array of external server key shares
Returns
Promise<{ derivedPrivateKey: string }>
- Object containing the exported private key
Example
Key Share Format
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