-
Notifications
You must be signed in to change notification settings - Fork 11.8k
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
Implement 0x00
version of EIP191 in ECDSA Library
#3772
Comments
Hello @YamenMerhi That is an interesting proposal. Do you know any wallet that include support for version |
Hey @Amxx As I stated in my message, we are planning to use it in the LSP6KeyManager contract, also when I met nick.eth in DevCon he mentioned that he uses it for xenium. Also when I checked argent, their old multisig use it with a weird combination of With the rise of smart contract-based accounts and wallets, I think it will start to be used more and more, and we should push to have it as anyone could be tricked to sign a I made a PR to the EIP191 standard to make it more comprehensible and the LUKSO team is also developing a library EIP191-Signer that allows signing different versions of EIP191 messages ( |
Thanks for all this information! I was only saying that because many devs still make the error of not using the "preparation" function, and not understanding the difference between rawsign and personalsign. I hope adding this new function doesn't add to the confusion. Also, I want us to test it, and for that we'll need to produce the corresponding signature, hopefully without using some low level rawsign. |
@Amxx Definitely we want to avoid confusion as much as possible. If you want to create a list of things to test, change, do please do, and let's sync on it 😀 |
Sorry for the silence. This is simple enough, I'm not opposed to a PR implementing it. |
Okay will do a PR, thanks! @frangio |
🧐 Motivation
In the current
ECDSA
library, there is support to construct a message to sign according to the EIP191 Standard with the following:0x45
(E) withtoEthSignedMessage(..)
function0x01
with thetoTypedDataHash(..)
function.But we are missing the
0x00
version.📝 Details
After looking at this closed issue, saw a comment from @frangio stating that
0x00
version is not that used, which is true because people are misusing the standard, they are using the0x45
version for everything: signing message for offchain verification, for smart contract execution based on signatures, which is dangerous.As people could be easily tricked to sign a normal message, we should have a different mechanism, then different handling for execution based on signatures, and that's why we should make people use the
0x00
version for this case. + some projects are starting to use it like xenium and the lsp-smart-contracts (planning to use it).I am suggesting to add a new function
toDataWithIntendedValidator(...)
to be compatible with the version0x00
taking 2 parameters,<address validator>
and<bytes dataToSign>
.The function would be:
If you're okay with it I am happy to open the PR, otherwise you can close the issue 😄
The text was updated successfully, but these errors were encountered: