Summary
The x402-sponsor-relay landed two significant nonce handling PRs (#247, #248) that change how downstream consumers interact with the relay. The skills repo documentation and code need updates to reflect these changes.
What Changed in the Relay
PR 247 — Nonce Pool Hardening
- New
MALFORMED_PAYLOAD (400) rejection with IP-based rate limiting (429 after 3 bad payloads in 10 min)
- Agent queue management endpoints:
GET /queue/:senderAddress, DELETE /queue/:senderAddress/:walletIndex/:sponsorNonce
- New SIP-018 actions:
queue-read, queue-cancel
- Full stuck-tx auto-recovery (dispatch queue + replay buffer)
PR 248 — Sequence-Aware Nonce Dispatch
POST /relay can now return HTTP 202 (transaction held) when sender nonce is out of order
- Response includes
QueueInfo with missingNonces[], Retry-After header
POST /sponsor returns 400 SENDER_NONCE_GAP with missingNonces[] when nonce would create a gap
POST /settle returns 200 with errorReason: "transaction_held" and QueueInfo
- Held transactions expire after 5 minutes with
recentlyExpired feedback on next submission
Files to Update
Documentation
Code
Skill
New Error Codes to Document
| Code |
HTTP |
Endpoint |
Meaning |
MALFORMED_PAYLOAD |
400 |
/relay, /sponsor, /settle |
Pre-flight validation failed (bad hex, wrong version/auth byte) |
SENDER_NONCE_GAP |
400 |
/sponsor |
Sender nonce would create gap; submit missingNonces first |
TRANSACTION_HELD |
202 |
/relay |
Transaction accepted but held pending missing nonces |
QUEUE_NOT_FOUND |
404 |
/queue/:addr |
No queued entries for sender |
QUEUE_ACCESS_DENIED |
403 |
/queue/:addr |
SIP-018 signature doesn't match sender |
Summary
The x402-sponsor-relay landed two significant nonce handling PRs (#247, #248) that change how downstream consumers interact with the relay. The skills repo documentation and code need updates to reflect these changes.
What Changed in the Relay
PR 247 — Nonce Pool Hardening
MALFORMED_PAYLOAD(400) rejection with IP-based rate limiting (429 after 3 bad payloads in 10 min)GET /queue/:senderAddress,DELETE /queue/:senderAddress/:walletIndex/:sponsorNoncequeue-read,queue-cancelPR 248 — Sequence-Aware Nonce Dispatch
POST /relaycan now return HTTP 202 (transaction held) when sender nonce is out of orderQueueInfowithmissingNonces[],Retry-AfterheaderPOST /sponsorreturns 400SENDER_NONCE_GAPwithmissingNonces[]when nonce would create a gapPOST /settlereturns 200 witherrorReason: "transaction_held"andQueueInforecentlyExpiredfeedback on next submissionFiles to Update
Documentation
aibtc-services/x402-sponsor-relay/README.md— Add 202 held response, queue endpoints, malformed payload rejection,SENDER_NONCE_GAPerror, new error codes (MALFORMED_PAYLOAD,SENDER_NONCE_GAP,TRANSACTION_HELD,QUEUE_NOT_FOUND,QUEUE_ACCESS_DENIED)Code
src/lib/transactions/sponsor-builder.ts— HandleSENDER_NONCE_GAP(400) from/sponsorwithmissingNonces[]in error response. Currently only handles generic errors.Skill
relay-diagnostic/SKILL.md/relay-diagnostic.ts— Consider adding queue inspection (GET /queue/:address) as a diagnostic subcommandNew Error Codes to Document
MALFORMED_PAYLOADSENDER_NONCE_GAPmissingNoncesfirstTRANSACTION_HELDQUEUE_NOT_FOUNDQUEUE_ACCESS_DENIED