Skip to content

Clarify ECDSA verification in RIP 7212#62

Open
tjade273 wants to merge 1 commit intoethereum:masterfrom
trail-of-forks:rip-7212-patch-1
Open

Clarify ECDSA verification in RIP 7212#62
tjade273 wants to merge 1 commit intoethereum:masterfrom
trail-of-forks:rip-7212-patch-1

Conversation

@tjade273
Copy link
Copy Markdown

The x coordinate of R may be greater than n.

The current specification of RIP-7212 compares the x coordinate with the signature r value directly (as integers, presumably), which may return false when the standard result should be true

This happens with negligible probability for honest signatures, but a malicious signature can be constructed which triggers this case. Disagreement could cause differing behavior on various EVM chains.

Similarly, it is not specified what should happen when the recovered R' is the point at infinity. Most implementations will likely fail (correctly) but some may incorrectly treat R'.x as 0.

The `x` coordinate of `R` may be greater than `n`. 

The current specification of RIP-7212 compares the `x` coordinate with the signature `r` value directly (as integers, presumably), which may return `false` when the standard result should be `true`

This happens with negligible probability for honest signatures, but a malicious signature can be constructed which triggers this case. Disagreement could cause differing behavior on various EVM chains.

Similarly, it is not specified what should happen when the recovered `R'` is the point at infinity. Most implementations will likely fail (correctly) but some may incorrectly treat `R'.x` as `0`.
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.

1 participant