Interface
Every chain connector implementsChainConnector:
Supporting Types
EVM Connector
A singleEVMConnector class covers all EVM-compatible chains. Different chains use different configuration — same code.
Configuration
How Methods Map to SDK Primitives
| Interface Method | Implementation |
|---|---|
deriveKeys(seed) | SHA-256 seed -> privateKeyToAccount -> sign message -> deriveStealthKeys(sig) -> encodeStealthMetaAddress |
sendPayment | decodeStealthMetaAddress -> generateStealthAddress -> writeContract(WraithSender, "sendETH") |
scanPayments | Query subgraph for Announcement events -> scanAnnouncements(events, ...) -> fetch balances |
getBalance | publicClient.getBalance + readContract(erc20, balanceOf) per token |
withdraw | deriveStealthPrivateKey -> privateKeyToAccount -> sendTransaction |
registerName | signNameRegistration(name, metaBytes, spendingKey) -> writeContract(WraithNames, "register") |
resolveName | readContract(WraithNames, "resolve", [name]) -> decode meta-address |
fundWallet | POST to faucet API (testnet) |
Adding a New EVM Chain
No code changes required. Register a new chain with its config:- Deploy the 4 Solidity contracts (Announcer, Registry, Sender, Names)
- Set up a subgraph to index Announcement events
- Add config to the registry
Stellar Connector
How Methods Map to SDK Primitives
| Interface Method | Implementation |
|---|---|
deriveKeys(seed) | SHA-256 seed -> ed25519 seed -> sign message -> deriveStealthKeys(sig) -> encodeStealthMetaAddress |
sendPayment | decodeStealthMetaAddress -> generateStealthAddress -> Operation.createAccount -> Soroban announcer |
scanPayments | Fetch Soroban events -> scanAnnouncements(events, ...) -> fetch balances from Horizon |
getBalance | GET /accounts/{key} from Horizon |
withdraw | deriveStealthPrivateScalar -> build payment tx -> signStellarTransaction -> submit to Horizon |
registerName | Call Soroban WraithNames register(name, metaAddress) |
resolveName | Simulate Soroban WraithNames resolve(name) |
fundWallet | Stellar Friendbot GET /friendbot?addr={key} |
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, notOperation.payment. - Signing: Stealth private keys are derived scalars. Must use
signWithScalar()from the SDK — can’t useKeypair.fromRawEd25519Seed(). - Events: Soroban contract events are fetched via
sorobanServer.getEvents(), not a subgraph.
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):- Create a connector class implementing
ChainConnector - Implement all methods using the chain’s SDK and cryptographic primitives
- Write the crypto module at
@wraith-protocol/sdk/chains/solana - Deploy stealth address contracts on the target chain
- Register the connector in the chain registry
Key Differences Between Chain Families
| Aspect | EVM | Stellar | Solana |
|---|---|---|---|
| Curve | secp256k1 | ed25519 | ed25519 |
| Address format | 0x... (20 bytes) | G... (56 chars) | Base58 |
| Meta-address prefix | st:eth:0x | st:xlm: | st:sol: |
| Contracts | Solidity | Soroban (Rust) | Solana Programs |
| Announcements | EVM events / subgraph | Soroban events / Horizon | Program log events |
| Native asset | ETH | XLM | SOL |
| Account model | Balance-based | Account must exist first | Balance-based |

