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.
Overview
This guide shows you how to sign messages with your EVM wallet. Message signing is commonly used for authentication, nonce verification, and data integrity checks.
Prerequisites
Basic Message Signing
The Node SDK is stateless — every sign call requires walletMetadata (and externalServerKeyShares if you store them in your own vault). Load both from where you persisted them at wallet creation time.
import { authenticatedEvmClient } from './client';
const evmClient = await authenticatedEvmClient();
// Load the metadata + shares you persisted at creation time.
const walletMetadata = JSON.parse(await redis.get(`wallet:${accountAddress}`));
const externalServerKeyShares = await vault.read(`wallet:${accountAddress}/shares`);
const signature = await evmClient.signMessage({
message: 'Hello, World!',
walletMetadata,
externalServerKeyShares,
password: 'your-password', // required if wallet was created with backUpToDynamic: true
});
console.log('Message signed:', signature);
Simple Message Signing
Whether you need to provide externalServerKeyShares depends on how you created your wallet:
With Automatic Backup (Recommended)
If you created your wallet with backUpToDynamic: true, the SDK can recover the shares from backup using password — you can omit externalServerKeyShares:
// ✅ Simple signing - SDK recovers shares from backup via password
const signature = await evmClient.signMessage({
message: 'Hello, World!',
walletMetadata,
password: 'your-password',
});
With Manual Backup
If you created your wallet with backUpToDynamic: false, you must provide the cached externalServerKeyShares:
// Retrieve your stored key shares from your secrets vault.
const externalServerKeyShares = await vault.read(`wallet:${accountAddress}/shares`);
const signature = await evmClient.signMessage({
message: 'Hello, World!',
walletMetadata,
externalServerKeyShares, // required for manual-backup wallets
});
Password handling notes:
- If your wallet was created without a password (
backUpToDynamic: false, no password), omit the password parameter.
- If your wallet was created with a password (
backUpToDynamic: true), pass it.
- See
signMessage reference for full details.
Password Handling Notes:
- If your wallet was created without a password, omit the
password parameter
- If your wallet was created with a password, you must provide it for all operations
- The password parameter is always optional in the API, but required if the wallet is password-protected
Common Use Cases
Authentication
const nonce = Date.now().toString();
const message = `Sign this message to authenticate: ${nonce}`;
const signature = await evmClient.signMessage({
message,
walletMetadata,
externalServerKeyShares,
password: 'your-password',
});
Data Integrity
const data = { userId: 123, action: 'transfer', amount: '100' };
const message = JSON.stringify(data);
const signature = await evmClient.signMessage({
message,
walletMetadata,
externalServerKeyShares,
password: 'your-password',
});
Next Steps