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

chore(rln-relay): update message validation #1451

Closed
1 task done
Tracked by #1501
rymnc opened this issue Dec 7, 2022 · 4 comments · Fixed by #1594
Closed
1 task done
Tracked by #1501

chore(rln-relay): update message validation #1451

rymnc opened this issue Dec 7, 2022 · 4 comments · Fixed by #1594
Assignees

Comments

@rymnc
Copy link
Contributor

rymnc commented Dec 7, 2022

Background

Based on -

Details

Messages will be sent with rln_identifier, epoch, and external_nullifier as usual, however the epoch is no longer used as the external_nullifier. We need to hash the epoch and rln_identifier (poseidon([epoch, rln_identifier])) to get the external_nullifier, which we compare with the external_nullifier sent along with the message.

Acceptance criteria

  • We correctly validate external_nullifier in Waku RLN Relay
@rymnc rymnc added the track:rln RLN Track (Secure Messaging/Applied ZK), e.g. relay and applications label Dec 7, 2022
@rymnc
Copy link
Contributor Author

rymnc commented Dec 7, 2022

@s1fr0 I'm not sure if Poseidon was implemented for nim. I did find this in rln.nim -

proc hash*(ctx: ptr RLN,
input_buffer: ptr Buffer,
output_buffer: ptr Buffer): bool {.importc: "hash".}
## it hashes (sha256) the plain text supplied in inputs_buffer and then maps it to a field element
## this proc is used to map arbitrary signals to field element for the sake of proof generation
## inputs_buffer holds the hash input as a byte seq
## the hash output is generated and populated inside output_buffer
## the output_buffer contains 32 bytes hash output

but it's keccak. Maybe worthwhile to expose the poseidon hasher via ffi as well?

@rymnc rymnc moved this to Next/Backlog in Vac Research Jan 16, 2023
@rymnc rymnc added track:rlnp2p and removed track:rln RLN Track (Secure Messaging/Applied ZK), e.g. relay and applications labels Jan 19, 2023
@rymnc
Copy link
Contributor Author

rymnc commented Feb 7, 2023

@s1fr0 should we move this issue to the next release given that there are pending circuit improvements which will change the scope?

@s1fr0
Copy link
Contributor

s1fr0 commented Feb 7, 2023

@rymnc Agreed, although I believe exposing Poseidon is a good idea regardless.

@rymnc
Copy link
Contributor Author

rymnc commented Feb 7, 2023

Reference issue in zerokit: vacp2p/zerokit#110

@rymnc rymnc self-assigned this Feb 28, 2023
@rymnc rymnc added this to Waku Feb 28, 2023
@rymnc rymnc added this to the Release 0.16.0 milestone Feb 28, 2023
@rymnc rymnc moved this to In Progress in Waku Feb 28, 2023
@github-project-automation github-project-automation bot moved this from Next/Backlog to Done in Vac Research Mar 13, 2023
@github-project-automation github-project-automation bot moved this from In Progress to Done in Waku Mar 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
Archived in project
Development

Successfully merging a pull request may close this issue.

3 participants