Skip to main content
A multichain agent shares a single .wraith name but holds independent identities on every chain you enable. The AI agent is chain-aware — tell it to send XLM and it routes to Stellar, tell it to send ZEN and it routes to Horizen, no extra configuration required.
The SDK interface is identical for single-chain and multichain agents. The only difference is the chain parameter you pass at creation time.

Create a multichain agent

Pass an array of Chain values instead of a single chain:
import { Wraith, Chain } from "@wraith-protocol/sdk";

const wraith = new Wraith({ apiKey: "wraith_live_abc123" });

const agent = await wraith.createAgent({
  name: "alice",
  chain: [Chain.Horizen, Chain.Stellar, Chain.Ethereum],
  wallet: "0xYourWallet",
  signature: "0xSignature",
  message: "Sign to create Wraith agent",
});
The agent receives a separate address and stealth meta-address on each chain:
console.log(agent.info.chains);
// [Chain.Horizen, Chain.Stellar, Chain.Ethereum]

console.log(agent.info.addresses);
// {
//   horizen:  "0xabc...",
//   stellar:  "GABC...",
//   ethereum: "0xdef..."
// }

console.log(agent.info.metaAddresses);
// {
//   horizen:  "st:eth:0x...",
//   stellar:  "st:xlm:...",
//   ethereum: "st:eth:0x..."
// }

Deploy on all chains at once

Use Chain.All to register on every chain the platform supports:
const agent = await wraith.createAgent({
  name: "alice",
  chain: Chain.All,
  wallet: "0xYourWallet",
  signature: "0xSignature",
  message: "Sign to create Wraith agent",
});
Chain.All is the fastest way to get started. You can always scope down to specific chains later by creating a new agent with an explicit chain array.

Chain-aware routing

The AI agent infers the correct chain from the currency or explicit mention in your message.

Explicit chain

Name the chain directly when you want full control:
await agent.chat("send 0.1 ETH to bob.wraith on horizen");
await agent.chat("send 10 XLM to carol.wraith on stellar");

Inferred chain

When the currency is unambiguous, the agent routes automatically:
await agent.chat("send 10 XLM to carol.wraith");
// XLM is only on Stellar — routed automatically

await agent.chat("send 100 ZEN to bob.wraith");
// ZEN is only on Horizen — routed automatically

Ambiguous cases

If the currency exists on more than one of your chains, the agent asks for clarification:
await agent.chat("send 0.1 ETH to bob.wraith");
// "ETH exists on both Horizen and Ethereum. Which chain do you mean?"

await agent.chat("horizen");
// "Payment sent — 0.1 ETH to bob.wraith on Horizen..."

Cross-chain balance

Check balances across all chains in a single message:
await agent.chat("what's my balance on all chains?");
// "Balances:
//  Horizen:  1.5 ETH, 100 ZEN, 50 USDC
//  Stellar:  500 XLM
//  Ethereum: 0.3 ETH"

Cross-chain scanning

Scan for incoming stealth payments on all chains at once:
await agent.chat("scan for payments on all chains");
// "Incoming payments:
//  Horizen:
//  - 0.1 ETH at 0xabc...
//  Stellar:
//  - 10 XLM at GABC..."

How multichain key derivation works

The TEE derives a separate key pair per chain from your wallet signature. Each chain uses the cryptographic scheme appropriate for that chain family — secp256k1 for EVM chains, ed25519 for Stellar. The derived keys are isolated per chain, so a Horizen key is never used on Ethereum and vice versa. The agent is aware of all chains it was created with, so it routes each operation to the correct chain automatically based on your message context.

Privacy across chains

Each chain maintains independent stealth address activity. Payments on Horizen are invisible to observers on Stellar. Run per-chain privacy checks to see the full picture:
await agent.chat("run privacy check on all chains");
// "Privacy Analysis:
//  Horizen: Score 85/100
//  - 5 unspent stealth addresses
//  Stellar: Score 95/100
//  - All clear"
Even though chains are independent, withdrawing to the same destination wallet across multiple chains can still link your activity. Use distinct destination addresses per chain — see the privacy best practices guide.

Single-chain vs. multichain comparison

FeatureSingle-chainMultichain
ChainsOneMultiple
AddressesOneOne per chain
Stealth meta-addressesOneOne per chain
Chat routingDirectAI infers chain
Key derivationOne pathOne path per chain
Privacy analysisOne chainPer-chain

What’s next

Privacy best practices

Understand cross-chain privacy risks and how to avoid them.

Bring your own model

Configure OpenAI or Claude as the AI provider for your agents.

Single-chain guide

Full lifecycle walkthrough for a single-chain agent.

SDK reference

Complete API documentation including the Chain enum.