-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
Use personal_sign instead of eth_sign for JSON-RPC #1544
Comments
Sharing what we have tested until now. For context, our app uses So far, we have identified 2 cases where we need to resort to
As a side note, I noticed that TrustWallet web3 provider does support Not relevant to this issue but listing here for completeness the other cases that we have working with
I intend to start testing tomorrow two new wallets:
We have more wallets to test in the backlog that I don't know yet when I'll be able to get to, such as:
I'll report back here with any new findings we have |
Egad. Good point. I will update the initial issue with that additional case; This change will be rolled into a minor version bump, so anyone relying on legacy |
The problem is the v3 typed data signing (i believe?) is incompatible with v4, so basically doubles the size of the typed data library, which is already quite large for a feature that is rarely used. It is probably a good idea to open an issue against TrustWallet to add v4 support though. If you can provide a concise difference between v3 and v4, I might consider it if the differences are easy to abstract. Thanks for the list and looking forward to the testing. :) |
For that, I'll paraphrase a co-worker (from here:
Which points to the MM change where So, yeah, depends on the data being hashed AFAICT. |
Reporting my findings with next 2 wallets: Status walletI can say that the dApp browser "works" with Crypto.com Defi WalletIt doesn't have a dApp browser as I thought. I assume this has nothing to do with ethers.js either. |
Two more to the list: imTokenFlawless both on dApp browser and WalletConnect. TokenPocketNo issues using dApp browser (same as above, using |
Is WC WalletConnect? I can try reaching out to them and getting it to at least throw the json-rpc “unsupported method” error. Did |
Ah yes, sorry for the lack of context. Your assumption is correct.
I've only tried Thinking about a way to easily try that with WalletConnet... For trying it out with dApp browser, I've been using https://github.com/BboyAkers/js-eth-personal-sign-examples But that doesn't have WC support. I could hard code it on ethersjs and copy it over to our dApp, or do it in our exported lib and use yalc to run that locally. I think the last option might be more practical and the least amount of effort No more time for that today, unfortunately. Will get back to it tomorrow. |
No worries. :) Basically, my ideal situation would be to move to Thanks for your help with this! :) |
I see your point and I think it's reasonable. In my case specifically, For instance, I just tested a new wallet which is the counter argument to the proposed change (replace Fantom wallet (opera)It works like an injected wallet in the Opera browser. So, I assume it does not use I've only tested in our app, since the approach used in https://github.com/BboyAkers/js-eth-personal-sign-examples didn't work. |
Hi, here is the conclusion of my tests with Portis using
|
Background
During frontier the
eth_sign
operation was used to sign raw digests, which was insecure (see EIP-191 for an explanation), so it was changed to use prefixed messages at the launch of homestead (the official Ethereum chain). However, some wallets, libraries and clients were operating off of older documentation and implemented theeth_sign
using the insecure method.So a new method,
personal_sign
was introduced to make the distinction between signing digests and signing prefixed messages.Problem
This resulted in a divide between:
eth_sign
which signs digests (insecure)eth_sign
which signed prefixed messages (ok)personal_sign
which signs prefixed messages (ok; identical to the second)Not all clients behave the same, and various combinations exist:
Yet, event more confusion, as these are difficult and/or impossible to detect which combination the current environment is using. Using any of the above calls can have the following outcome:
And keep in mind that a fully functional
eth_sign
andpersonal_sign
can return an error if the user rejects in the UI, so it is important to be able to distinguish between "detected method not supported" and "user rejected", especially since I would ideally usepersonal_sign
first and fallback ontoeth_sign
, if there are still a number of platforms that do not support the former.Fixing things; I need your help
These days, it appears most clients support the
personal_sign
method, but I would like some help identifying each client and how it operates today. So, if this issue matters to you, the best way to help us move forward is by testing your platform combination and including information about:eth_sign
andpersonal_message
are called?The text was updated successfully, but these errors were encountered: