Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix Ledger signatures (and other non compliant ECDSA signatures) #128

Merged
merged 4 commits into from
May 25, 2023

Conversation

q1keonchain
Copy link
Contributor

Ledger produces v,r,s signatures with a canonical v value of {0,1}, while Ethereum's ecrecover call only accepts a non-standard v value of {27,28}. More on that here.

Ledger was producing signatures that are not compatible with Ethereum's ECDSA implementation, and thus was failing on the public key recovery process.

As shown by Tenderly, the public key recovery was resulting in address(0) even if a Ledger message appeared to be signed correctly.

image

@vercel
Copy link

vercel bot commented May 25, 2023

The latest updates on your projects. Learn more about Vercel for Git ↗︎

Name Status Preview Comments Updated (UTC)
agreements ✅ Ready (Inspect) Visit Preview 💬 Add feedback May 25, 2023 8:17pm

Copy link
Contributor

@xPi2 xPi2 left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Tested. Great finding @q1keonchain !!

@xPi2 xPi2 merged commit ab9a714 into main May 25, 2023
@xPi2 xPi2 deleted the fix-ledger-signing branch May 25, 2023 20:44
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants