Skip to content

About

MolTrust trust verification middleware for x402 payments — npm install @moltrust/x402

Resources

Stars

2 stars

Watchers

0 watching

Forks

Repository files navigation

@moltrust/x402

MolTrust trust verification middleware for x402 payments. Checks the paying agent's MoltGuard reputation score before allowing payment flow.

Install

npm install @moltrust/x402

Hono

import { Hono } from "hono";
import { moltrustGuard } from "@moltrust/x402";

const app = new Hono();
app.use(moltrustGuard({ minScore: 50 }));

Express

import express from "express";
import { moltrustGuard } from "@moltrust/x402/express";

const app = express();
app.use(moltrustGuard({ minScore: 50 }));

How it works

  1. Extracts wallet address from the X-PAYMENT header
  2. Calls MoltGuard's free agent scoring endpoint
  3. Returns 403 if score is below minScore
  4. Passes through if score is OK
  5. Fails open if MoltGuard is unreachable (never blocks payments on downtime)

Options

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

Security advisory 2026-10-25: self-issued credential types in gate attestations, @moltrust/x402 2.0.0 with credentialType or requiredCredentials.

License

MIT — moltrust.ch

About

MolTrust trust verification middleware for x402 payments — npm install @moltrust/x402

Resources

Stars

2 stars

Watchers

0 watching

Forks

Releases

Packages

Contributors

Languages