-
-
Notifications
You must be signed in to change notification settings - Fork 1.9k
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
ethers.utils.splitSignature: recoveryParam doesn't match v value. #933
Comments
This is related to #893. I've found the problem and am putting a fix in place. It has to do with when a signature encodes the recoveryParam instead of a using the SIG header offset. So, for signatures ending in 0 or 1, that is the recoveryParam and the canonical v is 27 + recoveryParam. For signatures ending with a value 27 or higher, take that as the v and compute the recoveryParam from the ((parity of v) xor 0x01). I was doing this step before normalizing the v, so the v was equal to the recoveryParam in this case. It's harder to explain than show, once you see the code, I think the mistake will be more obvious. :) |
This should be fixed in 5.0.5. Try it out and let me know. :) |
@Amxx Can you confirm this is still an issue? I know you continued having the problem after the fix, but just curious if it was a caching issue that has since gone away? |
I think this is resolved now, so I'm going to close it. If you still have issues, please re-open. Thanks! :) |
ethers.utils.splitSignature("0x84708e867ef906fc61eecacf38218a209718e9529c32b33f5d68ee4c240b76133e3aeb2bacec6ae4b3fe0f9d982b214d265abe5434175dc41fc46210ff81a0da01")
returns
I was expecting (for the most common cases where 27 <= v <= 28) to have
v = 27 + recoveryParam
The text was updated successfully, but these errors were encountered: