Overview
Message signing allows users to prove ownership of their wallet by signing arbitrary messages. This is commonly used for authentication and verification.Prerequisites
- Dynamic SDK initialized (see Installation Guide)
- User authenticated (see Authentication Guide)
- EVM wallet available (see Wallet Creation)
Sign a Message
Sign a raw message
UsesignRawMessage to sign raw bytes without the EIP-191 message prefix. This is useful when you need to sign pre-hashed data or raw byte payloads.
Sign Message with SwiftUI
Common Use Cases
Authentication
Signing User Actions
Off-Chain Signatures
Verify Signatures
While signature verification typically happens on the backend or smart contract, here’s how to structure the verification data:Best Practices
1. Always Handle Errors
2. Include Context in Messages
3. Show Loading States
4. Clear Sensitive Data
Error Handling
Next Steps
- Typed Data Signing - Sign structured data (EIP-712)
- Send ETH Transactions - Send transactions
- Smart Contract Interactions - Interact with contracts