feat(extensions): add optional signed Offer & Receipt extension (draft, addresses #496) #935
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Description
This PR proposes and implements an optional Offer & Receipt extension for x402, along with a reference TypeScript implementation and documentation. It is intended as a response to the discussion in #496.
What this introduces
402 Payment Requiredresponses (accepts[])typescript/packages/extensions/specs/extensions/extension-offer-and-receipt.mdThe goal is to enable portable, verifiable proofs of paid service that can be reused outside the original request/response flow (e.g. disputes, auditing, or trust signals). One concrete use case: the OMATrust project (part of OMA3) plans to use these receipts as proofs for verified user-review attestations.
What this PR is not
Key authorization (e.g. whether a signing key is bound to a service identity) is intentionally treated as verifier policy, not a protocol requirement. The extension only defines the data model and signing semantics.
Intent of this PR
This PR is opened as a Draft to request maintainer and community feedback on the concept and integration surface before additional hardening.
In particular, feedback is requested on:
If there is alignment on the concept, follow-up work can add:
Tests
(
typescript/packages/extensions/test/offer-receipt.test.ts)No E2E extension test is included in this PR; this is intentional for the draft stage and can be added once maintainers confirm interest in the extension.
Checklist