x402-trust-layer 5.1.0
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/CHANGELOG.md +55 -0
- package/DEPLOY.md +53 -0
- package/Dockerfile +30 -0
- package/LICENSE +21 -0
- package/README.md +294 -0
- package/dist/agents/a2a-payment.d.ts +37 -0
- package/dist/agents/a2a-payment.js +105 -0
- package/dist/agents/agent-escrow.d.ts +30 -0
- package/dist/agents/agent-escrow.js +23 -0
- package/dist/agents/agent-verify.d.ts +15 -0
- package/dist/agents/agent-verify.js +112 -0
- package/dist/agents/api-router.d.ts +32 -0
- package/dist/agents/api-router.js +228 -0
- package/dist/agents/attestation-registry.d.ts +35 -0
- package/dist/agents/attestation-registry.js +76 -0
- package/dist/agents/audition-coach.d.ts +45 -0
- package/dist/agents/audition-coach.js +257 -0
- package/dist/agents/bedrock-bridge.d.ts +3 -0
- package/dist/agents/bedrock-bridge.js +60 -0
- package/dist/agents/budget-allocator.d.ts +24 -0
- package/dist/agents/budget-allocator.js +31 -0
- package/dist/agents/compliance-ledger.d.ts +66 -0
- package/dist/agents/compliance-ledger.js +80 -0
- package/dist/agents/dispute-resolver.d.ts +62 -0
- package/dist/agents/dispute-resolver.js +124 -0
- package/dist/agents/evidence-locker.d.ts +30 -0
- package/dist/agents/evidence-locker.js +47 -0
- package/dist/agents/facilitator-failover.d.ts +15 -0
- package/dist/agents/facilitator-failover.js +18 -0
- package/dist/agents/identity-gate.d.ts +20 -0
- package/dist/agents/identity-gate.js +79 -0
- package/dist/agents/mandate-compiler.d.ts +51 -0
- package/dist/agents/mandate-compiler.js +73 -0
- package/dist/agents/mandate-diff.d.ts +41 -0
- package/dist/agents/mandate-diff.js +170 -0
- package/dist/agents/market-buy-advisor.d.ts +65 -0
- package/dist/agents/market-buy-advisor.js +234 -0
- package/dist/agents/merchant-trust.d.ts +38 -0
- package/dist/agents/merchant-trust.js +171 -0
- package/dist/agents/mpp-session-broker.d.ts +27 -0
- package/dist/agents/mpp-session-broker.js +29 -0
- package/dist/agents/mpp-session-v2.d.ts +76 -0
- package/dist/agents/mpp-session-v2.js +269 -0
- package/dist/agents/payment-intent-compiler.d.ts +21 -0
- package/dist/agents/payment-intent-compiler.js +45 -0
- package/dist/agents/pipeline-execute.d.ts +40 -0
- package/dist/agents/pipeline-execute.js +100 -0
- package/dist/agents/pipeline-trust-v2.d.ts +31 -0
- package/dist/agents/pipeline-trust-v2.js +111 -0
- package/dist/agents/pre-x402-guard.d.ts +35 -0
- package/dist/agents/pre-x402-guard.js +84 -0
- package/dist/agents/quality-escrow-semantic.d.ts +88 -0
- package/dist/agents/quality-escrow-semantic.js +137 -0
- package/dist/agents/quality-escrow.d.ts +65 -0
- package/dist/agents/quality-escrow.js +104 -0
- package/dist/agents/quality-monitor.d.ts +32 -0
- package/dist/agents/quality-monitor.js +77 -0
- package/dist/agents/rail-optimizer.d.ts +33 -0
- package/dist/agents/rail-optimizer.js +133 -0
- package/dist/agents/receipt-auditor.d.ts +14 -0
- package/dist/agents/receipt-auditor.js +145 -0
- package/dist/agents/refund-arbiter.d.ts +24 -0
- package/dist/agents/refund-arbiter.js +70 -0
- package/dist/agents/research-brief.d.ts +14 -0
- package/dist/agents/research-brief.js +66 -0
- package/dist/agents/risk-gate.d.ts +11 -0
- package/dist/agents/risk-gate.js +78 -0
- package/dist/agents/settlement-graph.d.ts +16 -0
- package/dist/agents/settlement-graph.js +38 -0
- package/dist/agents/spend-governor.d.ts +2 -0
- package/dist/agents/spend-governor.js +70 -0
- package/dist/agents/trust-network.d.ts +138 -0
- package/dist/agents/trust-network.js +244 -0
- package/dist/agents/x402-proxy.d.ts +32 -0
- package/dist/agents/x402-proxy.js +90 -0
- package/dist/client/demo-alchemy-live.d.ts +1 -0
- package/dist/client/demo-alchemy-live.js +226 -0
- package/dist/client/demo-tail.d.ts +1 -0
- package/dist/client/demo-tail.js +100 -0
- package/dist/client/demo.d.ts +1 -0
- package/dist/client/demo.js +293 -0
- package/dist/config.d.ts +94 -0
- package/dist/config.js +223 -0
- package/dist/index.d.ts +1 -0
- package/dist/index.js +389 -0
- package/dist/lib/agent-response.d.ts +14 -0
- package/dist/lib/agent-response.js +13 -0
- package/dist/lib/agentic-gateways.d.ts +5 -0
- package/dist/lib/agentic-gateways.js +15 -0
- package/dist/lib/agentic-probes.d.ts +10 -0
- package/dist/lib/agentic-probes.js +49 -0
- package/dist/lib/alchemy-x402-fetch.d.ts +16 -0
- package/dist/lib/alchemy-x402-fetch.js +95 -0
- package/dist/lib/apply-verifier-body.d.ts +7 -0
- package/dist/lib/apply-verifier-body.js +179 -0
- package/dist/lib/attestation.d.ts +30 -0
- package/dist/lib/attestation.js +107 -0
- package/dist/lib/bazaar-extension.d.ts +15 -0
- package/dist/lib/bazaar-extension.js +265 -0
- package/dist/lib/bazaar.d.ts +100 -0
- package/dist/lib/bazaar.js +341 -0
- package/dist/lib/certified-sellers.d.ts +41 -0
- package/dist/lib/certified-sellers.js +129 -0
- package/dist/lib/chains.d.ts +20 -0
- package/dist/lib/chains.js +78 -0
- package/dist/lib/db-persistence.d.ts +7 -0
- package/dist/lib/db-persistence.js +65 -0
- package/dist/lib/db.d.ts +5 -0
- package/dist/lib/db.js +113 -0
- package/dist/lib/discovery-page.d.ts +2 -0
- package/dist/lib/discovery-page.js +71 -0
- package/dist/lib/ecosystem-telemetry.d.ts +20 -0
- package/dist/lib/ecosystem-telemetry.js +80 -0
- package/dist/lib/erc8004/agent-card.d.ts +34 -0
- package/dist/lib/erc8004/agent-card.js +151 -0
- package/dist/lib/erc8004/cache.d.ts +3 -0
- package/dist/lib/erc8004/cache.js +17 -0
- package/dist/lib/erc8004/constants.d.ts +22 -0
- package/dist/lib/erc8004/constants.js +35 -0
- package/dist/lib/erc8004/registry.d.ts +19 -0
- package/dist/lib/erc8004/registry.js +171 -0
- package/dist/lib/erc8004/resolve-agent.d.ts +7 -0
- package/dist/lib/erc8004/resolve-agent.js +70 -0
- package/dist/lib/erc8004/trust-score.d.ts +33 -0
- package/dist/lib/erc8004/trust-score.js +136 -0
- package/dist/lib/escrow-ledger.d.ts +14 -0
- package/dist/lib/escrow-ledger.js +54 -0
- package/dist/lib/escrow-unified.d.ts +15 -0
- package/dist/lib/escrow-unified.js +28 -0
- package/dist/lib/facilitator-extra.d.ts +13 -0
- package/dist/lib/facilitator-extra.js +52 -0
- package/dist/lib/facilitators.d.ts +20 -0
- package/dist/lib/facilitators.js +89 -0
- package/dist/lib/host-policy.d.ts +4 -0
- package/dist/lib/host-policy.js +20 -0
- package/dist/lib/idempotency.d.ts +4 -0
- package/dist/lib/idempotency.js +120 -0
- package/dist/lib/ledger.d.ts +2 -0
- package/dist/lib/ledger.js +17 -0
- package/dist/lib/logger.d.ts +6 -0
- package/dist/lib/logger.js +24 -0
- package/dist/lib/mandate-vc.d.ts +20 -0
- package/dist/lib/mandate-vc.js +25 -0
- package/dist/lib/mandate.d.ts +44 -0
- package/dist/lib/mandate.js +190 -0
- package/dist/lib/marketplace.d.ts +7 -0
- package/dist/lib/marketplace.js +127 -0
- package/dist/lib/migrations.d.ts +2 -0
- package/dist/lib/migrations.js +130 -0
- package/dist/lib/nonce-store.d.ts +6 -0
- package/dist/lib/nonce-store.js +109 -0
- package/dist/lib/openapi-agentcash.d.ts +5 -0
- package/dist/lib/openapi-agentcash.js +288 -0
- package/dist/lib/openapi-meta.d.ts +5 -0
- package/dist/lib/openapi-meta.js +235 -0
- package/dist/lib/otel.d.ts +2 -0
- package/dist/lib/otel.js +25 -0
- package/dist/lib/paid-resource-url.d.ts +6 -0
- package/dist/lib/paid-resource-url.js +47 -0
- package/dist/lib/parse-with-verifier-fallback.d.ts +3 -0
- package/dist/lib/parse-with-verifier-fallback.js +13 -0
- package/dist/lib/payment-request-context.d.ts +10 -0
- package/dist/lib/payment-request-context.js +5 -0
- package/dist/lib/payment-response.d.ts +13 -0
- package/dist/lib/payment-response.js +39 -0
- package/dist/lib/payto-guard.d.ts +10 -0
- package/dist/lib/payto-guard.js +20 -0
- package/dist/lib/probe.d.ts +29 -0
- package/dist/lib/probe.js +157 -0
- package/dist/lib/problem-detail.d.ts +10 -0
- package/dist/lib/problem-detail.js +14 -0
- package/dist/lib/rate-limit.d.ts +12 -0
- package/dist/lib/rate-limit.js +126 -0
- package/dist/lib/replay-middleware.d.ts +3 -0
- package/dist/lib/replay-middleware.js +27 -0
- package/dist/lib/response-guard.d.ts +5 -0
- package/dist/lib/response-guard.js +40 -0
- package/dist/lib/safe-fetch.d.ts +5 -0
- package/dist/lib/safe-fetch.js +19 -0
- package/dist/lib/security.d.ts +13 -0
- package/dist/lib/security.js +61 -0
- package/dist/lib/semantic-judge.d.ts +14 -0
- package/dist/lib/semantic-judge.js +107 -0
- package/dist/lib/semantic-judge.test.d.ts +1 -0
- package/dist/lib/semantic-judge.test.js +11 -0
- package/dist/lib/ssrf.d.ts +10 -0
- package/dist/lib/ssrf.js +130 -0
- package/dist/lib/ssrf.test.d.ts +1 -0
- package/dist/lib/ssrf.test.js +16 -0
- package/dist/lib/suite-catalog.d.ts +83 -0
- package/dist/lib/suite-catalog.js +131 -0
- package/dist/lib/telemetry.d.ts +5 -0
- package/dist/lib/telemetry.js +37 -0
- package/dist/lib/verifier-fast-path.d.ts +10 -0
- package/dist/lib/verifier-fast-path.js +44 -0
- package/dist/lib/verifier-probe-protocol.d.ts +7 -0
- package/dist/lib/verifier-probe-protocol.js +115 -0
- package/dist/lib/verify-examples.d.ts +2 -0
- package/dist/lib/verify-examples.js +438 -0
- package/dist/lib/version.d.ts +2 -0
- package/dist/lib/version.js +2 -0
- package/dist/lib/webhook-auth.d.ts +3 -0
- package/dist/lib/webhook-auth.js +34 -0
- package/dist/lib/webhook-routes.d.ts +2 -0
- package/dist/lib/webhook-routes.js +112 -0
- package/dist/lib/webhooks.d.ts +23 -0
- package/dist/lib/webhooks.js +123 -0
- package/dist/lib/webhooks.test.d.ts +1 -0
- package/dist/lib/webhooks.test.js +16 -0
- package/dist/lib/x402-client-options.d.ts +28 -0
- package/dist/lib/x402-client-options.js +138 -0
- package/dist/lib/x402-headers.d.ts +10 -0
- package/dist/lib/x402-headers.js +27 -0
- package/dist/lib/x402-paid.d.ts +5 -0
- package/dist/lib/x402-paid.js +252 -0
- package/dist/lib/x402-payment-replay.d.ts +22 -0
- package/dist/lib/x402-payment-replay.js +57 -0
- package/dist/lib/x402gle-host-verify.d.ts +3 -0
- package/dist/lib/x402gle-host-verify.js +27 -0
- package/dist/protocol/agent-passport.d.ts +34 -0
- package/dist/protocol/agent-passport.js +44 -0
- package/dist/protocol/compliance-v2.d.ts +21 -0
- package/dist/protocol/compliance-v2.js +19 -0
- package/dist/protocol/credit-bureau.d.ts +18 -0
- package/dist/protocol/credit-bureau.js +44 -0
- package/dist/protocol/crypto.d.ts +6 -0
- package/dist/protocol/crypto.js +41 -0
- package/dist/protocol/escrow-fsm.d.ts +33 -0
- package/dist/protocol/escrow-fsm.js +99 -0
- package/dist/protocol/fraud-engine.d.ts +28 -0
- package/dist/protocol/fraud-engine.js +77 -0
- package/dist/protocol/observability.d.ts +14 -0
- package/dist/protocol/observability.js +21 -0
- package/dist/protocol/pipeline-full-trust.d.ts +40 -0
- package/dist/protocol/pipeline-full-trust.js +96 -0
- package/dist/protocol/proof-of-execution.d.ts +36 -0
- package/dist/protocol/proof-of-execution.js +48 -0
- package/dist/protocol/reasoning-audit.d.ts +27 -0
- package/dist/protocol/reasoning-audit.js +51 -0
- package/dist/protocol/replay-guard.d.ts +28 -0
- package/dist/protocol/replay-guard.js +76 -0
- package/dist/protocol/replay-guard.test.d.ts +1 -0
- package/dist/protocol/replay-guard.test.js +10 -0
- package/dist/protocol/security-audit.d.ts +18 -0
- package/dist/protocol/security-audit.js +45 -0
- package/dist/protocol/store.d.ts +5 -0
- package/dist/protocol/store.js +59 -0
- package/dist/protocol/threat-catalog.d.ts +13 -0
- package/dist/protocol/threat-catalog.js +75 -0
- package/dist/protocol/trust-oracle.d.ts +23 -0
- package/dist/protocol/trust-oracle.js +30 -0
- package/dist/protocol/trust-score-v2.d.ts +33 -0
- package/dist/protocol/trust-score-v2.js +78 -0
- package/dist/protocol/zk-proofs.d.ts +24 -0
- package/dist/protocol/zk-proofs.js +32 -0
- package/dist/routes/a2a-agent-card.d.ts +3 -0
- package/dist/routes/a2a-agent-card.js +28 -0
- package/dist/routes/catalog.d.ts +5 -0
- package/dist/routes/catalog.js +47 -0
- package/dist/routes/register-all.d.ts +3 -0
- package/dist/routes/register-all.js +1240 -0
- package/dist/routes/schemas.d.ts +83 -0
- package/dist/routes/schemas.js +38 -0
- package/dist/routes/shared.d.ts +16 -0
- package/dist/routes/shared.js +27 -0
- package/dist/routes-protocol.d.ts +10 -0
- package/dist/routes-protocol.js +322 -0
- package/dist/routes.d.ts +2 -0
- package/dist/routes.js +2 -0
- package/dist/types.d.ts +66 -0
- package/dist/types.js +1 -0
- package/openapi.json +7940 -0
- package/package.json +124 -0
- package/public/.well-known/ai-plugin.json +12 -0
- package/public/assets/aegis-logo-blue.png +0 -0
- package/public/assets/aegis-logo-gold.png +0 -0
- package/public/assets/aegis-logo-green.png +0 -0
- package/public/assets/aegis-logo-purple.png +0 -0
- package/public/assets/aegis-logo-red.png +0 -0
- package/public/assets/aegis-logo-white.png +0 -0
- package/public/assets/aegis-logo.png +0 -0
- package/public/assets/x402-trustlayer-logo.png +0 -0
- package/public/assets/x402-trustlayer-logo.svg +5 -0
- package/public/data/agents.json +1528 -0
- package/public/index.html +198 -0
- package/public/landing.css +342 -0
- package/public/landing.js +405 -0
- package/public/llms-full.txt +582 -0
- package/public/llms.txt +132 -0
- package/public/skill.md +135 -0
- package/railway.toml +9 -0
- package/scripts/docker-entrypoint.sh +7 -0
- package/scripts/patch-facilitator-timeout.mjs +61 -0
package/public/llms.txt
ADDED
|
@@ -0,0 +1,132 @@
|
|
|
1
|
+
# x402 Trust Layer
|
|
2
|
+
|
|
3
|
+
> 58 paid x402 trust infrastructure APIs for AI agent fleets. Guard, attest, comply and audit every payment — before the money moves.
|
|
4
|
+
|
|
5
|
+
- Website: https://x402trustlayer.xyz
|
|
6
|
+
- OpenAPI: https://x402trustlayer.xyz/openapi.json
|
|
7
|
+
- Discovery: https://x402trustlayer.xyz/.well-known/x402
|
|
8
|
+
- Skill (agents): https://x402trustlayer.xyz/skill.md
|
|
9
|
+
- Full context: https://x402trustlayer.xyz/llms-full.txt
|
|
10
|
+
- MCP: npx @mimranakb/trust-layer-mcp@1.2.0 (trust_before_x402_fetch, trust_mandate_diff, trust_semantic_settle)
|
|
11
|
+
- npm: x402-agent-suite-preflight
|
|
12
|
+
- GitHub: https://github.com/mimranchohan/x402-trust-layer
|
|
13
|
+
|
|
14
|
+
## Default buyer flow (3 steps)
|
|
15
|
+
|
|
16
|
+
1. POST /api/x402/proxy — preflight ($0.08)
|
|
17
|
+
2. x402_check → x402_fetch on external marketplace URL
|
|
18
|
+
3. POST /api/receipt-auditor/verify — settlement proof ($0.05)
|
|
19
|
+
|
|
20
|
+
## Primary entry points
|
|
21
|
+
|
|
22
|
+
| Method | Path | Price | Purpose |
|
|
23
|
+
|--------|------|-------|---------|
|
|
24
|
+
|
|
25
|
+
|
|
26
|
+
## Tier-1 enterprise
|
|
27
|
+
|
|
28
|
+
| Method | Path | Price | Purpose |
|
|
29
|
+
|--------|------|-------|---------|
|
|
30
|
+
| POST | /api/merchant-trust/score | $0.06 | Know-Your-Merchant trust score with wash-trading and verification signals. |
|
|
31
|
+
| POST | /api/mandate/compile | $0.08 | Compiles AP2-style signed payment mandate from human intent and guardrails. |
|
|
32
|
+
| POST | /api/mandate/verify | $0.02 | Verifies mandate signature and scopes a proposed payment against it. |
|
|
33
|
+
| POST | /api/rail-optimizer/route | $0.04 | Picks best rail: Visa CLI, Stripe MPP, Circle, Base x402 or Solana x402. |
|
|
34
|
+
| POST | /api/compliance/ledger | $0.12 | SOC2/tax-ready spend reconciliation with policy flags and tamper hash. |
|
|
35
|
+
| POST | /api/dispute/resolve | $0.10 | Visa chargeback dossier or on-chain refund claim builder. |
|
|
36
|
+
| POST | /api/quality-escrow/settle | $0.10 | Quality-gated escrow — release on pass, auto-refund on response mismatch. |
|
|
37
|
+
| POST | /api/quality-escrow/semantic-settle | $0.12 | Schema + intent rubric escrow with optional LLM judge and auto bond slash. |
|
|
38
|
+
| POST | /api/mandate/diff | $0.04 | Compare signed mandate scope to MCP tool trace before payment. |
|
|
39
|
+
| POST | /api/merchant-trust/certify | $0.15 | Certify seller with KYM pass, badge, buyer policy, optional virtual bond. |
|
|
40
|
+
| POST | /api/trust-network/buyer-gate | $0.03 | Verify buyer attestation and tier against certified seller policy. |
|
|
41
|
+
| POST | /api/pipeline/trust-v2 | $0.35 | One-shot: mandate diff + KYM ingest + guard + certified buyer gate. |
|
|
42
|
+
| POST | /api/trust-network/bond/slash | $0.03 | Slash certified seller virtual bond after failed delivery. |
|
|
43
|
+
|
|
44
|
+
## All 58 paid routes
|
|
45
|
+
|
|
46
|
+
| Method | Path | Price | Summary |
|
|
47
|
+
|--------|------|-------|---------|
|
|
48
|
+
| POST | /api/a2a/execute | $0.10 | Agent-to-agent x402 orchestration: trust preflight then paid call to seller endpoint |
|
|
49
|
+
| POST | /api/bedrock/preflight | $0.05 | AWS Bedrock / enterprise agent preflight: guard, mandate, and trust bundle before x402 pay |
|
|
50
|
+
| POST | /api/market/buy-advisor | $0.08 | Jupiter-style buy quote — ranks paid APIs for an intent with policy and MPP advice. |
|
|
51
|
+
| POST | /api/seller/audition-coach | $0.06 | Pre-listing QA: audits OpenAPI, discovery manifests and 402 probes. |
|
|
52
|
+
| POST | /api/x402/proxy | $0.08 | All-in-one preflight before any external x402 payment — policy, identity, risk, security grade and optional attestation. |
|
|
53
|
+
| POST | /api/mpp/session | $0.03 | MPP session lifecycle: open, voucher, close — batch settlement on Base/Solana. |
|
|
54
|
+
| POST | /api/attestation/issue | $0.04 | Issues HMAC-signed preflight attestation for partner agent networks. |
|
|
55
|
+
| POST | /api/attestation/verify | $0.02 | Verifies attestation signature, expiry and registry lookup. |
|
|
56
|
+
| GET | /api/attestation/registry | $0.02 | Query trust registry of valid agent attestations. |
|
|
57
|
+
| POST | /api/guard/pre-x402 | $0.05 | Spend governor + identity gate + risk gate in one lightweight call. |
|
|
58
|
+
| POST | /api/agent/verify | $0.04 | ERC-8004 TrustScore on Base mainnet — registration, reputation, wallet binding, agent card, domain. |
|
|
59
|
+
| POST | /api/pipeline/execute | $0.25 | One-shot orchestration: guard, NL plan, facilitator routing and marketplace pick. |
|
|
60
|
+
| POST | /api/payment-intent/compile | $0.15 | Compiles natural-language task + budget into a multi-step x402 execution plan. |
|
|
61
|
+
| POST | /api/facilitator/failover | $0.05 | Ranks x402 facilitators and recommends a healthy failover route. |
|
|
62
|
+
| POST | /api/mpp/session-plan | $0.02 | Estimates MPP batch session savings vs per-call settlement. |
|
|
63
|
+
| POST | /api/spend-governor/check | $0.03 | Enforces per-call and daily USDC spend caps per agent. |
|
|
64
|
+
| POST | /api/identity-gate/check | $0.05 | Wallet identity tier and risk scoring before paid calls. |
|
|
65
|
+
| POST | /api/risk-gate/scan | $0.08 | Probes URL safety, HTTPS and x402 payment requirements. |
|
|
66
|
+
| POST | /api/router/route | $0.02 | Routes capability queries to the best verified x402 marketplace API. |
|
|
67
|
+
| POST | /api/research/brief | $0.20 | Builds a paid-API research pipeline and cost estimate for any topic. |
|
|
68
|
+
| POST | /api/receipt-auditor/verify | $0.05 | Verifies x402 settlement receipts and on-chain transaction alignment. |
|
|
69
|
+
| POST | /api/refund-arbiter/evaluate | $0.08 | Evaluates buyer refund eligibility from verification signals. |
|
|
70
|
+
| POST | /api/budget-allocator/run | $0.03 | Allocates shared USDC pool across agent fleet by priority. |
|
|
71
|
+
| POST | /api/settlement-graph/next | $0.02 | Recommends next paid APIs to call after a settlement receipt. |
|
|
72
|
+
| POST | /api/quality-monitor/probe | $0.03 | Regression-probes up to 10 x402 endpoints and returns quality scores. |
|
|
73
|
+
| POST | /api/evidence-locker/export | $0.10 | Exports tamper-evident compliance bundles for x402 settlements. |
|
|
74
|
+
| POST | /api/agent-escrow | $0.12 | Create, status or release agent-to-agent USDC escrow records. |
|
|
75
|
+
| POST | /api/merchant-trust/score | $0.06 | Know-Your-Merchant trust score with wash-trading and verification signals. |
|
|
76
|
+
| POST | /api/mandate/compile | $0.08 | Compiles AP2-style signed payment mandate from human intent and guardrails. |
|
|
77
|
+
| POST | /api/mandate/verify | $0.02 | Verifies mandate signature and scopes a proposed payment against it. |
|
|
78
|
+
| POST | /api/rail-optimizer/route | $0.04 | Picks best rail: Visa CLI, Stripe MPP, Circle, Base x402 or Solana x402. |
|
|
79
|
+
| POST | /api/compliance/ledger | $0.12 | SOC2/tax-ready spend reconciliation with policy flags and tamper hash. |
|
|
80
|
+
| POST | /api/dispute/resolve | $0.10 | Visa chargeback dossier or on-chain refund claim builder. |
|
|
81
|
+
| POST | /api/quality-escrow/settle | $0.10 | Quality-gated escrow — release on pass, auto-refund on response mismatch. |
|
|
82
|
+
| POST | /api/quality-escrow/semantic-settle | $0.12 | Schema + intent rubric escrow with optional LLM judge and auto bond slash. |
|
|
83
|
+
| POST | /api/mandate/diff | $0.04 | Compare signed mandate scope to MCP tool trace before payment. |
|
|
84
|
+
| POST | /api/merchant-trust/certify | $0.15 | Certify seller with KYM pass, badge, buyer policy, optional virtual bond. |
|
|
85
|
+
| POST | /api/trust-network/buyer-gate | $0.03 | Verify buyer attestation and tier against certified seller policy. |
|
|
86
|
+
| POST | /api/pipeline/trust-v2 | $0.35 | One-shot: mandate diff + KYM ingest + guard + certified buyer gate. |
|
|
87
|
+
| POST | /api/trust-network/bond/slash | $0.03 | Slash certified seller virtual bond after failed delivery. |
|
|
88
|
+
| POST | /api/protocol/pipeline/full-trust | $0.45 | Agent Trust Protocol v4 full pipeline before x402 payment |
|
|
89
|
+
| POST | /api/protocol/passport/issue | $0.06 | Issue Agent Passport DID verifiable credential |
|
|
90
|
+
| POST | /api/protocol/passport/verify | $0.02 | Verify Agent Passport credential signature |
|
|
91
|
+
| POST | /api/protocol/trust-score/v2 | $0.08 | TrustScore v2 with tamper-resistant HMAC proof |
|
|
92
|
+
| POST | /api/protocol/fraud/scan | $0.10 | Graph fraud scan for Sybil and wash trading |
|
|
93
|
+
| POST | /api/protocol/oracle/consensus | $0.12 | Trust oracle quorum consensus |
|
|
94
|
+
| POST | /api/protocol/execution/issue | $0.05 | Proof of Execution task receipt |
|
|
95
|
+
| POST | /api/protocol/execution/verify | $0.03 | Verify Proof of Execution receipt |
|
|
96
|
+
| POST | /api/protocol/reasoning/commit | $0.08 | Commit reasoning audit Merkle tree |
|
|
97
|
+
| POST | /api/protocol/reasoning/disclose | $0.04 | Selective disclosure of reasoning audit leaves |
|
|
98
|
+
| POST | /api/protocol/escrow/create | $0.08 | Create escrow FSM (CREATED) |
|
|
99
|
+
| POST | /api/protocol/escrow/transition | $0.06 | Transition escrow FSM state |
|
|
100
|
+
| POST | /api/protocol/escrow/status | $0.02 | Query escrow FSM status |
|
|
101
|
+
| POST | /api/protocol/replay/bind | $0.02 | Replay-safe payment binding |
|
|
102
|
+
| POST | /api/protocol/replay/verify | $0.02 | Verify and consume replay binding |
|
|
103
|
+
| POST | /api/protocol/zk/prove | $0.15 | ZK-style proof of budget, reputation, or compliance |
|
|
104
|
+
| POST | /api/protocol/credit/score | $0.06 | AI Agent Credit Bureau 300-900 |
|
|
105
|
+
| POST | /api/protocol/compliance/assess | $0.10 | Enterprise AML/KYC compliance assess |
|
|
106
|
+
|
|
107
|
+
## Free endpoints (no x402 payment)
|
|
108
|
+
|
|
109
|
+
| Method | Path | Purpose |
|
|
110
|
+
|--------|------|---------|
|
|
111
|
+
| GET | /health | Monitoring |
|
|
112
|
+
| GET | /.well-known/x402 | Paid URL catalog |
|
|
113
|
+
| GET | /llms.txt | AI index (this file) |
|
|
114
|
+
| GET | /skill.md | Agent skill file |
|
|
115
|
+
| GET | /api/agentic/validate-urls | Agentic Market URL list |
|
|
116
|
+
| POST | /api/webhooks/register | Fleet webhook registration (beta) |
|
|
117
|
+
| GET | /api/agent/lookup/:wallet | Free ERC-8004 TrustScore lookup (30/hr/IP) |
|
|
118
|
+
| GET | /api/merchant-trust/certified/:host | Certified seller badge lookup |
|
|
119
|
+
| GET | /api/trust-network/catalog | Certified sellers catalog |
|
|
120
|
+
| GET | /api/webhooks/list | List webhooks |
|
|
121
|
+
|
|
122
|
+
## Networks
|
|
123
|
+
|
|
124
|
+
Mainnet: Base (eip155:8453), Solana, Polygon (eip155:137) — USDC via Dexter or CDP facilitator.
|
|
125
|
+
Testnet: set X402_TESTNET=1 → Base Sepolia + Solana Devnet via https://x402.org/facilitator
|
|
126
|
+
|
|
127
|
+
## Agentic Wallet integration
|
|
128
|
+
|
|
129
|
+
Coinbase Agentic Wallet MCP pays for x402 services. Call Trust Layer guard BEFORE payments-mcp pays:
|
|
130
|
+
POST /api/guard/pre-x402 → then Agentic Wallet discovers and pays downstream.
|
|
131
|
+
|
|
132
|
+
See: docs/AGENTIC-WALLET.md
|
package/public/skill.md
ADDED
|
@@ -0,0 +1,135 @@
|
|
|
1
|
+
# x402 Trust Layer Skill
|
|
2
|
+
|
|
3
|
+
## Product Summary
|
|
4
|
+
|
|
5
|
+
x402 Trust Layer is the **control plane** between AI agents and the open x402 marketplace. 58 paid HTTP APIs decide whether to pay, whom to trust, which rail to use, and how to audit or dispute settlements. No API keys — USDC micropayments on Base, Solana, and Polygon.
|
|
6
|
+
|
|
7
|
+
- **Base URL:** https://x402trustlayer.xyz
|
|
8
|
+
- **OpenAPI:** https://x402trustlayer.xyz/openapi.json
|
|
9
|
+
- **Discovery:** https://x402trustlayer.xyz/.well-known/x402
|
|
10
|
+
- **Install skill:** `npx skills add https://x402trustlayer.xyz`
|
|
11
|
+
|
|
12
|
+
## When to Use
|
|
13
|
+
|
|
14
|
+
- Before any external `x402_fetch` to an unknown marketplace host
|
|
15
|
+
- Fleet spend policy enforcement (daily/per-call caps)
|
|
16
|
+
- Know-Your-Merchant trust scoring before payment
|
|
17
|
+
- AP2-style signed payment mandates for enterprise agents
|
|
18
|
+
- Receipt verification and SOC2/CFO compliance ledgers
|
|
19
|
+
- Disputes, quality escrow, cross-rail routing (Visa CLI, MPP, USDC)
|
|
20
|
+
- With **Coinbase Agentic Wallet MCP** — always preflight first
|
|
21
|
+
|
|
22
|
+
## Quick Reference
|
|
23
|
+
|
|
24
|
+
### Default 3-step buyer flow
|
|
25
|
+
|
|
26
|
+
```text
|
|
27
|
+
1. POST /api/x402/proxy ($0.08) — preflight
|
|
28
|
+
2. x402_check → x402_fetch (external API)
|
|
29
|
+
3. POST /api/receipt-auditor/verify ($0.05) — proof
|
|
30
|
+
```
|
|
31
|
+
|
|
32
|
+
### Primary entry points
|
|
33
|
+
|
|
34
|
+
| Path | Price | Use when |
|
|
35
|
+
|------|-------|----------|
|
|
36
|
+
| POST /api/x402/proxy | $0.08 | Default all-in-one preflight |
|
|
37
|
+
| POST /api/guard/pre-x402 | $0.05 | Lightweight allow/deny |
|
|
38
|
+
| POST /api/pipeline/execute | $0.25 | NL task + marketplace routing |
|
|
39
|
+
|
|
40
|
+
### Tier-1 enterprise
|
|
41
|
+
|
|
42
|
+
| Path | Price | Purpose |
|
|
43
|
+
|------|-------|----------|
|
|
44
|
+
| POST /api/merchant-trust/score | $0.06 | KYM trust — pay/caution/avoid |
|
|
45
|
+
| POST /api/mandate/compile | $0.08 | Signed AP2 payment mandate |
|
|
46
|
+
| POST /api/mandate/verify | $0.02 | Verify payment within mandate |
|
|
47
|
+
| POST /api/rail-optimizer/route | $0.04 | Visa CLI vs MPP vs Base/Solana |
|
|
48
|
+
| POST /api/compliance/ledger | $0.12 | CFO/SOC2 reconciliation |
|
|
49
|
+
| POST /api/dispute/resolve | $0.10 | Chargeback dossier / refund claim |
|
|
50
|
+
| POST /api/quality-escrow/settle | $0.10 | Pay-on-delivery + auto-refund |
|
|
51
|
+
| POST /api/agent/verify | $0.04 | ERC-8004 TrustScore (Base mainnet) |
|
|
52
|
+
|
|
53
|
+
## ERC-8004 Agent Verify
|
|
54
|
+
|
|
55
|
+
```text
|
|
56
|
+
POST /api/agent/verify { walletAddress, agentId?, chain? } → trustScore, tier, breakdown
|
|
57
|
+
GET /api/agent/lookup/:wallet?agentId=1 → free (30/hr/IP)
|
|
58
|
+
```
|
|
59
|
+
|
|
60
|
+
Tiers: PLATINUM ≥85 | GOLD ≥70 | SILVER ≥50 | BRONZE ≥30 | UNVERIFIED <30
|
|
61
|
+
|
|
62
|
+
Pair with guard: `POST /api/guard/pre-x402` + `minAgentTier: "SILVER"`
|
|
63
|
+
|
|
64
|
+
1. `POST /api/mandate/compile` — human intent → signed scope
|
|
65
|
+
2. `POST /api/merchant-trust/score` — KYM on target host
|
|
66
|
+
3. `POST /api/rail-optimizer/route` — pick best payment rail
|
|
67
|
+
4. `POST /api/x402/proxy` — preflight (spend + identity + risk)
|
|
68
|
+
5. External `x402_fetch` on marketplace URL
|
|
69
|
+
6. `POST /api/quality-escrow/settle` — verify response quality
|
|
70
|
+
7. `POST /api/receipt-auditor/verify` — on-chain proof
|
|
71
|
+
8. `POST /api/compliance/ledger` — audit record
|
|
72
|
+
|
|
73
|
+
## Agentic Wallet MCP integration
|
|
74
|
+
|
|
75
|
+
Coinbase `npx @coinbase/payments-mcp` gives agents wallet + x402 pay. **Always call Trust Layer first:**
|
|
76
|
+
|
|
77
|
+
```text
|
|
78
|
+
User task → POST /api/guard/pre-x402 (Trust Layer)
|
|
79
|
+
→ if allowed: Agentic Wallet MCP discovers + pays external API
|
|
80
|
+
→ POST /api/receipt-auditor/verify (Trust Layer)
|
|
81
|
+
```
|
|
82
|
+
|
|
83
|
+
Spend limits: configure in Agentic Wallet UI; enforce policy in Trust Layer `policy` object.
|
|
84
|
+
|
|
85
|
+
## Alchemy Agentic Gateway (x402.alchemy.com)
|
|
86
|
+
|
|
87
|
+
```text
|
|
88
|
+
1. trust_alchemy_preflight OR POST /api/guard/pre-x402 (allowedHosts: ["x402.alchemy.com"])
|
|
89
|
+
2. Pay via @alchemy/x402 (USDC on Base)
|
|
90
|
+
3. trust_receipt_verify from PAYMENT-RESPONSE tx hash
|
|
91
|
+
4. (enterprise) POST /api/compliance/ledger
|
|
92
|
+
```
|
|
93
|
+
|
|
94
|
+
Demo: `npm run demo:alchemy` (~$1.10) | `npm run demo:alchemy:enterprise` (~$1.32)
|
|
95
|
+
Alchemy skill: `npx skills add alchemyplatform/skills --yes`
|
|
96
|
+
|
|
97
|
+
## MCP tools (@mimranakb/trust-layer-mcp v1.2.0)
|
|
98
|
+
|
|
99
|
+
| Tool | Maps to |
|
|
100
|
+
|------|---------|
|
|
101
|
+
| trust_agent_verify | POST /api/agent/verify |
|
|
102
|
+
| trust_alchemy_preflight | POST /api/guard/pre-x402 (Alchemy preset) |
|
|
103
|
+
| trust_preflight_proxy | POST /api/x402/proxy |
|
|
104
|
+
| trust_guard_preflight | POST /api/guard/pre-x402 |
|
|
105
|
+
| trust_merchant_score | POST /api/merchant-trust/score |
|
|
106
|
+
| trust_mandate_verify | POST /api/mandate/verify |
|
|
107
|
+
| trust_receipt_verify | POST /api/receipt-auditor/verify |
|
|
108
|
+
|
|
109
|
+
Setup: `EVM_PRIVATE_KEY` or `SOLANA_PRIVATE_KEY` in env. Run: `npx @mimranakb/trust-layer-mcp@1.2.0`
|
|
110
|
+
|
|
111
|
+
## npm helper
|
|
112
|
+
|
|
113
|
+
```bash
|
|
114
|
+
npm install x402-agent-suite-preflight @dexterai/x402
|
|
115
|
+
```
|
|
116
|
+
|
|
117
|
+
## Idempotency
|
|
118
|
+
|
|
119
|
+
Paid POST retries: send `Idempotency-Key: <uuid>` with the same body after payment.
|
|
120
|
+
|
|
121
|
+
## Webhooks (beta)
|
|
122
|
+
|
|
123
|
+
`POST /api/webhooks/register` with fleetId, url, events[].
|
|
124
|
+
|
|
125
|
+
## Common Gotchas
|
|
126
|
+
|
|
127
|
+
- Unpaid POST → HTTP 402. Retry with Payment-Signature after USDC settles.
|
|
128
|
+
- Testnet: `X402_TESTNET=1` + x402.org facilitator.
|
|
129
|
+
- Production requires `ATTESTATION_HMAC_SECRET` (32+ chars).
|
|
130
|
+
|
|
131
|
+
## Resources
|
|
132
|
+
|
|
133
|
+
- Full catalog: https://x402trustlayer.xyz/llms-full.txt
|
|
134
|
+
- Integration: docs/INTEGRATE.md on GitHub
|
|
135
|
+
- Agentic Wallet: docs/AGENTIC-WALLET.md on GitHub
|
package/railway.toml
ADDED
|
@@ -0,0 +1,61 @@
|
|
|
1
|
+
/**
|
|
2
|
+
* Dexter facilitator /settle: raise HTTP timeout and cap retries (avoids 55s+ hangs → Railway 504).
|
|
3
|
+
* Env: X402_FACILITATOR_TIMEOUT_MS (default 25000), X402_FACILITATOR_MAX_RETRIES (default 1).
|
|
4
|
+
*/
|
|
5
|
+
import fs from "node:fs";
|
|
6
|
+
import path from "node:path";
|
|
7
|
+
import { fileURLToPath } from "node:url";
|
|
8
|
+
|
|
9
|
+
const root = path.dirname(fileURLToPath(import.meta.url));
|
|
10
|
+
const pkgRoot = path.join(root, "..", "node_modules", "@dexterai", "x402", "dist", "server");
|
|
11
|
+
const targets = ["index.js", "index.cjs"].map((f) => path.join(pkgRoot, f));
|
|
12
|
+
|
|
13
|
+
const timeoutDefault =
|
|
14
|
+
"(Number(process.env.X402_FACILITATOR_TIMEOUT_MS)||25e3)";
|
|
15
|
+
const maxRetriesDefault =
|
|
16
|
+
"(Number(process.env.X402_FACILITATOR_MAX_RETRIES)||1)";
|
|
17
|
+
|
|
18
|
+
/** @type {{ from: string; to: string }[]} */
|
|
19
|
+
const replacements = [
|
|
20
|
+
{
|
|
21
|
+
from: "this.timeoutMs=n?.timeoutMs??1e4",
|
|
22
|
+
to: `this.timeoutMs=n?.timeoutMs??${timeoutDefault}`,
|
|
23
|
+
},
|
|
24
|
+
{
|
|
25
|
+
from: "this.timeoutMs = config?.timeoutMs ?? 1e4",
|
|
26
|
+
to: `this.timeoutMs = config?.timeoutMs ?? ${timeoutDefault}`,
|
|
27
|
+
},
|
|
28
|
+
{
|
|
29
|
+
from: "this.maxRetries = config?.maxRetries ?? 3",
|
|
30
|
+
to: `this.maxRetries = config?.maxRetries ?? ${maxRetriesDefault}`,
|
|
31
|
+
},
|
|
32
|
+
];
|
|
33
|
+
|
|
34
|
+
let patched = 0;
|
|
35
|
+
for (const file of targets) {
|
|
36
|
+
if (!fs.existsSync(file)) continue;
|
|
37
|
+
let src = fs.readFileSync(file, "utf8");
|
|
38
|
+
if (src.includes("X402_FACILITATOR_TIMEOUT_MS")) {
|
|
39
|
+
patched += 1;
|
|
40
|
+
continue;
|
|
41
|
+
}
|
|
42
|
+
let changed = false;
|
|
43
|
+
for (const { from, to } of replacements) {
|
|
44
|
+
if (src.includes(from)) {
|
|
45
|
+
src = src.replaceAll(from, to);
|
|
46
|
+
changed = true;
|
|
47
|
+
}
|
|
48
|
+
}
|
|
49
|
+
if (!changed) {
|
|
50
|
+
console.warn(`[patch-facilitator-timeout] pattern not found in ${path.basename(file)}`);
|
|
51
|
+
continue;
|
|
52
|
+
}
|
|
53
|
+
fs.writeFileSync(file, src);
|
|
54
|
+
patched += 1;
|
|
55
|
+
}
|
|
56
|
+
|
|
57
|
+
if (patched === 0) {
|
|
58
|
+
console.warn("[patch-facilitator-timeout] no files patched — check @dexterai/x402 version");
|
|
59
|
+
process.exit(0);
|
|
60
|
+
}
|
|
61
|
+
console.log(`[patch-facilitator-timeout] patched ${patched} file(s), timeout 25s, maxRetries 1`);
|