wallet_verify_message
Verify the authenticity of a signed message on the Ethereum blockchain by validating the signature against the original message and the claimed address.
Instructions
Verify a signed message
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| address | Yes | The address that supposedly signed the message | |
| message | Yes | The original message | |
| signature | Yes | The signature to verify |
Implementation Reference
- src/handlers/wallet.ts:441-463 (handler)The main handler function that implements the wallet_verify_message tool. It uses ethers.utils.verifyMessage to recover the signer address from the message and signature, then checks if it matches the provided address.export const verifyMessageHandler = async (input: any): Promise<ToolResultSchema> => { try { if (!input.message || !input.signature || !input.address) { return createErrorResponse("Message, signature, and address are required"); } const recoveredAddress = ethers.utils.verifyMessage(input.message, input.signature); const isValid = recoveredAddress.toLowerCase() === input.address.toLowerCase(); return createSuccessResponse( isValid ? `Signature verified successfully Message: "${input.message}" Signature: ${input.signature} Address: ${input.address} ` : `Signature verification failed Message: "${input.message}" Signature: ${input.signature} Address: ${input.address} `); } catch (error) { return createErrorResponse(`Failed to verify message: ${(error as Error).message}`); } };
- src/tools.ts:361-373 (schema)Input schema for the wallet_verify_message tool, defining the required parameters: message, signature, and address.{ name: "wallet_verify_message", description: "Verify a signed message", inputSchema: { type: "object", properties: { message: { type: "string", description: "The original message" }, signature: { type: "string", description: "The signature to verify" }, address: { type: "string", description: "The address that supposedly signed the message" } }, required: ["message", "signature", "address"] } },
- src/tools.ts:586-586 (registration)Maps the tool name 'wallet_verify_message' to its handler function verifyMessageHandler in the central handlers dictionary."wallet_verify_message": verifyMessageHandler,