waku-org / js-rln

Browser library providing the cryptographic functions for Waku RLN Relay https://rfc.vac.dev/spec/17/
Apache License 2.0
5 stars 1 forks source link

js-rln keystore is not compatible with nwaku #80

Closed alrevuelta closed 11 months ago

alrevuelta commented 1 year ago

When generating a keystore with js-rln (using the frontend repo) and then importing it into nwaku it fails to load.

The error that nwaku raises:

Error: unhandled exception: Trying to access value with err Result: keystore error: OS specific error: Incorrect JSON kind. Wanted '{JNull, JString}' in '.membershipContract.chainId' but got 'JInt'. [ResultDefect]

Any idea?

weboko commented 1 year ago

Ok, turns out Keystore generated by nwaku is not a valid JSON. Specifically - nwaku adds trailing commas that are allowed in JSON files.

js-rln.json nwaku.json

Refs: MDN, the spec

weboko commented 1 year ago

Should be resolved by https://github.com/waku-org/nwaku/pull/2200