Skip to content
v0.15.2Package availableRecord category

Gateway Decision Records

Record evidence for gateway decisions: x402 payment-settlement state, recovery transitions, and facilitator timeouts. The gateway is the issuer; a downstream system can verify the record offline. PEAC observes and exports the state the gateway reported; it does not make the decision.

Packages: @peac/adapter-x402, @peac/schema

Gateway export records

The org.peacprotocol/gateway-export extension group covers the x402 settlement-and-recovery state machine across eight observed event kinds. Validate with validateGatewayExport() from @peac/schema before issuing.

Type URIRecords
org.peacprotocol/gateway-payment-submitted-observedA payment was submitted to the gateway
org.peacprotocol/gateway-settlement-unresolved-observedSettlement state is not yet resolved
org.peacprotocol/gateway-settlement-polling-observedThe gateway is polling for settlement
org.peacprotocol/gateway-settlement-confirmed-observedSettlement confirmed
org.peacprotocol/gateway-settlement-confirmed-late-observedSettlement confirmed after the expected window
org.peacprotocol/gateway-settlement-failed-observedSettlement failed
org.peacprotocol/gateway-settlement-failed-orphaned-observedSettlement failed and was orphaned
org.peacprotocol/gateway-facilitator-timeout-observedThe settlement facilitator timed out

x402 payment flow records

Map an x402 settlement response into a record and issue it on the gateway response header. The adapter supports x402 v1 and v2 with dual-header read.

gateway-x402.tsTypeScript
import { fromSettlementResponse } from '@peac/adapter-x402';
import { issue } from '@peac/protocol';

const claims = fromSettlementResponse(settlementResponse, { iss, sub });
const signed = await issue(claims, privateKey);
res.setHeader('PEAC-Receipt', signed);

The dual-header read precedence is PEAC-Receipt over PAYMENT-RESPONSE over X-PAYMENT-RESPONSE.

Single canonical money field

Gateway export records carry amounts as amount_minor (a non-negative decimal string); other money fields are rejected. Raw transaction payloads, nonces, and payer or pay-to material are blocked from the top level: the record carries opaque references, not settlement internals.

Semantic Boundary

PEAC records gateway evidence. It does not route requests, enforce policy, manage gateway processes, or settle payments; those remain the responsibility of the gateway. A gateway decision record proves what the gateway reported about a settlement state, not more.

Links

Portable Settlement Evidence

A signed gateway record lets a counterparty confirm a settlement state offline, with only the issuer's public key. The same record format travels across x402, MCP, and HTTP.