MolTrust trust verification middleware for x402 payments. Checks the paying agent's MoltGuard reputation score before allowing payment flow.
npm install @moltrust/x402import { Hono } from "hono";
import { moltrustGuard } from "@moltrust/x402";
const app = new Hono();
app.use(moltrustGuard({ minScore: 50 }));import express from "express";
import { moltrustGuard } from "@moltrust/x402/express";
const app = express();
app.use(moltrustGuard({ minScore: 50 }));- Extracts wallet address from the
X-PAYMENTheader - Calls MoltGuard's free agent scoring endpoint
- Returns
403if score is belowminScore - Passes through if score is OK
- Fails open if MoltGuard is unreachable (never blocks payments on downtime)
| Option | Type | Default | Description |
|---|---|---|---|
minScore |
number |
50 |
Minimum score (0–100) to allow |
apiUrl |
string |
https://api.moltrust.ch/guard |
MoltGuard API base URL |
timeout |
number |
3000 |
Timeout in ms |
Security advisory 2026-10-25: self-issued credential types in gate attestations, @moltrust/x402 2.0.0 with credentialType or requiredCredentials.
MIT — moltrust.ch