Skip to content

feat(inbox): gasless inbox sends via relay sponsorPayment - #1103

Merged
biwasxyz merged 2 commits into
mainfrom
feat/inbox-sponsored-feepayer
Oct 2, 2026
Merged

biwasxyz merged 2 commits into
mainfrom
feat/inbox-sponsored-feepayer

Conversation

@biwasxyz

@biwasxyz biwasxyz commented Oct 2, 2026 •

Copy link
Copy Markdown
Contributor

Gasless inbox sends.

  • X402_SPONSOR_FEE_PAYER (optional env var): when set, the inbox 402 advertises extra.feePayer: <address>. x402-stacks clients (>=2.1.0) then sign a sponsored sBTC transfer with fee 0. When unset, the 402 is unchanged and senders pay their own gas.
  • Sponsored payments are settled with env.X402_RELAY.sponsorPayment(txHex, settle) (feat: sponsor x402 payments over the service binding only, sign and broadcast in one step x402-sponsor-relay#436). The relay sponsors and broadcasts, or refuses with a code:
    • INSUFFICIENT_FUNDS → 402
    • RATE_LIMITED → 429 (new)
    • SENDER_NONCE_CONFLICT → 409
    • BROADCAST_FAILED → 502, counted toward the circuit breaker
    • SPONSOR_EXHAUSTED → RELAY_ERROR; it was mapped to the sender's INSUFFICIENT_FUNDS
  • The old submitPayment queue path and the HTTP /relay fallback are no longer used for inbox payments. A sponsored payment with no binding is refused.
  • Self-paid payments still go through the relay's /settle as before.

Deploy after the relay PR. Set X402_SPONSOR_FEE_PAYER to the relay's sponsor address once the relay is live; unset it to turn gasless sends off.

Inbox tests: 446 passing.

@cloudflare-workers-and-pages

cloudflare-workers-and-pages Bot commented Oct 2, 2026 •

Copy link
Copy Markdown

Deploying with  Cloudflare Workers  Cloudflare Workers

The latest updates on your project. Learn more about integrating Git with Workers.

Status Name Latest Commit Preview URL Updated (UTC)
✅ Deployment successful!
View logs
landing-page 5368e6c Commit Preview URL

Branch Preview URL
Oct 02 2026, 04:32 AM

@biwasxyz biwasxyz changed the title feat(inbox): advertise relay fee payer in 402 when X402_SPONSOR_FEE_PAYER is set feat(inbox): gasless inbox sends via relay sponsorPayment Oct 2, 2026
@biwasxyz
biwasxyz merged commit 27c0015 into main Oct 2, 2026
8 checks passed
@biwasxyz
biwasxyz deleted the feat/inbox-sponsored-feepayer branch October 2, 2026 04:40
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant