-
Notifications
You must be signed in to change notification settings - Fork 12
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
Improve the verification of v value in signature #15
Conversation
@janx Could you review this change, especially the Ethereum part. |
c/auth.c
Outdated
|
||
// where the V value will be 27 or 28 for legacy reasons | ||
// https://ethereum.github.io/yellowpaper/paper.pdf | ||
if (recid == 27 || recid == 28) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
37 and 38 are also possible.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Yes, mainnet is this value. If we support mainnet, do we still need to support others? Or should we simply not support these?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The chain relpay protection recovery id is calculated with this method: {0,1} + CHAIN_ID * 2 + 35
since EIP-155. It should be to consider. I don't think it is a good way to keep some available CHAIN_ID
s. Because it's user's work.
c/auth.c
Outdated
// where the V value will be 27 or 28 for legacy reasons | ||
// https://ethereum.github.io/yellowpaper/paper.pdf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
The annotation seems not exact.
LGTM except the annotation |
Verify the range of
v
in sign more strictly based on official documentation or code.v = CHAIN_ID * 2 + 35
orv = CHAIN_ID * 2 + 36
.I see EIP-155 mentioned here
Test cases are being improved.