> ## Documentation Index
> Fetch the complete documentation index at: https://www.dynamic.xyz/docs/llms.txt
> Use this file to discover all available pages before exploring further.

# Sign SVM Messages

> Learn how to sign messages with a Solana wallet using Dynamic's Python SDK

## Overview

This guide shows you how to sign messages with your Solana wallet. The Python SDK signs messages using Ed25519 and returns a base58-encoded signature.

## Prerequisites

* [Created a Solana wallet](/python/svm/create-wallet)

## Basic Message Signing

```python theme={"system"}
import asyncio
import os
from dynamic_wallet_sdk import DynamicSvmWalletClient

async def main():
    async with DynamicSvmWalletClient(os.environ["DYNAMIC_ENV_ID"]) as client:
        await client.authenticate_api_token(os.environ["DYNAMIC_API_TOKEN"])

        signature = await client.sign_message(
            message="Hello from Solana!",
            address="YourBase58WalletAddress",
        )
        print(f"Signature: {signature}")  # base58-encoded, 64 bytes

asyncio.run(main())
```

The returned signature is a base58-encoded Ed25519 signature (64 bytes).

## Signing with a Password-Protected Wallet

```python theme={"system"}
signature = await client.sign_message(
    message="Hello from Solana!",
    address="YourBase58WalletAddress",
    password="your-wallet-password",
)
```

**Password handling:**

* 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 signing operations.

Passing `password=` also enables auto-recovery of the local key share in fresh processes — pair it with `client.load_wallet(address)` after restart.

## Verifying a Signature

Verify signatures off-chain using `PyNaCl`:

```python theme={"system"}
import base58
import nacl.signing
import nacl.exceptions

message = "Hello from Solana!"
signature = await client.sign_message(message=message, address=address)

pubkey_bytes = base58.b58decode(address)
sig_bytes = base58.b58decode(signature)

verify_key = nacl.signing.VerifyKey(pubkey_bytes)
try:
    verify_key.verify(message.encode("utf-8"), sig_bytes)
    print("Signature verified")
except nacl.exceptions.BadSignatureError:
    print("Invalid signature")
```

## Common Use Cases

### Authentication Nonce

```python theme={"system"}
import time

nonce = str(int(time.time()))
message = f"Sign to authenticate: {nonce}"

signature = await client.sign_message(message=message, address=address)
```

## Next Steps

* [Sign Solana transactions](/python/svm/sign-transactions)
* [Create EVM wallet](/python/evm/create-wallet)
