chore(deps): migrate x402 SDK to x402-foundation/x402/go (unlocks upto + batch-settlement)#613
Closed
bussyjd wants to merge 2 commits into
Closed
chore(deps): migrate x402 SDK to x402-foundation/x402/go (unlocks upto + batch-settlement)#613bussyjd wants to merge 2 commits into
bussyjd wants to merge 2 commits into
Conversation
…o + batch-settlement) The coinbase/x402/go module renamed its path to github.com/x402-foundation/x402/go in the post-2026-03-31 releases, so a plain version bump fails with a module-path mismatch. Migrate imports github.com/coinbase/x402/go/types -> github.com/x402-foundation/x402/go/types and pin v0.0.0-20260529172747. The foundation module is the maintained path and already ships the `upto` (usage-metered, recipient-bound, settle<=max) and `batch-settlement` (deferred batch settle) EVM schemes; the `authCapture` funds-locked escrow scheme is still in-flight as draft x402-foundation/x402#2298. Types API is unchanged (PaymentRequirements/PaymentPayload/PaymentRequired/ResourceInfo); build and full unit suite green. Co-Authored-By: Claude Opus 4.8 (1M context) <noreply@anthropic.com>
6 tasks
bussyjd
added a commit
that referenced
this pull request
Jun 9, 2026
Runs a local x402-paid MCP (Model Context Protocol) server. The paid tool forwards the buyer's JSON arguments to a backend HTTP service and returns the response, so any real service can be resold to agents per call. Buyers settle in-band via the MCP request _meta["x402/payment"] field (per specs/transports-v2/mcp.md); verify -> execute -> settle runs inside the tool call, so a caller is never charged for a failed tool. Mirrors the canonical x402 paid-MCP example (a paid get_weather tool), generalising the upstream from a stub to a real backend. - internal/x402mcp: PaymentWrapper over the official modelcontextprotocol/go-sdk; proxyTool forwards args (+ optional backend auth header, set server-side, never sent to buyers) and returns the service response; free ping tool + /health. - cmd/obol/sell.go: `sell mcp` subcommand (--pay-to/--price/--chain/--tool-name/ --port/--upstream/--upstream-header/--description/--facilitator). Built on the x402-foundation/x402/go SDK; stacked on #613 (SDK module-path migration). go test ./internal/x402mcp/... ./cmd/obol/... green; gofmt/vet clean.
bussyjd
added a commit
that referenced
this pull request
Jun 9, 2026
Module-path migration (not a version bump): the SDK renamed its path in the post-2026-03-31 releases. `github.com/coinbase/x402/go` → `github.com/x402-foundation/x402/go` @ v0.0.0-20260529172747; the foundation module is the maintained path (and where new schemes land). Pure path swap of the single `.../go/types` import across the tree; types API unchanged. Unlocks the upto + batch-settlement schemes already shipped under mechanisms/evm/. Folded in from #613 so this branch is self-contained on the latest module.
Contributor
Author
OisinKyne
pushed a commit
that referenced
this pull request
Jun 10, 2026
Module-path migration (not a version bump): the SDK renamed its path in the post-2026-03-31 releases. `github.com/coinbase/x402/go` → `github.com/x402-foundation/x402/go` @ v0.0.0-20260529172747; the foundation module is the maintained path (and where new schemes land). Pure path swap of the single `.../go/types` import across the tree; types API unchanged. Unlocks the upto + batch-settlement schemes already shipped under mechanisms/evm/. Folded in from #613 so this branch is self-contained on the latest module.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.
What
Migrates the x402 Go SDK from
github.com/coinbase/x402/go→github.com/x402-foundation/x402/goand pinsv0.0.0-20260529172747.This is a module-path migration, not a version bump: the SDK renamed its module path in the post-2026-03-31 releases, so a plain
go get @latestfails with:The foundation module is the maintained path (and the one where new schemes land). Only one import path is used across the tree —
…/go/types(aliasedx402types) — rewritten in 18 files. The types API is unchanged:PaymentRequirements,PaymentPayload,PaymentRequired,ResourceInfoall present with the same shape, so this is a pure path swap.Why now
Unlocks the schemes we need for the demand-side / escrow direction, already shipped in this pin under
mechanisms/evm/:upto— usage-metered, Permit2witness.torecipient-bound, settle ≤ authorized max (incl. 0). Entry points:NewUptoEvmScheme,CreateUptoPermit2Payload,SettleUptoPermit2.batch-settlement— deferred/payment-channel batch settle (ComputeChannelId,CreateBatchedPermit2DepositPayload, deposit/claim/refund).The funds-locked
authCaptureescrow scheme is still in-flight (draftx402-foundation/x402#2298; spec already on that repo'smain) — not in this pin. Leveling up to it later is just a pin bump once it merges, no second migration.Testing
go build ./...✅internal/x402/...,internal/x402/buyer,internal/serviceoffercontroller,internal/inference)go.sumclean ofcoinbase/x402🤖 Generated with Claude Code