Initially thought this was a MetaMask issue but looks like it's a bug in ethers v5, ref
Describe the bug
When verifying a personal_sign signature from a Ledger hardware wallet ethers@5 will return the incorrect address.
To Reproduce
personal_sign signature with metamask in the browser console using a ledger device:> ethereum.sendAsync({
jsonrpc: '2.0', id: 1,
method: 'personal_sign',
params: ['0x6d7367', '0x73120171D5f26C93F7472b0f4F4C94C300264Bcb']
}, (a, x) => console.log(x.result))
0xfcd04509a330684eff11f6f4a872a592c33024f6d16022011f35323cb77147dd18f5600f22179721691ce4f3a2d7ee90adf6309bf86fb4bfb0740a330f8f539b01
@ethersproject/wallet in a node console:> require('@ethersproject/wallet).verifyMessage('msg', '0xfcd04509a330684eff11f6f4a872a592c33024f6d16022011f35323cb77147dd18f5600f22179721691ce4f3a2d7ee90adf6309bf86fb4bfb0740a330f8f539b01')
'0x1d741B84405D5D6cb4F05b5A74ac5588F2149B90'
ethers@4 in a node console:> require('ethers').utils.verifyMessage('msg', '0xfcd04509a330684eff11f6f4a872a592c33024f6d16022011f35323cb77147dd18f5600f22179721691ce4f3a2d7ee90adf6309bf86fb4bfb0740a330f8f539b01')
'0x73120171D5f26C93F7472b0f4F4C94C300264Bcb'
Expected behavior
When recovering the signature the same address as used in MetaMask should be returned using the ethers@5 library.
I鈥檒l look into this shortly.
Hey @ricmoo any update on this? :)
I've updated the issue #933 with this and will track progress there.
I've found the problem and am working on the fix right now.
This should be fixed in 5.0.5.
Try it out and let me know. :)
Confirmed to be working with 5.0.5. Thanks @ricmoo 馃檹