-
Notifications
You must be signed in to change notification settings - Fork 122
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
[hebao] ETH_SIGN signature refine #1227
Comments
Why not just use |
But the
|
As mentioned in ERC191:
we use 32 instead of len(message), this indicates that the user must pass in a hash string. When this hash string is signed in metamask, there will be a warning, and the user can not know what he is signing, compared to a simple source text "1234". |
But the problem is that we don't hash the text data onchain, we sign actual data. So if you hash And even in the best case it would be just a long string of data without any real context of what this data means (unless that's also added in some way, but then you're basically recreating EIP712 in a worse way). The MetaMask warning even links to this which in turn links to the recommendation to switch to EIP712. I don't think there's any way to make ethsign work any better, which was the main motivation for EIP712. |
Luckily we don't need to change our contract code, this issue is closed. |
As shown above, when signatureType == ETH_SIGN, the signHash is the hash of origin message,
In this way, there will be some warnings in metamask, and a user can not see the source text when
they do the signing.
I think we should change the flowing code:
to
The text was updated successfully, but these errors were encountered: