BAiSEDagent

a2a-protocol

0
0
# Install this skill:
npx skills add BAiSEDagent/openclaw-skills --skill "a2a-protocol"

Install specific skill from multi-skill repository

# Description

Google's Agent-to-Agent protocol for agent interoperability. Discovery, task delegation, async communication. Use when building agent coordination that works across platforms.

# SKILL.md


name: a2a-protocol
description: "Google's Agent-to-Agent protocol for agent interoperability. Discovery, task delegation, async communication. Use when building agent coordination that works across platforms."
metadata:
openclaw:
emoji: "🤝"


A2A Protocol (Agent-to-Agent)

Google's open protocol for agent interoperability. HTTP/SSE + JSON-RPC for capability discovery, task delegation, and async communication between agents.

Why A2A + x402

A2A handles coordination (find agents, delegate tasks, get results). x402 handles payment (pay for services rendered). Together they form the complete agent commerce stack: discover → negotiate → execute → pay → attest.

No other platform combines both. This is AgentHQ's moat.

Core Concepts

Agent Card

JSON document describing an agent's capabilities, published at /.well-known/agent.json:

{
  "name": "BAiSED",
  "description": "Base ecosystem agent — x402 payments, EAS attestations",
  "url": "https://agenthq.replit.app",
  "capabilities": {
    "streaming": true,
    "pushNotifications": true
  },
  "skills": [
    {
      "id": "x402-payment",
      "name": "x402 Payment Processing",
      "description": "Process USDC payments via x402 protocol"
    }
  ],
  "authentication": {
    "schemes": ["bearer"]
  }
}

Task Lifecycle

created → working → [input-required] → completed | failed | canceled

Tasks are the unit of work. An agent sends a task to another agent, which processes it asynchronously and returns results as "artifacts."

Protocol Flow

  1. Discovery — Fetch /.well-known/agent.json from target agent
  2. Task Creation — POST JSON-RPC tasks/send with message
  3. Streaming (optional) — SSE stream for real-time updates via tasks/sendSubscribe
  4. Status Checktasks/get to poll task state
  5. Completion — Task resolves with artifacts (text, files, structured data)

JSON-RPC Methods

Method Purpose
tasks/send Send a task (request/response)
tasks/sendSubscribe Send a task with SSE streaming
tasks/get Get task status and artifacts
tasks/cancel Cancel a running task
tasks/pushNotification/set Register webhook for updates
tasks/pushNotification/get Get current webhook config

Message Format

{
  "jsonrpc": "2.0",
  "id": "1",
  "method": "tasks/send",
  "params": {
    "id": "task-uuid",
    "message": {
      "role": "user",
      "parts": [
        { "type": "text", "text": "Analyze this contract for security issues" }
      ]
    }
  }
}

Integration with AgentHQ

AgentHQ as A2A Server

Expose AgentHQ agents via A2A so any A2A-compatible client can delegate tasks:
- Publish agent cards at /.well-known/agent.json
- Implement tasks/send endpoint that routes to AgentHQ task system
- Return EAS attestation UIDs as artifacts for verifiable results

AgentHQ as A2A Client

Discover and delegate to external agents:
- Fetch agent cards, match capabilities to task requirements
- Send tasks, monitor via streaming or polling
- Pay via x402 if the agent requires payment (check for 402 on task endpoints)

The Full Flow: A2A + x402 + EAS

1. Discover agent via A2A card
2. Send task via tasks/send
3. Agent returns 402 → pay via x402
4. Agent processes task → returns artifacts
5. Attest completion via EAS
6. Reputation updated on-chain

References

Cross-References

  • x402: Payment layer for A2A task execution
  • eas-attestations: Attest to task completion
  • erc-8004-registry: On-chain agent identity complements A2A agent cards
  • mcp-integration: MCP for tool access, A2A for agent-to-agent coordination

# Supported AI Coding Agents

This skill is compatible with the SKILL.md standard and works with all major AI coding agents:

Learn more about the SKILL.md standard and how to use these skills with your preferred AI coding agent.