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

feat: use RLN with RC instead of Poseidon #14

Open
wants to merge 1 commit into
base: main
Choose a base branch
from
Open

Conversation

rymnc
Copy link

@rymnc rymnc commented Nov 13, 2023

With the implementation of the RC hash in circom, we can substitute it instead of Poseidon in the calculation of -
a. identityCommitment
b. rateCommitment
c. a1
d. levelHashes in the MerkleInclusionProof

Here's the diff of constraints for both the RLN and withdraw circuits

  1. RLN Circuit =>
circom compiler 2.1.5
-template instances: 216
+template instances: 48
-non-linear constraints: 5820
+non-linear constraints: 957
linear constraints: 0
public inputs: 2
public outputs: 3
private inputs: 43
private outputs: 0
-wires: 5844
+wires: 1053
-labels: 18553
+labels: 24733
  1. Withdraw Circuit =>
circom compiler 2.1.5
-template instances: 71
+template instances: 42
-non-linear constraints: 214
+non-linear constraints: 37
linear constraints: 0
public inputs: 1
public outputs: 1
private inputs: 1
private outputs: 0
-wires: 217
+wires: 43
-labels: 585
+labels: 1021

@rymnc rymnc self-assigned this Nov 13, 2023
@rymnc
Copy link
Author

rymnc commented Nov 13, 2023

Tests fail since there is no RC implementation in js - I can add a known answer test if you'd like :)

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

1 participant