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

# Solana Message Signing

> Sign messages with Solana wallets in Unity.

<Note>
  Message signing works without the Solana extension package (`xyz.dynamic.unitysdk.solana`).
</Note>

## Sign a message

```csharp theme={"system"}
string signature = await DynamicSDK.Instance.Networks.Solana.SignMessage(
    wallet.Id, "Hello World");

Debug.Log($"Signature: {signature}");
```

## Complete example

```csharp theme={"system"}
using DynamicSDK.Core;
using UnityEngine;
using System.Linq;

public class SolanaSigningManager : MonoBehaviour
{
    private BaseWallet _solWallet;
    
    private void Start()
    {
        _solWallet = DynamicSDK.Instance.Wallets.UserWallets
            .FirstOrDefault(w => w.Chain.ToUpper() == "SOL");
    }
    
    public async void SignMessage()
    {
        if (_solWallet == null)
        {
            Debug.LogError("No Solana wallet available");
            return;
        }
        
        string message = "Sign this message to verify your identity";
        
        try
        {
            string signature = await DynamicSDK.Instance.Networks.Solana.SignMessage(
                _solWallet.Id, message);
            
            Debug.Log($"Message: {message}");
            Debug.Log($"Signature: {signature}");
            Debug.Log($"Signer: {_solWallet.Address}");
        }
        catch (System.Exception ex)
        {
            Debug.LogError($"Signing failed: {ex.Message}");
        }
    }
    
    public async void SignTimestampedMessage()
    {
        if (_solWallet == null)
        {
            Debug.LogError("No Solana wallet available");
            return;
        }
        
        // Include timestamp for replay protection
        long timestamp = System.DateTimeOffset.UtcNow.ToUnixTimeSeconds();
        string message = $"Sign in at {timestamp}";
        
        string signature = await DynamicSDK.Instance.Networks.Solana.SignMessage(
            _solWallet.Id, message);
        
        Debug.Log($"Timestamped signature: {signature}");
    }
}
```

## Next steps

* [Send Transactions](/docs/unity/wallets/solana/send-transactions) - Send Solana transactions
* [Token Balances](/docs/unity/wallets/general/token-balances) - Query token balances
