Introduction
Mycelium is a Python-first developer platform and framework designed for building, testing, and deploying autonomous agent networks on the Stellar Soroban blockchain. By compiling standard Python scripts into highly optimized WebAssembly (WASM) binaries, Mycelium bridges the developer-friendly Python ecosystem with Stellar’s fast, low-cost smart contract runtime.
With Mycelium, agents are not just isolated pieces of AI; they are decentralized actors with their own cryptographic identities, multi-signature wallets, on-chain registries, and capabilities to discover, contract, and settle transactions with other agents.
Overview
Modern agent frameworks focus heavily on prompt engineering and local tool calling. Mycelium expands this vision by adding on-chain capabilities. Every agent gets an Ed25519 identity, stores state variables inside Soroban ledger storage, resolves sibling agent endpoints via the shared Hive Registry contract, and pays/receives micropayments using secure escrow contracts.
The platform ships as a single dependency-free package (installed via pip install mycelium-stellar) that bundles the compiler, the command line interface, the agent SDK, and the contract DSL (Domain Specific Language).
Core Features
Why Mycelium
Traditional multi-agent systems rely on centralized orchestrators to sync state and distribute payments. This creates security risks, trust assumptions, and high overhead costs.
Mycelium addresses these limitations by introducing a cryptographically secure, decentralized infrastructure where:
- Zero Intermediaries: Agents directly contract other agents, verify outputs cryptographically, and pay using Stellar micro-escrows.
- Native Python Support: No context switching to Rust. Write contract state and logic using simple Python types.
- Built for Scale: Soroban’s state archival system and fast execution fees make micro-transactions viable down to fractions of a cent.
Platform Subsystems
The Mycelium codebase is organized into several key modular developer components:
- Web IDE (ide/): A full-featured web-based interface (React/Next.js frontend and FastAPI backend) that integrates with GitHub OAuth for Git-backed workspace management and compiles contracts inside secure, resource-limited Docker containers.
- Compiler (compiler/): A custom AST-to-WASM transpiler written in Python. It parses contract source code, verifies semantic AST rules, infers types dynamically, generates Soroban-compatible Rust source structures, and compiles them.
- CLI (cli/): The Command Line Interface developer suite that wraps compiling, deployment, testing, and registration operations in a single terminal framework.
- SDK (sdk/): The Python SDK which provides the core agent loops, wallet encryption (AES-256-GCM + PBKDF2), on-chain transaction signing, RPC client connections, and AI adapters (Anthropic, Gemini, LangGraph).
- Core Smart Contracts: On-chain contracts authored in the Mycelium DSL, including the global HiveRegistry directory and the x402 Escrow payment router.
