-
-
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
add status.im condition for eth_sign #1285
Conversation
add status.im condition for eth_sign
But it does support What is the security concern that Also, do they both throw in the event it is unsupported? Ideally I would like to try one and if an "unsupported error" is returned try the other... |
Oh! Also, if you know someone on status.im, can you tag them here, so they get notified. :) |
https://medium.com/metamask/the-new-secure-way-to-sign-data-in-your-browser-6af9dd2a1527
yes sure, @flexsurfer ;) |
LOL! Perfect, I was hoping so. ;) If the only difference is the prefixing, then that is also what What happens in status if return this.send("eth_sign", blah).then((result) => {
processResult(result);
}, (error) => {
if (hasSomeObviousWayToDetectUnsupportedOperation(error)) {
this.send("personal_signMessage", blah).then((result) => {
processResult(result);
});
}
}); For example, will the JSON-RPC response with error code -32601? I need to try out the most popular wallets to make sure this works. For now, I can add logic similar to what you've proposed in this PR, but am looking for something more scalable, especially with v6 on its way. Thanks! :) |
Fixed in 5.0.30. Try it out and let me know if there are any issues. :) |
Hey guys, I think that the |
@ricmoo any thoughts on this? |
@kenshyx I would need to investigate further. I am also curious why those other clients return wrong hashes; are they using the legacy implementation of eth_sign, in which does not EIP-191 prefix the message? If so, then there are massive security holes in those systems. If you'd like to open new issue with your findings, that'd be awesome. Could you include a table of each client you tried, the message you signed and the result of eth_sign and personal_sign? I would ideally like a way to detect whether a client supports personal_sign, but the problem is historically some clients just hang and never respond. If personal_sign is a hard fail, and I can fall back onto eth_sign, that is fine. But we really need a good list of what clients support which, and in the event they don't support it whether how they fail (return an error vs hang indefinitely). |
(also, make sure the discrepancy isn't a bug in the WalletConnect library you are using :)) |
@ricmoo I know this is closed, but this is an issue for non-metamask/non-status wallets (like https://github.com/torusresearch/torus-embed), I understand that there's no reliable way to find out if a provider supports personal_sign so it's hard to make a decision on what the default should be, but in the meantime perhaps we could add a way to override this behavior somewhere, since that would help make all these wallets compatible. |
@ricmoo We're also running into this issue as it relates to WalletConnect, moving from our dapp just supporting MetaMask to supporting WalletConnect too, which I think is a very common use case. This earlier comment in this thread summarizes our situation well. What about a new optional method that always uses |
I am still very open to making this a wider change. I need the following from people with access to larger sets of environments. A list with:
Basically, I want a safe way to detect which to use and when to fallback. As a prime example, it cannot just use the logic "if you fail, fallback onto the other", since if a person is asked to Ideally I'd love to make this process "just work". And maybe now its safe to move to |
I'm very interested in this subject as I'm currently facing issues with TrustWallet dApp browser. For a little context, our dApps default is to use An attempt to fix is to fallback to But, finally found out that The problem I see writing a solution to rule them all ™️ as mentioned, is that (in TrustWallet's case at least) This is a snipped from a co-worker who found out about the import { OrderKind, SigningScheme, decodeSignatureOwner } from "./src/ts";
const domain = {
name: "Gnosis Protocol",
version: "v2",
chainId: 1,
verifyingContract: "0x3328f5f2cEcAF00a2443082B657CedEAf70bfAEf",
};
const order = {
sellToken: "0xC02aaA39b223FE8D0A0e5C4F27eAD9083C756Cc2",
buyToken: "0x6B175474E89094C44Da98b954EedeAC495271d0F",
sellAmount: "98800574115482334",
buyAmount: "329621405635476313512",
validTo: 1620081463,
appData: "0x0000000000000000000000000000000000000000000000000000000000000000",
feeAmount: "1199425884517666",
kind: OrderKind.SELL,
receiver: "0x4CBc3B6B16Ac4218169078aDd37947B76127E10B",
partiallyFillable: false,
};
const signature =
"0x3c1c130149a870dc481065ea37af5514625f9d8265926f9a7657f0f95ad2e279328f2722fc11f1cae11a2fb5748f94c8463e9c3f15a4d065dcb188eb17b9a6a71c";
console.log(`Owner: ${order.receiver}`);
for (const signingScheme of [SigningScheme.EIP712, SigningScheme.ETHSIGN]) {
const recoveredOwner = decodeSignatureOwner(
domain,
order,
signingScheme,
signature,
);
console.log(`Recovered ${SigningScheme[signingScheme]}: ${recoveredOwner}`);
} Output:
|
Please see #1544. Add any environments you have access to. :) |
Add status.im condition for eth_sign. Status.im doesn't support eth_sign for security reason