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

Cheap inversion with 32 bytes helper value #33

Open
kilic opened this issue Nov 24, 2023 · 2 comments
Open

Cheap inversion with 32 bytes helper value #33

kilic opened this issue Nov 24, 2023 · 2 comments

Comments

@kilic
Copy link

kilic commented Nov 24, 2023

Alongside with pubkey and signature transaction caller may provide an inverted value then we can check the inversion (a * a_inv == 1) mod n. So that modexp call can be skipped

@nalinbhardwaj
Copy link
Member

nalinbhardwaj commented Dec 8, 2023

Good idea, while this would certainly reduce computation gas cost, it would increase call data used and thus, the L1 calldata fee (which is the dominant cost) for users of the contract on L2s; Since that's the primary use case ATM we probably won't implement this.

@kilic
Copy link
Author

kilic commented Dec 8, 2023

Single 32 byte helper would suffice If it is multiple signature verification case with batch inversion technique. But I'm not sure it would worth to touch too many places if modexp cost is not that high

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