-
Notifications
You must be signed in to change notification settings - Fork 1
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 identity credentials, and expose hash, bulk insert and delete members functions #58
Changes from 1 commit
File filter
Filter by extension
Conversations
Jump to
Diff view
Diff view
There are no files selected for viewing
Original file line number | Diff line number | Diff line change | ||||
---|---|---|---|---|---|---|
@@ -1,7 +1,7 @@ | ||||||
import * as rln from "@waku/rln"; | ||||||
|
||||||
rln.create().then(async rlnInstance => { | ||||||
let memKeys = rlnInstance.generateMembershipKey(); | ||||||
let credentials = rlnInstance.generateIdentityCredentials(); | ||||||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more.
Suggested change
no? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Also, didn't you/we said we could remove this example? cc @weboko There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. That was on js-noise, although I think we can remove it here too? There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Before we were talking about |
||||||
|
||||||
//peer's index in the Merkle Tree | ||||||
const index = 5 | ||||||
|
@@ -10,11 +10,11 @@ rln.create().then(async rlnInstance => { | |||||
for (let i = 0; i < 10; i++) { | ||||||
if (i == index) { | ||||||
// insert the current peer's pk | ||||||
rlnInstance.insertMember(memKeys.IDCommitment); | ||||||
rlnInstance.insertMember(credentials.IDCommitment); | ||||||
} else { | ||||||
// create a new key pair | ||||||
let memKeys = rlnInstance.generateMembershipKey(); // TODO: handle error | ||||||
rlnInstance.insertMember(memKeys.IDCommitment); | ||||||
let credentials = rlnInstance.generateIdentityCredentials(); // TODO: handle error | ||||||
rlnInstance.insertMember(credentials.IDCommitment); | ||||||
|
||||||
} | ||||||
} | ||||||
|
@@ -27,7 +27,7 @@ rln.create().then(async rlnInstance => { | |||||
|
||||||
console.log("Generating proof..."); | ||||||
console.time("proof_gen_timer"); | ||||||
let proof = await rlnInstance.generateRLNProof(uint8Msg, index, epoch, memKeys.IDKey) | ||||||
let proof = await rlnInstance.generateRLNProof(uint8Msg, index, epoch, credentials.IDSecretHash) | ||||||
console.timeEnd("proof_gen_timer"); | ||||||
console.log("Proof", proof) | ||||||
|
||||||
|
Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,6 +1,6 @@ | ||
{ | ||
"name": "@waku/rln", | ||
"version": "0.0.14", | ||
"version": "0.1.0", | ||
There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Big bump :) There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. Was thinking about it as well. I can duplicate from There was a problem hiding this comment. Choose a reason for hiding this commentThe reason will be displayed to describe this comment to others. Learn more. I think until we expect someone to use RLN in prod we leave it out. We can then reconsider when RLN is used beyond POCs |
||
"description": "Rate Limit Nullifier for js-waku", | ||
"types": "./dist/index.d.ts", | ||
"module": "./dist/index.js", | ||
|
@@ -130,7 +130,7 @@ | |
}, | ||
"dependencies": { | ||
"@waku/utils": "^0.0.4", | ||
"@waku/zerokit-rln-wasm": "^0.0.5", | ||
"@waku/zerokit-rln-wasm": "^0.0.10", | ||
"ethers": "^5.7.2" | ||
} | ||
} |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
formatting nitpick