Skip to content

Repository files navigation

Trustless Agent Commerce Platform

Vision: Agents with On-Chain Identity, Reputation, and Revenue

We aim for every AI agent to behave like a self-sovereign business: it owns its identity, reputation, and treasury directly on-chain.

  • ERC-8004 keeps shared ledgers for registration, feedback, and validation, making every interaction auditable and portable.
  • x402 upgrades HTTP 402 into native, stablecoin-denominated micropayments—buyers stay in the same request flow without manual trust gaps.
  • ERC-6551 (next phase) will bind each agent’s NFT to a token-bound account (TBA) so payouts, escrows, staking, and arbitration all live in one asset.

Guiding idea: assemble a self-operating league of agents. Requesters emit jobs; executor and validator agents rely on their own wallets and on-chain reputation to quote, deliver, and audit—no centralized coordinator required.


Current Focus

1. Minimal networking loop between agents

  • Roles: client (requester), server (executor), validator (quality assurance) run as independent FastAPI services, each with its own key and RPC.
  • Flow: register on ERC-8004 → launch a task → x402 collects payment → server executes → validator optionally audits → client writes back reputation.

2. x402 micropayment integration

  • Server-side: paid routes in server_service and validator_service use require_payment, returning HTTP 402 until the facilitator confirms payment.
  • Client-side: client_agent wraps the official x402_requests adapter, automating “request → 402 → pay → retry” and storing X-PAYMENT-RESPONSE receipts.
  • Defaults: Base Sepolia, 0.1 USDC per call, facilitator receipts cached for future arbitration or refunds.

3. Ready for ERC-6551

  • EOAs still sign transactions today, but the service/state abstraction isolates agent logic. The next milestone swaps EOAs for TBAs: mint identity NFTs, spawn TBAs, route payments to those accounts, and continue logging trust signals on ERC-8004.

Representative Use Cases

Scenario A · Instant Micropaid Query (currently under development)

  1. Client requests a one-off market analysis.
  2. Server returns HTTP 402 for 0.1 USDC.
  3. Client retries through x402 with a signed payment header.
  4. Server verifies, executes, and returns the result; settlement metadata is cached for future dashboards.

Scenario B · High-Value Task with Acceptance (next iteration)

  1. Client commissions a high-cost deliverable (e.g., a 60-second video).
  2. Funds move into the server’s future TBA or a shared escrow.
  3. Validator audits and records outcomes on ERC-8004.
  4. Funds release or refund automatically; arbitration hooks stay on-chain.
  5. Third-party arbitrator agents can adjudicate directly against escrow.

Scenario C · Marketplace Bidding with Reputation Pricing (planned)

  1. Client broadcasts an RFP with budget and SLA.
  2. Multiple server agents bid based on ERC-8004 reputation and historical performance.
  3. Client auto-selects the best mix of price and trust, triggers x402 payment, and receives auditable deliverables.

Project Structure

trustless-agent-commerce/
├── contracts/                 # ERC-8004 contracts and scripts
├── agents/
│   ├── client_service.py      # requester / coordinator
│   ├── server_service.py      # task executor
│   ├── validator_service.py   # validation specialist
│   └── base_agent.py          # shared on-chain utilities
├── payments/x402_client.py    # x402 requests client wrapper
├── docs/stage1-backend-design.md
└── README.md

Quick Start (Base Sepolia)

pip install -r requirements.txt
python scripts/deploy.py  # deploy ERC-8004 registries

uvicorn agents.server_service:app --port 8001
uvicorn agents.validator_service:app --port 8002
uvicorn agents.client_service:app --port 8000

Configure .env, then call POST /tasks to observe the payment + execution loop. A front-end ops panel will follow to visualize timelines, payment flows, and reputation trends.


Roadmap

  1. ERC-6551 integration

    • Mint identity NFTs and create token-bound accounts for each agent
    • Route x402 payouts directly into TBAs to form portable balance sheets
    • Extend escrow, staking, and arbitration logic
  2. Operations dashboard

    • Real-time task streams, reputation charts, payment receipts
    • Trigger validation, disputes, and settlement reviews from one UI
  3. Marketplace mechanics

    • Broadcast tasks → collect bids → auto-select by price and trust
    • Incentive design for validators and dispute resolution

Notes

This repository tracks the ongoing effort to make agent-to-agent commerce trust-minimized and programmatically enforceable. ERC-6551 wallets, marketplace UI, and arbitration workflows will build on this foundation. Contributions and ideas are welcome.


License

This project is released under the MIT License.

About

No description, website, or topics provided.

Resources

Stars

0 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages