Closed cxkoda closed 2 years ago
My reading of EIP-191 is that it only requires the 0x19
prefix, and that personal_sign
as implemented by ECDSA.toEthSignedMessageHash
is consequently a subset of that. I don't think we should be limiting to the most specific functionality.
As for how we change eth.Signer()
, we should definitely add PersonalSign()
and probably even ERC191Sign()
. Let's chat about whether we foresee raw signing being necessary in the future (for now we can always change Sign()
to sign()
to keep it around but not exposed).
Sorry I should have opened an issue for that, since the PR is somewhat outdated now. I agree - let's not touch the raw signs and keep them around for now.
As far as I have understood, it is not only prepending 0x19
but also some version + version specific data like "\x19Ethereum Signed Message:\n" + len(message)
in the case of personal signatures.
I'll submit a new PR, putting this into Signer.PersonalSign()
for now.
Rationale
Switch to signed messages that conform to the EIP-191 standard.
This PR builds on #1.
Implementation
ECDSA.toEthSignedMessageHash
to convert hashes inMessageGenerator
Go
ECDSA.toEthSignedMessageHash
EthSign
that uses conform messagesEthSign
instead ofSign
for message signingShould
Sign
be deprecated?