MPP — Machine Payments Protocol
"MPP" is the ecosystem name for HTTP payment authentication using the WWW-Authenticate: payment challenge scheme (draft-ryan-httpauth-payment). In PEAC it is implemented by the @peac/mappings-paymentauth package, which maps payment challenges, credentials, and receipts to portable signed records.
Canonical guide
MPP and paymentauth are the same package. The maintained, full integration guide with runnable code lives at paymentauth. This page summarizes how the ecosystem "MPP" name maps onto it.
Install
pnpm add @peac/mappings-paymentauth @peac/protocolWhat the package provides
@peac/mappings-paymentauth parses HTTP payment authentication artifacts and maps them to PEAC commerce evidence:
| Export | Purpose |
|---|---|
| parsePaymentauthChallenges | Parse WWW-Authenticate: payment challenge headers |
| parsePaymentauthReceipt | Parse a payment receipt artifact returned by the server |
| fromMPPPaymentAttempt | Map an observed MPP payment attempt to commerce evidence |
| fromMPPSettlement | Map an observed MPP settlement to commerce evidence |
| fromPaymentauthReceipt | Map a parsed paymentauth receipt to commerce evidence |
| parsePaymentauthFromJsonRpcError | Extract a payment challenge from a JSON-RPC error |
JSON-RPC and MCP transports
For JSON-RPC and MCP transports, payment-required and verification-failed conditions use dedicated error codes:
JSONRPC_PAYMENT_REQUIRED = -32042
JSONRPC_VERIFICATION_FAILED = -32043What PEAC does and does not do
PEAC records and verifies observations of MPP payment challenges, attempts, and settlements. It does not settle payments, custody funds, process transactions, or act as a payment facilitator. A settlement record proves what the server attested, not more.