Skip to main content

Function Signature

Description

Signs a message on behalf of a user who has granted delegation permission. This function requires delegation credentials (wallet ID, wallet API key, and key share) that are provided to your webhook endpoint when a user approves delegation. The function returns a base58-encoded Ed25519 signature, which is the standard signature format for Solana.

Parameters

Required Parameters

  • client (DelegatedSvmWalletClient) - The delegated client instance created with createDelegatedSvmWalletClient()
  • walletId (string) - The wallet ID from the delegation webhook
  • walletApiKey (string) - The wallet-specific API key from the delegation webhook
  • keyShare (ServerKeyShare) - The server key share from the delegation webhook
  • message (string) - The message to sign

Optional Parameters

  • isFormatted (boolean) - Whether the message is already formatted for signing. Defaults to false

Returns

Promise<string> - A base58-encoded Ed25519 signature

Example

Basic Message Signing

With Formatted Message

Complete Example with Try-Catch

Type Definitions

Common Use Cases

Authentication

Proof of Ownership

Error Handling

The function throws an error if:
  • Any required parameter is missing or invalid
  • The delegation credentials are expired or revoked
  • The MPC signing operation fails
  • Network communication with Dynamic services fails

Security Considerations

  • Credential Validation: Always validate delegation credentials before using them
  • Message Validation: Validate message content to prevent signing malicious data
  • Audit Logging: Log all signing operations for security auditing
  • Credential Storage: Never log or expose wallet API keys or key shares
  • Rate Limiting: Implement rate limiting to prevent abuse
Last modified on January 26, 2026