Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

eth_sign is not adding the expected prefix #9957

Closed
rmeissner opened this issue Nov 30, 2020 · 1 comment
Closed

eth_sign is not adding the expected prefix #9957

rmeissner opened this issue Nov 30, 2020 · 1 comment

Comments

@rmeissner
Copy link

rmeissner commented Nov 30, 2020

Describe the bug
Currently calling eth_sign will sign the raw message hash provided in this call (which seems to be expected when looking at comments and #1930). According to https://eth.wiki/json-rpc/API#eth_sign this method should return a signature based on the prefixed message hash.

This also leads to inconsistencies when a hardware wallet is connected (e.g. Trezor see Legacy and Model T) as they add the prefix.

Steps to reproduce (REQUIRED)

  • call eth_sign with a message hash
  • The returned signature is the raw hash signed.
  • TODO: add simple example app

Expected behavior

Edit:
The method with the expected behaviour is personal_sign ... I just find it very confusing that MetaMask is not following the common behaviour here to use this for eth_sign

@danfinlay
Copy link
Contributor

MetaMask implemented eth_sign back before it had a prefix, when this behavior was the most widely used behavior. Geth then decided to add the prefix out of security concerns, but we already had applications relying on our behavior, so we did not have the luxury of changing the behavior of our existing methods.

You can read more about this history here

Rather than remove the method for security concerns, we added a strong warning for usage, and this has seemed to mitigate dangers to users, as it makes users appropriately skeptical of any such signature they approve.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants