"personal_sign" response verification failure
We are developing android and ios dapps using WalletConnect library. After requesting wallet address, I call "personal_sign" method to verify user and I get the signature string. In order to validate the signature we use nethereum on server side. Here comes the problem. Until Metamask v4.1.1 this process was working without any problem but after v4.1.1 we can not verify the signature. If I run my application code on a device that has metamask v4.0.1 it works normally but even though i can get signature string using newer versions validation can’t success.
Anyone has an idea about this?
Smartphone (please complete the following information):
- Device: Google Pixel 3A
- OS: Android 12
- App Version 4.2.2
Our app is experiencing exactly the same error
We found the reason and a solution to this error. When you request wallet address from the older versions of Metamask it returns the address using both lowercase and uppercase characters like "0x593A4e.....15A23aD3". In the newer versions it only returns in lowercase like "0x593a4e.....15a23ad3". In the signature verification result, you get wallet address with mixed lowercase and uppercase characters. So you should ignore the case sensitivity for comparing wallet address’.
Hey @rollue, did @KAPLANDROID's solution also worked for you?
@KAPLANDROID
Hey, can you please give me more detail.s
Where to apply the change ?
Bcz, control is going to Metamask, but dialog is not showing up.
I checked the address, I am getting all small cases after connection and for signing I am also passing all small cases.
@jayvs6341
After signing the message on MetaMask app, you get the signature response. While decrypting this signature you will retrieve the wallet address in mixed case like "0x593A4e.....15A23aD3". So you need to ignore case sensitivity while comparing wallet addresses.
This was the problem we faced while validating the signature.
@KAPLANDROID But, for V4.1.1 after metamask , the signing dialog is not coming. I am struggling to get the dialog in metamask. For V4.1.1 and before, it shows the dialog.
@jayvs6341 I don't face this problem. Probably, you have problem with "personal_sign" call. You can check this code snipped. It works on my end.
Session.MethodCall.Custom( txRequest, "personal_sign", arrayListOf( getFormattedMessage(), // message to sign walletAddress ), ) session.performMethodCall(customMessage, ::handlePersonalSignResponse)
@KAPLANDROID Did you try to send a transaction function ? Can you help me with that? My main focus is to send transactions. I want to approve the transaction through metamask. As I told you, metamask V4.1.1 works fine, I can see the transaction approval dialog. But After V4.1.1, my app can redirect to mertamask, but I don't see any dialog.
@jayvs6341 sorry i edited my previous comment. It is just for "personal_sign" dialog not transaction.
@KAPLANDROID Okay, Thanks for your answer,still I am not getting the dialog in metamask. Not sure why.
@jayvs6341 I have encountered the same problem.In v5.1.1, i don't see any dialog,but V3.7.0 it works fine. How did you solve it?