Coinbase Wallet Agent
Create an XMTP Bitte Agent Message Listener
A Bun-based Node.js service that continuously listens for XMTP messages and processes them through the Bitte AI API.
β¨ Features
Real-time XMTP Integration: Continuously listens for new XMTP messages
Bitte AI Processing: Routes messages through Bitte AI agents for intelligent responses
Automatic Error Handling: Handles errors gracefully and sends fallback responses
Key Generation Utility: Script to generate wallet and encryption keys for setup
π οΈ Use Cases
XMTP Message Processing: Real-time automated response to XMTP messages
AI Agent Proxy: Bridge between XMTP and Bitte AI agents
Continuous Service: Long-running service for persistent message handling
π¦ Requirements
Bun (v1.0+)
Node.js v20+
βοΈ Setup
1. Install Dependencies
bun install
2. Generate Keys (Optional for First-Time Setup)
bun scripts/gen-keys.ts
This creates or appends to a
.env
file withWALLET_KEY
andENCRYPTION_KEY
.
3. Configure Environment Variables
Create a .env
file in your project root:
WALLET_KEY=your_wallet_private_key
ENCRYPTION_KEY=your_encryption_key
BITTE_API_KEY=your_bitte_api_key
BITTE_AGENT_ID=your_bitte_agent_id
XMTP_ENV=dev
Variable Reference:
WALLET_KEY
EVM private key (hex string, with or without 0x
)
ENCRYPTION_KEY
32-byte hex string for local DB encryption
BITTE_API_KEY
Your Bitte API key (get from Bitte platform)
BITTE_AGENT_ID
Agent ID to route messages to (e.g. coingecko-ai.vercel.app
)
XMTP_ENV
XMTP environment (dev
, production
, etc.)
βΆοΈ Run the Service
Production
bun start
Development
bun dev
π Scripts
bun start
/ bun dev
Start the XMTP message listener
bun scripts/gen-keys.ts
Generate wallet + encryption keys and update .env
π§ How It Works
XMTP Setup: Initializes XMTP client with wallet + encryption key
Message Streaming: Listens to incoming XMTP messages in real-time
Message Processing: Validates message sender + type
AI Response: Sends message to Bitte AI agent and gets a reply
Reply: Sends response back to original XMTP conversation
Error Handling: Logs errors and sends fallback replies if needed
π Deployment
This is a long-running process. Recommended platforms:
VPS / Dedicated server
Docker container
Railway, Fly.io, or DigitalOcean App Platform
π§° Troubleshooting
β Check Environment Variables: Ensure
.env
is correctly configuredπ Generate Keys: Use
bun scripts/gen-keys.ts
if keys are missingπ§Ύ Monitor Logs: Console output gives insight into runtime behavior
π Bitte API Errors: Double-check your API key + agent ID
β»οΈ Restart on Failures: Service continues running, but restart if persistent errors occur
π Notes
This project uses Bun as the runtime.
Use
.env.example
as a starting point for your configuration.See
XMTP_docs.md
for further XMTP details.
Last updated