> ## 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.

# Sign EVM Messages

> Learn how to sign messages using Dynamic's Node SDK for EVM chains

## 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

* [Created an EVM wallet](/node/evm/create-wallet)

## 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.

```typescript theme={"system"}
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`:

```typescript theme={"system"}
// ✅ 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`:

```typescript theme={"system"}
// 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](/node/reference/evm/sign-message) 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

```typescript theme={"system"}
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

```typescript theme={"system"}
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

* [Sign typed data (EIP-712)](/node/evm/sign-typed-data)
* [Verify message signatures](/node/reference/evm/verify-message-signature)
* [Sign transactions](/node/evm/sign-transactions)
