Skip to content

feat(x402): the signed domain follows the 402's network — Arc, Base, Base Sepolia - #69

Merged
VickyXAI merged 1 commit into
mainfrom
feat/arc-network
Sep 16, 2026
Merged

VickyXAI merged 1 commit into
mainfrom
feat/arc-network

Conversation

@VickyXAI

Copy link
Copy Markdown
Contributor

Why

The chain table knew Base and Base Sepolia and fell back to Base for any other network, while asset and extra were taken from the 402 as given. Against arc.blockrun.ai (eip155:5042, USDC at 0x3600…, domain name USDC) that signed chainId 8453 against Arc's contract — an invalid signature, a 401 from the facilitator, after the SDK had reported a payment.

What

  • EVM_NETWORKS in blockrun_llm.x402 maps a 402's network to the SDK's own chain id, USDC address and EIP-712 domain (Base, Arc, Base Sepolia; base-sepolia alias kept). create_payment_payload signs those.
  • The 402 selects the network and supplies nothing else: extra no longer reaches the domain; unknown network → ValueError naming what is supported; asset ≠ that network's USDC → ValueError before signing.
  • The twelve EVM clients that did not pass the 402's asset now do, so the check protects every route.
  • README "Arc Support" section + chains table row. 1.17.0, mirroring @blockrun/llm 3.16.0 (feat(x402): the signed domain follows the 402's network — Arc, Base, Base Sepolia blockrun-llm-ts#44).

Verified

Against arc.blockrun.ai with an unfunded throwaway key: Circle's /verify answers insufficient_funds and recovers the throwaway's own address as payer — the signature verifies on Arc's domain; only the balance is missing.

Six new tests recover the signer against each domain (Arc passes, Base fails for an Arc payment), pin the refusals, and that a 402's extra is ignored. 983 unit tests, ruff and black clean.

🤖 Generated with Claude Code

…Base Sepolia

The chain table knew Base and Base Sepolia and fell back to Base for any
other network, while `asset` and `extra` were taken from the 402 as given.
Against arc.blockrun.ai (eip155:5042, USDC at 0x3600…, domain name "USDC")
that signed chainId 8453 against Arc's contract — an invalid signature, a
401 from the facilitator, after the SDK had reported a payment.

EVM_NETWORKS maps a 402's `network` to the SDK's OWN chain id, USDC address
and EIP-712 domain; create_payment_payload signs those. The 402 SELECTS the
network and supplies nothing else: its `extra` no longer reaches the domain
(a hostile 402 cannot steer a signature onto another contract), an unknown
network raises naming what is supported, and an `asset` that is not that
network's USDC raises before signing. The twelve EVM clients that did not
pass the 402's asset now do, so the check protects every route.
get_chain_config / get_usdc_domain_name read the same table; the
`base-sepolia` alias still resolves.

Verified against arc.blockrun.ai with an unfunded throwaway key: Circle's
/verify answers insufficient_funds and recovers the throwaway's own address
as payer — the signature verifies on Arc's domain, only the balance is
missing. Six new tests recover the signer against each domain (Arc passes,
Base fails for an Arc payment), pin the refusals, and that a 402's `extra`
is ignored. 983 unit tests, ruff and black clean. 1.17.0, mirroring
@blockrun/llm 3.16.0.
@VickyXAI
VickyXAI merged commit 8a18227 into main Sep 16, 2026
4 checks passed
@VickyXAI
VickyXAI deleted the feat/arc-network branch September 16, 2026 18:47
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant