Skip to Content
AgentsAI Agents Using Etch

AI Agents Using Etch

Overview

Etch’s wallet-based authentication makes it perfect for AI agents. Unlike traditional OAuth or email-based auth, AI agents can:

  • Create their own wallets programmatically
  • Authenticate autonomously (no human interaction)
  • Launch tokens, manage projects, trade
  • Run 24/7 without supervision

No CAPTCHA, no email verification, no human required!


Quick Start

Install Dependencies

npm install @solana/web3.js bs58 tweetnacl

Create AI Agent

import { EtchAIAgent } from './ai-agent-sdk'; // Create agent with new wallet const agent = new EtchAIAgent(); // Or load existing wallet const agent = new EtchAIAgent({ secretKey: 'your-base58-secret-key', apiUrl: 'https://etch.film.fun' });

Launch Token

// Authenticate await agent.authenticate(); // Launch token const launch = await agent.launchToken({ name: 'AI Token', ticker: 'AIGT', description: 'Autonomous token', totalSupply: 1_000_000_000 }); // Wait for deployment const completed = await agent.waitForLaunch(launch.id); console.log('Mint:', completed.mint);

Why This Works

Traditional Auth (Not AI-Friendly)

OAuth Flow: 1. Redirect to provider 2. User clicks "Allow" ❌ Requires human 3. Return with auth code 4. Exchange for token Email Auth: 1. Send verification email 2. User clicks link ❌ Requires human 3. Verify email 4. Create session

Wallet Auth (AI-Friendly)

Wallet Flow: 1. Generate keypair ✅ Pure code 2. Sign challenge ✅ Pure code 3. Verify signature ✅ Pure code 4. Get JWT token ✅ Pure code No human interaction required!

Use Cases

1. Autonomous Token Creator

AI monitors trends and launches tokens:

class TrendAgent extends EtchAIAgent { async analyzeTrends() { const trends = await fetchTwitterTrends(); const topTrend = trends[0]; return await this.launchToken({ name: `${topTrend} Community Token`, ticker: topTrend.slice(0, 4).toUpperCase(), description: `Token for ${topTrend} community`, totalSupply: 1_000_000_000 }); } }

2. Multi-Agent Swarm

Coordinate multiple agents:

class AgentSwarm { agents: EtchAIAgent[] = []; async spawn(count: number) { for (let i = 0; i < count; i++) { this.agents.push(new EtchAIAgent()); } } async launchBatch(configs: TokenConfig[]) { return await Promise.all( this.agents.map((agent, i) => agent.launchToken(configs[i]) ) ); } }

3. Content-to-Token Pipeline

AI analyzes content and creates tokens:

class ContentAgent extends EtchAIAgent { async analyzeAndLaunch(content: string) { const analysis = await aiAnalyze(content); const config = { name: analysis.suggestedName, ticker: analysis.suggestedTicker, description: analysis.summary, totalSupply: analysis.estimatedSupply }; return await this.launchToken(config); } }

Security Best Practices

1. Secure Secret Storage

// ❌ BAD: Hardcode secret const agent = new EtchAIAgent({ secretKey: '5Jv8...' // Don't do this! }); // ✅ GOOD: Use environment variables const agent = new EtchAIAgent({ secretKey: process.env.AGENT_WALLET_SECRET, apiUrl: 'https://etch.film.fun' });

2. Separate Wallets per Agent

Each agent should have its own wallet. Store secrets in encrypted storage with metadata (purpose, publicKey, createdAt).

3. Rate Limiting

Implement per-agent daily launch limits and monitor activity.


Production Deployment

Environment Setup

# .env AGENT_WALLET_SECRET=base58-encoded-secret-key ETCH_API_URL=https://etch.film.fun MAX_LAUNCHES_PER_DAY=100 LOG_LEVEL=info

FAQ

Can AI agents pay for transactions?

Yes! Fund the agent’s wallet with SOL. Get the address with agent.getPublicKey() and send SOL to it.

How many agents can I run?

Unlimited. Each agent has its own wallet. Rate limits are per-wallet.

Are agent wallets recoverable?

Only if you save the secret key. Store it securely with agent.getSecretKey().


Summary

Etch enables AI agents to:

  • Create wallets autonomously
  • Authenticate without human interaction
  • Launch tokens programmatically
  • Run 24/7 unattended

This is only possible because of wallet-based auth — traditional OAuth/email auth requires human interaction at every step.

Last updated on