MPP + Grantex

Agent Identity for Machine Payments

For configured MPP requests, Grantex passports carry signed principal, organization, and policy claims. Merchants must still validate the payment, enforce limits, and refresh key and revocation status material.

The Problem

Without Grantex

When an agent makes an MPP payment, the source is just a wallet address. No human name, no org, no authorization chain. As transaction value and procurement risk increase, missing principal and policy context can become a security or compliance concern.

With Grantex

A configured MPP request can carry an AgentPassportCredential with principal, organization, category, and limit claims. Merchants validate the credential with obtained keys and separately enforce the payment request.

How Grantex Works with MPP

Install the package

npm install @grantex/mpp — agent-side middleware + merchant-side verification in one package.

Issue an agent passport

Call grantex.passports.issue() with categories (inference, compute, data), spending limits, and expiry.

Attach to MPP requests

createMppPassportMiddleware() adds the X-Grantex-Passport header to requests that pass through the configured middleware.

Verify on the merchant side

requireAgentPassport() can validate passport signatures and claims at an Express boundary; the merchant still enforces the requested category and amount.

Check the trust registry

lookupOrgTrust() returns the public organization record and current DNS-backed trust level.

Quick Start

npm install @grantex/mpp @grantex/sdk
import { Grantex } from '@grantex/sdk';
import { createMppPassportMiddleware, requireAgentPassport } from '@grantex/mpp';

// Agent side: issue passport and attach to requests
const grantex = new Grantex({ apiKey: process.env.GRANTEX_API_KEY });
const passport = await grantex.passports.issue({
  agentId: 'ag_01HXYZ...',
  grantId: 'grnt_01HXYZ...',
  allowedMPPCategories: ['inference', 'compute'],
  maxTransactionAmount: { amount: 50, currency: 'USDC' },
  expiresIn: '24h',
});

const middleware = createMppPassportMiddleware({ passport });
const enriched = await middleware(new Request(url));
// X-Grantex-Passport header attached

// Merchant side: validate the passport, then enforce payment policy
app.use('/api/inference', requireAgentPassport({
  requiredCategories: ['inference'],
  maxAmount: 10,
}));
// req.agentPassport → { humanDID, orgDID, categories, maxAmount, ... }

Why Grantex for MPP (Machine Payments Protocol)

AgentPassportCredential

W3C VC 2.0 with agent DID, human principal, org, categories, spending limits, and delegation depth.

Local Verification

Signature verification can reuse cached JWKS after keys are obtained; initial retrieval and key-rotation refreshes require network access.

9 MPP Categories

inference, compute, data, storage, search, media, delivery, browser, general — each maps to a Grantex scope.

StatusList2021 Revocation

Publish passport revocation state through a status list that verifiers can refresh and cache.

Trust Registry

Public organization lookup by DID with DNS TXT domain verification.

Auto-Refresh

Middleware proactively refreshes passports before expiry via onRefresh callback.

Credential and enforcement boundary

AgentPassportCredential verification establishes signed identity and policy claims after key and status material are obtained. The merchant still must enforce category and amount limits at the protected action, refresh revocation status according to policy, and keep payment or order execution in its own trusted system.

Ready to secure your MPP agents?

Follow the integration guide and verify the package version before deployment. Apache 2.0.