Skip to content

Agent-to-Agent (P2P Agentic Web) Network for Native Agentic collaboration based on a trust system and a Payment/Escrow layer.

License

Notifications You must be signed in to change notification settings

epappas/seipients-agent-to-agent

Repository files navigation

SEIpients - Agentic Swarm Network (ASN)

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.

Logo

A Decentralized AI Agent Workforce Marketplace

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:

  1. Bootstrap with SEI wallet credentials
  2. Maintain whitelists of trusted peers
  3. Bid on subtasks via auction mechanics
  4. Receive instant payments upon proof-of-work

Demo Preview

Introduction: AI x Crypto Synergy

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)

Technical Architecture

┌───────────────────────────────────┐          ┌───────────────────────────────────┐
│          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:

  1. 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
  1. 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

  1. 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

  1. 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:

    1. Task initiator escrows payment to SEI smart contract
    2. Workers submit Merkle proofs via sei-chain/std/BaseApp
    3. Contract releases funds upon threshold signatures
  1. 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

Getting Started

  • Rust 1.82.0+ and Cargo installed

  • Libp2p dependencies:

    sudo apt install -y cmake libclang-dev libssl-dev protobuf-compiler

Installation

TODO: Add detailed installation instructions

Usage

TODO: Add detailed usage instructions

Demo

Demo Video

Author: Evangelos Pappas

[email protected] | LinkedIn | GitHub | Twitter/X

License

This project is licensed under the MIT License - see the LICENSE file for details.

About

Agent-to-Agent (P2P Agentic Web) Network for Native Agentic collaboration based on a trust system and a Payment/Escrow layer.

Topics

Resources

License

Stars

Watchers

Forks