🧐 What are EXTENSIONS - (x402 v2)
The Spaces brought together Notorious (Pai) as host with Eric (author of X402, Coinbase), Carson (core X402 engineer, Coinbase), and Alexander (Corbetts/Fair Meter) to unpack X402 v2 “extensions.” Speakers explained why extensions exist: to keep the core payment spec minimal, secure, and interoperable while enabling optional, composable capabilities around payments (identity, discovery, sponsorship, receipts, etc.). They detailed communication patterns (server–client, server–facilitator, and facilitator–client), how facilitators advertise supported extensions, and where extension data travels in requests. V2’s notable changes include moving Payment-Required into headers, standardizing network identifiers (e.g., CAIP-2), and freeing the request body for arbitrary content. The panel emphasized safety (no facilitator-controlled arbitrary fund movement) and ecosystem-wide compatibility to avoid fragmentation. They brainstormed concrete use cases (Sign-in with X, discovery, payment splitting, gas/approval sponsorship, credits, receipts, licensing, free tiers) and discussed governance and adoption: propose an extension via PR with spec and at least one SDK implementation, aim for broad adoption, and rely on SDK-level backward compatibility. Coinbase’s facilitator is being rewritten atop the Go reference SDK to more easily adopt community extensions. Q&A covered migration from v1, optionality of extensions, and long-term stability.
Twitter Spaces Summary: X4O2 v2 Extensions – Concepts, Mechanics, Use Cases, and Adoption
Participants and Roles
- Notorious (Pai): Host/moderator; runs multi-network facilitator with X4O2; focused on growing the X4O2 ecosystem and supporting builders.
- Eric: Author of X4O2; leads developer platform efforts; close collaborator with Coinbase team.
- Carson (Coinbase): Core X4O2 engineer at Coinbase; primary driver of v2; co-designed v2 with Eric.
- Alexander (Corbets): Leads technology at Corbets; leads Fair Meter (Corbets’ X4O2 client/middleware/facilitator implementation).
- Audience contributors: VFEX, Lando, x42.rs (Sergey) posed questions.
Agenda Overview
- Introductions; target audience is developers/builders.
- Deep dive on X4O2 v2 extensions: rationale, design, and mechanics.
- Facilitator perspectives: Coinbase and Corbets/Fair Meter.
- Open discussion on use cases and future ideas.
- Q&A on governance, compatibility, and facilitator support.
What X4O2 Extensions Are and Why They Exist
- Design intent: Keep the core payment spec lean, interoperable, and transport-agnostic (primarily HTTP), while enabling optional, standardized capabilities around the payment flow.
- Background:
- v1 assumed co-existence with other HTTP standards (auth, identity), but real-world adoption highlighted gaps in standardized discovery/identity and transport variations (e.g., MCP integrations emerged quickly).
- Interoperability across multiple implementations (e.g., different MCP integrations, facilitators) required shared, optional standards to avoid fragmentation.
- The “Bazaar” release (last year) enabled aggregated distribution (e.g., X4O2 scan) but adoption was uneven (“lumpy”). Extensions formalize small, optional standards that can be widely adopted without forcing everyone into monolithic upgrades.
- Conceptual model:
- Extensions “invert the model” by letting payment-adjacent concerns (discovery, identity, facilitator-added services) live alongside X4O2 requests in a structured, optional way.
- They do not change payment semantics directly; they enrich or augment the request/response flow around core payment requirements.
Core vs. Mechanism: Separation and Safety
- Clear separation:
- Core payment semantics live in Payment Requirements.
- Extension data lives outside those semantics (top-level fields), allowing clients, servers, and facilitators to opt in.
- Safety and legal constraints:
- Preserve client trust: facilitators must not be able to arbitrarily move funds on behalf of clients.
- Avoid turning facilitators into money transmitters under regulatory regimes by limiting their powers in the core payment flow; extensions offer value without compromising this boundary.
- Interoperability as a first principle:
- Anyone should be able to implement a client/server/facilitator from the spec and interoperate with others.
- Avoid fragmentation; standards evolve intentionally and slowly (analogy: HTTP/1.1 longevity).
How Extensions Are Communicated (Mechanics)
- Types of extension communication (three patterns):
- Server ↔ Facilitator extensions:
- Facilitators advertise support via Supported endpoint including an
extensionsarray of keys they support. - Servers include extension data in the Payment Payload
extensionsproperty so facilitators can process it. - Example: Bazaar-like interactions where the facilitator needs extra context from the server and declares capabilities up front.
- Facilitators advertise support via Supported endpoint including an
- Client ↔ Server extensions:
- Servers declare supported extensions via Payment Required
extensionsproperty. - Clients “echo” extension declarations from Payment Required into Payment Payload and may add headers or append data relevant to the extension.
- Example: “Sign-in with X” (identity) would have the client add an auth header; client echoes extension info so the server can act on it.
- Servers declare supported extensions via Payment Required
- Facilitator ↔ Client (bridged via server):
- Active proposal: ERC-20 approval sponsorship (“gas dusting”) where the facilitator provides the initial approval/sponsorship; server proxies this info to the client.
- Client includes an extra signature/field to allow the facilitator’s sponsored approval, enabling arbitrary ERC-20 usage.
- Analogy to Solana: Account rent sponsorship by facilitator to activate accounts.
- Server ↔ Facilitator extensions:
Examples and Use Cases (Existing and Proposed)
- Discovery:
- First-class extension because discovery only makes sense in X4O2 payment context, not generic HTTP.
- Identity / “Sign-in with X”:
- Persistent identity needed by businesses (e.g., Pinata pinning and later access without per-read charges); extension lets servers request/verify identity linked to payments.
- Payment splitting:
- Option 1: As a scheme (client constructs multi-pay transaction with split percentages).
- Option 2: As an extension where facilitator performs smart-contract calls or post-payment fan-out.
- Credits / metering:
- Facilitator tracks API call counts for a customer credited via payment; server instructs facilitator (e.g., account ID to credit); clients include identifiers in requests.
- Receipts/Invoices:
- Receipt generation over time (e.g., monthly invoice PDFs) as a facilitator extension; businesses offload bookkeeping artifacts.
- Licensing/Terms acceptance:
- Servers require clients to agree to licensing or terms for access (e.g., large providers like Google/Cloudflare-like flows).
- Free tiers / conditional responses:
- v2 moves Payment Required from body to header; body can carry arbitrary content.
- Combined with identity extensions, servers can vary content (free vs. paid) per client.
- Alternative facilitator endpoints for new schemes:
- Extensions can advertise non-standard endpoints (e.g., for deferred settlements) beyond the canonical settle endpoint when a scheme requires differently shaped requests.
- Network-specific helper data:
- Corbets/Fair Meter example: recent Solana blockhash delivered via middleware/facilitator to clients without requiring client RPC access.
- Sponsorship services:
- ERC-20 approval sponsorship, Solana account rent sponsorship; merchants can choose facilitators offering these services and understand associated costs.
Corbets/Fair Meter Approach
- Philosophy:
- Keep all components composable and pluggable (client, middleware, facilitator) to support varied schemes and extensions without tight coupling.
- Middleware can relay facilitator-sourced data to clients without forcing merchants to know chain-specific details.
- Implementation notes:
- Dynamic accept endpoint: return chain metadata (e.g., recent blockhash) to clients; middleware defers specifics to facilitator.
- Hooks for extensions across client, middleware, facilitator to “patch in” support for extensions.
- Encourage experimentation in TypeScript via Fair Meter for rapid scheme/extension prototyping.
Coinbase Facilitator Perspective
- v2 rewrite:
- Coinbase facilitator is being rewritten to consume the Go reference SDK for v2.
- This lowers the effort to adopt community-merged extensions: once an extension spec and Go implementation exist in the X4O2 repo, wiring into Coinbase’s facilitator becomes simpler.
- Adoption stance:
- Will move with community demand; not seeking to dictate extensions unilaterally.
- Supports Bazaar; will progressively add logical/common extensions as they are merged into the repo and adopted.
Spec vs. Extensions: Promotion and Governance
- Promotion path:
- In principle, widely used extensions might be “enshrined” as official extensions in the X4O2 repository.
- Even if popular, the preference is to keep them optional extensions rather than core payment fields to avoid bloating the spec.
- Governance and contribution:
- Formal process to be clarified (January action item):
- Add
specs/extensionsfolder in X4O2 repo for extension specs (Markdown docs). - Propose via PR with spec doc; include at least one implementation (Go/TypeScript/Python). Go is strategic due to facilitator adoption.
- Add
- X4O2 Foundation expected to steward baseline decisions (e.g., deprecation timelines) based on adoption data.
- Formal process to be clarified (January action item):
v2 Changes and Compatibility
- Intent: Minimize breaking changes while correcting v1 limitations; expect v2 adoption to exceed v1 over time (months-scale).
- Notable changes:
- Network identifiers: Shift from bespoke strings (e.g., “base”, “solana”) in v1 to standardized chain identifiers (referred to in-call as CAP2/CIP-2, i.e., CAIP-2) in v2.
- Payment Required moved from body to header, opening the body for arbitrary content (e.g., free-tier responses).
- Clients should ignore unknown headers/fields to maintain compatibility (robustness principle).
- Backward compatibility approach:
- Spec-level changes consolidate learnings; SDK-level support provides dual v1/v2 handling.
- Reference SDKs include v1 and v2 client/facilitator implementations; you can register both for seamless interop.
- A future v3 (if ever needed) would similarly adhere to standardized identifiers and compatibility principles.
Philosophical Contrast: Speed vs. Stability
- Alexander’s view:
- Specs that move too slowly get left behind; embrace flexibility without absurdity. Market-driven evolution with high compatibility (as in HTTP/DNS/etc.) is crucial.
- Eric’s view:
- Standards must evolve intentionally and slowly to preserve interoperability and avoid fragmentation. HTTP/1.1 longevity exemplifies the importance of backward compatibility.
- Extensions are a safe sandbox for innovation; upstream only when clearly beneficial and broadly adopted.
Q&A Highlights
- VFEX: Extension approval process and v2↔v1 compatibility.
- Process: PR spec into
specs/extensions, plus implementation (start with one language); contributing docs to be updated. - Compatibility: v2 introduces standardized chain identifiers (CAIP-2); SDKs provide dual v1/v2 registration so clients/facilitators can handle both. Some breaking changes are intentional to fix v1 limitations.
- Process: PR spec into
- Lando: Bare minimum for “in spec”; strict baseline vs. flexibility.
- Extensions are optional; some schemes may require certain extensions, but the core protocol remains minimal and stateless.
- Aim: preserve a lean baseline for environments like Cloudflare Workers; use extensions to add capability without forcing core changes.
- Sergey (x42.rs): v1 lifetime and Coinbase facilitator’s stance on fancy extensions.
- v1 lifetime: Adoption-driven; maintain SDK compatibility until usage is negligible. Any drop would be a Foundation/community decision.
- Coinbase: Facilitator rewrite to use Go SDK; if an extension is merged and implemented in Go, adding support becomes straightforward; will follow community demand.
Key Takeaways for Builders
- Extensions are the vehicle for adding business-relevant capabilities (identity, discovery, sponsorships, receipts, metering, licensing, complex scheme endpoints) without bloating core payments.
- Preserve safety and interop: Clients must not be exposed to arbitrary fund movement by facilitators; unknown fields should be safely ignored.
- Use the reference SDKs to bridge v1 and v2; register both to cover more servers/clients during migration.
- Propose extensions via the repo with clear specs and at least one high-quality implementation (Go preferred for facilitator reach).
- Think like a business: Identify what your server needs around payments (credits, invoices, terms, discovery) and express those via extensions. Facilitators can offer value-added, stateful services competitively.
Actionable Next Steps
- If you have an extension idea:
- Draft a clear spec (scope, fields, communication pattern: server↔facilitator, client↔server, facilitator↔client).
- Implement in at least one language; Go is strategic for facilitator adoption; TypeScript/Python are also welcome.
- Submit PRs to the X4O2 repo; follow forthcoming contributing guidelines.
- For v2 migration:
- Update to standardized chain identifiers (CAIP-2).
- Move Payment Required handling to headers; leverage body for flexible responses.
- Register both v1 and v2 in client/facilitator SDKs to maintain compatibility while upgrading.
- For facilitators:
- Advertise supported extensions via the Supported endpoint.
- Implement extension hooks to process server-provided extension data and—when appropriate—bridge facilitator info to clients.
Closing Remarks
- Alexander (Corbets/Fair Meter): Will continue enabling composable, mature, and innovative tooling; adding hooks for extensions and post-payment actions (splits/commits). Encourages rapid prototyping and marketplace-driven evolution while staying compatible.
- Carson (Coinbase): Excited to see community proposals and implementations; rewrite to Go SDK will accelerate adoption of merged extensions. Emphasizes flexibility without breaking the core.
- Host (Notorious): Thanks to speakers and audience; developers encouraged to continue discussion via comments/threads and tag Eric, Carson, Alexander for follow-up.
