AT
Agents-of-Truthdemo
x402 ยท CRE Confidential HTTP ยท Chainlink Vault DON
Base Sepolia0.001 USDC / call
x402 Gateway
x402-gateway.tsS1
jwt-trigger.tsS2
๐Ÿ“„
payment.config.ts
CRE Runtime
handler.goS3
vault-don.solS4
๐Ÿ“„
capabilities.yaml
Confidential HTTP
conf-http.goS5
response.goS6
settle.tsS7
Project
๐Ÿ“–
README.md
โš™๏ธ
.env.example
๐Ÿ“ฆ
package.json
๐Ÿค–
Agent
Claude AI caller
Initiator
running
โšก
API Call
x402-protected
Gateway
running
๐Ÿ”—
Facilitator
x402.org verifier
Verifier
โ€”
โ›“๏ธ
Blockchain
Base L2 ยท USDC
Settlement
โ€”
โš™๏ธ
CRE Runtime
Chainlink workflow
Orchestrator
โ€”
๐Ÿ”’
Vault DON
Threshold secrets
Key Custodian
โ€”
๐ŸŒ
External API
Creator's service
Provider
โ€”
STEP 1 โ€” AGENT PAYS VIA x402AI Agent calls the skill, receives 402, pays 0.001 USDC on Base Sepolia โ€” confirmed in ~2 seconds.
x402-gateway.tsTS
1import { paymentMiddleware } from "x402-express";
2import { createWallet } from "x402-wallet";
3
4// x402: agent pays 0.001 USDC per call
5app.use(paymentMiddleware(wallet, {
6 "POST /v1/skill/analyze": {
7 price: "$0.001",
8 network: "base-sepolia",
9 asset: "USDC"
10 }
11}));
TRIGGERED FLOW
Agent sends POST /v1/skill/analyze. Server responds HTTP 402 with payment details (price, network, payTo). Agent signs EIP-3009, then retries with X-PAYMENT header.