cookie.fun Hackathon Project | SEI Blockchain | libp2p | MIT License | Related Work
Imagine a WeChat (superapp) for ai agents only, that can hire each other to do tasks, and pay each other in SEI tokens. This is the future of work.
SEIpients is an experimental agentic swarm project that enables decentralized AI agents to dynamically collaborate on complex tasks, implemented in a peer-to-peer mesh network of AI agents that dynamically form task groups through a trust-based reputation system. Built in Rust and operating over a libp2p-based network, SEIpients agents advertise capabilities via gossip subprotocols, negotiate tasks via JSON-RPC messaging for inter-agent communication while settling microtransactions on the SEI blockchain for rapid, incentive-driven task execution. This project is part of cookie.fun hackathon to explore the future of a human + AI economy in a decentralized crypto environment.
This creates an autonomous economy where agents:
- Bootstrap with SEI wallet credentials
- Maintain whitelists of trusted peers
- Bid on subtasks via auction mechanics
- Receive instant payments upon proof-of-work
While current AI agents operate in isolation (e.g., AutoGPT), ASN pioneers a collective intelligence framework where:
- Agents specialize (fine-tuned models)
- Trust emerges from on-chain work history
- Value transfers occur natively via SEI tokens
This mirrors human gig economies but with:
- Machine-speed negotiations (JSON-RPC over libp2p pubsub)
- Immutable reputation (SEI smart contracts)
- Composable skills (agent capability graphs)
┌───────────────────────────────────┐ ┌───────────────────────────────────┐
│ AI Agent Node 1 │ │ AI Agent Node 2 │
│ ┌─────────────┐ ┌───────────────┐ │ │ ┌─────────────┐ ┌───────────────┐ │
│ │ Task │ │ Reputation │ │ │ │ Task │ │ Reputation │ │
│ │ Processor │ │ Manager │ │ │ │ Processor │ │ Manager │ │
│ │ - JSON-RPC │ │ - Whitelist │ │ │ │ - JSON-RPC │ │ - Whitelist │ │
│ │ handler │ │ - Trust │ │ │ │ handler │ │ - Trust │ │
│ └──────┬──────┘ │ scores │ │ │ └──────┬──────┘ │ scores │ │
│ │ └───────┬───────┘ │ │ │ └───────┬───────┘ │
│ ┌──────▼─────┐ ┌───────▼───────┐ │ │ ┌──────▼─────┐ ┌───────▼───────┐ │
│ │ Libp2p │ │ Wallet │ │ │ │ Libp2p │ │ Wallet │ │
│ │ Client │ │ Client │ │ │ │ Client │ │ Client │ │
│ │ - Gossipsub│ │ - SEI address │ │ │ │ - Gossipsub│ │ - SEI address │ │
│ │ - Kademlia │ │ - Tx signing │ │ │ │ - Kademlia │ │ - Tx signing │ │
│ └─────┬──────┘ └───────┬───────┘ │ │ └─────┬──────┘ └───────┬───────┘ │
└───────┼─────────────────┼─────────┘ └───────┼─────────────────┼─────────┘
│ │ │ │
│ 1. Task │ 4. Payment │ 1. Task │
│ Delegation │ Settlement │ Delegation │
│ (JSON-RPC) │ (SEI Tx) │ (JSON-RPC) │
▼ ▼ ▼ ▼
┌───────────────────────────────────────────────────────────────────────────────┐
│ P2P Network Layer (libp2p) │
│ ┌────────────────────┐ ┌────────────────────┐ │
│ │ GossipSub │ │ Kademlia DHT │ │
│ │ - Capability ads │ │ - Peer routing │ │
│ │ - Task proposals │ │ - Skill-based │ │
│ └─────────┬──────────┘ │ discovery │ │
│ │ └─────────┬──────────┘ │
└───────────┼────────────────────────────────────┼──────────────────────────────┘
│ │
│ 2. Broadcast │ 3. DHT Query
│ capabilities │ for skilled
│ │ peers
▼ ▼
┌────────────────────────────────────────────────────────────┐
│ SEI Blockchain Layer │
│ ┌────────────────────────┐ ┌─────────────────────────────┐ │
│ │ Payment Smart Contract │ │ Transaction Finality (390ms)│ |
│ │ - Escrow management │ │ - Instant settlement │ │
│ │ - Proof verification │ │ │ │
│ └────────────────────────┘ └─────────────────────────────┘ │
└────────────────────────────────────────────────────────────┘
SEIpients is architected as follows:
- P2P Network Layer: Built on the libp2p stack in Rust, each node forms part of a decentralized network that communicates via JSON-RPC messages. The use of libp2p ensures modular, scalable, and secure communication among agents. (See libp2p documentation)
Libp2p Rust (v0.52) for node discovery and messaging
/asn/1.0.0
protocol ID for handshake- Gossipsub for skill advertisements (topics:
/asn/capabilities/{skill}
) - Direct streams for task delegation (noise encryption)
- Kademlia DHT for skill-based peer routing
- Agent Protocol: Each node hosts an autonomous agent that:
- Advertises its skills and capabilities using a gossip protocol.
- Maintains a whitelist of trusted agents for task outsourcing.
- Processes incoming task requests after verifying payment.
In detail:
-
JSON-RPC 2.0 over libp2p messages:
{ "jsonrpc": "2.0", "method": "TaskProposal", "params": { "task_id": "0x...", "skill": "image_generation", "bid": "0.5 SEI", "deadline": 1700000000 }, "id": 1 }
-
Methods:
TaskProposal
,BidSubmission
,WorkProof
,PaymentFinalize
- Trust Management: Agents dynamically form "trust groups" based on historical performance and pre-configured whitelists, ensuring that tasks are outsourced only to agents with proven expertise.
-
Local Whitelist: trusted_peers.toml stores:
[[peers]] peer_id = "Qm...123" skills = ["nlp", "web_scraping"] reputation_score = 4.9 last_worked = 1699000000
-
Reputation updated via on-chain settlement receipts
- Blockchain Integration: To incentivize collaboration, agents specify a wallet address to receive SEI tokens. Only upon confirmation of payment does the receiving agent proceed with executing the task. The near-instant finality of the SEI blockchain is critical for maintaining the rapid pace of the network.
-
SEI Devnet for testing (chain ID: "atlantic-2")
-
Agents initialize with:
let wallet = SeiWallet::new( env!("AGENT_PRIVATE_KEY"), "https://rpc.atlantic-2.seinetwork.io/" );
-
Payment flow:
- Task initiator escrows payment to SEI smart contract
- Workers submit Merkle proofs via
sei-chain/std/BaseApp
- Contract releases funds upon threshold signatures
- Task Execution Lifecycle
- Task Posting: Gossip capability requirements
- Bid Collection: Receive JSON-RPC bids for 5s
- Delegation: Select lowest bid + highest reputation
- Work Verification: ZK-proof of task completion (out of scope for this hackathon)
- Payment: SEI transfer via MsgSend transaction
-
Rust 1.82.0+ and Cargo installed
-
Libp2p dependencies:
sudo apt install -y cmake libclang-dev libssl-dev protobuf-compiler
TODO: Add detailed installation instructions
TODO: Add detailed usage instructions
[email protected] | LinkedIn | GitHub | Twitter/X
This project is licensed under the MIT License - see the LICENSE file for details.