Hi Ritik — thanks for the clear write-up. I can see you’re reporting an issue (not just exploring) so I pulled together the key details for the support team and a likely fix.
Extracted details
- SDK: Web3Auth (custom network) — @web3auth/modal
- SDK version: 10.3.0
- Platform / Frameworks: Next.js v14.2.4, React v18.2.0, Wagmi v2
- Network being added: CAMP testnet
- Chain ID(s) tried by you: decimal 123420001114 and hex 0x1C095F9B34
- Exact error (transaction signing fails): “invalid chain ID” with stacktrace from Web3Auth/Torus controller
Findings & likely cause
- The decimal chain id you listed (123420001114) converts to hex 0x1CBC67C35A. The hex you used (0x1C095F9B34) does NOT match that decimal value — so the provider and the tx are likely using different chain IDs which causes the “invalid chain ID” rejection when signing.
What to try (step-by-step)
- Use the correct hex chainId in your Web3Auth chainConfig:
- chainId: “0x1CBC67C35A” (this is the hex for decimal 123420001114)
- Verify the RPC actually reports the same chainId. From your app console run:
- provider.request({ method: ‘eth_chainId’ })
- Or curl the JSON-RPC eth_chainId on the CAMP testnet RPC endpoint and confirm it returns “0x1CBC67C35A”.
- Ensure transactions you send either omit the explicit chainId (let the provider inject it) or set chainId to the same numeric/hex value. Mismatched chainId in the unsigned tx vs provider chainId triggers that error.
- Web3Auth expects the chainConfig.chainId as a hex string (0x…). Example Web3Auth initialization pattern to try:
const web3auth = new Web3Auth({
clientId: ‘<YOUR_CLIENT_ID>’,
chainConfig: {
chainNamespace: CHAIN_NAMESPACES.EIP155,
chainId: ‘0x1CBC67C35A’,
rpcTarget: ‘<CAMP_TESTNET_RPC_URL>’,
displayName: ‘CAMP Testnet’,
blockExplorer: ‘<CAMP_EXPLORER_URL>’,
ticker: ‘’,
tickerName: ‘<TICKER_NAME>’
}
})
If that fixes initialization but signing still fails, try removing the explicit chainId from the tx payload so the provider supplies the correct one.
If it still fails, please share (only if you’re OK providing them):
- Your Web3Auth initialization + login snippets (the chainConfig you’re using)
- A console screenshot (or output) of provider.request({ method: ‘eth_chainId’ }) and the exact RPC URL you’re pointing at
- Any browser console errors beyond the stack you pasted
Related docs
- Web3Auth chainConfig expects hex chainId and the pattern above (chainNamespace/chainId/rpcTarget). See Web3Auth docs for custom chain configuration.
If you want, paste your initialization snippet (mask any secrets) and I’ll quickly check it for the chainId/rpc mismatch. Thanks — you’re very close, it looks like a hex mismatch is the root cause.
Note: This response was generated by an AI bot and may require further verification. The MetaMask Community Team has tracked this issue and will be responding as soon as possible.
Additionally, we would recommend you to join our biweekly Office Hours to get this resolved even faster. MetaMask Developer Office Hours