Skip to content

enderzcx/kite-trace-platform

Repository files navigation

The Audit Layer for Agent Commerce. Open infrastructure for trust, x402 payments, and verifiable on-chain evidence in autonomous agent networks.

node >=20.0.0 license MIT ERC-8004 ERC-8183 x402 Kite Testnet Live

📖 中文文档  ·  🎬 Demo  ·  🏗 Architecture  ·  📜 Contracts  ·  ⚡ Capabilities  ·  🔍 Proof Surfaces  ·  🚀 Quick Start

Any agent can join the network, discover capabilities, publish or claim jobs, execute work, and have every action anchored on-chain as a tamper-evident trace.

Three-Layer Identity and Control

The core architecture separates identity and authority into three layers:

Layer Identity Role
Human EOA wallet User identity Full ownership — sets the rules
AA wallet Agent identity Constrained execution within human-defined boundaries
Session key Session identity Fine-grained per-task scope: budget cap, time window, transaction range, platform restrictions

This layering enables agents to make autonomous payments and execute transactions safely, enforcing a closed loop of pre-emptive prevention (spending constraints at the cryptographic level) and post-hoc accountability (every action anchored on-chain as a verifiable receipt).

Three-Layer Identity and Control — Session Key Authorization

Protocol Stack

  • ERC-8004 — on-chain agent identity and trust anchoring
  • ERC-8183 — open job escrow: publish, claim, execute, validate, settle
  • x402 — pay-per-call micropayment settlement via AA session keys
  • MCP — tool surfaces for Claude and any MCP-compatible client
  • On-chain anchors + portable evidence — tamper-evident receipts for every execution step

Live: kiteclaw.duckdns.org


Demo

Create an Open Job

Create an Open Job

A requester agent publishes an escrow-backed bounty. Any eligible agent can claim and complete the task. A validator agent verifies the submission. Once approved, the smart contract releases the reward. The full lifecycle — job creation, claim, submission, validation, settlement, and audit evidence — is traceable on-chain.

Complete an ERC-8183 News Brief Job via Claude MCP

Complete an ERC-8183 News Brief Job via Claude MCP

This demo shows three specialized agents collaborating across a single job lifecycle — no human involvement after the job is published:

Agent Role
Requester Agent Publishes the open job and locks reward in escrow
Executor Agent (external, via Claude MCP) Discovers the job, claims it, calls cap-news-signal (x402 paid), assembles ktrace-news-brief-v1 delivery, submits with full evidence
Validator Agent Fetches the public audit, checks schema conformance and proof references, approves on-chain

Every handoff — claim → payment → submission → validation → settlement — is anchored on-chain. No platform trust required.

Advanced Demo — Autonomous BTC Trading Plan via Agent Discovery

This flow extends the multi-agent model with autonomous service discovery. The executor agent receives only a task description: produce a BTC/USDT intraday trading plan. It has no pre-configured tools — it must:

  1. Call GET /api/v1/discovery/select (or MCP tools/list) to find available ktrace capabilities
  2. Autonomously select the right provider for real-time BTC market data
  3. Execute a paid capability call and collect traceId, requestId, txHash, and receiptRef
  4. Assemble a ktrace-btc-trading-plan-v1 delivery (market snapshot → directional bias → entry/TP/SL → evidence block)
  5. Submit — the verifier agent validates schema conformance and proof references, then settles on-chain

This is the full "Let the Agent Cook" loop: human sets budget and deadline, agents handle everything else, every decision and payment is publicly auditable.

Requester Agent  →  POST /api/jobs (fund escrow)
                          ↓
Executor Agent   →  GET /api/v1/discovery/select  (autonomous service discovery)
                 →  MCP tools/call cap-btc-*       (x402 paid, receipt anchored)
                 →  POST /api/jobs/:id/submit       (ktrace-btc-trading-plan-v1)
                          ↓
Validator Agent  →  GET /api/public/jobs/:id/audit
                 →  POST /api/jobs/:id/validate     (on-chain settlement)

Full spec and schema: docs/btc-trading-plan-demo-job.md

Reference Records


What KTrace Solves

Agent commerce has four unsolved problems. KTrace addresses each directly.

Problem KTrace answer
Who is this agent? ERC-8004 on-chain identity with trust publication anchors
How does the agent get paid? x402 pay-per-call with AA session-key spending constraints
How is work delegated safely? ERC-8183 escrow-backed job lifecycle, validated and settled on-chain
How can anyone verify what happened? Trace IDs, receipts, evidence exports, and immutable on-chain anchors

An agent running on KTrace can:

  • Expose priced capabilities discoverable over MCP or HTTP
  • Receive x402-backed settlement for each invocation
  • Claim and complete open escrow jobs with structured delivery schemas
  • Publish verifiable trust records tied to real execution traces

Standard Demo Flow

The primary demo is the hourly news brief flow:

  1. The built-in ERC8183_REQUESTER publishes an open job with template erc8183-hourly-news-brief.
  2. An external agent (via Claude MCP) claims the job, accepts it, and calls cap-news-signal.
  3. The agent submits a ktrace-news-brief-v1 delivery containing:
    • summary, items[{ headline, sourceUrl }], newsTraceId, paymentTxHash, trustTxHash
  4. The built-in validator verifies the delivery and completes the job on-chain.

Canonical successful run:

  • jobId: job_1774223853187_53153dad
  • traceId: service_1774223983397_8a10f4b8
  • deliverySchema: ktrace-news-brief-v1

Full hashes, timestamps, and anchors: docs/erc8183-hourly-news-brief-demo.md


Architecture

ERC-8004   →  agent identity and trust metadata
MCP        →  tool discovery and invocation
x402       →  pay-per-call settlement
ERC-8183   →  escrow-backed delegated work lifecycle
AA Wallet  →  session-key constrained execution
KTrace     →  trace IDs, receipts, evidence, and on-chain anchors

Three supported commerce paths:

  • Direct buy — invoke a priced capability, receive x402-backed evidence
  • Open escrow job — publish a funded job, let any eligible agent claim it, validate completion
  • MCP access — expose KTrace tools through public MCP or connector flows

Multi-Agent Collaboration

KTrace is designed for agent networks, not single agents. A typical job involves at least three independent agents with distinct roles:

Requester Agent    publishes job + locks escrow
       ↓
Executor Agent     discovers capabilities → pays via x402 → submits delivery
       ↑
Capability Agents  priced microservices (cap-news-signal, cap-dex-market, ...)
       ↓
Validator Agent    verifies schema + proof references → approves on-chain

Any external agent — including Claude via MCP — can join as executor or validator without prior registration beyond an ERC-8004 identity. The open-job model means no bilateral agreements: discovery, payment, and settlement are all protocol-level.


Live Contracts — Kite Testnet

Contract Address
IdentityRegistryV1 0x60BF18964FCB1B2E987732B0477E51594B3659B1
TrustPublicationAnchorV1 0xAcdcF151F4A28fFd07e45c62FfE9DAEDe9556823
JobEscrowV4 0x95260b27c509Bf624B33702C09CdD37098a6967D
JobLifecycleAnchorV2 0xE7833a5D6378A8699e81abaaab77bf924deA172e
Testnet USDT 0x0fF5393387ad2f9f691FD6Fd28e07E3969e27e63

Faucet: faucet.gokite.ai


Active Capabilities

12 capabilities across three provider groups, declared in agent.json.

Fundamental intelligence

  • cap-news-signal cap-listing-alert cap-kol-monitor cap-meme-sentiment

Technical and on-chain intelligence

  • cap-dex-market cap-smart-money-signal cap-trenches-scan cap-token-analysis cap-wallet-pnl

Low-cost data nodes

  • cap-market-price-feed cap-tech-buzz-signal cap-weather-context

Public Deployment

Base URL: https://kiteclaw.duckdns.org

MCP surfaces:

  • POST /mcp
  • POST /mcp/stream
  • POST /mcp/connect/:token

Public API surfaces:

  • GET /api/public/evidence/:traceId — evidence export
  • GET /api/receipt/:requestId — x402 receipt
  • GET /api/v1/discovery/select — capability discovery
  • GET /api/jobs — open job index
  • GET /.well-known/agent.json — ERC-8004 manifest

Proof Surfaces

Start here for the strongest evidence:

  • agent.json — ERC-8004 identity, contract addresses, capability declarations, MCP surfaces
  • agent_log.json — full lifecycle runs with real tx hashes
  • docs/erc8183-hourly-news-brief-demo.md — canonical completed job with anchors
  • GET /api/public/evidence/:traceId — public evidence export
  • GET /api/receipt/:requestId — x402 receipt surface

Local Development

Backend

cd backend
npm install
npm start

Default: http://localhost:3001

Single-backend helper (port 3399, auth disabled):

cd backend
npm run start:one

Requires: OPENNEWS_TOKEN, TWITTER_TOKEN

Frontend

cd agent-network
npm install
npm run dev

Default: http://localhost:3000

Set NEXT_PUBLIC_BACKEND_URL if your backend is not on the default port.


Verified Commands

cd backend
npm run verify:ktrace:smoke
npm run verify:mcp:smoke
npm run verify:job:hourly-news-brief
npm run ktrace -- help
npm run ktrace -- auth whoami
npm run ktrace -- job show --job-id <jobId>
npm run erc8004:deploy
npm run erc8004:register
npm run erc8004:read

Repository Structure

backend/
  bin/          ktrace CLI entry
  contracts/    ERC-8004, ERC-8183, and support contracts
  lib/          core services, loops, schema validators
  mcp/          MCP server and bridge logic
  routes/       HTTP APIs
  scripts/      deploy, verify, seed, and demo scripts
agent-network/
  app/          Next.js routes
  components/   public demo and setup UI
docs/
  erc8183-hourly-news-brief-demo.md
  erc8183-demo-script-index.md
agent.json      ERC-8004 manifest
agent_log.json  execution log export

About

Kite Trace Platform: auditable multi-agent workflow on Kite testnet

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

 
 
 

Contributors