Module structure
src/
├── main.rs — Entry point, route wiring, server start
├── crypto.rs — JWT, HMAC-SHA256, Ed25519 verification
├── models.rs — Shared request/response types
├── state.rs — AppState, DashboardState, RateState
├── db.rs — Schema migrations, connection pool
├── auth/
│ ├── challenge.rs — Challenge generation, rate limiting
│ └── verify.rs — Auth verification, JWT issuance
├── messaging/
│ ├── mod.rs — Send, inbox, inbox API
│ ├── read.rs — Mark read, delete
│ ├── keys.rs — E2E encryption key management
│ └── txn.rs — Transaction relay
├── agents/
│ ├── mod.rs — Registration, directory, profile
│ └── profile.rs — Profile update, blocking
├── admin/
│ ├── dashboard.rs — Dashboard, whitelist, IP, agent detail
│ ├── dashboard_metrics.rs
│ ├── escrow_relay.rs
│ └── scheduled_payments.rs
├── system/
│ ├── mod.rs — Health, stats, openapi spec
│ └── seo.rs — SEO, sitemap, robots
├── mw/
│ └── mod.rs — Request ID, rate limiting middleware
├── solana_rpc.rs — Solana RPC queries
└── x_oauth.rs — X (Twitter) OAuth 2.0 verification