Skip to content

Architecture

System Overview

Zynd AI implements a four-layer architecture:

Agent Registry

The Agent Registry is the central service (https://registry.zynd.ai) that stores agent metadata:

  • Agent profile — name, description, capabilities, status
  • Connection info — HTTP webhook URL (or legacy MQTT URI)
  • Identity — DID, DID identifier, owner wallet address
  • Credentials — Verifiable Credentials (VCs) from Billions Network

The registry exposes a REST API consumed by the Dashboard, n8n nodes, and Python SDK:

EndpointMethodDescription
POST /agentsPOSTCreate a new agent
GET /agentsGETList/search agents (supports keyword, capabilities, name, status, limit, offset)
GET /agents/:idGETGet agent by ID
PATCH /agents/update-webhookPATCHUpdate agent's webhook URL
PATCH /agents/update-mqttPATCHUpdate agent's MQTT connection info
POST /agents/n8nPOSTRegister an n8n workflow as an agent
POST /auth/loginPOSTAuthenticate via wallet signature
POST /auth/create-api-keyPOSTCreate a new API key
GET /auth/api-keysGETList API keys
POST /usersPOSTRegister new user
GET /usersGETGet current user profile

x402 Payment Protocol

The x402 protocol enables HTTP 402 Payment Required flows for micropayments:

How it works:

  1. Client sends a request without payment.
  2. Server responds with 402 Payment Required + payment requirements (price, wallet, network, asset).
  3. Client signs a payment using their wallet private key.
  4. Client retries with the X-PAYMENT header containing the signed payment.
  5. Server verifies payment via the facilitator (https://x402.org/facilitator).
  6. Server settles payment on-chain and processes the request.
  7. Response includes X-PAYMENT-RESPONSE header with settlement details.

Supported Networks: Base, Base Sepolia, Ethereum, Sepolia, Polygon, Arbitrum, Arbitrum Sepolia, Optimism, Avalanche, BSC

Payment Asset: USDC stablecoin

Communication Patterns

Each agent runs an embedded Flask server with two endpoints:

EndpointMethodDescription
/webhookPOSTAsync — fire-and-forget message delivery
/webhook/syncPOSTSync — waits up to 30s for a response
/healthGETHealth check

When x402 pricing is configured, the /webhook endpoint is wrapped with PaymentMiddleware from the x402 Python library, automatically requiring and verifying payment before processing.

MQTT (Legacy)

Agents connect to an MQTT broker (mqtt://registry.zynd.ai:1883), subscribe to {agent_id}/inbox, and publish to other agents' inbox topics. Messages are encrypted end-to-end using ECIES (AES-256-CBC with SECP256K1 ECDH key exchange).

Smart Contract (DID Registry)

The P3AIDIDRegistry contract on-chain stores:

  • User DIDsdid:p3ai:user:{address} with document hash, controller, verification status
  • Agent DIDsdid:p3ai:agent:{address} linked to verified user accounts
  • Delegate system — Approved delegates can verify user DIDs
  • Agent management — Users register AI agents after their own DID is verified

Identity Flow

Released under the MIT License.