-
Notifications
You must be signed in to change notification settings - Fork 84
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
Generalize fields and curves #24
Comments
@vbuterin I am interested in generalizing and making the code flexible, could you please tell me the source of this whole codebase, such as a research paper or something. It would help me better in the understanding. |
Elliptic curve pairings in general: https://medium.com/@VitalikButerin/exploring-elliptic-curve-pairings-c73c1864e627 BN128: BLS-12-381: https://z.cash/blog/new-snark-curve/ |
The following things come to my mind.
Also the only difference I see in all the curves is
@vbuterin are my facts right or am I missing anything. |
Design seems 👍 Removing all of the runtime assertions would be nice, but lets make sure that they are all still executed as part of the test suite. |
@vbuterin in the py_ecc/py_ecc/bn128/bn128_curve.py Lines 139 to 140 in 212b193
|
Yeah, that seems like a mistake.... Here's the math: if in G2, |
I'd say keep the names as |
@Bhargavasomu if you've got any reference materials for the math of these functions please feel free to toss links to them in the README. |
@vbuterin we have another issue with the This error occurs because after changing the py_ecc/py_ecc/bn128/bn128_curve.py Lines 143 to 145 in b014882
To fix this, I believe we need to adjust the values of our EDIT : By |
Also piggybacking in the same thread, the following tests have been failing after I have changed the
|
@vbuterin, my apologies for pinging you multiple times. But I would greatly appreciate your help regarding how to adjust the constants, in regards to the above comments. |
OK, I think I figured it out. In the |
Update default author email
Currently, there are separate folders and files for bn128 and bls-12-381, with ~90% duplicated code.
It should be possible to generalize this more, creating a generic prime field class much like there is a semi-generic FQP class, as well as generic elliptic curves, and then only have separate files for the two existing curve types to define curve parameters and twist formulas and the slightly different pairing functions.
The text was updated successfully, but these errors were encountered: