@waku/rln 0.0.2-3ab8023.0 → 0.0.2-6cb9c9c.0
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/bundle/_virtual/utils.js +2 -2
- package/bundle/_virtual/utils2.js +2 -2
- package/bundle/index.js +2 -0
- package/bundle/packages/rln/dist/contract/rln_contract.js +30 -150
- package/bundle/packages/rln/dist/identity_generator.js +75 -0
- package/bundle/packages/rln/dist/rln.js +2 -4
- package/bundle/packages/rln/dist/rln_light.js +223 -0
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +1 -1
- package/bundle/packages/rln/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +2 -2
- package/bundle/packages/rln/node_modules/@noble/hashes/_sha2.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/hmac.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/pbkdf2.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/scrypt.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/sha256.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/sha512.js +1 -1
- package/bundle/packages/rln/node_modules/@noble/hashes/utils.js +1 -1
- package/dist/.tsbuildinfo +1 -1
- package/dist/contract/rln_contract.d.ts +4 -10
- package/dist/contract/rln_contract.js +30 -150
- package/dist/contract/rln_contract.js.map +1 -1
- package/dist/identity_generator.d.ts +19 -0
- package/dist/identity_generator.js +72 -0
- package/dist/identity_generator.js.map +1 -0
- package/dist/index.d.ts +4 -1
- package/dist/index.js +3 -1
- package/dist/index.js.map +1 -1
- package/dist/rln.js +2 -4
- package/dist/rln.js.map +1 -1
- package/dist/rln_light.d.ts +95 -0
- package/dist/rln_light.js +206 -0
- package/dist/rln_light.js.map +1 -0
- package/package.json +1 -1
- package/src/contract/rln_contract.ts +36 -218
- package/src/identity_generator.ts +108 -0
- package/src/index.ts +15 -0
- package/src/rln.ts +2 -5
- package/src/rln_light.ts +298 -0
@@ -0,0 +1,95 @@
|
|
1
|
+
import { ethers } from "ethers";
|
2
|
+
import { RLNContract } from "./contract/index.js";
|
3
|
+
import { IdentityCredential } from "./identity.js";
|
4
|
+
import type { DecryptedCredentials, EncryptedCredentials } from "./keystore/index.js";
|
5
|
+
import { Password } from "./keystore/types.js";
|
6
|
+
/**
|
7
|
+
* Options for starting the RLNLight instance
|
8
|
+
*/
|
9
|
+
type StartRLNLightOptions = {
|
10
|
+
/**
|
11
|
+
* If not set - will extract MetaMask account and get signer from it.
|
12
|
+
*/
|
13
|
+
signer?: ethers.Signer;
|
14
|
+
/**
|
15
|
+
* If not set - will use default SEPOLIA_CONTRACT address.
|
16
|
+
*/
|
17
|
+
address?: string;
|
18
|
+
/**
|
19
|
+
* Credentials to use for membership registration.
|
20
|
+
* If provided used for validating the network chainId and connecting to registry contract.
|
21
|
+
*/
|
22
|
+
credentials?: EncryptedCredentials | DecryptedCredentials;
|
23
|
+
/**
|
24
|
+
* Rate limit for the member.
|
25
|
+
*/
|
26
|
+
rateLimit?: number;
|
27
|
+
};
|
28
|
+
/**
|
29
|
+
* Options for registering membership
|
30
|
+
*/
|
31
|
+
type RegisterMembershipOptions = {
|
32
|
+
signature: string;
|
33
|
+
} | {
|
34
|
+
identity: IdentityCredential;
|
35
|
+
};
|
36
|
+
/**
|
37
|
+
* Lightweight RLN implementation without Zerokit
|
38
|
+
* Only supports Keystore and membership registration
|
39
|
+
*/
|
40
|
+
export declare class RLNLight {
|
41
|
+
private started;
|
42
|
+
private starting;
|
43
|
+
private _contract;
|
44
|
+
private _signer;
|
45
|
+
private keystore;
|
46
|
+
private _credentials;
|
47
|
+
private identityGenerator;
|
48
|
+
get contract(): undefined | RLNContract;
|
49
|
+
get signer(): undefined | ethers.Signer;
|
50
|
+
/**
|
51
|
+
* Get the current credentials
|
52
|
+
*/
|
53
|
+
get credentials(): undefined | DecryptedCredentials;
|
54
|
+
/**
|
55
|
+
* Start the RLNLight instance
|
56
|
+
* @param options Configuration options
|
57
|
+
*/
|
58
|
+
start(options?: StartRLNLightOptions): Promise<void>;
|
59
|
+
/**
|
60
|
+
* Find credentials in the keystore by contract address
|
61
|
+
*/
|
62
|
+
private findCredentialsByAddress;
|
63
|
+
/**
|
64
|
+
* Determine the correct options for starting RLNLight
|
65
|
+
*/
|
66
|
+
private determineStartOptions;
|
67
|
+
/**
|
68
|
+
* Decrypt credentials if they are encrypted
|
69
|
+
*/
|
70
|
+
private static decryptCredentialsIfNeeded;
|
71
|
+
/**
|
72
|
+
* Register a membership using an identity or signature
|
73
|
+
* @param options Options including identity or signature
|
74
|
+
* @returns Decrypted credentials if successful
|
75
|
+
*/
|
76
|
+
registerMembership(options: RegisterMembershipOptions): Promise<undefined | DecryptedCredentials>;
|
77
|
+
/**
|
78
|
+
* Changes credentials in use by relying on provided Keystore
|
79
|
+
* @param id Hash of credentials to select from Keystore
|
80
|
+
* @param password Password to decrypt credentials from Keystore
|
81
|
+
*/
|
82
|
+
useCredentials(id: string, password: Password): Promise<void>;
|
83
|
+
/**
|
84
|
+
* Generate a new identity credential
|
85
|
+
* @returns New identity credential
|
86
|
+
*/
|
87
|
+
generateIdentityCredential(): IdentityCredential;
|
88
|
+
/**
|
89
|
+
* Generate a seeded identity credential
|
90
|
+
* @param seed Seed string to generate deterministic identity
|
91
|
+
* @returns Seeded identity credential
|
92
|
+
*/
|
93
|
+
generateSeededIdentityCredential(seed: string): IdentityCredential;
|
94
|
+
}
|
95
|
+
export {};
|
@@ -0,0 +1,206 @@
|
|
1
|
+
import { Logger } from "@waku/utils";
|
2
|
+
import { RLNContract } from "./contract/index.js";
|
3
|
+
import { IdentityGenerator } from "./identity_generator.js";
|
4
|
+
import { Keystore } from "./keystore/index.js";
|
5
|
+
import { extractMetaMaskSigner } from "./utils/index.js";
|
6
|
+
const log = new Logger("waku:rln-light");
|
7
|
+
/**
|
8
|
+
* Lightweight RLN implementation without Zerokit
|
9
|
+
* Only supports Keystore and membership registration
|
10
|
+
*/
|
11
|
+
export class RLNLight {
|
12
|
+
started = false;
|
13
|
+
starting = false;
|
14
|
+
_contract;
|
15
|
+
_signer;
|
16
|
+
keystore = Keystore.create();
|
17
|
+
_credentials;
|
18
|
+
identityGenerator = new IdentityGenerator();
|
19
|
+
get contract() {
|
20
|
+
return this._contract;
|
21
|
+
}
|
22
|
+
get signer() {
|
23
|
+
return this._signer;
|
24
|
+
}
|
25
|
+
/**
|
26
|
+
* Get the current credentials
|
27
|
+
*/
|
28
|
+
get credentials() {
|
29
|
+
return this._credentials;
|
30
|
+
}
|
31
|
+
/**
|
32
|
+
* Start the RLNLight instance
|
33
|
+
* @param options Configuration options
|
34
|
+
*/
|
35
|
+
async start(options = {}) {
|
36
|
+
if (this.started || this.starting) {
|
37
|
+
log.warn("RLNLight already started or starting");
|
38
|
+
return;
|
39
|
+
}
|
40
|
+
this.starting = true;
|
41
|
+
try {
|
42
|
+
// Determine correct options based on credentials, if any
|
43
|
+
const keystoreCredentials = options.address
|
44
|
+
? await this.findCredentialsByAddress(options.address)
|
45
|
+
: undefined;
|
46
|
+
const { address, signer, rateLimit } = await this.determineStartOptions(options, keystoreCredentials);
|
47
|
+
// Set the signer
|
48
|
+
if (signer) {
|
49
|
+
this._signer = signer;
|
50
|
+
}
|
51
|
+
else {
|
52
|
+
this._signer = await extractMetaMaskSigner();
|
53
|
+
}
|
54
|
+
const contractOptions = {
|
55
|
+
signer: this._signer,
|
56
|
+
address: address,
|
57
|
+
rateLimit: rateLimit
|
58
|
+
};
|
59
|
+
// We need to create a minimal compatible object with RLNInstance interface
|
60
|
+
// but we only need it for contract initialization
|
61
|
+
const compatibleRLN = {
|
62
|
+
zerokit: {
|
63
|
+
getMerkleRoot: () => new Uint8Array(32),
|
64
|
+
insertMember: (_idCommitment) => { },
|
65
|
+
insertMembers: (_index, ..._idCommitments) => { },
|
66
|
+
deleteMember: (_index) => { }
|
67
|
+
}
|
68
|
+
};
|
69
|
+
this._contract = await RLNContract.init(
|
70
|
+
// Type assertion needed for compatibility with RLNInstance interface
|
71
|
+
// eslint-disable-next-line @typescript-eslint/no-explicit-any
|
72
|
+
compatibleRLN, contractOptions);
|
73
|
+
this.started = true;
|
74
|
+
}
|
75
|
+
catch (error) {
|
76
|
+
log.error("Failed to start RLNLight:", error);
|
77
|
+
throw error;
|
78
|
+
}
|
79
|
+
finally {
|
80
|
+
this.starting = false;
|
81
|
+
}
|
82
|
+
}
|
83
|
+
/**
|
84
|
+
* Find credentials in the keystore by contract address
|
85
|
+
*/
|
86
|
+
async findCredentialsByAddress(address) {
|
87
|
+
// Since Keystore doesn't have a direct method to find by address,
|
88
|
+
// we need to iterate through all credentials
|
89
|
+
const hashes = this.keystore.keys();
|
90
|
+
for (const hash of hashes) {
|
91
|
+
try {
|
92
|
+
// Try with an empty password - this won't work but lets us check schema
|
93
|
+
const credential = await this.keystore.readCredential(hash, new Uint8Array(0));
|
94
|
+
if (credential?.membership.address === address) {
|
95
|
+
return credential;
|
96
|
+
}
|
97
|
+
}
|
98
|
+
catch (e) {
|
99
|
+
// Ignore errors, just means we couldn't read this credential
|
100
|
+
}
|
101
|
+
}
|
102
|
+
return undefined;
|
103
|
+
}
|
104
|
+
/**
|
105
|
+
* Determine the correct options for starting RLNLight
|
106
|
+
*/
|
107
|
+
async determineStartOptions(options, credentials) {
|
108
|
+
if (options.credentials) {
|
109
|
+
const { credentials: decrypted } = await RLNLight.decryptCredentialsIfNeeded(options.credentials);
|
110
|
+
if (decrypted?.membership) {
|
111
|
+
this._credentials = decrypted;
|
112
|
+
return {
|
113
|
+
...options,
|
114
|
+
address: decrypted.membership.address
|
115
|
+
};
|
116
|
+
}
|
117
|
+
}
|
118
|
+
else if (credentials) {
|
119
|
+
return {
|
120
|
+
...options,
|
121
|
+
address: credentials.membership.address
|
122
|
+
};
|
123
|
+
}
|
124
|
+
return options;
|
125
|
+
}
|
126
|
+
/**
|
127
|
+
* Decrypt credentials if they are encrypted
|
128
|
+
*/
|
129
|
+
static async decryptCredentialsIfNeeded(credentials) {
|
130
|
+
if (!credentials) {
|
131
|
+
return {};
|
132
|
+
}
|
133
|
+
if ("identity" in credentials) {
|
134
|
+
return { credentials };
|
135
|
+
}
|
136
|
+
else {
|
137
|
+
const keystore = Keystore.create();
|
138
|
+
try {
|
139
|
+
const decrypted = await keystore.readCredential(credentials.id, credentials.password);
|
140
|
+
if (!decrypted) {
|
141
|
+
return {};
|
142
|
+
}
|
143
|
+
return {
|
144
|
+
credentials: {
|
145
|
+
identity: decrypted.identity,
|
146
|
+
membership: decrypted.membership
|
147
|
+
},
|
148
|
+
keystore
|
149
|
+
};
|
150
|
+
}
|
151
|
+
catch (e) {
|
152
|
+
log.error("Failed to decrypt credentials", e);
|
153
|
+
return {};
|
154
|
+
}
|
155
|
+
}
|
156
|
+
}
|
157
|
+
/**
|
158
|
+
* Register a membership using an identity or signature
|
159
|
+
* @param options Options including identity or signature
|
160
|
+
* @returns Decrypted credentials if successful
|
161
|
+
*/
|
162
|
+
async registerMembership(options) {
|
163
|
+
if (!this.contract) {
|
164
|
+
throw Error("RLN Contract is not initialized.");
|
165
|
+
}
|
166
|
+
let identity = "identity" in options && options.identity;
|
167
|
+
if ("signature" in options) {
|
168
|
+
identity = this.identityGenerator.generateSeededIdentityCredential(options.signature);
|
169
|
+
}
|
170
|
+
if (!identity) {
|
171
|
+
throw Error("Missing signature or identity to register membership.");
|
172
|
+
}
|
173
|
+
return this.contract.registerWithIdentity(identity);
|
174
|
+
}
|
175
|
+
/**
|
176
|
+
* Changes credentials in use by relying on provided Keystore
|
177
|
+
* @param id Hash of credentials to select from Keystore
|
178
|
+
* @param password Password to decrypt credentials from Keystore
|
179
|
+
*/
|
180
|
+
async useCredentials(id, password) {
|
181
|
+
const decrypted = await this.keystore.readCredential(id, password);
|
182
|
+
if (!decrypted) {
|
183
|
+
throw new Error("Credentials not found or incorrect password");
|
184
|
+
}
|
185
|
+
this._credentials = {
|
186
|
+
identity: decrypted.identity,
|
187
|
+
membership: decrypted.membership
|
188
|
+
};
|
189
|
+
}
|
190
|
+
/**
|
191
|
+
* Generate a new identity credential
|
192
|
+
* @returns New identity credential
|
193
|
+
*/
|
194
|
+
generateIdentityCredential() {
|
195
|
+
return this.identityGenerator.generateIdentityCredentials();
|
196
|
+
}
|
197
|
+
/**
|
198
|
+
* Generate a seeded identity credential
|
199
|
+
* @param seed Seed string to generate deterministic identity
|
200
|
+
* @returns Seeded identity credential
|
201
|
+
*/
|
202
|
+
generateSeededIdentityCredential(seed) {
|
203
|
+
return this.identityGenerator.generateSeededIdentityCredential(seed);
|
204
|
+
}
|
205
|
+
}
|
206
|
+
//# sourceMappingURL=rln_light.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"rln_light.js","sourceRoot":"","sources":["../src/rln_light.ts"],"names":[],"mappings":"AAAA,OAAO,EAAE,MAAM,EAAE,MAAM,aAAa,CAAC;AAGrC,OAAO,EAAE,WAAW,EAAE,MAAM,qBAAqB,CAAC;AAElD,OAAO,EAAE,iBAAiB,EAAE,MAAM,yBAAyB,CAAC;AAC5D,OAAO,EAAE,QAAQ,EAAE,MAAM,qBAAqB,CAAC;AAM/C,OAAO,EAAE,qBAAqB,EAAE,MAAM,kBAAkB,CAAC;AAEzD,MAAM,GAAG,GAAG,IAAI,MAAM,CAAC,gBAAgB,CAAC,CAAC;AAgCzC;;;GAGG;AACH,MAAM,OAAO,QAAQ;IACX,OAAO,GAAG,KAAK,CAAC;IAChB,QAAQ,GAAG,KAAK,CAAC;IAEjB,SAAS,CAA0B;IACnC,OAAO,CAA4B;IAEnC,QAAQ,GAAG,QAAQ,CAAC,MAAM,EAAE,CAAC;IAC7B,YAAY,CAAmC;IAC/C,iBAAiB,GAAG,IAAI,iBAAiB,EAAE,CAAC;IAEpD,IAAW,QAAQ;QACjB,OAAO,IAAI,CAAC,SAAS,CAAC;IACxB,CAAC;IAED,IAAW,MAAM;QACf,OAAO,IAAI,CAAC,OAAO,CAAC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N (Rate Limiting Nullifier) implementation for Waku","types":"./dist/index.d.ts","module":"./dist/index.js","exports":{".":{"types":"./dist/index.d.ts","import":"./dist/index.js"}},"type":"module","homepage":"https://github.com/waku-org/js-waku/tree/master/packages/rln#readme","repository":{"type":"git","url":"https://github.com/waku-org/js-waku.git"},"bugs":{"url":"https://github.com/waku-org/js-waku/issues"},"license":"MIT OR Apache-2.0","keywords":["waku","rln","rate-limiting","privacy","web3"],"scripts":{"build":"run-s build:**","build:copy":"mkdir -p dist/resources && cp -r src/resources/* dist/resources/","build:esm":"tsc","build:bundle":"rollup --config rollup.config.js","fix":"run-s fix:*","fix:lint":"eslint src *.js --fix","check":"run-s check:*","check:tsc":"tsc -p tsconfig.dev.json","check:lint":"eslint \"src/!(resources)/**/*.{ts,js}\" *.js","check:spelling":"cspell \"{README.md,src/**/*.ts}\"","test":"NODE_ENV=test run-s test:*","test:browser":"karma start karma.conf.cjs","watch:build":"tsc -p tsconfig.json -w","watch:test":"mocha --watch","prepublish":"npm run build","reset-hard":"git clean -dfx -e .idea && git reset --hard && npm i && npm run build"},"engines":{"node":">=20"},"devDependencies":{"@rollup/plugin-commonjs":"^25.0.7","@rollup/plugin-json":"^6.0.0","@rollup/plugin-node-resolve":"^15.2.3","@types/chai":"^5.0.1","@types/chai-spies":"^1.0.6","@types/deep-equal-in-any-order":"^1.0.4","@types/lodash":"^4.17.15","@types/sinon":"^17.0.3","@waku/build-utils":"^1.0.0","@waku/message-encryption":"0.0.32-6cb9c9c.0","chai":"^5.1.2","chai-as-promised":"^8.0.1","chai-spies":"^1.1.0","chai-subset":"^1.6.0","deep-equal-in-any-order":"^2.0.6","fast-check":"^3.23.2","rollup-plugin-copy":"^3.5.0","sinon":"^19.0.2"},"files":["dist","bundle","src/**/*.ts","!**/*.spec.*","!**/*.json","CHANGELOG.md","LICENSE","README.md"],"dependencies":{"@chainsafe/bls-keystore":"3.0.0","@ethersproject/keccak256":"^5.7.0","@ethersproject/strings":"^5.7.0","@waku/core":"0.0.34-6cb9c9c.0","@waku/utils":"0.0.22-6cb9c9c.0","@waku/zerokit-rln-wasm":"^0.0.13","ethereum-cryptography":"^3.1.0","ethers":"^5.7.2","lodash":"^4.17.21","uuid":"^11.0.5"}}
|