Eth_sign doesn't conform to RPC API


It seems to me that Metamask’s handling of eth_sign is wrong. According to 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?

Hi @kyepskee ,

does this section of the developer docs ‘signing data’ get you any info that helps?

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 :slight_smile:

1 Like

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!

This topic was automatically closed 30 days after the last reply. New replies are no longer allowed.