fix: fall back to blind signing when clear signing not supported by Ledger device#41017
Merged
fix: fall back to blind signing when clear signing not supported by Ledger device#41017
Conversation
Add INS_NOT_SUPPORTED fallback in signTypedData: try clear signing (signEIP712Message) first; if the device doesn't support it, compute EIP-712 domain and message hashes and use signEIP712HashedMessage instead. Mirrors Ledger Live's approach and restores compatibility with Ledger Nano S.
Contributor
|
CLA Signature Action: All authors have signed the CLA. You may need to manually re-run the blocking PR check if it doesn't pass in a few minutes. |
Contributor
Builds ready [6d556cc]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Test the INS_NOT_SUPPORTED fallback path in signTypedData that falls back to signEIP712HashedMessage when clear signing is unsupported.
Contributor
Builds ready [6f4cd8c]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
montelaidev
approved these changes
Mar 19, 2026
Contributor
montelaidev
left a comment
There was a problem hiding this comment.
LGTM code wise. I can't test because i don't have a nano
|
Contributor
Builds ready [10515dd]
⚡ Performance Benchmarks
🌐 Dapp Page Load BenchmarksCurrent Commit: 📄 Localhost MetaMask Test DappSamples: 100 Summary
📈 Detailed Results
Bundle size diffs
|
Member
|
Test Dapp Sign Typed V4 and Permit ledger-nano-s.movUniswap signatures nano-s-uniswap.mov |
gantunesr
approved these changes
Mar 19, 2026
Member
gantunesr
left a comment
There was a problem hiding this comment.
lgtm and tested with Nano Gen5
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to subscribe to this conversation on GitHub.
Already have an account?
Sign in.
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.



Description
signTypedDatapreviously used onlysignEIP712Message(clear signing), which is not supported on Ledger Nano S. This change adds a fallback: if the device returnsINS_NOT_SUPPORTED, it computes the EIP-712 domain separator and message struct hashes and callssignEIP712HashedMessage(blind signing) instead. This mirrors Ledger Live's approach and restores EIP-712 signing compatibility with Ledger Nano S.Changelog
CHANGELOG entry: Fixed EIP-712 typed data signing for Ledger Nano S devices
Related issues
Fixes: #39983
Manual testing steps
Screenshots/Recordings
Before
Screen.Recording.2026-03-18.at.17.44.13.mov
After
Screen.Recording.2026-03-18.at.17.42.07.mov
Pre-merge author checklist
Pre-merge reviewer checklist
Note
Medium Risk
Changes EIP-712 signing behavior for Ledger devices by adding a clear-signing fallback path that computes hashes locally and uses
signEIP712HashedMessage; incorrect hash computation or error classification could cause signature failures on some devices.Overview
Restores EIP-712 typed-data signing on Ledger devices that don’t support clear signing by catching
INS_NOT_SUPPORTEDfromsignEIP712Messageand falling back tosignEIP712HashedMessageusing locally computed domain/message struct hashes.Adds helpers in
app/offscreen/ledger.tsto detect the specific Ledger error and compute EIP-712 hashes via@metamask/eth-sig-util, and expandsledger.test.tsto cover clear-sign success, theINS_NOT_SUPPORTEDfallback, and non-fallback error propagation.Written by Cursor Bugbot for commit 10515dd. This will update automatically on new commits. Configure here.