feat: add BSC (BNB Smart Chain) support to x402 — native + ERC-20 verification
Add BSC (BNB Smart Chain) Support to x402
This PR introduces EVM network support for Binance Smart Chain (BSC) — including both native BNB and ERC-20 token verification (e.g., USDT / USDC).
It adds production-ready helpers under src/verify/evmVerify.ts, using the same model as other EVM integrations:
verifyNativeExactByTxHash()— validates on-chain native transfers (BNB)verifyErc20ExactByTxHash()— validates ERC-20 token transfersverifyErc20ExactByLogs()— optional log-based scan mode for batch verification- Fallback RPC clients with retry and timeout (
withEvmClientsRetry)
Specification note
BSC currently does not support EIP-3009 (transferWithAuthorization) for its major stablecoins (USDT, USDC, etc.).
Therefore, this integration uses standard ERC-20 transfer verification, requiring users to submit and pay for gas themselves.
While this deviates from the fully gasless x402 payment model, it remains EVM-compliant and enables BSC ecosystem compatibility as an optional fallback network.
This PR introduces BSC support as an optional network extension.
While BSC currently lacks EIP-3009 support, standard ERC-20 flows remain valuable for ecosystem compatibility and can serve as a fallback model until gasless tokens (or wrapped variants) are available.
Checklist
- [x] I have formatted and linted my code (
pnpm format && pnpm lint) - [x] All new and existing tests pass (
pnpm test) - [x] My commits are signed (verified via
git log --show-signature)
🟡 Heimdall Review Status
| Requirement | Status | More Info | ||||||||||||||||||||||||
|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|---|
| Reviews |
🟡
0/1
|
Denominator calculation
|
@web3luka is attempting to deploy a commit to the Coinbase Team on Vercel.
A member of the Team first needs to authorize it.