draft: operation-binding companion extension and TS prototype#1932
draft: operation-binding companion extension and TS prototype#1932ayushozha wants to merge 6 commits intox402-foundation:mainfrom
Conversation
|
This draft now includes a concrete TypeScript prototype in Included in the prototype:
Validation run locally:
If this is the right first-step shape, I can keep iterating from here rather than expanding the scope further. |
|
Direction looks right to me — keeping it as a companion extension so receipt format churn doesn't cascade is the sane call. One question on scope: the v1 receipt is resource-server-signed, which works for any scheme. But some schemes can carry the binding natively — e.g. BOLT11 Not asking you to solve it here, just trying to understand whether the v1 shape would let that plug in later or whether it'd need its own extension. |
|
Ran the TS prototype on this branch against The Concrete: body
Same story with Test vectorsWhile both impls were running, pinned 8 vectors against the two example bindings (
Would be worth pinning a subset of these in the spec as a Test Vectors appendix — independent SDK authors get a bit-for-bit target to verify against, which is the cheapest insurance against drift. One more number-related thing
Can send a small PR against this branch with the escape fix plus regression tests for |
|
Addressed the RFC 8785 escaping bug in the shared canonicalizer. What changed:
Ran locally:
This is on the branch now in |
Summary
This draft PR still starts with the first narrow slice from #1921: a standalone
operation-bindingcompanion extension. It now also includes a TypeScript prototype in@x402/extensionsso reviewers can react to both the proposed spec surface and a concrete SDK shape.The goal is still to keep this first step narrow:
operationDigestoffer-and-receiptWhat This PR Includes
Spec draft
specs/extensions/operation-binding.mdoperationDigestinputspayment-identifieroffer-and-receiptand Facilitator-side attestation to complement offer-receipt — coordination proposal #1802TypeScript prototype
@x402/extensions/operation-bindingentrypoint402 Payment RequiredWhat This PR Does Not Yet Do
For the prototype, I kept the code in
@x402/extensionsrather than wiring it directly into core server settlement hooks, because the current hook surface does not yet expose enough validated operation context to do that cleanly.Validation
Ran locally:
pnpm --dir typescript --filter @x402/extensions test -- operation-binding.test.tspnpm --dir typescript --filter @x402/extensions buildReview Intent
This PR is meant to answer two questions:
If this is directionally right, I can follow up by either:
Refs #1921