Cred402 is the credit & reputation layer for ALL x402 services — RWA verification is the first wedge, not the whole product. Add docs/roadmap/ with the forward phase plan (p1–p6): universal x402 receipts, the x402 Gateway wedge, credit-as-a-service, mainnet-beta credit market, omnichain credit, and decentralization + the data moat. Broaden README positioning + link the roadmap. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
39 lines
1.9 KiB
Markdown
39 lines
1.9 KiB
Markdown
# p2 — The x402 Gateway wedge
|
|
|
|
> **The Stripe-for-agents adoption flywheel.** Make any API x402-payable *and*
|
|
> receipt-generating with one line of middleware. Every wrapped endpoint feeds the
|
|
> Cred402 credit-data moat — distribution first, credit second.
|
|
|
|
## Why
|
|
Asking developers to understand "agent credit" first is a hard sell. Asking them to
|
|
"monetize your API per request, paid by agents" is easy and immediately valuable.
|
|
Each integration silently produces x402 receipts → which become the raw material
|
|
for reputation and credit. The gateway is how Cred402 gets distribution and data.
|
|
|
|
## Scope
|
|
- **`@cred402/x402` middleware** for the common stacks (Express / Fastify / Next.js
|
|
route handlers / edge). Wrap a route:
|
|
```ts
|
|
app.get("/weather-risk", cred402X402({ serviceType: "rwa.weather_risk",
|
|
price: "0.04", asset: "CSPR", receiverAgent: "caid:casper:..." }), handler);
|
|
```
|
|
The middleware handles: `402` challenge, EIP-712 payment-proof verification,
|
|
receipt hashing, on-chain anchoring, replay protection, analytics.
|
|
- **Seller dashboard.** Pricing config, per-endpoint usage + revenue analytics,
|
|
receipt explorer, service-category selection (uses the p1 registry).
|
|
- **Facilitator option.** Plug the real `make-software/casper-x402` facilitator for
|
|
CEP-18 settlement, or use the built-in ed25519 verifier.
|
|
- **Quotas + keys.** Optional API-key gating + rate limits for sellers.
|
|
|
|
## Deliverables
|
|
- Published `@cred402/x402` package + framework adapters + docs/quickstart.
|
|
- Seller dashboard tab in the console (pricing, analytics, receipts).
|
|
- A reference "paid API in 5 minutes" example repo.
|
|
|
|
## Success metric
|
|
**External** APIs (not operated by Cred402) integrate the gateway and emit x402
|
|
receipts that flow into the protocol's credit data — the data moat starts compounding.
|
|
|
|
## Out of scope
|
|
Underwriting third parties (p3), mainnet money movement (p4).
|