Current behavior
Our 402 response uses some field names that differ from the x402 V2 spec:
{
"accepts": [{
"scheme": "hathor-escrow",
"network": "hathor:testnet",
"asset": "00",
"amount": "100",
"description": "Pay 1.00 HTR",
"payTo": "WZe3ty22...",
"maxTimeoutSeconds": 300,
"extra": {
"facilitatorUrl": "https://facilitator.x402.hathor.dev",
"facilitatorAddress": "Wb6eLTZS...",
"blueprintId": "0000121e...",
"deadlineSeconds": 300
}
}]
}
x402 V2 spec field names
The V2 spec uses these field names in the accepts array entries:
scheme ✅ (matches)
network ✅ (matches)
asset ✅ (matches)
price — we use amount. The spec calls it price.
payTo ✅ (matches)
description ✅ (matches)
resource ✅ (matches)
mimeType ✅ (matches)
The extra field is Hathor-specific (escrow blueprint ID, facilitator address, deadline). The spec doesn't define this — each scheme can add its own fields.
Changes needed
Resource server (resource-server.js)
- Rename
amount to price in the 402 response
- Keep
amount in the facilitator verify/settle payloads (internal, not spec-facing)
Client (client.js) and dApp (dapp/components/X402Fetch.tsx)
- Read
price instead of amount from 402 responses
Facilitator (facilitator.js)
- Accept both
maxAmountRequired and price in verify requests for compatibility
References
Current behavior
Our 402 response uses some field names that differ from the x402 V2 spec:
{ "accepts": [{ "scheme": "hathor-escrow", "network": "hathor:testnet", "asset": "00", "amount": "100", "description": "Pay 1.00 HTR", "payTo": "WZe3ty22...", "maxTimeoutSeconds": 300, "extra": { "facilitatorUrl": "https://facilitator.x402.hathor.dev", "facilitatorAddress": "Wb6eLTZS...", "blueprintId": "0000121e...", "deadlineSeconds": 300 } }] }x402 V2 spec field names
The V2 spec uses these field names in the
acceptsarray entries:scheme✅ (matches)network✅ (matches)asset✅ (matches)price— we useamount. The spec calls itprice.payTo✅ (matches)description✅ (matches)resource✅ (matches)mimeType✅ (matches)The
extrafield is Hathor-specific (escrow blueprint ID, facilitator address, deadline). The spec doesn't define this — each scheme can add its own fields.Changes needed
Resource server (
resource-server.js)amounttopricein the 402 responseamountin the facilitator verify/settle payloads (internal, not spec-facing)Client (
client.js) and dApp (dapp/components/X402Fetch.tsx)priceinstead ofamountfrom 402 responsesFacilitator (
facilitator.js)maxAmountRequiredandpricein verify requests for compatibilityReferences
{ scheme, price, network, payTo }