Skip to main content
Chain connectors are the abstraction layer between Wraith’s chain-agnostic agent core and blockchain-specific logic. Each connector implements a standard interface, allowing the same agent engine to operate across any supported chain.

Interface

Every chain connector implements ChainConnector:

Supporting Types


EVM Connector

A single EVMConnector class covers all EVM-compatible chains. Different chains use different configuration — same code.

Configuration

How Methods Map to SDK Primitives

Adding a New EVM Chain

No code changes required. Register a new chain with its config:
Requirements for each new EVM chain:
  1. Deploy the 4 Solidity contracts (Announcer, Registry, Sender, Names)
  2. Set up a subgraph to index Announcement events
  3. Add config to the registry

Stellar Connector

How Methods Map to SDK Primitives

Stellar-Specific Considerations

  • Account creation: Stellar requires accounts to exist with a minimum balance (1 XLM). Sending to a new stealth address uses Operation.createAccount, not Operation.payment.
  • Signing: Stealth private keys are derived scalars. Must use signWithScalar() from the SDK — can’t use Keypair.fromRawEd25519Seed().
  • Events: Soroban contract events are fetched via sorobanServer.getEvents(), not a subgraph.

Configuration


Solana Connector

Handles Solana using ed25519 and Anchor programs.

How Methods Map to SDK Primitives

Solana-Specific Considerations

  • No account deployment: An ed25519 public key is a valid Solana address. Send SOL directly — no createAccount needed.
  • Rent exemption: Accounts need ~0.00089 SOL minimum. When withdrawing all, send balance - 5000 lamports (tx fee).
  • SPL tokens: Use associated token accounts (ATAs). The ATA must be created for the stealth address before transferring SPL tokens.
  • Signing: Uses signWithScalar() from the SDK — stealth scalars can’t be used with standard Keypair.
  • Events: Anchor emit!() writes to program logs. Parse via transaction history, not subgraph.

Configuration


CKB Connector

Handles Nervos CKB using secp256k1 and the UTXO-based Cell model. CKB is architecturally unique: there is no separate announcer contract. Cells are the announcements — the ephemeral public key and stealth address hash are embedded directly in the Cell’s lock script args.

How Methods Map to SDK Primitives

CKB-Specific Considerations

  • UTXO model: CKB uses Cells (UTXOs), not accounts. Sending creates a Cell; withdrawing consumes it. There’s no balance to query on an address — you query live Cells.
  • No separate announcer: The Cell’s lock script args contain the ephemeral public key. No event infrastructure needed.
  • Minimum capacity: A stealth-lock Cell requires at least 61 CKB due to the 53-byte args field.
  • blake160: Address hashing uses blake2b with "ckb-default-hash" personalization, truncated to 20 bytes.
  • SHA-256 for shared secret: Unlike EVM (keccak256), CKB uses SHA-256 for hashing the ECDH shared secret.
  • No view tags: Every Cell is fully checked. The get_cells RPC pre-filters by code hash, keeping the scan set small.
  • Name ownership via lock script: Unlike EVM/Solana where names are owned by the spending key, CKB name ownership is determined by the Cell’s lock script. Whoever can spend the Cell controls the name.

Configuration


Chain Registry

The TEE server maintains a registry of available chain connectors:

Usage in Agent Service


Adding a New Chain Family

To add support for a completely new chain family (e.g., Solana):
  1. Create a connector class implementing ChainConnector
  2. Implement all methods using the chain’s SDK and cryptographic primitives
  3. Write the crypto module at @wraith-protocol/sdk/chains/solana
  4. Deploy stealth address contracts on the target chain
  5. Register the connector in the chain registry
The agent core, AI engine, storage, notifications, and scheduling work automatically — no changes needed.

Key Differences Between Chain Families