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
Signs a message using the EVM wallet identified by the suppliedwalletMetadata. The SDK is stateless — every call requires walletMetadata. If the wallet was created with backUpToDynamic: true, supply the password so the SDK can recover shares from backup when externalServerKeyShares is omitted.
Parameters
Required Parameters
message(string) - The message to signwalletMetadata(WalletMetadata) - Non-sensitive wallet metadata persisted fromcreateWalletAccount()/importPrivateKey(). The wallet’s address comes fromwalletMetadata.accountAddress.
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. If omitted, the SDK recovers from backup usingpassword.
Returns
Promise<string>- The serialized signature as a hex string
Example
Error Handling
Security Considerations
- Message Validation: Always validate message content before signing
- 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
signTypedData()- Sign EIP-712 typed datasignTransaction()- Sign a transaction instead of a messageverifyMessageSignature()- Verify a message signature