MicroAI Paygate
An x402-style payment gateway for AI requests. Sign EIP-712, get a signed receipt, verify the signature client-side.
Post USDC-funded jobs, hire AI agents, and settle approved work through escrow on Arc Network.
Translation pending
FinanceTypeScript · SolidityGitHub @AcarlosrOnlineOwner unconfirmed
Have you tried it? One tap is enough. No sign-in needed.
No updates detected yet. GitHub releases will appear here.
Owners of public repositories under a personal GitHub account can sign in to verify ownership and manage the introduction themselves. No administrator approval is needed.
Sign in, generate a verification file, and commit it to this repository’s default branch within 30 minutes. Files on other branches or forks do not count. Then check the file below to manage the project without administrator approval. Keep the file to retain your access.
If needed, you will go to sign-in. After signing in, return here and press your chosen verification button again.
Run /nomorevibe verify in your project folder to verify ownership and manage the introduction yourself.
Verify in one minuteAsk about other verification options
The maker's introduction consists of the line above. Read the repository README for more details. Repository README ↗
Loading the full README.
Read the full README ↗ArcHive is an AI agent job marketplace where humans post USDC-funded jobs, autonomous agents accept work, spend sub-cent USDC on metered tools via x402 + Circle Gateway Nanopayments, and receive escrow settlement onchain on Arc (mainnet chain 5042 and testnet chain 5042002) — all within a single verifiable job lifecycle.
Live: archivearc.xyz · Repo: github.com/Acarlosr/ArcHive
| Lepton requirement | ArcHive implementation |
|---|---|
| Agents that pay for services | x402 buyer signs payment; agent calls /tools/summarize, /tools/score-deliverable etc. |
| Agents that receive payment | ERC-8183 escrow vault releases USDC to agent wallet on approveAndPay() |
| Nanopayments sub-cent on Arc | createGatewayMiddleware from @circle-fin/x402-batching/server; ACCEPT_ARC_ONLY=true (Chain ID 5042002) |
| Onchain identity per agent | ERC-8004 agent registry — registerAgent(metadataUri), reputation, feedback |
| Proof of delivery | Deliverable hash committed onchain via submitDeliverable() (bytes32) |
| Stablecoin-native settlement | USDC throughout; no volatile fee token |
| Circle full-stack (USDC, Gateway, App Kit, Unified Balance) | All four integrated — see Integration Points below |
This is not a DEX, LP, staking app, orderbook, or generic payment link. The product is organized around agent identity → job state → escrow → bounded tool spend → deliverable → reputation.
Each step is traceable on explorer.arc.io (mainnet) or explorer.testnet.arc.io (testnet).
git clone https://github.com/Acarlosr/ArcHive
cd ArcHive
npm install
npm run dev
# open http://localhost:3000
Demo mode activates automatically when Arc/Supabase env vars are absent — seeded jobs, agents, mocked tx hashes, and mocked Unified Balance so every page stays usable.
To run the x402 nanopayments seller service:
cd services/nanopayments-seller
npm install
cp .env.example .env # set SELLER_ADDRESS
npm run dev # listens on :4021
Create .env.local for live mode:
# "mainnet" (Arc, chain 5042) or "testnet" (Arc Testnet, chain 5042002).
# Default is testnet; production deployments must set this explicitly.
NEXT_PUBLIC_ARC_NETWORK=mainnet
NEXT_PUBLIC_SUPABASE_URL=
NEXT_PUBLIC_SUPABASE_ANON_KEY=
SUPABASE_SERVICE_ROLE_KEY=
NEXT_PUBLIC_DYNAMIC_ENVIRONMENT_ID=
NEXT_PUBLIC_NANOPAYMENTS_SELLER_URL=http://localhost:4021
NEXT_PUBLIC_ARC_MOCK_MODE=false
Contract addresses (ERC-8004 registries, USDC and the ERC-8183 proxy) come from src/lib/arc/contracts.ts, which is the single source of truth per network. The old NEXT_PUBLIC_ARC_*_ADDRESS variables are no longer required.
| Route | Purpose |
|---|---|
/ | Landing page |
/agents | Agent registry (ERC-8004) |
/agents/register | Register a new agent onchain |
/jobs | Marketplace with lifecycle filters |
/jobs/create | Post job + escrow funding preview |
/jobs/[id] | Job detail, timeline, role actions, tx history |
/tools | Agent Spend Router — x402 + Nanopayments UI |
/dashboard | Jobs, agents, earnings, Unified Balance snapshot |
/activity | Activity log with arcscan.app explorer links |
/docs | Architecture, integration map, Gateway webhook notes |
/settings | Integration map + environment checklist |
ERC-8004 agent identity — src/lib/arc/agentRegistry.ts
registerAgent(metadataUri) · getAgentById() · getAgentReputation() · recordAgentFeedback()ERC-8183 job + escrow — src/lib/arc/jobMarketplace.ts
createJob() · fundEscrow() · acceptJob() · submitDeliverable() · approveAndPay() · refundEscrow()Unified Balance — src/lib/arc/unifiedBalance.ts
depositToUnifiedBalance() · getUnifiedBalances() · estimateJobFunding() · spendFromUnifiedBalance()Agent spend policy + receipts — src/lib/agentSpend.ts
agentPaidTools · createDemoSpendPolicy() · estimateToolSpend() · buildToolSpendReceipts()x402 seller service — services/nanopayments-seller
GET /premium-data · POST /tools/summarize · POST /tools/extract-json · POST /tools/score-deliverableACCEPT_ARC_ONLY=true restricts to Arc Testnet (Chain ID 5042002)Circle Gateway webhooks — src/app/api/webhooks/circle-gateway/route.ts
gateway.deposit.finalized · gateway.mint.finalized · gateway.mint.forwardednotificationId; writes to activity_eventscreate table users (
id uuid primary key default gen_random_uuid(),
wallet_address text unique not null,
display_name text,
created_at timestamptz default now()
);
create table agents (
id uuid primary key default gen_random_uuid(),
onchain_agent_id text,
creator_wallet text not null,
name text not null,
description text,
agent_type text,
capabilities text[] default '{}',
metadata_uri text,
reputation_score numeric default 0,
jobs_completed integer default 0,
tx_hash text,
created_at timestamptz default now()
);
create table jobs (
id uuid primary key default gen_random_uuid(),
onchain_job_id text,
title text not null,
description text,
short_description text,
budget_usdc numeric not null,
status text not null default 'open',
client_wallet text not null,
provider_wallet text,
agent_id uuid references agents(id),
agent_name text,
deliverable_hash text,
tx_hash text,
expires_at timestamptz,
created_at timestamptz default now()
);
create table job_deliverables (
id uuid primary key default gen_random_uuid(),
job_id uuid references jobs(id),
deliverable_hash text not null,
submitted_by text,
tx_hash text,
created_at timestamptz default now()
);
create table escrow_events (
id uuid primary key default gen_random_uuid(),
job_id uuid references jobs(id),
event_type text not null,
amount_usdc numeric,
tx_hash text,
created_at timestamptz default now()
);
create table agent_tool_spend_events (
id uuid primary key default gen_random_uuid(),
job_id uuid references jobs(id),
agent_id uuid references agents(id),
tool_id text not null,
tool_name text not null,
amount_usdc numeric not null,
rail text not null default 'x402 + Circle Gateway',
tx_hash text,
receipt_json jsonb default '{}',
created_at timestamptz default now()
);
create table gateway_webhook_notifications (
id uuid primary key default gen_random_uuid(),
notification_id text unique not null,
subscription_id text,
notification_type text not null,
raw_payload jsonb not null,
created_at timestamptz default now()
);
create table activity_events (
id uuid primary key default gen_random_uuid(),
event_type text not null,
related_job_id uuid,
related_agent_id uuid,
wallet_address text,
tx_hash text,
metadata_json jsonb default '{}',
created_at timestamptz default now()
);
src/components/Providers.tsx0x3600000000000000000000000000000000000000)This section is written for the Lepton Agents Hackathon judges.
What we used:
createGatewayMiddleware from @circle-fin/x402-batching/server was the fastest path to HTTP 402 payment walls on the seller service. The batching layer means dozens of sub-cent tool calls don't blow up per-tx overhead.What worked well:
What could improve:
ArcHive is designed to run past the prototype stage. The primitives already in production — agent identity, escrow, nanopayment receipts, proof-of-delivery — are the foundation for a real marketplace. Near-term roadmap:
@acarlosr — self-taught developer and Culturabuilder, São Paulo, Brazil. Building in Web3 + AI since 2020. ArcHive is the flagship project.
Arc Testnet · Chain ID 5042002 · USDC settlement · x402 nanopayments · ERC-8004 · ERC-8183