Generalised Precompile for Elliptic Curve arithmetics and pairings Working Group

So far, the roadblock for me to complete the implementation including gas schedule is to generate a set of MNT4/6 curves with bit width for the base field of 256, 320, 384, etc bits up to (1024-1) to measure pairing cost on those and redo G1 and G2 operations gas metering based on the latest Monte-Carlo simulation approach (first results an the description of the procedure can be found here).

After that for sure there will be test vectors in a form [curve description, points, operation, expected output, encoded input, encoded output, gas cost]. I can already derive most part of it, but gas cost will be missing.

For BN254 price - it will not be ā€œthe lowest possibleā€. Due to variable field modulus some precomputations are not possible and one will have to pay substantial price for those over the run time.

Iā€™m not sure the status of this, it seems relatively stale. I find this eip to be extremely important, and if it needs a new champion Iā€™m happy to help get this pushed forward.

A little background:
This eip should enable the ability for a cheap on-chain bls-verify which is the a missing check on the eth2 deposit contract. Without that verification a user can submit an invalid deposit,that only gets rejected after the beacon chain has processed it. This means the users funds will be ā€œburntā€.

If anyone can provide a status to where it is at we (ChainSafe/Lodestar) would be more than happy to help bring this to fruition.

Eth2 phase0 launch is uncertain (perhaps this summer) but if we can get reference implementations, and an inclusion to a HF or even its own HF in a few months that would would be extremely helpful for the UX of new users on eth2.

Feel free to contact me @GregTheGreek

1 Like

Hey Greg.

Itā€™s not stale, recent progress can be seed in latest CoreDevs meeting, like in this agenda.

Iā€™d say that precompile is complete in itā€™s Rust and C++ forms and now we are trying to complete testing of an independent Go implementation.

Sincerely, Alex

1 Like

@shamatar incredible! I wasnā€™t aware of the active implementations.

Let me know if thereā€™s anything you need help with!

Any estimate is to which version this might find itself? I guess as the beacon chain release is getting closer this becomes more and more pressing/