zcash_crosschain_swap
Initiate cross-chain swaps between Zcash transparent, Bitcoin, and EVM assets. Choose custody via Ika, NEAR Chain Signatures, or direct wallet. Only transparent ZEC works with external MPC custody.
Instructions
Cross-chain swap intent for Zcash transparent, Bitcoin, or EVM assets. Custody via Ika (split-key on Sui), NEAR Chain Signatures, or direct wallet. Zcash shielded (Orchard) requires RedPallas - not available via Ika or NEAR. Only transparent ZEC works through external MPC custody.
Input Schema
| Name | Required | Description | Default |
|---|---|---|---|
| source_chain | Yes | Source chain (transparent ZEC, BTC, or ETH) | |
| dest_chain | Yes | Destination chain or asset | |
| amount | Yes | Amount in source denomination | |
| recipient | Yes | Recipient address on destination chain | |
| custody | No | Custody provider (default: direct) |
Implementation Reference
- src/tools/crosschain.ts:4-77 (registration)Registration of the 'zcash_crosschain_swap' tool via McpServer.tool(), called from src/index.ts line 47.
export function registerCrosschainTool(server: McpServer) { server.tool( "zcash_crosschain_swap", "Cross-chain swap intent for Zcash transparent, Bitcoin, or EVM assets. " + "Custody via Ika (split-key on Sui), NEAR Chain Signatures, or direct wallet. " + "Zcash shielded (Orchard) requires RedPallas - not available via Ika or NEAR. " + "Only transparent ZEC works through external MPC custody.", { source_chain: z .enum(["zcash-transparent", "bitcoin", "ethereum"]) .describe("Source chain (transparent ZEC, BTC, or ETH)"), dest_chain: z .enum(["zcash-transparent", "bitcoin", "ethereum", "usdc", "usdt"]) .describe("Destination chain or asset"), amount: z.string().describe("Amount in source denomination"), recipient: z.string().describe("Recipient address on destination chain"), custody: z .enum(["ika", "near", "direct"]) .optional() .describe("Custody provider (default: direct)"), }, async ({ source_chain, dest_chain, amount, recipient, custody }) => { const provider = custody ?? "direct"; const signingParams: Record<string, { curve: string; algorithm: string; hash: string }> = { "zcash-transparent": { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" }, bitcoin: { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" }, ethereum: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, usdc: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, usdt: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, }; const custodyInfo: Record<string, { name: string; security: string; pkg: string | null }> = { ika: { name: "Ika 2PC-MPC on Sui", security: "Split-key: agent holds half, network holds half. Neither signs alone.", pkg: "@frontiercompute/zcash-ika", }, near: { name: "NEAR Chain Signatures (v1.signer)", security: "Threshold Cait-Sith MPC across NEAR nodes. secp256k1 only.", pkg: "@frontiercompute/zap1-near", }, direct: { name: "Local Zebra wallet", security: "Full key on machine. Use ika or near for split-key custody.", pkg: null, }, }; const result = { intent: { from: source_chain, to: dest_chain, amount, recipient }, signing: { source: signingParams[source_chain], destination: signingParams[dest_chain], }, custody: custodyInfo[provider], attestation: { protocol: "ZAP1", event_type: "AGENT_ACTION", api: "https://pay.frontiercompute.io/attest", }, limitations: { shielded: "Zcash Orchard requires RedPallas on Pallas curve. Not available via Ika or NEAR MPC. Use direct wallet for shielded.", }, status: "Intent recorded. Execution requires active custody + solver.", }; return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }], }; } ); } - src/tools/crosschain.ts:25-75 (handler)Handler function that processes the cross-chain swap intent by building signing parameters, custody info, and attestation metadata.
async ({ source_chain, dest_chain, amount, recipient, custody }) => { const provider = custody ?? "direct"; const signingParams: Record<string, { curve: string; algorithm: string; hash: string }> = { "zcash-transparent": { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" }, bitcoin: { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" }, ethereum: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, usdc: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, usdt: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, }; const custodyInfo: Record<string, { name: string; security: string; pkg: string | null }> = { ika: { name: "Ika 2PC-MPC on Sui", security: "Split-key: agent holds half, network holds half. Neither signs alone.", pkg: "@frontiercompute/zcash-ika", }, near: { name: "NEAR Chain Signatures (v1.signer)", security: "Threshold Cait-Sith MPC across NEAR nodes. secp256k1 only.", pkg: "@frontiercompute/zap1-near", }, direct: { name: "Local Zebra wallet", security: "Full key on machine. Use ika or near for split-key custody.", pkg: null, }, }; const result = { intent: { from: source_chain, to: dest_chain, amount, recipient }, signing: { source: signingParams[source_chain], destination: signingParams[dest_chain], }, custody: custodyInfo[provider], attestation: { protocol: "ZAP1", event_type: "AGENT_ACTION", api: "https://pay.frontiercompute.io/attest", }, limitations: { shielded: "Zcash Orchard requires RedPallas on Pallas curve. Not available via Ika or NEAR MPC. Use direct wallet for shielded.", }, status: "Intent recorded. Execution requires active custody + solver.", }; return { content: [{ type: "text" as const, text: JSON.stringify(result, null, 2) }], }; } - src/tools/crosschain.ts:11-23 (schema)Zod schema defining input parameters: source_chain, dest_chain, amount, recipient, and optional custody provider.
{ source_chain: z .enum(["zcash-transparent", "bitcoin", "ethereum"]) .describe("Source chain (transparent ZEC, BTC, or ETH)"), dest_chain: z .enum(["zcash-transparent", "bitcoin", "ethereum", "usdc", "usdt"]) .describe("Destination chain or asset"), amount: z.string().describe("Amount in source denomination"), recipient: z.string().describe("Recipient address on destination chain"), custody: z .enum(["ika", "near", "direct"]) .optional() .describe("Custody provider (default: direct)"), - src/tools/crosschain.ts:28-34 (helper)Helper lookup table mapping each chain/asset to its cryptographic curve, signing algorithm, and hash function.
const signingParams: Record<string, { curve: string; algorithm: string; hash: string }> = { "zcash-transparent": { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" }, bitcoin: { curve: "secp256k1", algorithm: "ECDSA", hash: "DoubleSHA256" }, ethereum: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, usdc: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, usdt: { curve: "secp256k1", algorithm: "ECDSA", hash: "KECCAK256" }, }; - src/tools/crosschain.ts:36-52 (helper)Helper lookup table mapping custody providers (ika, near, direct) to their name, security description, and optional package.
const custodyInfo: Record<string, { name: string; security: string; pkg: string | null }> = { ika: { name: "Ika 2PC-MPC on Sui", security: "Split-key: agent holds half, network holds half. Neither signs alone.", pkg: "@frontiercompute/zcash-ika", }, near: { name: "NEAR Chain Signatures (v1.signer)", security: "Threshold Cait-Sith MPC across NEAR nodes. secp256k1 only.", pkg: "@frontiercompute/zap1-near", }, direct: { name: "Local Zebra wallet", security: "Full key on machine. Use ika or near for split-key custody.", pkg: null, }, };