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

[Berlin] EIP-2537: BLS12-381 Curve Operation Precompiles #738

Closed
holgerd77 opened this issue May 1, 2020 · 2 comments · Fixed by #785
Closed

[Berlin] EIP-2537: BLS12-381 Curve Operation Precompiles #738

holgerd77 opened this issue May 1, 2020 · 2 comments · Fixed by #785

Comments

@holgerd77
Copy link
Member

Not to be underestimated, this is a pretty big one (likely).

Might be a way to follow the path of the rustbn.js library and do an analogue integration on the ZCash implementation.

Eventually it is also possible (not sure about the performance implications) to take a pure JS implementation from the list of suggestions in the EIP specification.

Discussion around this should start relatively imminent so that we can have some decision here.

@holgerd77
Copy link
Member Author

Thought about this a bit more, especially on the question which library to use: the integration of a library itself is actually not that much work - just some simple API calls - see e.g. the implementation for an exemplic rustbn.js precompile like evm/precompiles/ecadd.ts.

So I think we can very well start with a JS library integration RIGHT NOW (one, but not necessarily THE candidate to investigate Apache Milagro) and in parallel further prepare around a potential Rust-bindings implementation.

I have a growing sympathy for this solution since this would:

  • substantially speed things up (respectively not delay things too much 😋)
  • allow us to at least ship a minimal working solution if we won't get it managed to release a Rust version in time (so kind of a backup plan, at least to have something here would be 1000x (Scientific Estimation [tm] 😄) better than nothing at all, so that people can do some experimental runs in time)
  • allow us to get some better feeling on the sideline for the JS side-of-things performance

So again, think this won't cause a substantial amount of extra work, respectively THE extra work it is causing should be very much limited and justifiable by the extra benefits.

What do you think?

@jochem-brouwer jochem-brouwer self-assigned this Jun 17, 2020
@jochem-brouwer
Copy link
Member

Heya, small update. I've checked this Apache Milagro repository but to me it does not seem that they expose the low-level curve operations which we need. Instead, mcl-wasm seems (so far) to look more promising.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment