waku-org / js-rln

Browser library providing the cryptographic functions for Waku RLN Relay https://rfc.vac.dev/spec/17/
Apache License 2.0
5 stars 1 forks source link

Slowness to generate proofs with recent zerokit versions #66

Open richard-ramos opened 1 year ago

richard-ramos commented 1 year ago

As described in these comments:

weboko commented 1 year ago

My understanding is that in this issue we should:

@richard-ramos is it correct?

richard-ramos commented 1 year ago

Indeed, but i'm not entirely sure we'll be able to mitigate the issue on JS side as it seems to have been introduced in zerokit

rymnc commented 1 year ago

@tyshko-rostyslav any idea why this is happening?

tyshko-rostyslav commented 1 year ago

If indeed this commit https://github.com/vacp2p/zerokit/commit/5eb98d4b330e1107ed18c22856707110302263e4 is the reason, it's quite odd, nothing special is happening there

rymnc commented 1 year ago

@tyshko-rostyslav is it possible the move from ark-circom 0.3.0 to 0.4.0 is the problem?

tyshko-rostyslav commented 1 year ago

There was a significant slowdown, when we changed versions, specifically a lot of operations became compressed. As you've seen in this thread, I tried uncompressed versions in ark-circom 0.4, which somewhat helped, but not to the desired effect

rymnc commented 1 year ago

right, I think it'd be more performant if js-rln used a similar approach to https://github.com/Rate-Limiting-Nullifier/rlnjs, maybe even use the package to avoid de-duped work. ofcourse, they use rln-v2, but an older commit will be your best bet

weboko commented 1 year ago

I need to look into how we can leverage https://github.com/Rate-Limiting-Nullifier/rlnjs

weboko commented 6 months ago

rlnjs was not selected to be used due to fact that we needed to maintain proxy in JS code for our RLN contract and be able to optimize code in our own way.

Ice boxing this task as in future we might have a light weight way of generating / verifying proofs. Potentially we can use parts of rlnjs for this to avoid using wasm version of zerokit.

@adklempner @waku-org/js-waku-developers