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

ecrecover precompile allows EIP-155 style v value #678

Closed
axic opened this issue Jun 9, 2022 · 2 comments
Closed

ecrecover precompile allows EIP-155 style v value #678

axic opened this issue Jun 9, 2022 · 2 comments

Comments

@axic
Copy link

axic commented Jun 9, 2022

As discussed in ethereum/yellowpaper#860 the ecrecover precompile only allows v={27,28} and no other value.

The precompile code (here) calls ecdsa::is_valid_signature to check r/s values and ecdsa::v_to_y_parity_and_chain_id to retrieve the v value.

This latter seems to silently allow EIP-155 style v values too, which would be against the spec.

@yperbasis
Copy link
Member

yperbasis commented Jun 10, 2022

It's not a problem because later the precompile rejects EIP-155 values.

@axic
Copy link
Author

axic commented Jun 10, 2022

Oh you mean the parity_and_id->chain_id != std::nullopt part? Yeah, it is a bit confusing, but I see all of this has been rewritten/reworked now.

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

No branches or pull requests

2 participants