1

I am using the following code to sign a message:

web3.currentProvider.sendAsync(
  {
    jsonrpc: '2.0',
    id: 1,
    method: 'personal_sign',
    params: [
      `My account is ${this.accounts[0]}`,
      this.accounts[0],
    ],
  },
  (err, res) => {
     // send res.result to server
  },
);

on the server i do the following:

// Recover the public key
const candidate = web3.eth.accounts.recover(`My account is ${account}`, signature);

// Verify the recovered key and the key making the request are the same
return ethUtil.toChecksumAddress(candidate) === ethUtil.toChecksumAddress(myPublicKey)

This works correctly when using MetaMask, but the recovered address does not match when using Opera on android. From what I can tell both are using v0.20.7 of web3. Anyone have any ideas?

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Browse other questions tagged or ask your own question.