I’m integrating the CAMP Network with Web3Auth. Since it’s not listed among the default Web3Auth-supported networks, I’ve added it as a custom network configuration.
The setup works correctly for the CAMP mainnet, but when I try to configure and use the CAMP testnet, Web3Auth starts throwing an invalid chain ID error.
When I use the actual testnet chain ID (123420001114), Web3Auth stops working and asks for the chain ID in hexadecimal format.
So I added it’s hex (0x1C095F9B34) and added it to my Web3Auth custom network configuration.
After doing this, Web3Auth initializes successfully but any transaction attempt fails with the following error.
Exact Error and Logs
Transaction Signature: failed to sign message {
"code": -32603,
"data": {
"cause": null,
"code": -32000,
"message": "invalid chain ID"
},
"message": "invalid chain ID",
"stack": "Error: invalid chain ID
at Ee.e.sendAsync (https://wallet.web3auth.io/v5/assets/AbstractTorusController-BpVeEJxQ.js:1:5845)
at async Ee.e.request (https://wallet.web3auth.io/v5/assets/AbstractTorusController-BpVeEJxQ.js:1:6193)
at async kn.publishTransaction (https://wallet.web3auth.io/v5/assets/EthereumController-DNfrzaGr.js:5:16552)
at async kn.approveTransaction (https://wallet.web3auth.io/v5/assets/EthereumController-DNfrzaGr.js:5:15518)
at async Qn.handleConfirmation (https://wallet.web3auth.io/v5/assets/AbstractTorusController-BpVeEJxQ.js:2:36413)"
}
Platform / Framework
Next.js (v14.2.4)
React (v18.2.0)
Wagmi (v2)
Web3Auth SDK Details
@web3auth/modal — version 10.3.0
What I’ve Tried
Using the decimal chain ID (123420001114) directly Web3Auth fails to initialize.
Using the hex chain ID (0x1C095F9B34) Web3Auth initializes, but transaction signing fails with invalid chain ID.
Verified the CAMP testnet RPC and network details they work fine outside of Web3Auth.
Expected Behavior
I want to connect and test my application on the CAMP testnet through Web3Auth and successfully perform transactions, similar to how it works on the CAMP mainnet.
Request
Could you please confirm the correct chain ID (decimal or hex) for the CAMP testnet, or share the proper way to configure and test Web3Auth with CAMP testnet?
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.
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