ethereum / ethereum/execution-apis
Add eth_signMessage method
- Dominant language
- Io
- Stars
- 1.1k
- Forks
- 530
- Avg merge
- 5d 8h
- Merged PRs (30d)
- 9
Description
This issue is a predecessor to [EIP-3361](https://github.com/ethereum/EIPs/pull/3361) which is now more relevant in this repository
This proposal adds a new method `eth_signMessage` to address the fragmentation of the plaintext message signing methods currently used by Wallets in production.
While `eth_sign` was intended to be prefixed there was misunderstanding on the implementation that left unprefixed. This then lead to the introduction for a fix that was addressed with a new method in Geth called `personal_sign` which was part of a set of special methods prefixed with `personal_`. Yet these methods were not part of Ethereum's execution APIs neither were formally specified anywhere
MetaMask needed to push forward for this fix hence popularized the use of `personal_sign` to prevent unprefixed signing with `eth_sign` but to maintain backwards-compatibility it still allowed dapps to request it. The fragmentation further worsened once some new wallets start implementing `eth_sign` prefixed as the new spec was described and more documentation was written about it.
Today we have many applications relying on plaintext message signing either through `eth_sign` and/or `personal_sign` and this includes some very popular EIPs such as Sign-in-with-Ethereum (EIP-4361) which defines strict parameters for authenticated a user with a plaintext message.
This proposal aims to maintain backwards-compatibility while reducing the fragmentation of different behaviors for very similar methods. Additionally we must specify `personal_sign` behavior within the execution APIs for Ethereum with appropriate order of parameters and prefix.
Currently we have the following signing methods:
* eth_sign / unprefixed / params = [address, data]
* personal_sign / prefixed / params = [data, address]
* eth_signTypedData / prefixed / params = [address, data]
With my proposal we simply rename personal_sign and reorder params:
* eth_sign / unprefixed / params = [address, data]
* eth_signMessage / prefixed / params = [address, data]
* eth_signTypedData / prefixed / params = [address, data]
It would be a simple change that would make newer and older implementations satisfied without breaking APIs and finding consensus over using a single method
Contributor guide
Assessment
This issue has not been assessed yet.