Tax compliance for gasless x402 on SKALE
SKALE is gasless. Sub-cent x402 payments are finally profitable — which means a merchant can do 100K+ transactions a day for real money. At that volume, per-state sales tax isn't optional, and no existing tax API can afford to serve it. AgentTax is the one that can.
Drops in alongside @x402/hono with a post-settlement recording call. 51 US state-level jurisdictions plus 100+ zip-level local rates, with statute citations and confidence scores on every record.
Why this matters on SKALE specifically
3-step integration
The handler
SKALE's x402 cookbook uses @x402/hono with the DirtRoad facilitator. Add the AgentTax fetch inside your route handler — that's it.
// SKALE x402 merchant — record each gasless settlement to AgentTax.
// SKALE is gasless: $0.0001 transactions are profitable, which means
// compliance becomes necessary at transaction counts Avalara can't handle.
import { Hono } from "hono";
import { paymentMiddleware, x402ResourceServer } from "@x402/hono";
import { ExactEvmScheme } from "@x402/evm/exact/server";
import { HTTPFacilitatorClient } from "@x402/core/server";
const app = new Hono();
const facilitator = { url: "https://facilitator.dirtroad.dev" };
const facilitatorClient = new HTTPFacilitatorClient(facilitator);
// Flip SKALE_CHAIN_ID between 324705682 (Sepolia testnet)
// and 1187947933 (SKALE Base Mainnet) without code changes.
const NETWORK = `eip155:${process.env.SKALE_CHAIN_ID || "324705682"}`;
app.use("*", paymentMiddleware(
{
"GET /paid": {
accepts: [{
scheme: "exact",
network: NETWORK,
payTo: process.env.RECEIVING_ADDRESS,
price: {
amount: "10000", // 0.01 USDC, atomic units (6 decimals)
asset: process.env.PAYMENT_TOKEN_ADDRESS,
},
}],
},
},
new x402ResourceServer(facilitatorClient).register(NETWORK, new ExactEvmScheme()),
));
async function recordTax({ amount, buyerState, counterpartyId }) {
const res = await fetch("https://agenttax.io/api/v1/calculate", {
method: "POST",
headers: {
"Content-Type": "application/json",
"Authorization": `Bearer ${process.env.AGENTTAX_API_KEY}`,
},
body: JSON.stringify({
role: "seller",
amount,
buyer_state: buyerState,
transaction_type: "compute",
counterparty_id: counterpartyId,
}),
});
if (!res.ok) throw new Error(`AgentTax ${res.status}`);
return res.json();
}
app.get("/paid", async (c) => {
const buyerState = c.req.query("buyer_state") || process.env.AGENTTAX_DEFAULT_STATE;
try {
const tax = await recordTax({
amount: 0.01,
buyerState,
counterpartyId: c.req.header("x-payer-address") || "anonymous",
});
return c.json({
data: "your paid resource",
agenttax: {
transaction_id: tax.transaction_id,
tax_amount: tax.sales_tax?.amount,
tax_rate: tax.sales_tax?.combined_rate,
jurisdiction: tax.sales_tax?.jurisdiction,
},
});
} catch {
return c.json({ data: "your paid resource", agenttax: { error: "record_failed" } });
}
});Sub-cent settlement is where x402 and state sales tax disagree most, and rounding is not the only place. The x402 tax compliance reference works through the four gaps that surface in production.
Response shape
{
"success": true,
"role": "seller",
"amount": 100,
"buyer_state": "TX",
"transaction_type": "compute",
"jurisdiction": "Texas",
"combined_rate": 0.0625,
"classification_basis": "data_processing",
"total_tax": 5,
"sales_tax": {
"jurisdiction": "Texas",
"combined_rate": 0.0625,
"amount": 5,
"taxable_amount": 80,
"taxable_percentage": 0.8,
"note": "TX Tax Code §151.351 — 20% statutory exemption"
},
"use_tax": null,
"confidence": {
"score": 72,
"level": "partial"
},
"transaction_id": "txn_skale_abc123"
}SKALE Base chains
https://facilitator.dirtroad.dev (run by DirtRoad). Sepolia bridged USDC: 0x2e08028E…030bD. Mainnet token addresses are not yet in SKALE's public docs — ask in the SKALE Builders Chat for the current list.New to x402 in general? See the generic x402 integration guide.
Ship tax-compliant SKALE merchants today
Clone the starter, drop in your AgentTax key, run it. 1,500 calls/mo free, no credit card.