Skip to main content
Message signing allows users to cryptographically prove their identity and provide data without paying transaction fees. This makes it perfect for authentication, feedback collection, surveys, and any scenario where you need verified user input but don’t require on-chain storage.

Key Concepts

Authentication

Users sign messages with their wallet to authenticate themselves

Cryptographic Proof

Signatures provide cryptographic proof of wallet ownership

Instant Verification

No blockchain confirmation time - instant verification

When to Use Message Signing vs Transactions

Two Approaches to Message Signing

There are two primary approaches to implementing message signing in Blinks:

1. Plain Text Signing

Simple message signing with a static string. Best for basic authentication and use-cases where you don’t need the enhanced security of the structured approach.
src/app/api/actions/sign-plain/route.ts
Uses the SIWS (Sign-In With Solana) standard with anti-replay protection and domain binding. Best for production applications requiring enhanced security.

Main Endpoint

src/app/api/actions/sign-structured/route.ts

Verification Endpoint

src/app/api/actions/sign-structured/verify/route.ts
This structured approach uses the SIWS (Sign-In With Solana) standard and provides enhanced security through:
  • Domain binding - Message is tied to your specific domain
  • Anti-replay protection - Unique nonce prevents message reuse
  • Timestamp validation - issuedAt helps detect stale requests
  • Server signature - Prevents message tampering

Security Considerations

Production Security Requirements
  • Store server keypairs securely (use environment variables)
  • Validate all inputs thoroughly
  • Implement rate limiting to prevent spam
  • Use HTTPS in production
  • Consider nonce expiration for time-sensitive operations
  • Log security events for monitoring

Common Use Cases

Message signing is ideal for:
  • Wallet Based Login/Authentication - Sign in to dApps and platforms
  • Token Holder Verification - Prove ownership of specific tokens or NFTs for access
  • Multi-Step Flows - Combine with action chaining
  • Whitelist Registration - Sign up for airdrops, presales, or exclusive events
  • DAO Governance - Off-chain voting and proposal participation
  • Settings Management - Change notification preferences, update profile settings

Integration with Action Chaining

Message signing works seamlessly with action chaining for multi-step flows:
For a complete working example, see our Feedback Blink guide which implements message signing with database storage and action chaining.