Skip to content

feat(adapter): track current x402 offer-receipt extension#511

Merged
jithinraj merged 3 commits intomainfrom
feat/x402-offer-receipt-tracking
Mar 13, 2026
Merged

feat(adapter): track current x402 offer-receipt extension#511
jithinraj merged 3 commits intomainfrom
feat/x402-offer-receipt-tracking

Conversation

@jithinraj
Copy link
Member

Summary

Update @peac/adapter-x402 to track the current x402 offer-receipt extension at the raw wire layer. The adapter keeps PEAC's normalization, verification helpers, and record mapping above that wire format without changing x402 payload semantics.

Scope

  • @peac/adapter-x402 source
  • adapter tests and conformance bridge
  • package README
  • weather-proof example

No kernel, schema, protocol, or other adapter source changes.

What changed

  • raw wire types now follow the current x402 offer-receipt shapes
  • JWS and EIP-712 artifacts use discriminated unions
  • JWS artifacts omit payload at the envelope level
  • EIP-712 placeholder values are normalized in a separate layer
  • verification is split into wire, offer, receipt, and consistency checks
  • record mapping preserves raw proofs and produces normalized evidence fields
  • README and example were updated to match the current adapter API

x402 compatibility

  • signature remains the field name for both JWS and EIP-712 artifacts
  • offer-receipt remains the extension key
  • adapter defaults follow the current x402 extension behavior for expiry and receipt recency

Adapter policy surfaces

These behaviors are adapter-level and are separate from x402 wire semantics:

  • placeholder normalization
  • configurable expiry policy
  • network-aware address comparison
  • optional signer authorization hooks
  • record mapping into PEAC evidence structures

API changes

  • version is now numeric
  • receipts now use resourceUrl, payer, issuedAt, and transaction
  • offers are now offers[]
  • acceptIndex is per-offer
  • AcceptEntry.scheme is required
  • AcceptEntry.settlement is removed
  • X402OfferReceiptChallenge is a post-extraction convenience type, not the upstream wire message

Validation

  • build
  • typecheck
  • lint
  • adapter tests
  • conformance tests
  • guard script
  • package smoke check

Not included

  • no x402 payload changes
  • no authorization hints in signed payloads
  • no fixture rewrite yet
  • no compatibility drift CI yet

Follow-ups

  • replace the conformance bridge with native current-shape fixtures
  • add pinned upstream compatibility CI and drift checks
  • update broader repo-level docs where needed

Raw wire types now follow the current x402 offer-receipt shapes.
JWS and EIP-712 artifacts use discriminated unions. Verification
is split into wire, offer, receipt, and consistency checks. Record
mapping preserves raw proofs and produces normalized evidence fields.
@jithinraj jithinraj merged commit 08549b0 into main Mar 13, 2026
11 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant