metamask-extension icon indicating copy to clipboard operation
metamask-extension copied to clipboard

Support EIP-712 signing for Ledger accounts

Open remyroy opened this issue 5 years ago • 116 comments

Describe the bug When using a website that tries to sign data using EIP-712 structured data signing and a Ledger account, MetaMask fails with not supported error messages.

Steps to reproduce

  1. Find a website that uses EIP-712 signing
  2. Connect a MetaMask Ledger account
  3. Start the signing process
  4. Notice the error

MetaMask returns the following as an error:

MetaMask - RPC Error: MetaMask Message Signature: Error: Not supported on this device {code: -32603, message: "MetaMask Message Signature: Error: Not supported on this device", data: {…}}

A simple way to reproduce is to use this proof of concept that uses ethers.js 5.0.26 on https://github.com/remyroy/api-usage-examples/blob/master/EIP-712/sign_flat.html .

Expected behavior A website trying to sign data using EIP-712 structured data signing and a Ledger account should be able to do so with MetaMask without any issue.

Browser details (please complete the following information):

  • OS: Windows 10
  • Hardware Wallet: Ledger Nano X Firmware version 1.2.4-5, Ethereum App Version 1.6.4
  • Browser: Brave Version 1.19.86 Chromium: 88.0.4324.96 (Official Build) (64-bit)
  • MetaMask Version: 9.0.1

Additional context (Error Messages, etc.) EIP-712 signing support has been added to Ledger hardware wallets with Ethereum App Version 1.5.0 on September 25th, 2020.

remyroy avatar Jan 21 '21 17:01 remyroy

Thank you for the report @remyroy ! Is this something you've noticed recently stopped working or has never worked to your knowledge?

darkwing avatar Jan 21 '21 18:01 darkwing

I'm not a regular user of EIP-712 signing on Ledger, but my guess is that it never worked since the hardware support has been added recently and MetaMask changes as noted in the changelog since that added support have been very small and especially small in relation to Ledger hardware wallets.

remyroy avatar Jan 21 '21 18:01 remyroy

It looks like we're using v5.22.0 of @ledgerhq/hw-app-eth right now, and experimental support of EIP-712 was added in v5.27.0.

Gudahtt avatar Jan 21 '21 20:01 Gudahtt

So what is missing to fix this? Looks like the keyring pull request was merged.

torfbolt avatar Feb 25 '21 17:02 torfbolt

See https://github.com/MetaMask/eth-ledger-bridge-keyring/pull/56#issuecomment-775483760, it's literally

  signTypedData () {
    throw new Error('Not supported on this device')
  }

https://github.com/LedgerHQ/ledgerjs/blob/v5.43.0/packages/hw-app-eth/src/Eth.js#L360 might have the functions required, and https://github.com/LedgerHQ/ledger-live-common/blob/master/src/families/ethereum/hw-signMessage.js might show it being used. Feeling like creating a PR, @torfbolt ? :)

yorickdowne avatar Feb 25 '21 17:02 yorickdowne

Update: we’ve got a PR closing that updates our ledger library version to the one that supports signTypedData, so updating this issue to reflect the final step of adding the method to our ledger keyring that can pass through to it.

danfinlay avatar Mar 08 '21 02:03 danfinlay

Mở

tuanggolt avatar Mar 08 '21 02:03 tuanggolt

Hey @danfinlay great to hear the fix is prepped and ready, any further word on when it might be released? Have a few people on our dapp caught out by it.

geoffwellman avatar Mar 13 '21 08:03 geoffwellman

great to hear the fix is prepped and ready

This is not accurate, but as you can see in the current "Project" field, this issue is now "ready", ie it is eligible to be worked on in the current sprint (the next 1.5 weeks now), and would then be in the next release (usually at the beginning of a week).

danfinlay avatar Mar 16 '21 16:03 danfinlay

Oh sorry, our project board is currently private! I'll propose we open that up, I'm not sure it's private on purpose.

So the news is: We have most of the work done, and the last bit may be done in the next two weeks (as long as it is as simple as we expect it to be)!

danfinlay avatar Mar 16 '21 17:03 danfinlay

hey @danfinlay - how did the proposal go to open up the project board? and more importantly any light at the end of the tunnel for this issue?

geoffwellman avatar Mar 24 '21 05:03 geoffwellman

Seconding Geoff's question

LizardCollective avatar Mar 28 '21 21:03 LizardCollective

Looking forward for this fix! What's the status?

ivanhueso avatar Mar 28 '21 23:03 ivanhueso

+1 looking forward for the fix as well!

albertchon avatar Mar 29 '21 16:03 albertchon

hey @danfinlay, any updates on this?

ap08723 avatar Mar 30 '21 04:03 ap08723

Looking for support on this also. Any news?

berzo84 avatar Mar 30 '21 09:03 berzo84

I struggle same problem like many unable login to opensea matic with metamask ledger nano. Sirs is there timeline for resolution with metamask ledger issue @danfinlay. Thank you sir.

drish-singh avatar Mar 30 '21 17:03 drish-singh

This issue will be addressed as soon as makes sense, is at least 4 weeks out, so thanks for your patience. I will lock the topic if people keep spamming it to ping me. Just use the 👍🏽React on the top comment to indicate your support please.

danfinlay avatar Mar 30 '21 20:03 danfinlay

Hey @danfinlay ! Not trying to spam, but wanted to ask if there is any workaround here since I don't see that topic represented in the current comments. I also wanted to highlight the significance of this issue as I have a rather large amount of NFTs that are locked on the Zed.run platform until this fix goes in, and I believe several others do as well. Thanks Dan!

MikeDRoss avatar Mar 30 '21 22:03 MikeDRoss

@MikeDRoss we are in the same situation at www.withTally.com, and I think the truth is that there is no workaround right now and we just need to be patient.

crazyrabbitLTC avatar Mar 30 '21 22:03 crazyrabbitLTC