How zugzwang-world/graphpay works
GraphPay is a testnet agent-commerce demo: a customer describes a purchase, agents discover and assess shops, then a guarded payer completes x402 checkout through a facilitator. Payments are recorded in Arkiv for later reputation and explainable queries; merchants and customers can manage orders and agent authority. The map also includes the live phone/stage interfaces and the documented refund, reorder, and subscription paths. Some subsystem links are supported by the README rather than sampled implementation; unsampled details are not inferred.
Main entry points: buyer.mjs Buyer agents · pipeline.mjs Payment facilitator · route.ts GraphQL and MCP · merchant-actions.server.ts Merchant actions
Components 20
Agent commerce
- Buyer agents
packages/agents/src/buyer.mjs - Shop discovery
packages/agents/src/graph.mjs - Shop ranking
packages/agents/src/scoring.mjs
Checkout and settlement
- Shopfront
packages/checkout-kit/src/server.mjs - Payment facilitator
packages/facilitator/src/pipeline.mjs - Checkout contract
packages/contracts/index.mjs - Whitechain
Arkiv money graph
- Mirror workers
packages/mirror/src/workers.mjs - Arkiv graph store
packages/arkiv-graph/src/engine.mjs - GraphQL and MCP
apps/web/app/api/graphql/route.ts - Explain traces
apps/web/app/api/graphql/arkiv.server.ts
Merchant and owner controls
- Merchant actions
apps/web/lib/merchant-actions.server.ts - Customer controls
apps/web/lib/customer-state.server.ts - ENS authority
packages/ens/src/actions.mjs - Refunds and renewals
apps/web/lib/subscription.server.ts
Demo interfaces
- Customer and merchant phones
apps/phones/src/customer.tsx - Live demo stage
apps/web/lib/stage/errand.ts - Customer and merchant web
apps/web/app/customer/page.tsx
Other components
- Customer
- Merchant
Connections 24
- Customer → Buyer agents: requests purchase
README.md - Buyer agents → Shop discovery: finds shops
README.md - Buyer agents → GraphQL and MCP: asks reputation
README.md - GraphQL and MCP → Arkiv graph store: queries graph
- GraphQL and MCP → Explain traces: returns read trace
README.md - Buyer agents → Shop ranking: ranks in code
README.md - Buyer agents → Shopfront: requests checkout
README.md - Shopfront → Payment facilitator: delegates payment
packages/checkout-kit/src/server.mjs - Payment facilitator → ENS authority: checks agent status
README.md - Payment facilitator → Checkout contract: verifies and settles
README.md - Checkout contract → Whitechain: records payment
README.md - Whitechain → Mirror workers: emits checkout events
- Mirror workers → Arkiv graph store: writes payment memory
- Merchant → Merchant actions: manages orders
README.md - Merchant actions → Checkout contract: dispatches or refunds
README.md - Customer → Customer controls: manages payer
README.md - Customer controls → ENS authority: pauses payer
README.md - Customer controls → Refunds and renewals: changes subscription
README.md - Merchant actions → Refunds and renewals: refunds or renews
README.md - Customer → Customer and merchant phones: uses phone
README.md - Merchant → Customer and merchant phones: uses phone
README.md - Customer and merchant phones → Live demo stage: drives demo stage
apps/phones/src/customer.tsx - Customer → Customer and merchant web: uses web controls
README.md - Merchant → Customer and merchant web: uses merchant view
README.md