Invalid signed message generated by @tkey-mpc SDK package js

Hi! Referring to this guid https://web3auth.io/docs/content-hub/guides/tkey-js-mpc, I have a production project with exactly same package versions and setup. I try to do a web3.eth.personal.sign but I am not able to recover the signedMessage as it produces different account address every time. Personal Recover | EthSigner and different Eth Signers used to recover wallet address but failed. any help would be appreciated!

could you provide the snippet for better debugging and understanding

also checkout https://web3auth.io/docs/sdk/core-kit/mpc-core-kit
this is wrapper on top of tkey also minimal lines of code and better maintainability, also check if this can help you out

Hi I already mentioned the guide. This is the link to the source code tkey-examples/tkey-mpc-web/tkey-mpc-react-popup-example at main · tkey/tkey-examples · GitHub you can pull & run locally.
After creating the web3js object try to sign with eth personal sign:

       const accounts = await web3.eth.getAccounts();
      const account = accounts[0];
      const msg = "Welcome to Example Website.\nYou need to sign this message in order to use Example Website services. By signing this message, you agree with the Terms of Service.\nhttps://site.com/terms";
       const signedMessage = await web3.eth.personal.sign(
              msg,
              account,
              "",
            );

and then use signedMessage to recover account address with any ethereum signer like the one mentioned in the question (Personal Recover | EthSigner) and you get different account from the account address used to sign the message

i have created a pr
main changes

thanks for pointing out the issue

1 Like

This topic was automatically closed 2 days after the last reply. New replies are no longer allowed.