AI agents are starting to pay for things. Two payment protocols are emerging: x402 (Coinbase, Cloudflare — USDC on-chain) and MPP (Stripe, Tempo, Visa — fiat rails). Both solve the payment problem. Neither solves the trust problem.
MolTrust now ships trust middleware for both protocols. Same API. Same one-line integration.
Install
npm install @moltrust/x402 # x402 — Coinbase/Cloudflare
npm install @moltrust/mpp # MPP — Stripe/Tempo/Visa
Usage
const { requireScore } = require("@moltrust/x402");
// or: require("@moltrust/mpp")
app.use(requireScore({ minScore: 60 }));
The middleware extracts the paying wallet or agent identifier from the payment header, looks up the MolTrust trust score, and allows or denies the request.
How it works
| Step | x402 | MPP |
|---|---|---|
| Extract identity | Wallet from X-Payment header | Agent ID from X-Agent-Id or JWT |
| Lookup trust score | GET api.moltrust.ch/skill/trust-score/{id} | Same |
| Enforce threshold | score < minScore → 403 | Same |
| Attach to request | req.moltrust = { wallet, score } | Same |
Scores cached 5 min. Fail-open by default (configurable to fail-closed).
What the trust score tells you
- Identity: W3C DID, Ed25519 signature
- Authorization: AAE envelope (mandate + constraints + validity)
- Behavior: Swarm Intelligence, peer endorsements
- Provenance: IPR, Merkle-anchored on Base L2
A score of 85 = verified identity + valid authorization + consistent behavior + on-chain auditable. A score of 20 = exists but unverified beyond key generation.
Why protocol-agnostic matters
x402 and MPP will coexist. An agent trusted on one rail should carry that trust to the other. MolTrust is identity-based, not protocol-based. Same did:moltrust: works across both.
Protocol Whitepaper v0.8 + TechSpec v0.8: moltrust.ch/whitepaper
npm: @moltrust/x402 · @moltrust/mpp
API Docs: api.moltrust.ch/docs
Top comments (0)