I’m using MPC Core Kit with a JWT verifier on a Next.js 13 app under Next Auth using Google as my sign in provider. All works fine, except sometimes–especially if I haven’t used the tab for a while–I get an invalid signature when trying to sign a message or send a signed userop.
Here’s an example of the error sendUserOpToBundler failed Error: Invalid UserOp signature
.
Usually, the issue resolves if I reload. And it always resolves if I sign out and sign in again. Any ideas what could be happening and how to correct? Is the timestamp of the token or nonce stale/old perhaps? Any ideas on how to check this?
- SDK Version: @web3auth/mpc-core-kit@0.3.1
const coreKitInstance = new Web3AuthMPCCoreKit({
web3AuthClientId: WEB3AUTH_CLIENTID,
web3AuthNetwork: WEB3AUTH_NETWORK.DEVNET,
uxMode: "popup",
});
await coreKitInstance.init();
- Verifier Details:
const web3authProvider = await coreKitInstance.connect({
subVerifierDetails: {
verifier: "denim-mpc-devnet",
typeOfLogin: 'jwt',
clientId: WEB3AUTH_CLIENTID,
jwtParams: {
verifierIdField: "sub",
id_token: session?.user?.id_token,
domain: "http://localhost:3000",
}
}
})
- Verifier Name: denim-mpc-devnet
- JWKS Endpoint: https://www.googleapis.com/oauth2/v3/certs
- Sample idToken(JWT):
Error Message:
client.js:1 sendUserOpToBundler failed Error: processing response error (body="{\"error\":{\"code\":-32507,\"data\":null,\"message\":\"Invalid UserOp signature or paymaster signature\"},\"id\":44,\"jsonrpc\":\"2.0\"}", error={"code":-32507,"data":null}, requestBody="{\"method\":\"eth_sendUserOperation\",\"params\":[{\"sender\":\"0x8ae89588b845Cd9392a545E8c9ba509D814Dfb79\",\"nonce\":\"0x11\",\"initCode\":\"0x\",\"callData\":\"0x940d3c6000000000000000000000000007865c6e87b9f70255377e024ace6630c1eaa37f0000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000008000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000044a9059cbb000000000000000000000000e6d24e69a35944fd15ef2948ca8e07067bd5d57a00000000000000000000000000000000000000000000000000000000005b8d8000000000000000000000000000000000000000000000000000000000\",\"callGasLimit\":\"0xf86e\",\"verificationGasLimit\":\"0x282d4\",\"maxFeePerGas\":\"0x1609a0\",\"maxPriorityFeePerGas\":\"0x4e83c\",\"paymasterAndData\":\"0x\",\"signature\":\"0xaa5e799546d4f8a47733e03e4dd2b33e16d353d354c601fcde115d9141f149b8005d9c49edc684ab66cdf375b496038c88004a5d5b384c986c97c4a0ef85540e1b\",\"preVerificationGas\":\"0xee21\"},\"0x5FF137D4b0FDCD49DcA30c7CF57E578a026d2789\"],\"id\":44,\"jsonrpc\":\"2.0\"}", requestMethod="POST", url="https://v0-6-meta-bundler.onrender.com", code=SERVER_ERROR, version=web/5.7.1) at Logger.makeError (index.js:224:1) at Logger.throwError (index.js:233:1) at eval (index.js:261:1) at Generator.next (<anonymous>) at fulfilled (index.js:5:43)