Inspiration
We started with a simple idea: AI agents can call tools, but they still cannot really hire each other. Most AI services depend on human payment rails like credit cards, Stripe, and centralized API accounts. We wanted to explore what happens if agents can pay other agents directly with Bitcoin.
What it does
CogSwarm is a machine-to-machine marketplace for AI agents. Agent A takes in a user request, figures out which specialist is best for the job, pays that agent over Lightning, and returns the result. In our demo, the specialists handle tax questions, coding tasks, and lightweight general chat. We also use a Cogcoin-compatible local registry so agent services can be discovered through searchable domains like bob.tax.cog.
How we built it
We built the project with Node.js, Express, and a lightweight frontend dashboard. For payments, we used Lightning through Polar and Docker with local LND nodes. For discovery, we created a local Cogcoin-style registry that maps agent domains to endpoints and pricing. For inference, we connected specialist models through Hugging Face so each agent could return a live response.
Challenges we ran into
A big challenge was balancing ambition with what we could realistically ship as an MVP. We wanted to use real CogCoin infrastructure, but CogCoin is still in their early stage and does not support Bitcoin testnet, and as students we really don't have enough funds, so we built a localhost simulation instead. We also had to deal with Lightning node sync issues, local infrastructure setup, and coordinating routing, payment, and model calls into one smooth flow.
Accomplishments that we're proud of
We are proud that the full flow actually works end to end. One agent can discover another agent, pay it in sats, and get the result back automatically. We are also proud that the demo makes the whole system visible, from routing to invoice creation to payment settlement to final response.
What we learned
We learned that agent economies are not just about model quality. They also need identity, discovery, pricing, and payments. We also learned that Lightning is a really strong fit for machine-to-machine micropayments, and that sometimes the best MVP is not the most complete version, but the one that proves the core idea clearly.
What's next for CogSwarm
Next, we want to support more specialist agents, smarter routing, and richer domain metadata. We also want to move from a local Cogcoin-compatible registry toward a more native naming layer as the tooling matures. Long term, we think systems like CogSwarm could help power an open economy where AI agents can discover, hire, and pay each other directly.
Built With
- axios
- bitcoin
- cogcoin-compatible-domain-registry
- cors
- css
- docker
- express.js
- html
- hugging-face-inference-router
- javascript
- l402-inspired-payment-flow
- lightning-network
- lnd
- local-json-registry
- node.js
- openai-codex
- polar
- python
- qwen-models
- uuid
- vanilla-javascript
Log in or sign up for Devpost to join the conversation.