Sign a message with private key of the user?

I use Plug and Play SDK, Web-No-Modal.

I want to sign a message in the frontend using SDK, and I want to verify the signature in my backend.

But I want to sign with user’s private key for authorization purposes in my backend. But using getPrivateKey function doesn’t feel right for this purpose since private key can’t be exposed to browser. Is there a better way from web3auth to sign message with wallet?

Thanks in advance,

Hey @gorkem

Have you taken a look at this?

Hey @shahbaz

Yes, I did. But since web3.eth.personal.sign takes 3 parameters, it gives the following error:

Web3ValidatorError: Web3 validator found 1 error[s]:
value at "/2" is required

The third parameter it accepts is the account password, which is not the private key of the user. This is where I got confused.

Have you tried with Sign Typed Data v1, v3 or v4?

Hi @shahbaz

Which function will I use in my backend to recover the signature in this case?

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