zetrix_crypto_verify
Verify digital signatures on the Zetrix blockchain by checking a signature against a message and public key to confirm authenticity.
Instructions
Verify a signature against a message and public key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| message | Yes | The original message (hex string) | |
| signature | Yes | The signature to verify | |
| publicKey | Yes | The public key to verify against |
Implementation Reference
- src/index.ts:601-622 (schema)Defines the tool schema including input validation for message, signature, and publicKey.{ name: "zetrix_crypto_verify", description: "Verify a signature against a message and public key", inputSchema: { type: "object", properties: { message: { type: "string", description: "The original message (hex string)", }, signature: { type: "string", description: "The signature to verify", }, publicKey: { type: "string", description: "The public key to verify against", }, }, required: ["message", "signature", "publicKey"], }, },
- src/index.ts:1328-1345 (handler)Executes the tool by calling zetrixEncryption.verify with provided arguments and returns whether the signature is valid.case "zetrix_crypto_verify": { if (!args) { throw new Error("Missing arguments"); } const isValid = await zetrixEncryption.verify( args.message as string, args.signature as string, args.publicKey as string ); return { content: [ { type: "text", text: JSON.stringify({ isValid }, null, 2), }, ], }; }
- src/zetrix-encryption.ts:186-200 (helper)Core implementation of signature verification using the zetrix-encryption-nodejs library.async verify( message: string, signData: string, publicKey: string ): Promise<boolean> { await this.initEncryption(); try { return this.signature.verify(message, signData, publicKey); } catch (error) { throw new Error( `Failed to verify signature: ${error instanceof Error ? error.message : String(error)}` ); } }