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

# SUI Message Signing

> Sign messages with SUI wallets in Unity.

## Sign a message

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

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

## Complete example

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

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

## Next steps

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