rawgroundbeef/x402lint
Overview
This skill validates, generates, and debugs x402 payment configurations and HTTP 402 responses. It helps produce canonical v2 paywall configs, parse 402 endpoints or headers, and convert or normalize between v1 and v2 formats. Use it to ensure payment-required responses follow CAIP-2, EIP-55, and protocol rules.
How this skill works
The linter inspects a config object or a parsed Payment-Required header and returns validation results: valid flag, blocking errors, non-blocking warnings, a normalized v2 shape, and a display-ready summary with registry lookups. It can generate templates that follow x402 v2 rules, convert legacy v1 to v2, and run strict mode where warnings become errors. It also validates EVM and Solana address formats and CAIP-2 network identifiers.
When to use it
- Validate an existing x402 config or an HTTP 402 response
- Generate a new x402 v2 payment config or template
- Build an endpoint that returns a 402 payment-required response
- Debug validation failures and apply suggested fixes
- Convert or normalize between x402 v1 and v2 formats
- Check EVM (EIP-55) or Solana addresses and CAIP-2 network IDs
Best practices
- Always emit x402 v2 when creating configs and include resource.url and method
- Use CAIP-2 for network fields (namespace:reference), not plain network names
- Express amounts as digit-only strings in atomic units; never use decimals
- Use EIP-55 checksummed addresses for EVM fields and base58 for Solana
- Include maxTimeoutSeconds and choose a reasonable default like 300 seconds
- Run validation after any automated generation and enable strict mode for production
Example use cases
- Return a 402 JSON response from an Express route with a valid v2 accepts block
- Validate a base64 Payment-Required header from an HTTP response and get a normalized v2 shape
- Convert a legacy v1 paywall stored in a database to v2 before sending to clients
- Diagnose a failing config: get INVALID_NETWORK_FORMAT, BAD_EVM_CHECKSUM, or INVALID_AMOUNT with suggested fixes
- Generate a paywall that charges USDC on Base (eip155:8453) with proper token address and payTo checksum
FAQ
Amount must be a string of digits in atomic units (no decimals), e.g., "1000000" for 1 USDC with 6 decimals.
How should I format network and addresses?
Use CAIP-2 for network (namespace:reference). Use EIP-55 checksummed addresses for EVM and base58 for Solana public keys.