MetaMask / metamask-extension

:globe_with_meridians: :electric_plug: The MetaMask browser extension enables browsing Ethereum blockchain enabled websites
https://metamask.io
Other
12.01k stars 4.91k forks source link

Can't verify signed message with MM and trezor wallet #7594

Closed maptuhec closed 1 year ago

maptuhec commented 4 years ago

Describe the bug When signing a message with metamask and trezor wallet I get invalid singature. I am using web3js for triggering the msg sign. When I get the signature, etherscan verifications says that the signature can't be verified. The second check was to run it against ecrecover, and the result from it is wrong address(not the one used to sign the message).

This is what I am using in the js code: let signature = await $web3.eth.sign($web3.utils.sha3(msg), _coinbase) where msg is the msg to sign and coinbase is the ETH publickey

To Reproduce Steps to reproduce the behavior:

  1. Try signing this message: ak_TgaLnCYN1wtXP9KKQz3apMNzXMuUJa9gXbv4o5uW73tRW8Gue with an eth account: I have used 0x284aa677bf83a0e7e5f3ba13ddda1f9569132807
  2. Try signing the message using MetaMask and Trezor wallet.
  3. Try to verify the signature in etherscan.
  4. Try to ecrecover the eth address with the msg hash and signature.
  5. Check whether the recovered address is the one used for signing the message.

Expected behavior Expectations were that the signed message can be verified. After ecrecovering the msg hash with the signature, expected result is the ETH address used to sign the message.

Screenshots

image

Result from ecrecover the msg hash and signature: image

Browser details (please complete the following information):

tmashuang commented 4 years ago

Which version web3 are you using? Possibly using ^1.0.0, since the params look swapped https://web3js.readthedocs.io/en/v1.2.1/web3-eth.html#sign compared to https://github.com/ethereum/wiki/wiki/JavaScript-API#web3ethsign, just want to confirm.

maptuhec commented 4 years ago

I am using version 1.2.1

maptuhec commented 4 years ago

Any update on this issue? It has been two months now?

github-actions[bot] commented 1 year ago

This issue has been automatically marked as stale because it has not had recent activity in the last 90 days. It will be closed in 45 days if there is no further activity. The MetaMask team intends on reviewing this issue before close, and removing the stale label if it is still a bug. We welcome new comments on this issue. We do not intend on closing issues if they report bugs that are still reproducible. Thank you for your contributions.

github-actions[bot] commented 1 year ago

This issue was closed because there has been no follow up activity in the last 45 days. If you feel this was closed in error, please reopen and provide evidence on the latest release of the extension. Thank you for your contributions.