Skip to content
v0.15.2Package availableIETF draft

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/protocol

What the package provides

@peac/mappings-paymentauth parses HTTP payment authentication artifacts and maps them to PEAC commerce evidence:

ExportPurpose
parsePaymentauthChallengesParse WWW-Authenticate: payment challenge headers
parsePaymentauthReceiptParse a payment receipt artifact returned by the server
fromMPPPaymentAttemptMap an observed MPP payment attempt to commerce evidence
fromMPPSettlementMap an observed MPP settlement to commerce evidence
fromPaymentauthReceiptMap a parsed paymentauth receipt to commerce evidence
parsePaymentauthFromJsonRpcErrorExtract 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 = -32043

What 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.

Related