Skip to main content
Glama
Frontier-Compute

Frontier-Compute/zcash-mcp

zcash_sign_mpc

Sign a message hash through Ika 2PC-MPC without exposing the full private key. Uses two on-chain transactions and returns a DER-encoded ECDSA signature.

Instructions

Sign a message hash through Ika 2PC-MPC. Two on-chain transactions: presign + sign. Neither party sees the full private key. Returns DER-encoded ECDSA signature.

Input Schema

TableJSON Schema
NameRequiredDescriptionDefault
wallet_idYesdWallet object ID from create_wallet
message_hashYesHex-encoded 32-byte message hash (sighash) to sign
chainYesChain determines hash algorithm (DoubleSHA256 or KECCAK256)
encryption_seedYesHex encryption seed from wallet creation
sui_private_keyYesSui private key for signing the MPC transactions
ika_coin_idNoIKA coin object ID

Implementation Reference

  • Handler function for 'zcash_sign_mpc'. Accepts wallet_id, message_hash, chain, encryption_seed, sui_private_key, and optional ika_coin_id. Returns instructions for using the @frontiercompute/zcash-ika package to perform 2PC-MPC signing.
    async ({ wallet_id, message_hash, chain, encryption_seed, sui_private_key, ika_coin_id }) => {
      try {
        const hashAlgo: Record<string, string> = {
          "zcash-transparent": "DoubleSHA256",
          bitcoin: "DoubleSHA256",
          ethereum: "KECCAK256",
        };
    
        const result = {
          status: "sign_requires_zcash_ika_package",
          instructions: {
            step1: "import { sign } from '@frontiercompute/zcash-ika'",
            step2: `const sig = await sign(config, { messageHash: Buffer.from('${message_hash}', 'hex'), walletId: '${wallet_id}', chain: '${chain}', encryptionSeed: '${encryption_seed}' })`,
          },
          signing_params: {
            curve: "secp256k1",
            algorithm: "ECDSA",
            hash: hashAlgo[chain],
          },
          flow: [
            "TX 1: Request presign (pre-compute MPC ephemeral key share)",
            "Poll for presign completion (up to 5 min on testnet)",
            "TX 2: Approve message + request signature",
            "Poll for sign completion",
            "Parse DER-encoded ECDSA signature from output",
          ],
          wallet_id,
          message_hash,
          chain,
        };
    
        return {
          content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
        };
      } catch (err) {
        const msg = err instanceof Error ? err.message : String(err);
        return { content: [{ type: "text" as const, text: `Error: ${msg}` }], isError: true };
      }
    }
  • Input schema/type definitions for the zcash_sign_mpc tool using Zod. Defines wallet_id, message_hash, chain (zcash-transparent|bitcoin|ethereum), encryption_seed, sui_private_key, and optional ika_coin_id.
    {
      wallet_id: z.string().describe("dWallet object ID from create_wallet"),
      message_hash: z.string().describe("Hex-encoded 32-byte message hash (sighash) to sign"),
      chain: z
        .enum(["zcash-transparent", "bitcoin", "ethereum"])
        .describe("Chain determines hash algorithm (DoubleSHA256 or KECCAK256)"),
      encryption_seed: z.string().describe("Hex encryption seed from wallet creation"),
      sui_private_key: z.string().describe("Sui private key for signing the MPC transactions"),
      ika_coin_id: z.string().optional().describe("IKA coin object ID"),
  • Registration of the 'zcash_sign_mpc' tool on the McpServer via the registerSignMpcTool function.
    export function registerSignMpcTool(server: McpServer) {
      server.tool(
        "zcash_sign_mpc",
        "Sign a message hash through Ika 2PC-MPC. Two on-chain transactions: presign + sign. " +
          "Neither party sees the full private key. Returns DER-encoded ECDSA signature.",
        {
          wallet_id: z.string().describe("dWallet object ID from create_wallet"),
          message_hash: z.string().describe("Hex-encoded 32-byte message hash (sighash) to sign"),
          chain: z
            .enum(["zcash-transparent", "bitcoin", "ethereum"])
            .describe("Chain determines hash algorithm (DoubleSHA256 or KECCAK256)"),
          encryption_seed: z.string().describe("Hex encryption seed from wallet creation"),
          sui_private_key: z.string().describe("Sui private key for signing the MPC transactions"),
          ika_coin_id: z.string().optional().describe("IKA coin object ID"),
        },
        async ({ wallet_id, message_hash, chain, encryption_seed, sui_private_key, ika_coin_id }) => {
          try {
            const hashAlgo: Record<string, string> = {
              "zcash-transparent": "DoubleSHA256",
              bitcoin: "DoubleSHA256",
              ethereum: "KECCAK256",
            };
    
            const result = {
              status: "sign_requires_zcash_ika_package",
              instructions: {
                step1: "import { sign } from '@frontiercompute/zcash-ika'",
                step2: `const sig = await sign(config, { messageHash: Buffer.from('${message_hash}', 'hex'), walletId: '${wallet_id}', chain: '${chain}', encryptionSeed: '${encryption_seed}' })`,
              },
              signing_params: {
                curve: "secp256k1",
                algorithm: "ECDSA",
                hash: hashAlgo[chain],
              },
              flow: [
                "TX 1: Request presign (pre-compute MPC ephemeral key share)",
                "Poll for presign completion (up to 5 min on testnet)",
                "TX 2: Approve message + request signature",
                "Poll for sign completion",
                "Parse DER-encoded ECDSA signature from output",
              ],
              wallet_id,
              message_hash,
              chain,
            };
    
            return {
              content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }],
            };
          } catch (err) {
            const msg = err instanceof Error ? err.message : String(err);
            return { content: [{ type: "text" as const, text: `Error: ${msg}` }], isError: true };
          }
        }
      );
    }
  • src/index.ts:24-49 (registration)
    Import and invocation of registerSignMpcTool in the main server entry point.
    import { registerSignMpcTool } from "./tools/sign-mpc.js";
    import { registerShieldTool } from "./tools/shield.js";
    import { registerVerifyEvmTool } from "./tools/verify-evm.js";
    
    const server = new McpServer({
      name: "zcash-mcp",
      version: "1.2.0",
    });
    
    registerBalanceTool(server);
    registerSendTool(server);
    registerMemoTool(server);
    registerAttestTool(server);
    registerVerifyTool(server);
    registerStatsTool(server);
    registerChainTools(server);
    registerAnchorTools(server);
    registerEventTools(server);
    registerInvoiceTool(server);
    registerWatchTool(server);
    registerReceiptTool(server);
    registerIdentityTool(server);
    registerReputationTool(server);
    registerCrosschainTool(server);
    registerCreateWalletTool(server);
    registerSignMpcTool(server);
Behavior4/5

Does the description disclose side effects, auth requirements, rate limits, or destructive behavior?

With no annotations, the description discloses key behaviors: two sequential transactions, security property of not exposing full private key, and output format. However, it omits potential costs, failure modes, or that a Sui private key is required.

Agents need to know what a tool does to the world before calling it. Descriptions should go beyond structured annotations to explain consequences.

Conciseness5/5

Is the description appropriately sized, front-loaded, and free of redundancy?

Two sentences that are front-loaded with the action. Every word contributes meaning; no redundancy.

Shorter descriptions cost fewer tokens and are easier for agents to parse. Every sentence should earn its place.

Completeness4/5

Given the tool's complexity, does the description cover enough for an agent to succeed on first attempt?

Despite no output schema, the description explains the process and return value. It provides sufficient context for an AI to understand the flow, though details like error handling or gas costs are missing.

Complex tools with many parameters or behaviors need more documentation. Simple tools need less. This dimension scales expectations accordingly.

Parameters3/5

Does the description clarify parameter syntax, constraints, interactions, or defaults beyond what the schema provides?

Schema coverage is 100% with descriptions for all 6 parameters. The description adds no additional meaning beyond the schema, so baseline score is appropriate.

Input schemas describe structure but not intent. Descriptions should explain non-obvious parameter relationships and valid value ranges.

Purpose5/5

Does the description clearly state what the tool does and how it differs from similar tools?

The description clearly states the tool signs a message hash via Ika 2PC-MPC, mentions two on-chain transactions, and specifies the output format. This distinguishes it from sibling tools like zcash_shield or zcash_create_wallet.

Agents choose between tools based on descriptions. A clear purpose with a specific verb and resource helps agents select the right tool.

Usage Guidelines2/5

Does the description explain when to use this tool, when not to, or what alternatives exist?

No explicit guidance on when to use this vs other signing tools or alternatives. The description does not mention prerequisites or context for choosing MPC signing.

Agents often have multiple tools that could apply. Explicit usage guidance like "use X instead of Y when Z" prevents misuse.

Install Server

Other Tools

Latest Blog Posts

MCP directory API

We provide all the information about MCP servers via our MCP API.

curl -X GET 'https://glama.ai/api/mcp/v1/servers/Frontier-Compute/zcash-mcp'

If you have feedback or need assistance with the MCP directory API, please join our Discord server