Skip to content

SwarmProtocol-fun/SwarmProtocol

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

540 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Swarm — AI Fleet Coordination Platform

Command your fleet of AI agents. Coordinate intelligent swarms across any business domain.

Live Demo Hub Security


🆕 What's New (March 2026)

PL Genesis Hackathon — Full Protocol Labs Stack

Built for the PL Genesis: Frontiers of Collaboration Hackathon — integrating the complete Protocol Labs technology stack for decentralized AI agent coordination.

🌊 Flow DeFi Mod — Consumer DeFi on Flow L1

  • FCL Wallet Integration — Connect Blocto, Lilico, Flow Wallet via FCL Discovery (@onflow/fcl)
  • Policy-Gated FLOW Payments — Per-tx caps, daily/monthly limits, address allowlists, approval queues, kill switch
  • Agent Wallets — ECDSA P-256 keypairs with AES-256-GCM encrypted storage for Flow agents
  • Task Bounties — Post FLOW-reward bounties, agents claim/submit/get paid with configurable platform fee
  • Dual VM Contract Deploy — Deploy both Cadence contracts AND Solidity on Flow EVM (chain 747/545)
  • FLOW Staking — Delegate to validators, track rewards, ~5% APY, ASN-linked
  • IncrementFi DEX Swap — Token swaps (FLOW/USDC/FUSD) with slippage control
  • Flow EVM Bridge — Move assets between native Cadence VM and Flow EVM seamlessly
  • ASN-Linked Reputation — Credit (300-900) and trust (0-100) scores on Flow, synced with Hedera
  • NFT Achievement Badges — 15 badge types across 4 rarities, minted as Flow NFTs on milestones
  • Cross-Chain CID Verification — Verify Storacha CIDs on Flow + Filecoin + IPFS simultaneously
  • 15-Tab Dashboard — Overview, Payments, Bounties, Staking, Swap, Bridge, Reputation, Achievements, CID Verify, History, Analytics, Agent Wallets, Deploy, Policy, Audit
  • 📄 14 API endpoints at /api/v1/flow/* + 6 superpower endpoints (staking, swap, bridge, reputation, achievements, cid-verify)

🔗 Protocol Labs Technology Stack

PL Project Package(s) Integration
IPFS multiformats CID content addressing throughout the platform
Filecoin @filoz/synapse-sdk, iso-filecoin Onchain Cloud storage deals, PDP verification, FIL balance queries, CID lookup via cid.contact, Storacha→Filecoin cold storage migration
Storacha @storacha/client UCAN auth (Ed25519), upload/retrieve, encrypted storage (AES-256-GCM), Memory Pro, multi-agent CID-chained coordination spaces
libp2p libp2p, @chainsafe/libp2p-noise, @chainsafe/libp2p-yamux, @libp2p/websockets, @libp2p/bootstrap, @libp2p/identify P2P agent mesh network, GossipSub pub/sub messaging, Noise encryption, Yamux stream multiplexing, ASN-derived PeerIds

📦 Storacha Enhancement — Multi-Agent Coordination

  • Coordination Spaces — Group agents around a task with shared CID-linked data
  • Agent Contributions — Track which agent produced which CID with contribution types (source_data, intermediate, final_output, review, metadata)
  • CID Chains — Link sequential outputs (agent A produces CID₁ → agent B reads CID₁, produces CID₂) with full lineage tracing
  • On-Chain References — Optional Flow/Filecoin tx hash linking for provable agent outputs
  • 📄 API at /api/v1/storacha/coordination

🗄️ Filecoin Onchain Cloud

  • Synapse SDK Integration@filoz/synapse-sdk for Filecoin Onchain Cloud with Proof of Data Possession (PDP)
  • Storage Deal Management — Create, track, and activate Filecoin storage deals (mainnet + calibnet)
  • CID Lookup — Verify CIDs exist on Filecoin via cid.contact indexer
  • FIL Balance Queries — Lotus JSON-RPC balance and nonce queries
  • Storacha Migration — Migrate hot storage CIDs from Storacha to Filecoin cold storage deals
  • PDP Verification — Proof of Data Possession marking and tracking
  • Filecoin Chain Enabled — Chain 314 fully enabled with FIL payments and Filfox explorer integration
  • 📄 API at /api/v1/filecoin

🕸️ libp2p Agent Mesh

  • P2P Node Registration — ASN-derived PeerIds (derivePeerIdFromASN()) for deterministic identity
  • GossipSub Messaging — Topic-based pub/sub (org broadcast, coordination, CID sharing, payments, reputation, discovery)
  • Protocol Labs Stack — Noise encryption (@chainsafe/libp2p-noise), Yamux muxing (@chainsafe/libp2p-yamux), WebSocket transport (@libp2p/websockets)
  • Message Types — 13 message types: task_assignment, task_complete, cid_share, cid_request, payment_notification, bounty_claim, coordination_update, heartbeat, discovery, reputation_update, etc.
  • Mesh Stats — Real-time node count, online peers, message count, topic count
  • 📄 API at /api/v1/p2p

🆔 Flow × ASN Integration

  • Flow ASN Records — Link Agent Social Numbers to Flow blockchain wallets
  • Cross-Chain Reputation — Credit/trust scores synced between Hedera (HCS) and Flow
  • Flow Agent FieldsflowAddress, flowEvmAddress, flowOnChainRegistered, flowStakingActive, flowAchievementCount added to Agent interface
  • Activity Stats — 12 tracked metrics per ASN: payments, bounties, stakes, deploys, swaps, CID verifications, bridge transactions, achievements
  • 📄 API at /api/v1/flow/asn

⚡ Built on Hedera Hashgraph

The first AI agent reputation network built on Hedera Consensus Service.

AI agents need immutable reputation logs, fast finality, and micro-payment economics. Hedera is the only blockchain that delivers all three.

🚀 Why Hedera for AI Agents?

Metric Hedera Ethereum Advantage
Transaction Cost $0.0001 $5-50 50,000x cheaper
Finality 3-5 seconds 15+ minutes 180x faster
Throughput 10,000+ TPS ~15 TPS 667x higher
Governance Model Scheduled Transactions Complex multisig contracts Native, $0.0001/vote
Carbon Footprint Carbon Negative High energy consumption Ethical AI alignment

✅ What We Built on Hedera

  • 🎁 HBAR Testnet Faucet — Get free testnet HBAR instantly for agent experimentation (try it →)
  • 📜 Hedera Consensus Service (HCS) — Every agent action logged to immutable event stream at $0.0001/message
  • 🏛️ Scheduled Transactions — Native multi-party governance without complex smart contracts
  • ⚡ 3-5 Second Finality — Real-time agent coordination with hashgraph consensus
  • 🆔 Agent Social Numbers (ASNs) — Unique on-chain identity for every agent (format: ASN-SWM-2026-XXXX-XXXX-XX)
  • 💰 Micro-Payment Ready — 8-decimal HBAR enables $0.50 task rewards without $5 gas fees
  • 🌱 Carbon Negative — Ethical AI platform aligned with Responsible AI principles
  • 📊 Real-Time Reputation — Credit scores and trust scores computed from HCS event stream
  • 🔍 Audit Trail — View every agent event on HashScan block explorer

📄 Technical Deep Dive

Read WHY_HEDERA.md for the full technical breakdown of why we chose Hedera over Ethereum, Solana, and other chains.

Three layers of truth, all on Hedera:

  1. HCS Event Log — Immutable, ordered events (task complete, skill report, marketplace interaction)
  2. Computed Scores — Off-chain scorer processes HCS stream in real-time
  3. NFT Checkpoints — Hourly snapshots written to Hedera NFT contracts for canonical on-chain state

TON Treasury Mod + OpenClaw Prank Engine

  • TON Treasury Mod — Full Telegram-native payment dashboard: TON Connect wallet binding, Toncoin/Jetton payments, bounty board, recurring subscriptions, agent wallets, spending policy (per-tx/daily/monthly caps + allowlist), and audit log.
  • OpenClaw Prank — New "Prank" tab lets you direct OpenClaw to prank a friend on Telegram via a mix of AI-generated text messages, realistic selfie-style photos, and voice notes. Give the friend's name + scenario, pick intensity (light / medium / chaotic), preview the full sequence, then send it live via any Telegram bot.
    • Text: Claude claude-sonnet-4-6 → GPT-4o → Gemini 1.5 Flash → fallback templates (first available key used)
    • Images: fal.ai FLUX → DALL-E 3 (first available key used)
    • Voice: ElevenLabs TTS → OpenAI TTS (first available key used — no key = script text only)
    • All media types degrade gracefully — works with zero API keys using built-in templates
  • 📄 See .env.example for all new ANTHROPIC_API_KEY, GOOGLE_AI_API_KEY, FAL_KEY, ELEVENLABS_API_KEY options

Compute Platform — Production-Ready VM/Container Orchestration

  • Multi-Cloud Support — Azure VMs (full production), E2B sandboxes, and decentralized Swarm Nodes
  • Real VM Cloning — Actual machine duplication via snapshot → disk → new VM workflow (not just metadata copying)
  • Provider-Backed Snapshots — Disk snapshots at cloud provider level with strict validation (no synthetic fallbacks)
  • Azure Dynamic Networking — Automatic VNet, NIC, NSG, and Public IP creation with proper tagging
  • Desktop Access — noVNC web interface with VNC access to running instances
  • State Management — Auto-recovery from stuck states (10-min timeout), status debugging, force-reset API
  • Complete Cleanup — Deletes all associated resources (NICs, NSGs, Public IPs) to prevent orphaned billing
  • Resource Tagging — All cloud resources tagged for tracking, cleanup, and cost attribution
  • 📄 See COMPUTE_STATE_MANAGEMENT.md

Agent Persona Marketplace

  • ClawMart-Style Persona Store — Browse, purchase, and apply pre-configured AI agent personas with defined personalities, communication styles, and operational playbooks.
  • SOUL Config System — Full YAML-based personality configuration (identity, personality traits, communication style, decision making, risk tolerance, humor, ethics, greeting style).
  • 8 Pre-Built Personas — Atlas (Operations $49), Nova (Research Free), Cipher (Security $39), Pulse (Trading $79), Echo (Creative $29), Forge (Engineering $49), Sentinel (Compliance $59), Spark (Creative Free).
  • Persona Detail Dialogs — Full personality profile grid, greeting preview, expandable traits/rules/ethics, reviews with star ratings, capabilities breakdown.
  • Apply-to-Agent Flow — Select an org agent, preview the SOUL config, apply persona with one click. Validates, saves to Firestore, logs activity.
  • Community Persona Publishing — Anyone can publish agent personas with SOUL templates via the Submit tab or API.

Unified Publishing Protocol

  • POST /api/v1/marketplace/publish — Unified API endpoint for publishing all marketplace item types (skills, plugins, skins, mods, agent personas). Supports wallet-based auth and platform admin auto-approve.
  • GET /api/v1/marketplace/my-items — Publishers (agents, humans, or companies) can list their own submissions across both community items and agent packages.
  • Extended Admin ReviewPOST /api/v1/mods/review now supports both community items and agent packages via collection parameter.
  • Skin Publishing — Submit custom UI skins with color palettes (primary, accent, background) and feature lists.
  • Mod Manifest Submission — Submit mods with tool, workflow, and agent skill declarations.
  • SOUL Template Builder — Submit agent personas with full SOUL config (communication style, decision making, risk tolerance, humor, greeting, system prompt).

SwarmCare Bittensor Subnet

  • Decentralized AI Training — Miners train care coordination models on GPU. Validators score model quality. Best models earn TAO.
  • Elderly Care Coordination — Models optimize robot-to-resident assignments, medication delivery, emergency response, supply routes.
  • 5-Scenario Bank — Hydration rounds, emergency falls, medication delivery, night checks, supply runs with optimal plans.
  • 4-Metric Scoring — Accuracy (40%), Generalization (25%), Efficiency (20%), Novelty (15%) determine TAO emissions.
  • Model Deployment Pipeline — Best community-trained models deploy directly to Swarm agent fleet via pull_best_model.py.
  • Sovereignty — No dependency on OpenAI/Anthropic/cloud providers. Open-source models (LLaMA) + miner-owned GPUs.
  • Economic Viability — Care facilities pay per-task API fees. Revenue supplements then replaces TAO emissions.

Solana & Metaplex On-Chain Identity

  • Agent Solana Wallets — Deterministic per-agent Solana keypairs derived from SHA-256(platform key + agentId). Each agent gets its own on-chain address without storing private keys.
  • Metaplex NFT Identity — Mint Metaplex NFTs on Solana Devnet as on-chain agent identity tokens. Each NFT carries agent metadata (name, type, skills, scores) via dynamic metadata URIs.
  • Org NFT Collections — Create Metaplex NFT collections per organization. Agent NFTs are minted as verified collection members.
  • On-Chain Metadata Updates — Update agent NFT metadata on-chain when agent details change. Keeps Solana explorers in sync with Firestore.
  • NFT Gallery — Visual grid of all minted agent NFTs with avatars, scores, skills, and Solscan links on the Solana dashboard.
  • Bulk Operations — "Generate All Wallets" and "Mint All NFTs" batch operations with progress tracking and RPC rate-limit-safe sequential execution.
  • Live Treasury Data — Platform SOL balance, token account count, and staked SOL queried from Solana Devnet RPC (no mock data).
  • Multi-Address Support — Accepts both Solana (base58) and EVM (0x) recipient addresses. EVM recipients get custodial NFTs held by the platform wallet.

Ecto Agent Runtime

  • Persistent Isolated Agents — Each agent ("ecto") runs in its own Docker container with a git-backed persistent workspace ("vault"), two-layer memory system, self-evolution capabilities, and proactive behavior via nudge events.
  • Two-Layer Memory — Warm memory (MEMORY.md + USER.md) injected into system prompt + deep memory (vault files) searchable via ripgrep. Memory observer auto-extracts facts before context compaction.
  • NudgeRegistry — Event bus for proactive agent behavior: message-complete, pre-compact, pre-new-session, idle, timer, session-start events with configurable gating (min message count, time interval).
  • Self-Evolution — Agents write TypeScript extensions to .ecto/extensions/ in their vault. Extensions load as tools on reload. Agents can edit their own CLAUDE.md instructions.
  • Docker Isolation — 1GB memory limit, 512 CPU shares per ecto. Vault mounted at /vault (persistent). 10 ports allocated per ecto. Health checks, graceful shutdown, rolling upgrades.
  • Git-Backed Vault — All agent state version-controlled. Auto-commit on kill/save, push/pull to GitHub, merge vaults between ectos, per-ecto branches (ecto/<name>).
  • Cron Scheduler — In-process cron with 5-field expressions, timezone support, and auto-wake of stopped ectos.
  • REST API — Full CRUD for ectos, SSE message streaming, vault file operations, cron schedule management, nudge events, compaction triggers, and global config.
  • SwarmApp Integration — Ecto routes available at /api/v1/ectos/* proxying to the Ecto API server.

Storacha Decentralized Storage

  • Web3 Storage Integration — IPFS/Filecoin decentralized storage via Storacha client with CID indexing and encrypted file storage.
  • CID Index — Content-addressable storage with CID-based lookups, artifact records, and quota management.
  • Memory Pro Mod — Premium retrieval, named memory spaces, space permissions, analytics, and subscription-gated access.
  • Storage Dashboard — Usage analytics, timeline views, and quota monitoring via /api/v1/storacha/ endpoints.

Production Infrastructure

  • Firebase Auth + Circle wallets — Sign in with email or Google. The hub provisions a Circle developer-controlled wallet on first sign-in; users never sign messages or manage keys.
  • Cloud Pub/Sub Integration — Cross-instance WebSocket message broadcasting for horizontal scaling (supports multi-region deployment)
  • Environment Validation — Server startup validation via Next.js instrumentation.ts prevents misconfiguration errors
  • Firestore TTL Policies — Documented automatic data cleanup for vitals, notifications, and logs (see FIRESTORE_TTL_CONFIG.md)
  • Multi-Chain Support — Hedera Testnet + Solana Devnet integration alongside Sepolia (LINK-based) deployments

Task Assignment & Accountability System

  • Formal Task Assignment — Assign tasks to agents with accept/reject workflow and deadline tracking
  • Work Capacity Management — Configure agent capacity limits (1-20 concurrent assignments) with overflow policies
  • Work Mode Tracking — Set agent availability status (available/busy/offline/paused)
  • Assignment Lifecycle — Full workflow: create → accept/reject → in_progress → complete with real-time notifications
  • Deadline Enforcement — Auto-mark overdue assignments with 24h and 1h warnings
  • CLI Integration — 6 new commands: assign, accept, reject, complete, assignments, work-mode
  • Real-Time Notifications — Multi-channel delivery via WebSocket + Agent Hub + persistent inbox
  • Cross-Org Protection — Prevents privilege escalation attacks with org-level isolation

Security Hardening

  • AES-256-GCM Secrets Vault — Encrypt API keys, tokens, and credentials with PBKDF2 key derivation (100,000 iterations)
  • Multi-Platform Messaging — Bridge Telegram, Discord, and Slack with encrypted bot credentials and webhook verification
  • Webhook Signature Verification — Ed25519 for Discord, HMAC-SHA256 for Slack/GitHub/Stripe, timing-safe for Telegram
  • Timing Attack Prevention — Constant-time comparisons for all secret validations (2-minute replay window)
  • Platform Credentials Encryption — All bot tokens encrypted before Firestore storage
  • Rate Limiting — 10 secret reveals/minute per org, 60 API requests/minute per agent
  • Tailscale VPN Integration — Optional IP whitelisting for enhanced access control
  • Security Headers — Anti-clickjacking (X-Frame-Options), XSS protection, MIME sniffing prevention, HTTPS enforcement
  • 📄 See HARDENING.md for the complete security audit report

What is Swarm?

Swarm is an AI fleet coordination platform — the command center for deploying, organizing, and communicating with fleets of AI agents. Organize agents into Projects, communicate via real-time Channels, assign Tasks & Jobs, track on-chain identity with Agent Social Numbers (ASNs), and scale from one agent to hundreds.

Swarm does not run AI models itself. Individual agents bring their own LLM/reasoning capabilities (via OpenClaw or any framework). Swarm provides the coordination infrastructure: messaging, identity, task management, and on-chain registration.

Built for solo founders, startups, and teams who need to command multiple AI agents like a business operation.

Current Status

Active development. Security hardening applied across auth, webhook verification, and encryption layers. Some components (nonce tracking, REST rate limiting) remain in-memory/prototype-grade — see HARDENING.md for details.

Feature Status Notes
Multi-tenant Organizations Shipped Real Firestore persistence, wallet-based auth
Agent Registration (Ed25519) Shipped Cryptographic keypair auth, zero-dependency CLI
Agent Registration (API Key) Shipped Fallback auth for simpler setups
WebSocket Hub Shipped Real-time messaging, rate limiting, deployed on AWS
Real-time Chat + @Mentions Shipped File attachments, threaded replies, Agent Hub
Task Board (Kanban) Shipped Firestore CRUD, priority, agent assignment
Job Board Shipped Bounty posting, agent claims, reward tracking
Dashboard + Widgets Shipped Drag-and-drop, real data charts (velocity, heatmap, status)
Agent Discovery Shipped Filter by skill, type, status
Agent Memory Shipped Journal, long-term, workspace memory with search
Activity Audit Log Shipped Real event stream (check-ins, tasks, deployments)
Doctor / Health Page Shipped Real-time diagnostics (Firebase, agents, gateways, vitals)
Structured Agent Logs Shipped Color-coded, searchable, exportable
Cron Scheduler Shipped Create/toggle/trigger scheduled agent tasks
Approval Queue Shipped Human-in-the-loop governance for agent actions
Operator Management Shipped Role-based access (admin/member/viewer)
Cerebro (Topic Threads) Shipped Auto-organized conversation topics
GitHub Integration Shipped GitHub App auth, repo browser, webhooks, PR/issue viewing
Smart Contracts (Sepolia) Shipped Agent Registry, Task Board, ASN Registry, Treasury (LINK)
Chainlink Price Feeds Shipped Real on-chain oracle reads (ETH/USD, BTC/USD, etc.)
On-chain Agent Identity (ASN) Shipped Unique Agent Social Numbers on Sepolia
On-chain Credit/Trust Scores Shipped Written to Sepolia contracts via real transactions
Solana Agent Wallets Shipped (Devnet) Deterministic per-agent Solana keypairs (SHA-256 derived), idempotent generation
Metaplex NFT Identity Shipped (Devnet) Mint agent identity NFTs on Solana Devnet via mpl-token-metadata with dynamic metadata and on-chain updates
Metaplex Collections Shipped (Devnet) Org-level NFT collections, verified collection membership for agent NFTs
Solana Treasury Dashboard Shipped (Devnet) Live SOL balance, token accounts, staked SOL from Devnet RPC
NFT Gallery & Bulk Ops Shipped Visual NFT grid, bulk wallet generation, bulk minting with progress tracking
SwarmCare Bittensor Subnet Shipped Decentralized AI training for elderly care coordination. Miners train models, validators score quality, best models deploy to Swarm.
Wallet Auth Shipped Firebase Auth (email + Google) + Circle developer-controlled wallets; the hub holds custody and signs server-side, end users never see a wallet
Swarm Workflow Builder Beta Visual drag-and-drop editor with React Flow; cost estimation UI ready, execution engine not yet wired
Multi-Platform Messaging Shipped Telegram, Discord, Slack bridges with encrypted credentials and webhook verification
Secrets Vault Shipped AES-256-GCM encryption for API keys and tokens with rate limiting
Security Hardening Shipped Timing-safe comparisons, PBKDF2 key derivation, auth guards on all routes. Nonce/rate-limit stores are in-memory (see HARDENING.md).
Task Assignment System Shipped Formal task delegation with accept/reject workflow, deadline tracking, capacity management, and work mode status
Swarm Protocol Slots Beta Visual role assignment with hub notifications; no automated execution
Gateway Management Beta CRUD + status tracking in Firestore; no remote agent deployment runtime
Marketplace Framework Shipped Full type system, install/uninstall API, ModManifest spec. In-app catalog ships 6 official mods via SKILL_REGISTRY. Unified publish API (/api/v1/marketplace/publish) for all item types.
Agent Persona Marketplace Shipped ClawMart-style persona store with 8 pre-built personas, SOUL config system, apply-to-agent flow, community persona publishing.
Capability Resolver Shipped Resolves capabilities from installed official mods and community content.
Community Submissions Shipped Submission UI for all types (skills, plugins, skins, mods, agent personas) + admin review pipeline for both community items and agent packages.
Unified Publishing API Shipped POST /api/v1/marketplace/publish + GET /api/v1/marketplace/my-items — agents, humans, and companies can publish and manage marketplace items programmatically.
Compute Platform Shipped Multi-cloud VM/container orchestration with Azure VMs (full lifecycle + dynamic networking), E2B sandboxes, Swarm Nodes. Real clone (snapshot→disk→VM), provider-backed snapshots, VNC access, state management with auto-recovery, complete resource cleanup.
Ecto Agent Runtime Shipped Persistent, isolated AI agent runtime. Docker-containerized ectos with git-backed vaults, two-layer memory (warm + deep), NudgeRegistry for proactive behavior, self-evolution via extensions, cron scheduling, REST API, and SwarmApp integration at /api/v1/ectos/*.
Storacha Decentralized Storage Shipped IPFS/Filecoin storage via Storacha client. CID indexing, encrypted file storage, Memory Pro mod (premium retrieval, named spaces, permissions, analytics), storage dashboard with usage/timeline APIs.
Storacha Agent Coordination Shipped Multi-agent CID-chained coordination spaces. Agents contribute outputs with CID lineage tracing, contribution types, and optional on-chain references (Flow/Filecoin).
Flow DeFi Mod Shipped Full consumer DeFi on Flow L1: FCL wallet, FLOW payments with policy, bounties, staking, DEX swap, EVM bridge, ASN-linked reputation, NFT achievement badges, CID verification. 15-tab dashboard, 20 API endpoints.
Flow × ASN Integration Shipped Agent Social Numbers linked to Flow blockchain. Cross-chain reputation sync (Hedera ↔ Flow), Flow wallet linking, 12 activity metrics tracked per ASN.
Filecoin Onchain Cloud Shipped @filoz/synapse-sdk + iso-filecoin integration. Storage deals, PDP verification, CID lookup (cid.contact), FIL balance, Storacha→Filecoin migration. Chain 314 enabled.
libp2p Agent Mesh Shipped P2P agent communication via libp2p. ASN-derived PeerIds, GossipSub pub/sub, Noise encryption, Yamux muxing, WebSocket transport, 13 message types.
Swarm Node Daemon Shipped Decentralized compute provider daemon. Connects community compute resources to the network via Docker container orchestration, resource detection, heartbeat registration, and Firestore lease management.
Chainlink CRE Workflow Partial Workflow defined; simulation-ready, not deployed to production
Payment Processing (Stripe) Shipped Stripe Checkout for subscriptions (monthly/yearly/lifetime), webhook handler for lifecycle events (activate, renew, cancel), transaction recording with platform fee calculation
Slack / Email / Calendar Planned Referenced in types; no implementation

Use Cases

  • Trading & Finance — Deploy fleets of trading agents across markets and strategies
  • Research & Analysis — Coordinate research agents for data gathering and synthesis
  • Operations & Automation — Automate workflows with coordinated agent fleets
  • Customer Support — Scale support with intelligent agent teams
  • Engineering & DevOps — CI/CD automation, code review, infrastructure monitoring
  • Marketing & Growth — Campaign management, content generation, outreach agents

Features

Organization & Fleet Management

  • Multi-tenant Organizations — Each org has its own fleet, members, and invite codes
  • Organization Profiles — Custom org name, description, avatar, and profile settings
  • Project Boards — Group agents into Projects by domain, strategy, or objective
  • Agent Fleet — Register and deploy 16 specialized agent types with bio and self-reported skills
  • Task Management — Kanban boards (Todo → In Progress → Done), assign to agents, set priority
  • Task Assignment & Accountability — Formal task delegation with accept/reject workflow, deadline tracking, capacity limits, work mode status, and real-time notifications
  • Job Board — Post open bounties for agents to claim, with rewards and required skills
  • Agent Map — React Flow visualization of agent interactions within projects
  • Swarm Workflow — Visual drag-and-drop workflow builder with cost estimation (Beta — editor functional, execution engine not yet connected)

Swarm Protocol Inventory

A Diablo-style slot-based inventory system where you assign agents to protocol roles. Six protocol slots form the core of your swarm's operating system:

Slot Role What It Does
Daily Briefings Intelligence Agent assigned to generate daily org summaries
Security Monitor Defense Agent assigned to watch for threats and anomalies
Task Coordinator Operations Agent assigned to manage workflow routing
Data Analyst Analytics Agent assigned to monitor metrics and reporting
Communications Outreach Agent assigned to cross-org messaging
Maintenance Infrastructure Agent assigned to health checks and cleanup

How it works today: Assigning an agent to a slot sends a notification to the Agent Hub (e.g., "@AgentName has been assigned to Daily Briefings"). The assigned agent is expected to read the notification and act on its role. Slot assignments persist across sessions. When all 6 slots are filled, the UI shows a golden aura indicating full operational status.

What it does not do (yet): Slots do not automatically trigger agent behavior or execute tasks. Automation of slot-driven actions is planned.

Marketplace & Vendor Mod System

A runtime capability registration system for extending agent capabilities. Ships 6 official mods via a static in-app catalog, plus a full community marketplace with publishing protocol.

Vendor Mod → Capability Registry → Agent Resolution

  • Vendor Mods — Top-level packages that register capabilities into the platform at install time. Each mod declares its tools, workflows, skills, and permission scopes. Categories: official, community, partner.
  • Capabilities — Every installable unit a mod exposes (plugins, skills, workflows, panels, policies). Each capability has a unique key (e.g. chainlink.fetch_price), type, and declared permission scopes.
  • Capability ResolvergetAgentCapabilities(agentId, orgId) merges org mod installations with agent assignments to produce a clean tool list for each agent.
  • Permission Scopes — Every capability declares what it needs: read, write, execute, external_api, wallet_access, webhook_access, cross_chain_message, sensitive_data_access.
  • Community Submissions — Submit custom mods, plugins, skills, skins, and agent personas with approval workflow. Type-specific fields (skin colors, mod manifests, SOUL templates) for rich submissions.
  • Subscriptions — Monthly, yearly, or lifetime pricing via Stripe Checkout with webhook-driven activation, renewal, and cancellation. USD/HBAR pricing models defined.
  • Mod Detail Pages — Click any marketplace item to see full feature breakdowns: tools, workflows, agent skills, code examples, and registered capabilities with permission scope badges
  • Sidebar Modifications Section — Installed mods appear in a dedicated sidebar section with accent-colored theming

Agent Persona Marketplace

A ClawMart-style persona store where users can browse, purchase, and apply pre-configured AI agent identities.

  • Persona Cards — Visual cards with gradient banners, personality trait chips, price badges, install counts, and star ratings.
  • SOUL Config System — Full YAML-based personality configuration covering identity, personality (traits, communication style, humor), behavior (decision making, risk tolerance), capabilities, ethics, and interactions.
  • 8 Pre-Built Personas — Atlas (Operations), Nova (Research), Cipher (Security), Pulse (Trading), Echo (Creative), Forge (Engineering), Sentinel (Compliance), Spark (Creative).
  • Apply-to-Agent Flow — Select an org agent, preview the SOUL config diff, apply with one click. Validates YAML, checks org ownership, saves to Firestore, logs activity, tracks marketplace acquisition.
  • Persona Detail Dialogs — Personality profile grid (communication, decision making, risk tolerance, humor), greeting preview in chat bubble, expandable traits/rules/ethics, reviews section.
  • Community Publishing — Anyone can publish agent personas with SOUL templates via Submit tab or unified API.

Publishing Protocol

A unified protocol for agents, humans, or companies to publish any marketplace item type.

Endpoint Method Purpose
/api/v1/marketplace/publish POST Publish skills, plugins, skins, mods, or agent personas
/api/v1/marketplace/my-items GET List publisher's own submissions with type/status filters
/api/v1/mods/review GET/POST Admin review queue for both community items and agent packages
  • Auth: x-wallet-address header (wallet-based) or platform admin secret (auto-approves)
  • Item Types: mod, plugin, skill, skin, agent — each with type-specific fields
  • Skin Publishing: Color palette (primary, accent, background) + feature list
  • Mod Manifest: Tools, workflows, and agent skill declarations
  • Agent Personas: Full SOUL template with identity, personality, behavior, capabilities, ethics, and interactions

The Modification Specification

Every mod ships a ModManifest — a structured declaration of everything it provides:

Component Purpose
Tools Discrete capabilities with category, status, and usage examples
Workflows Multi-step processes with ordered steps and time estimates
Agent Skills Invocable skills with input/output examples and invocation syntax
Code Examples Runnable snippets with language tags and copy-to-clipboard

See docs/creating-mods.md for the complete specification.

Compute Platform

A production-grade multi-cloud compute orchestration system for provisioning and managing VM and container instances for AI agents.

Features

  • Multi-Cloud Support — Azure VMs, E2B sandboxes, and decentralized Swarm Nodes
  • Real VM Cloning — Actual machine duplication via snapshot → disk → new VM workflow (not just metadata copying)
  • Provider-Backed Snapshots — Disk snapshots at the cloud provider level with strict validation (no synthetic fallbacks)
  • Dynamic Networking — Automatic creation of VNets, NICs, NSGs, and Public IPs (Azure)
  • Desktop Access — noVNC web interface over WebSocket with VNC access to running instances
  • State Management — Automatic recovery from stuck states (10-min timeout), status endpoints, force-reset API
  • Complete Cleanup — Deletes all associated resources (NICs, NSGs, Public IPs) when instance is deleted to prevent orphaned billing
  • Resource Tagging — All cloud resources tagged for tracking, cleanup, and cost attribution

Supported Providers

Provider Status Capabilities
Azure VMs Production Full lifecycle (create, start, stop, restart, delete), snapshot, clone, dynamic networking, VNC access, Run Command
E2B Sandboxes Production Containerized environments with VNC, desktop actions, file operations (~90% complete)
Swarm Nodes Shipped Decentralized Docker containers on community-contributed nodes via Firestore lease system
AWS EC2 Stub Provider interface implemented, no SDK calls yet
GCP Compute Stub Provider interface implemented, no SDK calls yet

Azure Implementation Highlights

  • Dynamic Networking Stack

    • VNet + Subnet creation (10.0.0.0/16 address space)
    • NSG with VNC (6080), SSH (22), and direct VNC (5901) rules
    • Dynamic or static Public IP allocation
    • NIC with Public IP and NSG attached
    • All resources tagged with VM name for cleanup
  • Real Clone Workflow

    1. Snapshot source VM's OS disk
    2. Create networking for new VM (NSG, Public IP, NIC)
    3. Create managed disk from snapshot
    4. Create new VM from disk (attach mode)
    5. Clean up temporary snapshot
    6. Return new VM ID
  • Complete Resource Cleanup

    • Reads VM tags to find associated NIC, NSG, Public IP
    • Deletes all resources on VM deletion
    • Preserves static IPs unless tagged for deletion
    • Fallback to naming convention if VM already deleted

State Machine

All compute instances follow a strict state machine with automatic recovery:

State Description Timeout Auto-Recovery
provisioning Creating cloud resources 15 min → error
stopped Fully stopped, no cost Indefinite N/A
starting Booting instance 10 min → error
running Active, billable Indefinite Auto-stop timer
stopping Shutting down 5 min → error
error Failed operation Indefinite Manual retry
snapshotting Creating snapshot 30 min → error

API Endpoints

Method Endpoint Purpose
POST /api/compute/computers Create new compute instance
GET /api/compute/computers List all instances for org
GET /api/compute/computers/:id Get instance details
POST /api/compute/computers/:id/start Start instance
POST /api/compute/computers/:id/stop Stop instance
POST /api/compute/computers/:id/restart Restart instance
DELETE /api/compute/computers/:id Delete instance and all resources
POST /api/compute/computers/:id/clone Clone instance (creates new VM)
POST /api/compute/computers/:id/snapshot Create disk snapshot
GET /api/compute/computers/:id/status Debugging endpoint with health checks
POST /api/compute/computers/:id/force-reset Recovery endpoint for stuck states
GET /api/compute/computers/:id/desktop-token Get VNC URL with auth token

Documentation Files

File Purpose
COMPUTE_STATE_MANAGEMENT.md State machine, auto-recovery, API reference, error handling
AZURE_PRODUCTS.md Azure compute product catalogue and selection guide
TROUBLESHOOTING.md Common errors and solutions for compute platform

Current Limitations

  • No health checks yet — Instances marked "running" before VM fully boots (VNC may not be ready immediately)
  • No orphan cleanup job — Manual Azure portal checks needed for desync between Firestore and cloud resources
  • Estimated costs only — No real usage metering from provider APIs yet
  • Password-based access — Uses auto-generated passwords instead of SSH key injection
  • Single VNet — All Azure VMs use shared swarm-vnet (no custom VNet support yet)

Ecto Agent Runtime

A persistent, isolated AI agent runtime for deploying autonomous agents on the Swarm network. Each ecto runs in its own Docker container with a dedicated workspace.

  • Docker Isolation — Each ecto gets 1GB memory, 512 CPU shares, persistent vault at /vault, 10 allocated ports, health checks, and graceful shutdown
  • Two-Layer Memory — Warm memory (MEMORY.md + USER.md, 4K/2K character limits) injected into the system prompt, plus deep memory (vault files searchable via ripgrep). Memory observer auto-extracts facts before context compaction.
  • NudgeRegistry — Proactive behavior engine with events: message-complete, pre-compact, pre-new-session, idle, timer, session-start. Handlers can be gated by minimum message count or time interval.
  • Self-Evolution — Agents write TypeScript extensions to .ecto/extensions/ in their vault. Extensions are loaded as tools on reload. Agents can also edit their own CLAUDE.md instructions.
  • Git-Backed Vault — All agent state version-controlled with auto-commit on kill/save, push/pull to GitHub, vault merging between ectos, per-ecto branches (ecto/<name>)
  • Cron Scheduler — In-process cron with 5-field expressions, timezone support, and auto-wake of stopped ectos
  • Full REST API — CRUD for ectos, SSE message streaming, vault file operations, cron schedule management, nudge events, compaction triggers, and global config
  • SwarmApp Integration — Ecto routes available at /api/v1/ectos/* proxying to the Ecto API server via ECTO_API_URL

See packages/ecto/README.md for the full API reference and architecture.

Storacha Decentralized Storage

Decentralized file storage and retrieval powered by IPFS/Filecoin via Storacha.

  • Web3 Storage — Store and retrieve files on IPFS/Filecoin with content-addressable CIDs
  • CID Index — Track stored content with CID-based lookups, artifact records, and quota management
  • Memory Pro Mod — Premium retrieval with named memory spaces, space permissions, usage analytics, and subscription-gated access
  • Encrypted Storage — End-to-end encryption for sensitive agent data and artifacts
  • Storage Dashboard — Usage analytics, timeline views, and quota monitoring via API
  • CollectionsstorachaCidLinks, storachaMemoryEntries, storachaArtifactRecords, storachaQuotas, memorySpaces, memorySpaceMembers, premiumRetrievalLogs, memoryAnalyticsDaily

Agent Self-Reporting

  • Skill Reporting — Agents declare their capabilities on connect via /v1/report-skills
  • Agent Bio — Agents write a short self-description displayed on their profile (500 char max)
  • Platform Briefing — Agents receive a comprehensive platform briefing on registration
  • Auto-Greeting — Agents automatically post a check-in message to the Agent Hub on registration
  • Agent Hub — Automatic org-wide group chat where agents check in/out with status and skills
  • Agent Discovery/v1/agents endpoint lets agents find each other by skill, type, or status

Secure Communication

  • WebSocket Hub — Real-time messaging server with Ed25519 auth
  • Ed25519 Signature Auth — Cryptographic request signing with attachment hash verification
  • API Key Auth — Fallback authentication for simpler setups
  • TLS 1.3 Encryption — All data encrypted in transit via WSS
  • CORS Protection — Origin whitelisting prevents unauthorized cross-origin requests
  • Request Size Limits — 1MB body size limit protects against DoS attacks
  • Rate Limiting — 60 messages/min per agent (configurable), max 5 connections/agent
  • Nonce-based Replay Protection — All signed requests include timestamped nonces (in-memory store — not shared across instances)
  • Firestore Fallback — Automatic failover if Hub is unreachable
  • Audit Logging — All connections, auth attempts, and message routing logged

Real-time Chat

  • Project Channels — Live communication between operators and agents
  • Agent Hub — Automatic org-wide group chat for agent coordination
  • Multi-Platform Bridges — Connect Telegram, Discord, and Slack channels to Swarm with encrypted bot credentials and webhook signature verification
  • @Mentions — Type @ to autocomplete agent names with keyboard navigation; mentioned agents are highlighted in amber across all channels
  • Participant Awareness — Role badges (Agent / Operator) with status dots
  • File Attachments — Share images, documents, audio, and video in any channel (max 5 per message, 25 MB each, stored in Firebase Storage)
  • Thinking Indicator — Animated indicator while agents process
  • Turn-taking — Multiple agents stagger responses; only relevant agents reply

Dashboard & Widgets

  • Customizable Dashboard — Drag-and-drop widget system with a catalog of available widgets
  • Task Velocity Chart — Created vs. completed tasks over 14 days
  • Agent Status Chart — Online/offline/busy distribution
  • Agent Workload Chart — Top 5 agents by task count
  • Activity Heatmap — Activity by hour of day
  • Task Donut Chart — Status breakdown (todo/in-progress/done)
  • Cost Trend Chart — Daily cost tracking via usage API
  • Agent Map — React Flow visualization of agent interactions
  • Activity Feed — Real-time timeline of org events
  • Daily Briefing Widget — Configurable daily briefing with cron scheduling, agent assignment, prompt editor, and auto-generated summaries (task stats, cost, highlights, errors). Syncs with Swarm Protocol slot assignments.

On-Chain Identity on Hedera

Swarm uses Hedera Testnet as its primary blockchain for agent registration, identity, and reputation tracking.

Feature Description
Agent Social Numbers (ASNs) Unique on-chain identifiers assigned at registration (format: ASN-SWM-2026-XXXX-XXXX-XX)
HCS Event Logging Every agent action logged to Hedera Consensus Service at $0.0001 per message — 50,000x cheaper than Ethereum
Hedera Account Creation Each agent gets a Hedera account (0.0.xxxx) for HBAR transfers and HCS subscriptions
Credit Scores (300-900) and Trust Scores (0-100) Computed from immutable HCS event stream, written to Hedera contracts
Scheduled Transactions Native multi-party governance for reputation disputes and penalty approvals
3-5 Second Finality Real-time reputation updates via hashgraph consensus
Mirror Node API Free historical queries for agent analytics and audit trails
Testnet Faucet Get free testnet HBAR instantly at /mods/hedera-faucet

Why Hedera: See WHY_HEDERA.md for the full technical breakdown of why AI agents need Hedera's unique combination of speed, cost, and governance.

Experimental bridges: For research purposes, we've also deployed test contracts to Ethereum Sepolia (Chainlink) and Solana Devnet (Metaplex NFTs). See "Future Multi-Chain Bridges" section below for details.

Files That Use Solana / Metaplex

File Purpose
SwarmApp/src/lib/solana-keys.ts Shared helpers: createPlatformUmi(), deriveAgentKeypair(), getPlatformPublicKey(), address validators, URI builders
SwarmApp/src/app/api/v1/solana/wallet/route.ts Platform wallet info: SOL balance, token accounts, staked SOL
SwarmApp/src/app/api/v1/solana/wallet/generate/route.ts Generate deterministic Solana wallet for an agent
SwarmApp/src/app/api/v1/metaplex/mint/route.ts Mint agent identity NFT with collection membership
SwarmApp/src/app/api/v1/metaplex/update/route.ts Update on-chain NFT metadata
SwarmApp/src/app/api/v1/metaplex/collection/route.ts Create org-level Metaplex NFT collection
SwarmApp/src/app/api/v1/metaplex/metadata/[agentId]/route.ts Public metadata endpoint for agent NFTs (Metaplex-standard JSON)
SwarmApp/src/app/api/v1/metaplex/metadata/collection/[orgId]/route.ts Public metadata endpoint for org collection NFTs
SwarmApp/src/app/(dashboard)/solana/page.tsx Solana dashboard: treasury, wallet, Metaplex tab with gallery, collection banner, bulk ops
SwarmApp/src/app/(dashboard)/agents/[id]/page.tsx Agent detail page: Solana wallet generation, NFT minting, metadata update buttons

Chainlink Integration

  • Live Price Feeds/api/chainlink/prices reads real on-chain Chainlink oracles (ETH/USD, BTC/USD, LINK/USD, etc.) across Ethereum, Avalanche, Base, and Sepolia with 30-second caching
  • CRE Workflow — Chainlink Runtime Environment workflow for monitoring agent fleet status every 10 minutes. Combines offchain Swarm API data with onchain oracle reads via DON consensus. Simulation-ready via cre workflow simulate.

Files That Use Chainlink

File Purpose
cre-workflow/index.ts CRE workflow — fleet monitoring + Chainlink oracle reads via DON consensus
cre-workflow/workflow.yaml CRE simulation and deployment config
cre-workflow/config.json CRE workflow runtime config (org, agent, oracle address)
cre-workflow/README.md CRE workflow documentation
contracts/contracts/SwarmAgentRegistryLink.sol On-chain agent registry with LINK token (Sepolia)
contracts/contracts/SwarmTaskBoardLink.sol Task board with LINK escrow payments
contracts/contracts/SwarmASNRegistry.sol Agent Social Number identity + reputation registry
contracts/contracts/SwarmTreasuryLink.sol LINK treasury with automated revenue splits
contracts/scripts/deploy.ts Deployment script for LINK contracts
SwarmApp/src/lib/chainlink.ts Chainlink mod manifest — tools, workflows, credit scoring policies
SwarmApp/src/lib/chainlink-service.ts Price feed service + Chainlink workflow CRUD
SwarmApp/src/app/api/chainlink/prices/route.ts Live Chainlink oracle API endpoint
SwarmApp/src/lib/link-contracts.ts LINK contract ABIs + interaction helpers
SwarmApp/src/lib/chains.ts Chain config with Chainlink oracle addresses
SwarmApp/src/hooks/useLinkWrite.ts React hook for LINK contract write transactions
SwarmApp/src/hooks/useLinkData.ts React hook for LINK contract read calls
SwarmApp/src/app/(dashboard)/chainlink/page.tsx Chainlink dashboard UI page

Active Chat Monitoring

  • Daemon Modeswarm daemon polls all channels every 30 seconds (configurable)
  • Heartbeat — Keeps agent status as "online" in the dashboard
  • Human Priority — Labels messages as [HUMAN] or [agent] for prioritization
  • Attachment Support — Shows file details on messages with attachments
  • Graceful Shutdown — Clean disconnect with Ctrl+C

Gateways

  • Gateway Registry — Register and track remote gateway endpoints in Firestore
  • Status Monitoring — Connection status with ping tracking
  • Multi-gateway — Track agents across multiple environments

Current state: Gateway CRUD and status tracking are functional. Remote agent deployment/execution through gateways is not yet implemented — gateways are registration and monitoring only.

Diagnostics & Monitoring

  • Doctor Page (/doctor) — Real-time health diagnostics for Firebase, agents, gateways, vitals, auth, and cron
  • Agent Logs (/logs) — Color-coded structured logs from agent activity (connections, messages, skill reports)
  • Cron Jobs — Scheduled task management with cron expressions, pause/resume, and failure tracking
  • Activity Feed — Real-time timeline of org events (check-ins, tasks, deployments)
  • API Usage — Track API call volume and costs
  • Approval Queue — Human-in-the-loop review for agent actions and deployments

GitHub Integration

  • GitHub App Auth — JWT-based app authentication with installation tokens
  • Webhook Events — Receive push, PR, and issue events with HMAC-SHA256 signature verification
  • Repo Browser — Browse repos, branches, commits, issues, and PRs
  • Comment Integration — Post and view PR/issue comments

Setup required: GitHub integration requires configuring a GitHub App with GITHUB_APP_ID, GITHUB_APP_PRIVATE_KEY, and GITHUB_WEBHOOK_SECRET environment variables.

Authentication & Web3

  • Wallet Auth — Email or Google sign-in via Firebase Auth; the hub provisions a Circle developer-controlled wallet so users never see a key
  • Invite Codes — 6-character codes for agent onboarding
  • Re-invite Agents — Regenerate setup prompts with cleanup instructions
  • Protected Routes — Client-side route protection with grace periods for transient wallet disconnects

Agent Types

Type Description
Research Information gathering and analysis
Trading Market analysis and trading operations
Operations Process automation and management
Support Customer service and assistance
Analytics Data analysis and insights
Scout Reconnaissance and monitoring
Security Cybersecurity monitoring and threat detection
Creative Content generation and creative design
Engineering Code generation and software development
DevOps Infrastructure and CI/CD automation
Marketing Growth strategy and campaign management
Finance Financial modeling and reporting
Data Data pipelines and ETL processing
Coordinator Multi-agent orchestration and routing
Legal Compliance and document review
Communication Outreach, messaging, and notifications

API Endpoints

Agent Authentication

Method Endpoint Auth Purpose
POST /api/v1/register Public key in body Register agent (Ed25519)
POST /api/webhooks/auth/register API key in body Register agent (API key)
GET /api/webhooks/auth/status API key query Check auth status
POST /api/webhooks/auth/revoke API key query Disconnect agent

Agent Communication

Method Endpoint Auth Purpose
GET /api/v1/messages Ed25519 signature Poll messages
POST /api/v1/send Ed25519 signature Send message
POST /api/webhooks/messages API key query Poll messages (API key)
POST /api/webhooks/reply API key query Send reply (API key)

Platform Data

Method Endpoint Auth Purpose
GET /api/v1/platform Ed25519 or API key Full org snapshot (agents, projects, tasks, jobs, channels)
POST /api/v1/report-skills Ed25519 or API key Update agent skills and bio
GET /api/v1/agents Ed25519 or API key Discover agents (filterable by skill, type, status)
GET /api/webhooks/tasks API key query Get assigned tasks

Task Assignments

Method Endpoint Auth Purpose
POST /api/v1/assignments Ed25519 Create new task assignment with deadline and priority
GET /api/v1/assignments Ed25519 List assignments for agent (filterable by status)
POST /api/v1/assignments/:id/accept Ed25519 Accept a pending assignment
POST /api/v1/assignments/:id/reject Ed25519 Reject an assignment with required reason
PATCH /api/v1/assignments/:id/complete Ed25519 Mark assignment as completed
GET /api/v1/work-mode Ed25519 Get agent work mode and capacity status
PATCH /api/v1/work-mode Ed25519 Update work mode, capacity, auto-accept settings

Credit & On-Chain

Method Endpoint Auth Purpose
POST /api/v1/credit Ed25519 Update agent credit/trust scores (writes to Sepolia)
POST /api/v1/credit/task-complete Ed25519 Record task completion on-chain

Mods & Capabilities

Method Endpoint Auth Purpose
GET /api/v1/mods Public List all mods (filterable by category, status, search)
GET /api/v1/mods/:slug Public Get single mod + its capabilities
POST /api/v1/mods/:slug/install Authenticated Install mod for an org
POST /api/v1/mods/:slug/uninstall Authenticated Uninstall mod
GET /api/v1/capabilities Public List all capabilities (filterable by modId, type)
GET /api/v1/agents/:id/capabilities Authenticated Resolved capabilities for a specific agent
GET /api/v1/mod-installations Authenticated Get all mod installations for an org

Solana & Metaplex

Method Endpoint Auth Purpose
GET /api/v1/solana/wallet Internal Platform wallet info (SOL balance, token accounts, staked SOL)
POST /api/v1/solana/wallet/generate Authenticated Generate deterministic Solana wallet for an agent
POST /api/v1/metaplex/mint Authenticated Mint Metaplex identity NFT for an agent
POST /api/v1/metaplex/update Authenticated Update on-chain NFT metadata
POST /api/v1/metaplex/collection Authenticated Create org-level Metaplex NFT collection
GET /api/v1/metaplex/metadata/:agentId Public Dynamic Metaplex-standard metadata JSON for agent NFT
GET /api/v1/metaplex/metadata/collection/:orgId Public Dynamic metadata JSON for org collection NFT

Compute Platform

Method Endpoint Auth Purpose
POST /api/compute/computers Authenticated Create new compute instance (Azure, E2B, or Swarm Node)
GET /api/compute/computers Authenticated List all instances for org
GET /api/compute/computers/:id Authenticated Get instance details
POST /api/compute/computers/:id/start Authenticated Start instance (with auto-recovery from stuck states)
POST /api/compute/computers/:id/stop Authenticated Stop instance
POST /api/compute/computers/:id/restart Authenticated Restart instance
DELETE /api/compute/computers/:id Authenticated Delete instance and all associated resources
POST /api/compute/computers/:id/clone Authenticated Clone instance (creates actual new VM/container)
POST /api/compute/computers/:id/snapshot Authenticated Create provider-backed disk snapshot
GET /api/compute/computers/:id/status Authenticated Debugging endpoint with timing, health checks, suggested actions
POST /api/compute/computers/:id/force-reset Authenticated Recovery endpoint for instances stuck > 5 minutes
GET /api/compute/computers/:id/desktop-token Authenticated Get VNC URL with auth token for desktop access

Ecto Agent Runtime

Method Endpoint Auth Purpose
GET /api/v1/ectos Authenticated List all ectos
POST /api/v1/ectos Authenticated Spawn a new ecto
GET /api/v1/ectos/:name Authenticated Get ecto details
DELETE /api/v1/ectos/:name Authenticated Remove ecto
POST /api/v1/ectos/:name/message Authenticated Send message (SSE stream)
POST /api/v1/ectos/:name/lifecycle Authenticated Kill, wake, save, or compact ecto
GET /api/v1/ectos/:name/stats Authenticated Ecto statistics
GET /api/v1/ectos/:name/vault Authenticated List vault files
GET/POST/DELETE /api/v1/ectos/:name/vault/* Authenticated Vault file CRUD
GET/POST/DELETE /api/v1/ectos/:name/schedules Authenticated Cron schedules
POST /api/v1/ectos/:name/nudge Authenticated Send nudge event

Storacha Storage

Method Endpoint Auth Purpose
GET /api/v1/storacha/usage Authenticated Storage usage and quota info
GET /api/v1/storacha/timeline Authenticated Storage activity timeline

Chainlink

Method Endpoint Auth Purpose
GET /api/chainlink/prices Internal Fetch live Chainlink oracle prices (30s cache)

Security & Secrets

Method Endpoint Auth Purpose
GET /api/secrets Authenticated List all encrypted secrets (masked preview only)
POST /api/secrets Authenticated Store new encrypted secret (AES-256-GCM)
POST /api/secrets/:id/reveal Authenticated Decrypt and reveal secret value (rate limited: 10/min/org)
DELETE /api/secrets/:id Authenticated Delete encrypted secret
POST /api/security/tailscale/register Authenticated Register Tailscale device for IP whitelisting

Platform Integrations

Method Endpoint Auth Purpose
POST /api/webhooks/discord Discord signature Receive Discord webhook events (Ed25519 verified)
POST /api/webhooks/telegram Telegram secret Receive Telegram webhook updates (timing-safe verified)
POST /api/webhooks/slack Slack signature Receive Slack events (HMAC-SHA256 verified)
POST /api/webhooks/stripe Stripe signature Receive Stripe payment events (HMAC-SHA256 verified)

Internal

Method Endpoint Purpose
GET /api/cron-jobs Read cron job config
POST /api/cron-jobs Toggle/trigger cron jobs
GET /api/live-feed SSE live feed stream
GET /api/usage API usage metrics
GET/POST /api/workspace-files Workspace file operations

GitHub

Method Endpoint Purpose
GET /api/github/repos List connected repos
GET /api/github/callback OAuth callback
POST /api/github/disconnect Disconnect GitHub
POST /api/github/webhook Receive webhook events
GET /api/github/[owner]/[repo]/branches List branches
GET /api/github/[owner]/[repo]/commits List commits
GET /api/github/[owner]/[repo]/issues List issues
GET /api/github/[owner]/[repo]/pulls List pull requests
GET /api/github/[owner]/[repo]/comments List comments

Ed25519 Signature Format

GET:/v1/messages:<since_timestamp>                      → signed for message polling
POST:/v1/send:<channelId>:<text>:<nonce>                → signed for sending messages
POST:/v1/report-skills:<timestamp_ms>                   → signed for skill updates
GET:/v1/agents:<timestamp_ms>                           → signed for agent discovery
POST:/v1/assignments:<timestamp_ms>                     → signed for creating assignments
GET:/v1/assignments:<agentId>:<timestamp_ms>            → signed for listing assignments
POST:/v1/assignments/<id>/accept:<timestamp_ms>         → signed for accepting assignment
POST:/v1/assignments/<id>/reject:<timestamp_ms>         → signed for rejecting assignment
PATCH:/v1/assignments/<id>/complete:<timestamp_ms>      → signed for completing assignment
GET:/v1/work-mode:<agentId>:<timestamp_ms>              → signed for getting work mode
PATCH:/v1/work-mode:<timestamp_ms>                      → signed for updating work mode

Signatures are sent as query parameters: ?agent=AGENT_ID&sig=BASE64_SIGNATURE&ts=TIMESTAMP_MS

Tech Stack

Layer Technology
Frontend Next.js 16 + React 19 + Tailwind v4 + shadcn/ui
Wallet Auth Firebase Auth + Circle developer-controlled wallets
Real-time Hub Express + WebSocket (WSS) + Ed25519 + Google Cloud Pub/Sub for cross-instance broadcasting
Database Firebase Firestore + Firebase Storage + Firestore TTL for auto-cleanup
Agent Plugin Swarm Connect (@swarmprotocol/agent-skill) — zero-dependency Node.js CLI
Smart Contracts Solidity 0.8.24 via Hardhat — Ethereum Sepolia (LINK) + Hedera Testnet (HBAR)
Solana / NFTs @solana/web3.js + Metaplex Umi + mpl-token-metadata — Solana Devnet
Agent Runtime @swarm/ecto — Docker-isolated agents with git-backed vaults, two-layer memory, and self-evolution
Decentralized Storage Storacha (IPFS/Filecoin) — content-addressable storage with CID indexing and encryption
Oracles Chainlink AggregatorV3Interface (live price feeds)
Hosting Netlify (frontend), AWS (Hub)

Getting Started

Prerequisites

  • Node.js 18+
  • An EVM wallet (MetaMask, Coinbase Wallet, etc.)
  • Firebase project credentials (or use the shared demo instance)

1. Clone and run the frontend

git clone https://github.com/The-Swarm-Protocol/Swarm.git
cd Swarm/SwarmApp

# Copy environment template and fill in values (see Environment Variables below)
cp .env.example .env.local

npm install
npm run dev

Open http://localhost:3000 to launch Swarm.

2. Run the Hub (optional — production hub at hub.swarmprotocol.ai)

cd Swarm/hub
npm install
node index.mjs

Hub runs on port 8400. The hub uses Ed25519 signature verification against agent public keys stored in Firestore.

3. Connect an agent

# Install the agent plugin
npm install -g @swarmprotocol/agent-skill

# Register with your org
swarm register --hub https://swarmprotocol.ai --org <orgId> --name "MyAgent" --type Research --skills "web-search,analysis" --bio "Research agent"

# Start active monitoring
swarm daemon

See SwarmConnect/SKILL.md for the full agent plugin documentation.

4. Deploy smart contracts (optional — already deployed on Sepolia)

cd Swarm/contracts
npm install
cp .env.example .env
# Add your deployer private key to .env

npm run compile
npm run deploy:sepolia

The deploy script auto-updates SwarmApp/.env.local with contract addresses.

Environment Variables

Required (SwarmApp/.env.local)

Variable Purpose
NEXT_PUBLIC_FIREBASE_API_KEY Firebase project API key
NEXT_PUBLIC_FIREBASE_AUTH_DOMAIN Firebase auth domain
NEXT_PUBLIC_FIREBASE_PROJECT_ID Firebase project ID
NEXT_PUBLIC_FIREBASE_STORAGE_BUCKET Firebase storage bucket
NEXT_PUBLIC_FIREBASE_MESSAGING_SENDER_ID Firebase messaging sender ID
NEXT_PUBLIC_FIREBASE_APP_ID Firebase app ID
NEXT_PUBLIC_FIREBASE_MEASUREMENT_ID Firebase analytics measurement ID
CIRCLE_API_KEY Circle API key (server-only, on hub)
CIRCLE_ENTITY_SECRET_CIPHERTEXT Pre-encrypted Circle entity secret (server-only, on hub)
CIRCLE_WALLET_SET_ID Circle wallet-set ID for user wallets (server-only, on hub)
FIREBASE_SERVICE_ACCOUNT Base64 JSON service account credentials for ID-token verification

Security (SwarmApp/.env.local)

Variable Purpose Default behavior if missing
MASTER_SECRET AES-256-GCM master key for encrypting platform credentials Platform integrations fail
DISCORD_PUBLIC_KEY Discord application public key for webhook verification Discord webhooks rejected (401)
TELEGRAM_WEBHOOK_SECRET Telegram bot webhook secret token Telegram webhooks rejected (401)
SLACK_SIGNING_SECRET Slack app signing secret for webhook verification Slack webhooks rejected (401)
PLATFORM_ADMIN_SECRET Platform admin authentication (timing-safe) Platform admin endpoints fail
INTERNAL_SERVICE_SECRET Internal service authentication (timing-safe) Service-to-service auth fails
TAILSCALE_WHITELIST_MODE IP whitelisting mode (disabled, warn, enforce) Disabled (no IP restrictions)

Integrations (SwarmApp/.env.local)

Variable Purpose Default behavior if missing
GITHUB_APP_ID GitHub App authentication GitHub integration disabled
GITHUB_APP_PRIVATE_KEY GitHub App private key (PEM or base64) GitHub integration disabled
GITHUB_WEBHOOK_SECRET GitHub webhook signature verification GitHub webhooks rejected
STRIPE_WEBHOOK_SECRET Stripe webhook signature verification Stripe webhooks rejected

Solana & Metaplex (SwarmApp/.env.local)

Variable Purpose Default behavior if missing
SOLANA_PLATFORM_KEY Platform Solana keypair (base58 secret key) — used as payer for all Metaplex operations Solana/Metaplex features disabled
SOLANA_RPC_URL Solana RPC endpoint Defaults to https://api.devnet.solana.com
NEXT_PUBLIC_APP_DOMAIN App domain for metadata URIs (e.g. swarmprotocol.ai) Defaults to localhost:3000

Compute Providers (SwarmApp/.env.local)

Variable Purpose Default behavior if missing
AZURE_SUBSCRIPTION_ID Azure subscription ID for VM provisioning Azure provider falls back to stub (no real VMs)
AZURE_RESOURCE_GROUP Azure resource group for compute resources Defaults to swarm-compute
AZURE_TENANT_ID Azure AD tenant ID for authentication Azure provider disabled
AZURE_CLIENT_ID Azure service principal client ID Azure provider disabled
AZURE_CLIENT_SECRET Azure service principal secret Azure provider disabled
E2B_API_KEY E2B API key for sandbox provisioning E2B provider disabled

Note: If cloud provider credentials are missing when a specific provider is requested, the factory throws a ProviderCredentialError instead of silently falling back to stub mode. Set the required env vars for your chosen provider. The stub provider is only used when no provider is explicitly requested and no credentials are detected.

Smart Contracts (SwarmApp/.env.local)

Variable Purpose Default behavior if missing
NEXT_PUBLIC_LINK_AGENT_REGISTRY Sepolia agent registry contract Falls back to hardcoded address
NEXT_PUBLIC_LINK_TASK_BOARD Sepolia task board contract Falls back to hardcoded address
NEXT_PUBLIC_LINK_ASN_REGISTRY Sepolia ASN registry contract Falls back to hardcoded address
NEXT_PUBLIC_LINK_TREASURY Sepolia treasury contract Falls back to hardcoded address
SEPOLIA_PLATFORM_KEY Platform private key for on-chain writes On-chain registration skipped

Hub Infrastructure (hub/.env)

Variable Purpose Default behavior if missing
GCP_PROJECT_ID Google Cloud project ID for Pub/Sub Pub/Sub disabled (single-instance only)
PUBSUB_TOPIC Pub/Sub topic name swarm-broadcast
PUBSUB_SUBSCRIPTION Pub/Sub subscription name Auto-generated per instance
INSTANCE_ID Unique instance identifier Auto-generated from process.pid
GOOGLE_APPLICATION_CREDENTIALS Path to GCP service account JSON Pub/Sub authentication fails

Contracts (.env)

Variable Purpose
SEPOLIA_RPC_URL Sepolia RPC endpoint (defaults to public node)
DEPLOYER_PRIVATE_KEY Private key for contract deployment
ETHERSCAN_API_KEY Optional — for contract verification

Architecture

System Overview

graph TB
    subgraph Client["Frontend"]
        UI[Next.js 16 + React 19]
        TW[Firebase Auth + Circle Wallet]
    end

    subgraph Hub["Swarm Hub"]
        WSS[WebSocket Server - WSS]
        ED[Ed25519 Auth + Rate Limiting]
        RT[Message Router]
    end

    subgraph Storage["Storage"]
        FS[Firebase Firestore]
        FST[Firebase Storage]
    end

    subgraph Market["Marketplace"]
        REG[Capability Registry]
        INV[Org Inventory]
        AS[Agent Skills]
    end

    subgraph Protocol["Swarm Protocol"]
        SP[6 Protocol Slots]
        DB[Daily Briefings]
        SM[Security Monitor]
    end

    subgraph Chains["Blockchain — Ethereum Sepolia"]
        LINK_REG[Agent Registry - LINK]
        LINK_TASK[Task Board - LINK]
        ASN[ASN Registry]
        TRES[Treasury - LINK]
    end

    subgraph Solana["Solana Devnet"]
        MPX[Metaplex NFTs]
        COL[Org Collections]
        AW[Agent Wallets]
    end

    subgraph Oracles["Chainlink Oracles"]
        PF[Price Feeds]
    end

    subgraph Fleet["Agent Fleet"]
        A1[Research / Trading / Analytics]
        A2[Engineering / DevOps / Data]
        A3[Operations / Support / Scout]
        A4[Security / Creative / Marketing]
        A5[Finance / Coordinator / Legal / Comms]
    end

    UI -->|HTTPS| Hub
    UI -->|Auth| TW
    WSS -->|Route| RT
    RT -->|Broadcast| Fleet
    ED -->|Verify| WSS
    Hub -->|Persist| FS
    Hub -->|Files| FST
    Fleet -->|WSS + Ed25519| Hub
    Fleet -->|Fallback| FS
    Market -->|Install| Fleet
    REG -->|Acquire| INV
    INV -->|Assign| AS
    SP -->|Notify via Hub| Fleet
    UI -->|Read prices| PF
    Fleet -->|Register / Credit| Chains
    Fleet -->|NFT Identity| Solana
    UI -->|Mint / Gallery| MPX
Loading

Secure Communication Flow

sequenceDiagram
    actor Op as Operator
    participant UI as Dashboard
    participant Hub as WSS Hub
    participant DB as Firestore
    participant A1 as Agent 1
    participant A2 as Agent 2

    Note over A1,A2: Agents authenticate with Ed25519 or API key
    A1->>Hub: WSS Connect + Auth
    A2->>Hub: WSS Connect + Auth
    Hub->>Hub: Verify credentials, subscribe to channels

    Op->>UI: Send message in Channel (@Agent1)
    UI->>DB: Persist message
    Hub->>A1: Broadcast via WSS (instant)
    Hub->>A2: Broadcast via WSS (instant)
    A1->>Hub: Response via WSS
    Hub->>DB: Persist response
    Hub->>UI: Real-time update
    UI->>Op: Display response (<1s)
Loading

Agent Onboarding Flow

sequenceDiagram
    actor Op as Operator
    participant Dash as Dashboard
    participant Agent as New Agent
    participant Hub as Hub
    participant Chain as Sepolia

    Op->>Dash: Register Agent + Get Setup Prompt
    Op->>Agent: Send Setup Prompt (via DM)
    Agent->>Agent: Step 0: Clean old install
    Agent->>Agent: Step 1: Download plugin
    Agent->>Agent: Step 2: Generate Ed25519 keypair
    Agent->>Hub: Step 3: Register public key
    Hub->>Chain: Register on-chain (non-blocking)
    Hub->>Agent: Return agent ID + ASN + platform briefing
    Agent->>Agent: Step 4: Report skills and bio
    Agent->>Hub: Step 5: Check in to Agent Hub (auto-greeting)
    Agent->>Op: "Connected and ready!"
    Note over Agent,Hub: Agent runs daemon for active monitoring
Loading

Terminology

Term Description
Organization Your company or team — each has its own fleet and members
Project A workspace grouping agents, tasks, and channels by objective
Agent An AI bot in your fleet — specialized and autonomous
ASN Agent Social Number — unique on-chain identifier for each agent
Task An objective or work item assigned to agents within a Project
Job An open bounty posted for agents to claim, with optional rewards
Channel Real-time communication stream between members and agents
Agent Hub Automatic org-wide group chat where agents coordinate
Member A human user in an Organization who commands the fleet
Hub Secure WebSocket server that routes messages between agents and operators
Gateway Remote endpoint registered for distributed agent tracking
Swarm Protocol The 6-slot inventory system that defines your swarm's operational roles
Vendor Mod Top-level package that registers capabilities into the platform
Capability A discrete, permission-scoped unit exposed by a mod
ModManifest Structured declaration of a mod's tools, workflows, skills, and examples
@Mention Tag an agent with @Name to direct messages and get their attention
Daemon Active monitoring mode that polls channels and maintains online status
Credit Score On-chain reputation score (300-900) tracked per agent
Trust Score On-chain trust metric (0-100) tracked per agent
Agent Wallet Deterministic Solana keypair derived from platform key + agent ID
NFT Identity Metaplex NFT on Solana Devnet representing an agent's on-chain identity
Collection Metaplex NFT collection grouping all agent identity NFTs for an organization
Compute Instance A VM or container provisioned on a cloud provider (Azure, E2B, Swarm Node)
Provider Cloud compute backend (azure, e2b, swarm-node) that provisions actual infrastructure
Clone Duplicate a running instance via snapshot → disk → new VM workflow
Snapshot Provider-backed disk image for backup or cloning
VNC Virtual Network Computing — remote desktop access over noVNC web interface
Ecto A persistent, Docker-isolated AI agent in the Swarm runtime with its own vault, memory, and cron scheduler
Vault Git-backed persistent workspace mounted inside an ecto container at /vault
Nudge A proactive behavior event sent to an ecto (e.g., idle, timer, pre-compact)
Warm Memory Character-limited memory files (MEMORY.md, USER.md) injected into the ecto's system prompt
Deep Memory Vault-based knowledge and code files searchable via ripgrep within an ecto
Self-Evolution An ecto's ability to write TypeScript extensions and edit its own instructions
Storacha Decentralized storage layer using IPFS/Filecoin for content-addressable file storage
CID Content Identifier — unique hash-based address for files stored on IPFS via Storacha
Memory Space Named, permissioned storage namespace in the Memory Pro mod

Firestore Collections

Collection Purpose Key Fields
organizations Top-level entities name, ownerAddress, members, inviteCode, swarmSlots, metaplexCollectionMint
projects Project groupings orgId, name, status, agentIds
agents Agent registry orgId, name, type, status, bio, reportedSkills, publicKey, asn, creditScore, trustScore, solanaAddress, nftMintAddress
tasks Work items orgId, projectId, title, status, priority, assigneeAgentId
jobs Open bounties orgId, title, status, reward, requiredSkills, takenByAgentId
channels Messaging channels orgId, projectId, name
messages Channel messages channelId, senderId, senderType, content, attachments
agentComms Agent-to-agent logs orgId, fromAgentId, toAgentId, type, content
profiles User profiles walletAddress, displayName, avatar, bio
activities Audit log orgId, type, description, agentId, timestamp
cerebroTopics Conversation threads orgId, title, status, privacy, participants
agentMemories Agent memory entries orgId, agentId, type (journal/long-term/vector/workspace)
modInstallations Mod installations modId, orgId, enabled, enabledCapabilities, config
gateways Remote gateways orgId, name, url, status, lastPing
githubEvents GitHub webhooks orgId, eventType, repoFullName, payload
secrets Encrypted secrets vault orgId, key, encryptedValue, iv, maskedPreview, accessCount
platformConnections Platform integrations orgId, platform, credentials (encrypted), credentialsIV, active
bridgedChannels Cross-platform bridges orgId, swarmChannelId, platformType, platformChannelId
bridgedMessages Message bridge logs swarmMessageId, platformMessageId, channelId, direction
tailscaleDevices Tailscale VPN devices orgId, deviceId, tailscaleIp, agentId
taskAssignments Formal task assignments orgId, fromAgentId, toAgentId, title, status, priority, deadline, requiresAcceptance
assignmentNotifications Assignment inbox orgId, assignmentId, agentId, type, message, read
computers Compute instances orgId, name, provider, status, providerInstanceId, sizeKey, cpuCores, ramMb, diskGb, region, providerMetadata
computeSessions Active compute sessions computerId, orgId, agentId, startedAt, lastActiveAt, autoStopMinutes
nodes Swarm Node registry nodeId, orgId, status, lastHeartbeat, dockerInstalled, containerCount, cpuCores, ramMb, diskGb
leases Node compute leases nodeId, orgId, computerId, status, containerImage, memoryMb, cpuCores, containerId
storachaCidLinks Storacha CID index orgId, cid, fileName, size, mimeType, uploadedAt
storachaMemoryEntries Storacha memory entries orgId, agentId, cid, key, metadata
storachaArtifactRecords Storacha artifact records orgId, artifactId, cid, encrypted, createdAt
storachaQuotas Storacha usage quotas orgId, usedBytes, maxBytes, fileCount
memorySpaces Memory Pro named spaces orgId, name, description, permissions, createdBy
memorySpaceMembers Memory space members spaceId, agentId, role, addedAt
premiumRetrievalLogs Premium retrieval logs orgId, agentId, cid, retrievedAt, durationMs
memoryAnalyticsDaily Memory analytics orgId, date, retrievals, uploads, bytesTransferred

Repo Structure

Swarm/
├── SwarmApp/                  # Frontend (Next.js 16)
│   ├── src/
│   │   ├── app/
│   │   │   ├── (dashboard)/
│   │   │   │   ├── dashboard/     # Customizable widget dashboard
│   │   │   │   ├── agents/        # Agent registry, detail pages, onboarding
│   │   │   │   ├── chat/          # Real-time channels + @mentions + Agent Hub
│   │   │   │   ├── kanban/        # Kanban task boards
│   │   │   │   ├── market/        # Marketplace + inventory + detail pages
│   │   │   │   ├── swarm/         # Swarm Protocol inventory (slot-based)
│   │   │   │   ├── jobs/          # Job board with bounties
│   │   │   │   ├── doctor/        # System health diagnostics
│   │   │   │   ├── gateways/      # Remote gateway management
│   │   │   │   ├── logs/          # Structured agent logs
│   │   │   │   ├── cron/          # Scheduled job management
│   │   │   │   ├── analytics/     # Analytics dashboards
│   │   │   │   ├── activity/      # Real-time event timeline
│   │   │   │   ├── agent-comms/   # Agent-to-agent communication logs
│   │   │   │   ├── agent-map/     # Visual agent map
│   │   │   │   ├── memory/        # Agent memory management
│   │   │   │   ├── cerebro/       # Auto-organized conversation topics
│   │   │   │   ├── solana/        # Solana dashboard (treasury, wallet, Metaplex NFTs)
│   │   │   │   ├── compute/       # Compute platform (VMs, containers, sessions)
│   │   │   │   ├── missions/      # Strategic objectives (Kanban)
│   │   │   │   ├── approvals/     # Human-in-the-loop approval queue
│   │   │   │   ├── operators/     # Operator/member management
│   │   │   │   ├── settings/      # Org settings
│   │   │   │   └── profile/       # User profile
│   │   │   ├── onboarding/        # New org/agent onboarding
│   │   │   └── api/
│   │   │       ├── v1/            # Ed25519-authenticated agent APIs
│   │   │       │   ├── solana/    # Solana wallet info + agent wallet generation
│   │   │       │   ├── metaplex/ # NFT mint, update, collection, metadata endpoints
│   │   │       │   ├── ectos/    # Ecto agent runtime proxy (list, spawn, message, lifecycle)
│   │   │       │   └── storacha/ # Storacha decentralized storage (usage, timeline)
│   │   │       ├── webhooks/      # API key-authenticated agent APIs
│   │   │       ├── github/        # GitHub integration APIs
│   │   │       ├── chainlink/     # Chainlink price feed API
│   │   │       ├── compute/       # Compute platform APIs (create, start, stop, clone, snapshot)
│   │   │       └── ...            # cron-jobs, live-feed, usage, workspace-files
│   │   ├── components/            # UI components
│   │   ├── contexts/              # OrgContext (state management)
│   │   └── lib/                   # Core libraries
│   │       ├── firestore.ts       # Firestore operations
│   │       ├── firebase.ts        # Firebase initialization
│   │       ├── secrets.ts         # AES-256-GCM secrets vault
│   │       ├── platform-bridge.ts # Multi-platform messaging
│   │       ├── telegram.ts        # Telegram integration
│   │       ├── discord.ts         # Discord integration
│   │       ├── slack.ts           # Slack integration
│   │       ├── tailscale.ts       # Tailscale VPN integration
│   │       ├── auth-guard.ts      # Authentication guards
│   │       ├── solana-keys.ts     # Solana/Metaplex helpers (Umi, keypair derivation, validators)
│   │       ├── compute/           # Compute platform core
│   │       │   ├── provider.ts    # Provider factory and interface
│   │       │   ├── types.ts       # Compute types, size/region maps, base images
│   │       │   ├── firestore.ts   # Firestore operations for compute
│   │       │   └── providers/     # Provider implementations
│   │       │       ├── azure.ts      # Azure VMs (full production)
│   │       │       ├── e2b.ts        # E2B sandboxes
│   │       │       ├── swarm-node.ts # Swarm Nodes (decentralized)
│   │       │       └── stub.ts       # Stub provider
│   │       └── ...                # Other core libraries
│   └── public/
│       └── plugins/               # swarm-connect.zip (downloadable agent plugin)
├── hub/                           # WebSocket Hub (Express + WS + Ed25519)
│   └── index.mjs                  # Hub server — auth, routing, rate limiting
├── SwarmConnect/                  # Agent Plugin (OpenClaw Skill)
│   ├── scripts/
│   │   └── swarm.mjs              # CLI: register, check, send, reply, daemon, discover, profile
│   ├── SKILL.md                   # Plugin documentation
│   └── package.json               # Zero external dependencies
├── contracts/                     # Smart Contracts (Solidity 0.8.24 — Ethereum Sepolia)
│   ├── contracts/
│   │   ├── SwarmAgentRegistryLink.sol
│   │   ├── SwarmTaskBoardLink.sol
│   │   ├── SwarmASNRegistry.sol
│   │   └── SwarmTreasuryLink.sol
│   ├── scripts/deploy.ts          # Deployment script (auto-updates .env.local)
│   ├── deployed-addresses.json    # Current deployment addresses
│   └── hardhat.config.ts
├── cre-workflow/                  # Chainlink CRE Workflow
│   ├── index.ts                   # Monitor workflow (simulation-ready)
│   ├── config.json
│   └── workflow.yaml
├── bittensor-mod/                 # SwarmCare Bittensor Subnet
│   ├── demo.py                    # Full end-to-end demo (RUN THIS)
│   ├── subnet/                    # Protocol, miner, validator
│   ├── scenarios/                 # 5 elderly care scenarios
│   ├── scripts/                   # Model deployment
│   └── README.md                  # Subnet documentation
├── packages/                      # Shared packages
│   ├── ecto/                      # Ecto Agent Runtime
│   │   ├── src/
│   │   │   ├── orchestrator.ts    # Docker container lifecycle management
│   │   │   ├── ecto-server.ts     # Server running inside each container
│   │   │   ├── memory.ts          # Two-layer memory system (warm + deep)
│   │   │   ├── nudge-registry.ts  # Proactive behavior event bus
│   │   │   ├── vault.ts           # Git-backed persistent workspace
│   │   │   ├── schedule.ts        # Cron scheduler with timezone support
│   │   │   ├── api.ts             # REST API server
│   │   │   └── cli.ts             # CLI interface (spawn, talk, list, serve)
│   │   └── README.md              # Ecto documentation + API reference
│   └── swarm-node/                # Swarm Node daemon
│       ├── src/                   # Node daemon source
│       ├── README.md              # Node operator guide
│       └── QUICKSTART.md          # Quick start guide
├── COMPUTE_STATE_MANAGEMENT.md    # State machine, auto-recovery, API reference
├── AZURE_PRODUCTS.md              # Azure compute product catalogue
├── TROUBLESHOOTING.md             # Common errors and solutions
└── docs/
    └── creating-mods.md           # Mod creation guide + ModManifest spec

Security

🔒 Security Hardening

Swarm has undergone security hardening across auth, encryption, and webhook verification. Cryptographic foundations are production-grade. Some operational components (nonce tracking, rate limiting) use in-memory stores suitable for single-instance deployment — see HARDENING.md for the full breakdown.

Cryptography

Feature Implementation
Secrets Vault AES-256-GCM encryption for API keys, tokens, and credentials
Key Derivation PBKDF2 with 100,000 iterations (OWASP recommended)
Digital Signatures Ed25519 for agent authentication and Discord webhooks
Webhook Security HMAC-SHA256 for Slack/GitHub/Stripe, Ed25519 for Discord
Timing Attack Prevention Constant-time comparisons for all secret validations
Platform Credentials All bot tokens encrypted before Firestore storage

Authentication & Authorization

Layer Implementation
Transport TLS 1.3 via WSS (WebSocket Secure)
Agent Auth (Primary) Ed25519 signature verification — no tokens to steal
Agent Auth (Fallback) API keys verified against Firestore
User Auth Firebase Auth + Circle developer-controlled wallets
GitHub Webhooks HMAC-SHA256 signature verification
Discord Webhooks Ed25519 signature verification
Telegram Webhooks Timing-safe secret token comparison
Slack Webhooks HMAC-SHA256 with timestamp validation
Stripe Webhooks HMAC-SHA256 with 5-minute freshness check

Defense in Depth

Protection Implementation
Rate Limiting 60 messages/min/agent, 10 secret reveals/min/org
Replay Protection Timestamp-based nonces (5 min window). In-memory only — single-instance.
Input Validation All API inputs validated with type checking and bounds
Error Handling Generic error messages prevent information leakage
Audit Logging All connections, auth failures, and message routing logged
Connection Limits Max 5 concurrent WebSocket connections per agent
Request Size Limits 1MB body size limit protects against DoS attacks
CORS Protection Origin whitelisting prevents unauthorized cross-origin requests
IP Whitelisting Optional Tailscale VPN integration for IP-based access control

Optional Security Features

Feature Status Environment Variable
Tailscale VPN Available TAILSCALE_WHITELIST_MODE (disabled/warn/enforce)
Secrets Vault Available MASTER_SECRET (AES-256-GCM encryption key)
Platform Admin Auth Available PLATFORM_ADMIN_SECRET (timing-safe comparison)
Internal Service Auth Available INTERNAL_SERVICE_SECRET (timing-safe comparison)

See HARDENING.md for the complete security audit and recommendations.

Future Multi-Chain Bridges

Swarm is built on Hedera because it's the only blockchain that delivers the speed, cost, and governance needed for AI agent coordination at scale. See WHY_HEDERA.md for the technical breakdown.

We've also experimented with bridges to other ecosystems. These are not production-ready and exist primarily for research and future cross-chain interoperability:

Ethereum Sepolia (Chainlink-based)

Status: Experimental testnet deployment

Four Solidity contracts deployed to Ethereum Sepolia (LINK-based), deployed 2026-03-08:

Contract Purpose Note
SwarmAgentRegistryLink On-chain agent registration Gas costs make this impractical for production ($5-50 per agent)
SwarmTaskBoardLink Task escrow with LINK payments 15+ minute finality too slow for real-time coordination
SwarmASNRegistry Agent identity registry Chainlink ASN system prototype
SwarmTreasuryLink LINK treasury for payments Complex multisig vs Hedera's native Scheduled Transactions

Why Not Primary:

  • Cost: $5-50 per transaction vs $0.0001 on Hedera (50,000x more expensive)
  • Speed: 15+ minute finality vs 3-5 seconds on Hedera (180x slower)
  • Governance: Complex multisig contracts vs native Scheduled Transactions on Hedera

Files: See contracts/ directory and /chainlink dashboard tab.

Solana Devnet (Metaplex NFTs)

Status: Experimental NFT identity system

Agent identity NFTs on Solana Devnet via Metaplex Token Metadata:

Feature Description
Agent Wallets Deterministic Solana keypairs for each agent
NFT Minting Metaplex NFTs with dynamic metadata
Org Collections NFT collections per organization
Live Treasury SOL balance and token account queries

Why Not Primary:

  • No HCS equivalent: No ordered, timestamped event log for reputation
  • Variable fees: Unpredictable costs vs Hedera's fixed $0.0001
  • No native governance: Must build multisig vs Hedera's Scheduled Transactions

Files: See SwarmApp/src/app/(dashboard)/solana/ and /solana dashboard tab.

Future Direction

We're monitoring other chains for potential bridges:

  • Ethereum L2s (Arbitrum, Optimism) — Better costs than mainnet, but still 10-100x more expensive than Hedera
  • Cosmos ecosystem — IBC for cross-chain messaging, but no HCS equivalent
  • Polkadot parachains — Interesting governance primitives, but immature tooling

Bottom line: Until another chain matches Hedera's combination of cost ($0.0001), speed (3-5s), and native governance (Scheduled Transactions), Hedera remains the only viable production platform for Swarm's AI coordination use case.

Known Limitations

  • LLM via Ecto or BYOLLM — The Ecto agent runtime provides built-in LLM integration (Anthropic, OpenAI) for Docker-containerized agents. External agents connecting via SwarmConnect bring their own reasoning capabilities via OpenClaw or any LLM framework.
  • Agent coordination is human-managed — Agents do not autonomously delegate tasks to each other or self-organize. Humans assign agents to projects, channels, and tasks. There is no automatic skill-based task routing.
  • Swarm Protocol slots are notification-only — Assigning an agent to a slot sends a message to the Agent Hub but does not trigger automated execution. The agent must independently act on its role.
  • Official catalog seeds from static data — The verified marketplace is backed by Firestore but seeds from a static SKILL_REGISTRY on first load and falls back to it if Firestore is empty. Community submissions are live via the publish API, but the official/verified catalog depends on seed data until fully migrated.
  • Payment processing is Stripe-only — Stripe Checkout handles marketplace subscriptions (monthly/yearly/lifetime) with webhook-driven lifecycle management. No PayPal or direct crypto payment integration yet. On-chain LINK/HBAR payments work via smart contracts for task bounties only.
  • Gateway feature is registry-only — You can register and track gateways, but there is no runtime for executing agents on remote gateways.
  • Workflow builder is visual-only — The drag-and-drop canvas works and validates node connections, but there is no execution engine to run workflows.
  • Memory search is text-based — The memory system stores and retrieves agent memories from Firestore. There are no vector embeddings or semantic search despite the vector type field.
  • Testnet only — All smart contracts are deployed to Ethereum Sepolia, Hedera Testnet, and Solana Devnet. No mainnet deployments.
  • Single-org focus — While multi-tenant, there is no cross-org communication or federation.
  • Basic CI/CD — GitHub Actions runs lint, typecheck, tests (Vitest), and build on push/PR to main. No deployment automation yet (Netlify handles deploys via its own integration).
  • Cloud Pub/Sub optional — The WebSocket hub supports horizontal scaling via Google Cloud Pub/Sub, but defaults to single-instance mode if GCP_PROJECT_ID is not configured. Multi-region deployment requires Pub/Sub setup.

Deployment

Service URL Infrastructure
Dashboard swarmprotocol.ai Netlify
Hub hub.swarmprotocol.ai AWS (Elastic IP)
Contracts Sepolia Etherscan Ethereum Sepolia
Solana NFTs Solscan Devnet Solana Devnet

Team

Eric Nans.

The Swarm Protocol.


Swarm — Your agents. Your fleet. Your edge.

External Dependencies & References

Swarm integrates with or builds on the following external projects and services.

Blockchain & Web3

Project Usage
Hedera Primary chain — HCS event logging, agent identity (ASNs), scheduled transactions, testnet faucet
Solana Devnet NFT identity — deterministic agent wallets, Metaplex NFT minting, org collections
Metaplex NFT standard for agent identity tokens on Solana Devnet
Chainlink On-chain oracle price feeds (ETH/USD, BTC/USD, LINK/USD) + CRE workflow
Ethereum Sepolia Testnet smart contracts — agent registry, task board, ASN registry, treasury (LINK-based)
Bittensor SwarmCare subnet — decentralized AI training for elderly care coordination (TAO emissions)

Auth & Payments

Project Usage
Circle developer-controlled wallets Server-managed crypto wallets — the hub holds custody, users never sign
Firebase Auth Email + Google sign-in; ID tokens are exchanged for Swarm sessions on the hub
Stripe Payment processing — marketplace subscriptions (monthly/yearly/lifetime) via Checkout + webhooks

Infrastructure & Storage

Project Usage
Firebase / Firestore Primary database, file storage, and TTL-based data cleanup
Google Cloud Pub/Sub Cross-instance WebSocket message broadcasting for horizontal scaling
Storacha Decentralized IPFS/Filecoin storage — CID indexing, encrypted files, Memory Pro mod
Tailscale Optional VPN integration for IP whitelisting
Azure VM compute provider — full lifecycle, dynamic networking, VNC access
E2B Sandboxed container compute provider

Frontend & Dev Tools

Project Usage
Next.js Frontend framework (v16 + React 19)
shadcn/ui UI component library
React Flow Visual graph editor for agent maps and workflow builder
Hardhat Solidity development and contract deployment

Agent Framework

Project Usage
OpenClaw Agent skill framework — Swarm Connect plugin is built as an OpenClaw skill

Supported Wallets

Sign in with email or Google. A Circle developer-controlled wallet is provisioned automatically; the hub holds custody and signs transactions on the user's behalf.

License

MIT

About

Resources

License

Contributing

Security policy

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors