@waku/rln 0.0.14 → 0.1.0-e52107d
This diff represents the content of publicly available package versions that have been released to one of the supported registries. The information contained in this diff is provided for informational purposes only and reflects changes between package versions as they appear in their respective public registries.
- package/README.md +5 -5
- package/bundle/assets/{rln-fb4d7b4b.wasm → rln-6ded2896.wasm} +0 -0
- package/bundle/assets/rln_final-8b299152.zkey +0 -0
- package/bundle/assets/rln_wasm_bg-6f96f821.wasm +0 -0
- package/bundle/index.js +491 -212
- package/dist/.tsbuildinfo +1 -1
- package/dist/codec.d.ts +4 -4
- package/dist/codec.js +4 -4
- package/dist/codec.js.map +1 -1
- package/dist/index.d.ts +3 -3
- package/dist/index.js +3 -3
- package/dist/index.js.map +1 -1
- package/dist/resources/rln.wasm +0 -0
- package/dist/resources/rln_final.zkey +0 -0
- package/dist/resources/verification_key.js +63 -72
- package/dist/resources/verification_key.js.map +1 -1
- package/dist/rln.d.ts +22 -8
- package/dist/rln.js +56 -20
- package/dist/rln.js.map +1 -1
- package/dist/rln_contract.d.ts +9 -3
- package/dist/rln_contract.js +61 -5
- package/dist/rln_contract.js.map +1 -1
- package/dist/root_tracker.d.ts +10 -0
- package/dist/root_tracker.js +72 -0
- package/dist/root_tracker.js.map +1 -0
- package/package.json +2 -2
- package/src/codec.ts +7 -7
- package/src/index.ts +10 -3
- package/src/rln.ts +83 -20
- package/src/rln_contract.ts +110 -11
- package/src/root_tracker.ts +88 -0
- package/bundle/assets/rln_final-a641c06e.zkey +0 -0
- package/bundle/assets/rln_wasm_bg-4d82d6a4.wasm +0 -0
package/README.md
CHANGED
@@ -70,10 +70,10 @@ import * as rln from "@waku/rln";
|
|
70
70
|
const rlnInstance = await rln.create();
|
71
71
|
```
|
72
72
|
|
73
|
-
|
73
|
+
#### Generating RLN Membership Credentials
|
74
74
|
|
75
75
|
```js
|
76
|
-
let
|
76
|
+
let credentials = rlnInstance.generateIdentityCredentials();
|
77
77
|
```
|
78
78
|
|
79
79
|
### Generating RLN Membership Keypair Using a Seed
|
@@ -81,13 +81,13 @@ let memKeys = rlnInstance.generateMembershipKey();
|
|
81
81
|
This can be used to generate credentials from a signature hash (e.g. signed by an Ethereum account).
|
82
82
|
|
83
83
|
```js
|
84
|
-
let
|
84
|
+
let credentials = rlnInstance.generateSeededIdentityCredentials(seed);
|
85
85
|
```
|
86
86
|
|
87
87
|
### Adding Membership Keys Into Merkle Tree
|
88
88
|
|
89
89
|
```js
|
90
|
-
rlnInstance.insertMember(
|
90
|
+
rlnInstance.insertMember(credentials.IDCommitment);
|
91
91
|
```
|
92
92
|
|
93
93
|
### Generating a Proof
|
@@ -106,7 +106,7 @@ const proof = await rlnInstance.generateProof(
|
|
106
106
|
uint8Msg,
|
107
107
|
index,
|
108
108
|
epoch,
|
109
|
-
|
109
|
+
credentials.IDSecretHash
|
110
110
|
);
|
111
111
|
```
|
112
112
|
|
Binary file
|
Binary file
|
Binary file
|