Skip to content

x402: define a durable MerchantOfferStore path #209

Description

@longfin

Context

PR #207 introduces MerchantOfferStore with an in-memory implementation for single-process deployments. Multi-replica hosts need a durable implementation with an atomic one-shot execution claim.

The bridge already has a Postgres-backed precursor, while the gateway is separately tracking a shared durable consistency domain in planetarium/foundry-x402-gateway#12.

Scope

  • Decide where a standard durable implementation belongs without leaking database dependencies into the root @a2x/sdk entry.
  • Implement or publish a reference Postgres-compatible MerchantOfferStore for:
    • atomic publishing with rollback;
    • frozen MerchantOffer reads;
    • compare-and-set claim;
    • expiry and delete;
    • multi-replica correctness.
  • Evaluate a read-only claimed-state fast path so known replays can avoid a facilitator verify round trip, while retaining the post-verify atomic claim as the arbiter.
  • Add concurrency, expiry, rollback, and restart tests.
  • Document schema migration and operational cleanup.

Constraints

  • Preserve host-owned connection and transaction management.
  • Do not make a database driver a root SDK runtime dependency.

Dependencies

Metadata

Metadata

Assignees

Labels

No labels
No labels

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions