Skip to content

How to sign messages without the "\x19Ethereum Signed Message" prefix? #555

@ghost

Description

We're currently working on a project that needs to interoperate with other platforms and we're using Metamask through a Signer. However, when running something like

wallet.signMessage(message)

message will always be salted with '\x19Ethereum Signed Message:\n' + <message.length>:

https://github.com/ethers-io/ethers.js/blob/master/src.ts/utils/hash.ts#L59-L63

This will produce signatures that will not match other generic libraries.

We could use myWallet.signingKey.signDigest(hashBytes) , but unfortunately this method is not available when using a Signer attached to MetaMask.

Would it be possible to pass a flag to Wallet.prototype.signMessage to allow bypassing the salt? I can provide a PR if needed.

Thank you!

Metadata

Metadata

Assignees

No one assigned

    Labels

    discussionQuestions, feedback and general information.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions