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

refactor(rln): update APIs after circuit update #84

Merged
merged 3 commits into from
Dec 9, 2022
Merged

Conversation

s1fr0
Copy link
Contributor

@s1fr0 s1fr0 commented Dec 6, 2022

This PR updates some zerokit RLN APIs in light of the security design changes discussed in vacp2p/research#152, Rate-Limiting-Nullifier/rln-circuits#1 and implemented in Rate-Limiting-Nullifier/rln-circuits#2.

In particular external_nullifier is now computed as the Poseidon hash of epoch and RLN identifier, while in generating shares the nullifier is computed only by hashing the a1 coefficient (see above issues for more details).

Note that all circuit resources had to be re-generated and that new circuits are not compatible with previous ones.

@richard-ramos @fryorcraken could you please ensure that these changes doesn't break anything in rln-wasm and js-rln ? (should not, but better we double check)

FYI: @curryrasul @AtHeartEngineer

Copy link
Contributor

@rymnc rymnc left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

LGTM! Thanks for the quick PR :)

@rymnc
Copy link
Contributor

rymnc commented Dec 7, 2022

This PR fixes #82

@fryorcraken
Copy link
Contributor

@richard-ramos you ok to handle the query from @s1fr0 ?

@oskarth
Copy link
Contributor

oskarth commented Dec 7, 2022

Does this imply any spec changes? If so this needs a corresponding issue in RFC repo.

We need to have the RFC up to date and alive.

Copy link
Contributor

@oskarth oskarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

See above

@rymnc
Copy link
Contributor

rymnc commented Dec 7, 2022

See above

Tracking here vacp2p/rfc#560

Copy link
Member

@richard-ramos richard-ramos left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It does not break any API but will require the following actions
In JS-Land:

  1. Edit the Cargo.toml of rln-wasm to increase the version number
  2. Publish a new version of @waku/zerokit-rln-wasm, with cargo make publish
  3. Publish a new version of js-rln that uses the version of the package published in last step

In GO-Land:

  1. Update go-zerokit-rln so it uses latest zerokit version, and update all static libraries
  2. Update go-waku to use latest go-zerokit-rln

@rymnc
Copy link
Contributor

rymnc commented Dec 8, 2022

@richard-ramos, please can you check if the nightly wasm artifact here is suitable till we complete the steps you mentioned?

Having a new release is preferred since we are breaking APIs. (for slashing/withdrawing)

@s1fr0
Copy link
Contributor Author

s1fr0 commented Dec 9, 2022

The corresponding RFC 32/RLN has been updated in vacp2p/rfc#561 to reflect the changes implemented by this PR.

@s1fr0 s1fr0 self-assigned this Dec 9, 2022
@s1fr0 s1fr0 added track:zerokit Zerokit track (Applied ZK/Explorations) track:rln RLN Track - (Secure Messaging/Applied ZK), relay and applications labels Dec 9, 2022
@s1fr0 s1fr0 linked an issue Dec 9, 2022 that may be closed by this pull request
@s1fr0
Copy link
Contributor Author

s1fr0 commented Dec 9, 2022

Please let me know if we're ok to merge @oskarth @rymnc @richard-ramos

Copy link
Contributor

@oskarth oskarth left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Approving assuming we are tracking relevant changes in implementations too:

  • Spec PR is done so that's good
  • refactor(rln): update APIs after circuit update #84 (review) this should have issues in nwaku/go-waku/js-waku so we make sure to update all implementations, or at least capture that this has to be done - it'd be good if we created these issues before merging (easy to forget otherwise)
  • who will update nwaku?

@rymnc
Copy link
Contributor

rymnc commented Dec 9, 2022

We're tracking the nwaku update here - waku-org/nwaku#1451. I can take it up after we're done with waku-org/nwaku#1457

@s1fr0 s1fr0 merged commit 9e1355d into master Dec 9, 2022
@rymnc rymnc deleted the update-circuit branch December 9, 2022 18:06
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
track:rln RLN Track - (Secure Messaging/Applied ZK), relay and applications track:zerokit Zerokit track (Applied ZK/Explorations)
Projects
None yet
Development

Successfully merging this pull request may close these issues.

RLN: Update proof generation according to updated circuit
5 participants