It seems to me that Metamask’s handling of eth_sign is wrong. According to eth.wiki the second argument of eth_sign is N bytes - any message to be signed. However, ethereum.request({ method: 'eth_sign', params: [address, "hello"] })
throws the following error: “RPC Error: eth_sign requires 32 byte message hash”.
To verify, I even used web3.js’s web3.eth.sign and it threw the same error. Am I doing something wrong? How to remedy this?
Yeah, but still, this is a bug. eth_sign’s argument is wrong, it shouldn’t be a hash of a message but the message itself and thus is wrong. I hope you can fix this
Can you create an issue for it on GitHub, along with the steps to reproduce and the transaction hash of your successful transaction when this error message comes up? Thanks!