Skip to main content

Overview

This guide shows you how to verify message signatures to authenticate users and ensure data integrity. Message verification is essential for secure dApp interactions and user authentication.

Prerequisites

Step 1: Basic Message Verification

Verify a simple message signature:

Step 2: Authentication with Nonce

Verify a message with a nonce to prevent replay attacks:

Step 3: Data Integrity Verification

Verify that data hasn’t been tampered with:

Step 5: Complete Authentication Flow

Here’s a complete example of a secure authentication flow:

Best Practices

  1. Nonce Usage: Always use nonces to prevent replay attacks
  2. Message Format: Use consistent message formats across your application
  3. Error Handling: Implement proper error handling for verification failures
  4. Security: Never trust client-side verification - always verify on the server
  5. Nonce Management: Clear used nonces to prevent reuse

Common Use Cases

  • User Authentication: Verify wallet ownership for login
  • Transaction Approval: Verify user approval for transactions
  • Data Integrity: Ensure data hasn’t been modified
  • Access Control: Verify permissions for specific actions

Next Steps

Last modified on May 21, 2026