zetrix_crypto_get_public_key
Derive a public key from an encrypted private key for secure Zetrix blockchain account operations.
Instructions
Derive public key from private key
Input Schema
TableJSON Schema
| Name | Required | Description | Default |
|---|---|---|---|
| privateKey | Yes | The encrypted private key |
Implementation Reference
- src/index.ts:536-549 (registration)Tool registration including name, description, and input schema definition.{ name: "zetrix_crypto_get_public_key", description: "Derive public key from private key", inputSchema: { type: "object", properties: { privateKey: { type: "string", description: "The encrypted private key", }, }, required: ["privateKey"], }, },
- src/index.ts:1250-1265 (handler)MCP server handler for the tool: validates input, calls encryption helper, returns public key in MCP response format.case "zetrix_crypto_get_public_key": { if (!args) { throw new Error("Missing arguments"); } const publicKey = await zetrixEncryption.getPublicKeyFromPrivate( args.privateKey as string ); return { content: [ { type: "text", text: JSON.stringify({ publicKey }, null, 2), }, ], }; }
- src/zetrix-encryption.ts:81-91 (helper)Helper function in ZetrixEncryption class that derives the encrypted public key from encrypted private key using official zetrix-encryption-nodejs library.async getPublicKeyFromPrivate(privateKey: string): Promise<string> { await this.initEncryption(); try { return this.KeyPair.getEncPublicKey(privateKey); } catch (error) { throw new Error( `Failed to derive public key: ${error instanceof Error ? error.message : String(error)}` ); } }