How ankieroar/ai-agent-marketplace-on-avalanche works
This repository is a planned Avalanche AI marketplace with private dispute resolution; the sampled implementation is an early foundation, not the complete documented product. The intended user journey is discover and buy a curated service, execute it, then accept or dispute the result and settle escrow. The graph preserves that documented journey alongside the existing wallet, API, agent, encrypted-evidence, and ping/pong relay code. Marketplace contracts and dispute/ZK stages are documented capabilities, but their implementation was not shown; those links are therefore documented-design relationships, not evidence of a working end-to-end flow.
Main entry points: server.mjs Backend API · contracts Dispute workflow · page.tsx Marketplace UI · index.mjs Dispute agents
Components 18
User experience
- Marketplace UI
project/apps/web/app/page.tsx - Wallet providers
project/apps/web/app/providers.tsx
Service and API
- Curated listings
project/contracts/contracts - Orders and escrow
project/contracts/contracts - Backend API
project/apps/api/src/server.mjs - Dispute agents
project/services/agents/index.mjs - Request schemas
project/packages/schema/index.mjs - Encrypted evidence
project/apps/api/src/crypto.mjs - Evidence database
project/apps/api/src/db.mjs
Dispute protocol
- Dispute workflow
project/contracts/contracts - Policy ZK proof
project/circuits/policy-eligibility
Cross-chain plumbing
- Fuji contracts
project/contracts/contracts/c-chain/PingSender.sol - Dispute L1 receiver
project/contracts/contracts/dispute-l1/PongReceiver.sol - Relay monitor
project/services/relayer-monitor/relayer.js
Other components
- Buyer
- Seller
- Reviewer
- OpenRouter API
Connections 21
- Buyer → Marketplace UI: uses
- Seller → Curated listings: registers listing
- Marketplace UI → Wallet providers: configures
- Marketplace UI → Orders and escrow: buys or accepts
- Curated listings → Orders and escrow: supplies listing
- Orders and escrow → Backend API: purchase event
- Backend API → Dispute agents: runs pipeline
project/apps/api/src/server.mjs - Backend API → Request schemas: validates with
project/apps/api/src/server.mjs - Dispute agents → Request schemas: validates results
project/services/agents/index.mjs - Dispute agents → OpenRouter API: requests completions
project/services/agents/index.mjs - Backend API → Encrypted evidence: encrypts and decrypts
project/apps/api/src/server.mjs - Backend API → Evidence database: reads and writes
project/apps/api/src/server.mjs - Marketplace UI → Dispute workflow: opens dispute
- Dispute workflow → Backend API: notifies case
- Backend API → Policy ZK proof: submits proof
- Policy ZK proof → Dispute workflow: gates resolution
- Reviewer → Dispute workflow: approves decision
- Dispute workflow → Orders and escrow: settles escrow
- Fuji contracts → Dispute L1 receiver: sends ping
- Relay monitor → Fuji contracts: polls events
project/services/relayer-monitor/relayer.js - Relay monitor → Dispute L1 receiver: delivers message
project/services/relayer-monitor/relayer.js