I am getting wrong signature on trust wallet. I am getting signature in some encrypted way and when trying to verify it its giving wrong recovered address, its working with metamask mobile wallet but not with trust wallet

Please provide the following details too when asking for help in this category:

  • SDK Version: 6.1.4

  • Platform: React js

  • Browser Console Screenshots:

  • Related to Custom Authentication? Please provide the following info too: (Optional)

    • Verifier Name:
    • JWKS Endpoint:
    • Sample idToken(JWT)

Please provide the Web3Auth initialization and login code snippet below:
if (connectedAddress) {
try {
const provider = new ethers.providers.Web3Provider(
web3auth.provider
);
let nonce = “”;
await provider
?.getTransactionCount(connectedAddress)
.then(async (result) => {
nonce = CryptoJS.AES.encrypt(
JSON.stringify(result),
“DASecretKey”
).toString();
});
console.log(“siteUrl”, siteUrl, “nonce”, nonce);
const signer = provider.getSigner();

        const originalMessage = `Welcome to Digital Arms!\n\nClick to sign in and accept the Digital Arms Terms of Service: ${siteUrl}/\n\nThis request will not trigger a blockchain transaction or cost any gas fees.\n\nYour authentication status will reset after 24 hours.\n\nWallet address:\n${connectedAddress}\n\nNonce:\n${nonce}`;
        const signature = await signer.signMessage(originalMessage);
        if (signature) {
          userAuth(
            connectedAddress,
            signature,
            originalMessage,
            user?.email ? user.email : ""
          );
        } else {
          console.log("disconnect wallet");
          await web3auth?.logout();
          //await onboard.disconnectWallet({ label: wallets[0].label });
          NotificationManager.error(
            "User Denied Signature",
            "",
            NOTIFICATION_DELAY
          );
          setTimeout(() => {
            window.location.reload();
          }, 1000);
          refreshState();
        }

        console.log("signature", signature);
      } catch (error) {
        await web3auth?.logout();
        console.log(
          "denied message is--->",
          error.message,
          typeof error.message
        );
     
    }

Trust Wallet

@neha.decrypt Thanks for reaching out.

Your issue has been forwarded to our team and we will get back with further updates once more information becomes available.

1 Like

Hi @neha.decrypt may I know do you fix this issue? recently we have same issue, but don’t know how to fix.

Hi @vjgee any update about this issue?