Enjin wallet issue with personal_sign

alex_opensea

New member
Hi! I was wondering if Enjin Wallet has some nuance with doing personal_sign.
when calling

web3.currentProvider.sendAsync({

method: 'personal_sign',

params: [message, signerAddress],

from: signerAddress,

})

I’m seeing signatures that do not correspond to the signerAddress when doing the normal ecrecover(msg, sig.v, sig.r, sig.s) from solidity (and from python ethereum libs).

All other wallets, including MetaMask, seem to work fine. Anyone have ideas?
 
Last edited:

VillageIdiot

New member
Frontend signing metamask+enjin wallet:
function signMessage()
{
web3.eth.getAccounts().then(function(result) {currentAccount = result[0]});
web3.eth.personal.sign(web3.utils.fromUtf8(nonce), currentAccount).
then(function(result)
{signedMsg = result;
document.getElementById("signedMesssage").value = signedMsg;
finalizeLogin();
});
}
Backend verification python:
def verifyMessage(self,ethaddress,signedMsg):
nonce = self.getNonce(ethaddress)
hexnonce= defunct_hash_message(text = nonce)
resultAddress = web3.Account.recoverHash(hexnonce,signature = signedMsg)
if(resultAddress.lower() == ethaddress.lower()):
return True
return False


Check if address handling is checksumed (ie with uppercase characters) on both signing and checking side.
Maybe some funky stuff there ?
 

alex_opensea

New member
This type of verification works fine, but it looks like when signing hashes (output of `ethUtil.bufferToHex(ethABI.soliditySHA3(types, values))`) there's an issue.
 
Top