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 URI | Records |
|---|---|
org.peacprotocol/gateway-payment-submitted-observed | A payment was submitted to the gateway |
org.peacprotocol/gateway-settlement-unresolved-observed | Settlement state is not yet resolved |
org.peacprotocol/gateway-settlement-polling-observed | The gateway is polling for settlement |
org.peacprotocol/gateway-settlement-confirmed-observed | Settlement confirmed |
org.peacprotocol/gateway-settlement-confirmed-late-observed | Settlement confirmed after the expected window |
org.peacprotocol/gateway-settlement-failed-observed | Settlement failed |
org.peacprotocol/gateway-settlement-failed-orphaned-observed | Settlement failed and was orphaned |
org.peacprotocol/gateway-facilitator-timeout-observed | The 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.
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.