Skip to content
This repository has been archived by the owner on May 20, 2021. It is now read-only.

eth_sign behavior is not compatible with JSON RPC spec and other wallet implementations. #32

Open
dvush opened this issue Jun 25, 2020 · 2 comments

Comments

@dvush
Copy link

dvush commented Jun 25, 2020

When using JSON-RPC method "eth_sign" as described here https://eth.wiki/json-rpc/API user is asked to sign hex of the message instead of the actual message.

This behavior in inconsistent with other wallets such as metamask, geth, argent, etc.

On the other hand "personal_sign" with the same arguments (in different order) works as expected.

@hewigovens
Copy link
Contributor

do you have sample request/response? or you just mean the UI in Trust wallet?

@dvush
Copy link
Author

dvush commented Jun 26, 2020

I don't have sample request response, because it depends on particular private key and I think it easy to generate sample request response, since "personal_sign" works as expected. (and they have the same arguments but in different order).

I used very convoluted sample page that I set up for debugging this particular issue and I think it would be easier for developers of the Trust Wallet to setup simple test that will compare outputs of "personal_sign" [1] and "eth_sign" [2] with the same arguments.

I don't think there are any problem with UI, because in UI when I use "personal_sign" I see human readable message and resulting signature is correct, but when I do "eth_sign" I see correct hex representation of this message and signature is incorrect, that is why I think that "eth_sign" signs hex of the message, but I never checked this explicitly.

  1. https://github.com/ethereum/go-ethereum/wiki/Management-APIs#personal_sign
  2. https://eth.wiki/json-rpc/API#eth_sign

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

No branches or pull requests

2 participants