zetrix_crypto_get_public_key
Derive a public key from an encrypted private key for secure Zetrix blockchain account operations and transactions.
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:1250-1265 (handler)MCP server tool handler case that extracts arguments and calls the encryption module's getPublicKeyFromPrivate method, then formats the response.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 (handler)The core implementation function of ZetrixEncryption class that initializes encryption library and calls KeyPair.getEncPublicKey to derive public key from private key.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)}` ); } }
- src/index.ts:536-549 (registration)Registration of the tool in the MCP tools array, defining name, description, and input schema.{ 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:539-548 (schema)Input schema defining the required 'privateKey' parameter for the tool.inputSchema: { type: "object", properties: { privateKey: { type: "string", description: "The encrypted private key", }, }, required: ["privateKey"], },