@waku/rln 0.1.8-e224c05.0 → 0.1.8-e800af3.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.
Files changed (187) hide show
  1. package/bundle/_virtual/utils.js +2 -2
  2. package/bundle/_virtual/utils2.js +2 -2
  3. package/bundle/index.js +6 -1
  4. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/_sha2.js +1 -1
  5. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/hmac.js +1 -1
  6. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/pbkdf2.js +1 -1
  7. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/scrypt.js +1 -1
  8. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha256.js +1 -1
  9. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/sha512.js +1 -1
  10. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/@noble/hashes/utils.js +1 -1
  11. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/random.js +1 -1
  12. package/bundle/node_modules/@chainsafe/bls-keystore/node_modules/ethereum-cryptography/utils.js +2 -2
  13. package/bundle/node_modules/@chainsafe/is-ip/lib/is-ip.js +12 -0
  14. package/bundle/node_modules/@chainsafe/is-ip/lib/parse.js +26 -0
  15. package/bundle/node_modules/@chainsafe/is-ip/lib/parser.js +202 -0
  16. package/bundle/node_modules/@multiformats/multiaddr/dist/src/constants.js +43 -0
  17. package/bundle/node_modules/@multiformats/multiaddr/dist/src/errors.js +17 -0
  18. package/bundle/node_modules/@multiformats/multiaddr/dist/src/registry.js +245 -0
  19. package/bundle/node_modules/@multiformats/multiaddr/dist/src/utils.js +191 -0
  20. package/bundle/node_modules/@multiformats/multiaddr/dist/src/validation.js +30 -0
  21. package/bundle/node_modules/@noble/hashes/esm/hmac.js +88 -0
  22. package/bundle/node_modules/@noble/hashes/esm/sha3.js +1 -1
  23. package/bundle/node_modules/@noble/hashes/esm/utils.js +8 -1
  24. package/bundle/node_modules/@waku/zerokit-rln-wasm/rln_wasm.js +517 -255
  25. package/bundle/node_modules/it-length-prefixed/dist/src/decode.js +6 -0
  26. package/bundle/node_modules/multiformats/dist/src/bases/base10.js +3 -1
  27. package/bundle/node_modules/multiformats/dist/src/bases/base16.js +4 -2
  28. package/bundle/node_modules/multiformats/dist/src/bases/base2.js +3 -1
  29. package/bundle/node_modules/multiformats/dist/src/bases/base256emoji.js +3 -1
  30. package/bundle/node_modules/multiformats/dist/src/bases/base32.js +11 -9
  31. package/bundle/node_modules/multiformats/dist/src/bases/base36.js +4 -2
  32. package/bundle/node_modules/multiformats/dist/src/bases/base58.js +4 -2
  33. package/bundle/node_modules/multiformats/dist/src/bases/base64.js +6 -4
  34. package/bundle/node_modules/multiformats/dist/src/bases/base8.js +3 -1
  35. package/bundle/node_modules/multiformats/dist/src/bases/identity.js +3 -1
  36. package/bundle/node_modules/multiformats/dist/src/basics.js +15 -0
  37. package/bundle/node_modules/multiformats/dist/src/bytes.js +15 -1
  38. package/bundle/node_modules/multiformats/dist/src/cid.js +371 -0
  39. package/bundle/node_modules/multiformats/dist/src/hashes/digest.js +62 -0
  40. package/bundle/node_modules/multiformats/dist/src/varint.js +15 -0
  41. package/bundle/node_modules/multiformats/dist/src/vendor/varint.js +78 -0
  42. package/bundle/node_modules/protons-runtime/dist/src/codec.js +20 -0
  43. package/bundle/node_modules/protons-runtime/dist/src/codecs/enum.js +24 -0
  44. package/bundle/node_modules/protons-runtime/dist/src/codecs/message.js +7 -0
  45. package/bundle/node_modules/protons-runtime/dist/src/decode.js +8 -0
  46. package/bundle/node_modules/protons-runtime/dist/src/encode.js +11 -0
  47. package/bundle/node_modules/protons-runtime/dist/src/index.js +30 -0
  48. package/bundle/node_modules/protons-runtime/dist/src/utils/float.js +54 -0
  49. package/bundle/node_modules/protons-runtime/dist/src/utils/longbits.js +175 -0
  50. package/bundle/node_modules/protons-runtime/dist/src/utils/pool.js +28 -0
  51. package/bundle/node_modules/protons-runtime/dist/src/utils/reader.js +367 -0
  52. package/bundle/node_modules/protons-runtime/dist/src/utils/utf8.js +99 -0
  53. package/bundle/node_modules/protons-runtime/dist/src/utils/writer.js +438 -0
  54. package/bundle/node_modules/uint8-varint/dist/src/index.js +124 -0
  55. package/bundle/node_modules/uint8arrays/dist/src/alloc.js +17 -0
  56. package/bundle/node_modules/uint8arrays/dist/src/concat.js +20 -0
  57. package/bundle/node_modules/uint8arrays/dist/src/from-string.js +19 -0
  58. package/bundle/node_modules/uint8arrays/dist/src/to-string.js +19 -0
  59. package/bundle/node_modules/uint8arrays/dist/src/util/as-uint8array.js +9 -0
  60. package/bundle/node_modules/uint8arrays/dist/src/util/bases.js +49 -0
  61. package/bundle/packages/core/dist/lib/connection_manager/connection_limiter.js +18 -0
  62. package/bundle/packages/core/dist/lib/connection_manager/connection_manager.js +24 -0
  63. package/bundle/packages/core/dist/lib/connection_manager/dialer.js +14 -0
  64. package/bundle/packages/core/dist/lib/connection_manager/discovery_dialer.js +14 -0
  65. package/bundle/packages/core/dist/lib/connection_manager/keep_alive_manager.js +15 -0
  66. package/bundle/packages/core/dist/lib/connection_manager/shard_reader.js +14 -0
  67. package/bundle/packages/core/dist/lib/filter/filter.js +28 -0
  68. package/bundle/packages/core/dist/lib/light_push/light_push.js +28 -0
  69. package/bundle/packages/core/dist/lib/message/version_0.js +172 -0
  70. package/bundle/packages/core/dist/lib/metadata/metadata.js +28 -0
  71. package/bundle/packages/core/dist/lib/store/store.js +24 -0
  72. package/bundle/packages/interfaces/dist/connection_manager.js +9 -0
  73. package/bundle/packages/interfaces/dist/health_status.js +17 -0
  74. package/bundle/packages/interfaces/dist/protocols.js +92 -0
  75. package/bundle/packages/interfaces/dist/waku.js +7 -0
  76. package/bundle/packages/proto/dist/generated/filter.js +447 -0
  77. package/bundle/packages/proto/dist/generated/filter_v2.js +426 -0
  78. package/bundle/packages/proto/dist/generated/light_push.js +550 -0
  79. package/bundle/packages/proto/dist/generated/message.js +215 -0
  80. package/bundle/packages/proto/dist/generated/metadata.js +132 -0
  81. package/bundle/packages/proto/dist/generated/peer_exchange.js +211 -0
  82. package/bundle/packages/proto/dist/generated/sds_message.js +172 -0
  83. package/bundle/packages/proto/dist/generated/store_v3.js +492 -0
  84. package/bundle/packages/proto/dist/generated/topic_only_message.js +63 -0
  85. package/bundle/packages/rln/dist/codec.js +92 -0
  86. package/bundle/packages/rln/dist/contract/constants.js +14 -7
  87. package/bundle/packages/rln/dist/contract/rln_base_contract.js +2 -1
  88. package/bundle/packages/rln/dist/contract/rln_contract.js +109 -0
  89. package/bundle/packages/rln/dist/credentials_manager.js +45 -4
  90. package/bundle/packages/rln/dist/identity.js +2 -1
  91. package/bundle/packages/rln/dist/keystore/keystore.js +30 -9
  92. package/bundle/packages/rln/dist/message.js +59 -0
  93. package/bundle/packages/rln/dist/proof.js +54 -0
  94. package/bundle/packages/rln/dist/resources/verification_key.js +112 -0
  95. package/bundle/packages/rln/dist/resources/witness_calculator.js +1 -1
  96. package/bundle/packages/rln/dist/rln.js +36 -4
  97. package/bundle/packages/rln/dist/root_tracker.js +76 -0
  98. package/bundle/packages/rln/dist/utils/bytes.js +70 -31
  99. package/bundle/packages/rln/dist/utils/epoch.js +23 -1
  100. package/bundle/packages/rln/dist/utils/hash.js +10 -0
  101. package/bundle/packages/rln/dist/zerokit.js +99 -2
  102. package/bundle/packages/utils/dist/bytes/index.js +31 -0
  103. package/bundle/resources/rln.wasm +0 -0
  104. package/bundle/resources/rln_final.zkey +0 -0
  105. package/bundle/resources/verification_key.d.ts +13 -0
  106. package/bundle/resources/verification_key.js +112 -0
  107. package/bundle/resources/witness_calculator.d.ts +7 -21
  108. package/bundle/resources/witness_calculator.js +1 -1
  109. package/dist/.tsbuildinfo +1 -1
  110. package/dist/codec.d.ts +40 -0
  111. package/dist/codec.js +79 -0
  112. package/dist/codec.js.map +1 -0
  113. package/dist/codec.test-utils.d.ts +37 -0
  114. package/dist/codec.test-utils.js +61 -0
  115. package/dist/codec.test-utils.js.map +1 -0
  116. package/dist/contract/constants.d.ts +10 -3
  117. package/dist/contract/constants.js +13 -6
  118. package/dist/contract/constants.js.map +1 -1
  119. package/dist/contract/index.d.ts +1 -0
  120. package/dist/contract/index.js +1 -0
  121. package/dist/contract/index.js.map +1 -1
  122. package/dist/contract/rln_base_contract.js +2 -1
  123. package/dist/contract/rln_base_contract.js.map +1 -1
  124. package/dist/contract/rln_contract.d.ts +17 -0
  125. package/dist/contract/rln_contract.js +107 -0
  126. package/dist/contract/rln_contract.js.map +1 -0
  127. package/dist/contract/test_setup.d.ts +26 -0
  128. package/dist/contract/test_setup.js +56 -0
  129. package/dist/contract/test_setup.js.map +1 -0
  130. package/dist/contract/test_utils.d.ts +39 -0
  131. package/dist/contract/test_utils.js +118 -0
  132. package/dist/contract/test_utils.js.map +1 -0
  133. package/dist/credentials_manager.d.ts +14 -2
  134. package/dist/credentials_manager.js +45 -4
  135. package/dist/credentials_manager.js.map +1 -1
  136. package/dist/identity.js +2 -1
  137. package/dist/identity.js.map +1 -1
  138. package/dist/index.d.ts +6 -2
  139. package/dist/index.js +6 -2
  140. package/dist/index.js.map +1 -1
  141. package/dist/keystore/keystore.js +30 -9
  142. package/dist/keystore/keystore.js.map +1 -1
  143. package/dist/message.d.ts +19 -0
  144. package/dist/message.js +51 -0
  145. package/dist/message.js.map +1 -0
  146. package/dist/proof.d.ts +21 -0
  147. package/dist/proof.js +50 -0
  148. package/dist/proof.js.map +1 -0
  149. package/dist/resources/rln.wasm +0 -0
  150. package/dist/resources/rln_final.zkey +0 -0
  151. package/dist/resources/verification_key.d.ts +13 -0
  152. package/dist/resources/verification_key.js +112 -0
  153. package/dist/resources/witness_calculator.d.ts +7 -21
  154. package/dist/resources/witness_calculator.js +1 -1
  155. package/dist/rln.d.ts +9 -0
  156. package/dist/rln.js +32 -4
  157. package/dist/rln.js.map +1 -1
  158. package/dist/root_tracker.d.ts +10 -0
  159. package/dist/root_tracker.js +75 -0
  160. package/dist/root_tracker.js.map +1 -0
  161. package/dist/utils/bytes.d.ts +31 -9
  162. package/dist/utils/bytes.js +70 -31
  163. package/dist/utils/bytes.js.map +1 -1
  164. package/dist/zerokit.d.ts +11 -0
  165. package/dist/zerokit.js +97 -1
  166. package/dist/zerokit.js.map +1 -1
  167. package/package.json +1 -1
  168. package/src/codec.test-utils.ts +88 -0
  169. package/src/codec.ts +138 -0
  170. package/src/contract/constants.ts +16 -6
  171. package/src/contract/index.ts +1 -0
  172. package/src/contract/rln_base_contract.ts +2 -1
  173. package/src/contract/rln_contract.ts +147 -0
  174. package/src/contract/test_setup.ts +86 -0
  175. package/src/contract/test_utils.ts +179 -0
  176. package/src/credentials_manager.ts +72 -8
  177. package/src/identity.ts +2 -1
  178. package/src/index.ts +11 -1
  179. package/src/keystore/keystore.ts +32 -9
  180. package/src/message.ts +73 -0
  181. package/src/proof.ts +69 -0
  182. package/src/resources/verification_key.d.ts +13 -0
  183. package/src/resources/witness_calculator.d.ts +7 -21
  184. package/src/rln.ts +65 -5
  185. package/src/root_tracker.ts +92 -0
  186. package/src/utils/bytes.ts +73 -36
  187. package/src/zerokit.ts +217 -1
@@ -0,0 +1,112 @@
1
+ const verificationKey = {
2
+ protocol: "groth16",
3
+ curve: "bn128",
4
+ nPublic: 6,
5
+ vk_alpha_1: [
6
+ "20124996762962216725442980738609010303800849578410091356605067053491763969391",
7
+ "9118593021526896828671519912099489027245924097793322973632351264852174143923",
8
+ "1"
9
+ ],
10
+ vk_beta_2: [
11
+ [
12
+ "4693952934005375501364248788849686435240706020501681709396105298107971354382",
13
+ "14346958885444710485362620645446987998958218205939139994511461437152241966681"
14
+ ],
15
+ [
16
+ "16851772916911573982706166384196538392731905827088356034885868448550849804972",
17
+ "823612331030938060799959717749043047845343400798220427319188951998582076532"
18
+ ],
19
+ ["1", "0"]
20
+ ],
21
+ vk_gamma_2: [
22
+ [
23
+ "10857046999023057135944570762232829481370756359578518086990519993285655852781",
24
+ "11559732032986387107991004021392285783925812861821192530917403151452391805634"
25
+ ],
26
+ [
27
+ "8495653923123431417604973247489272438418190587263600148770280649306958101930",
28
+ "4082367875863433681332203403145435568316851327593401208105741076214120093531"
29
+ ],
30
+ ["1", "0"]
31
+ ],
32
+ vk_delta_2: [
33
+ [
34
+ "8353516066399360694538747105302262515182301251524941126222712285088022964076",
35
+ "9329524012539638256356482961742014315122377605267454801030953882967973561832"
36
+ ],
37
+ [
38
+ "16805391589556134376869247619848130874761233086443465978238468412168162326401",
39
+ "10111259694977636294287802909665108497237922060047080343914303287629927847739"
40
+ ],
41
+ ["1", "0"]
42
+ ],
43
+ vk_alphabeta_12: [
44
+ [
45
+ [
46
+ "12608968655665301215455851857466367636344427685631271961542642719683786103711",
47
+ "9849575605876329747382930567422916152871921500826003490242628251047652318086"
48
+ ],
49
+ [
50
+ "6322029441245076030714726551623552073612922718416871603535535085523083939021",
51
+ "8700115492541474338049149013125102281865518624059015445617546140629435818912"
52
+ ],
53
+ [
54
+ "10674973475340072635573101639867487770811074181475255667220644196793546640210",
55
+ "2926286967251299230490668407790788696102889214647256022788211245826267484824"
56
+ ]
57
+ ],
58
+ [
59
+ [
60
+ "9660441540778523475944706619139394922744328902833875392144658911530830074820",
61
+ "19548113127774514328631808547691096362144426239827206966690021428110281506546"
62
+ ],
63
+ [
64
+ "1870837942477655969123169532603615788122896469891695773961478956740992497097",
65
+ "12536105729661705698805725105036536744930776470051238187456307227425796690780"
66
+ ],
67
+ [
68
+ "21811903352654147452884857281720047789720483752548991551595462057142824037334",
69
+ "19021616763967199151052893283384285352200445499680068407023236283004353578353"
70
+ ]
71
+ ]
72
+ ],
73
+ IC: [
74
+ [
75
+ "11992897507809711711025355300535923222599547639134311050809253678876341466909",
76
+ "17181525095924075896332561978747020491074338784673526378866503154966799128110",
77
+ "1"
78
+ ],
79
+ [
80
+ "17018665030246167677911144513385572506766200776123272044534328594850561667818",
81
+ "18601114175490465275436712413925513066546725461375425769709566180981674884464",
82
+ "1"
83
+ ],
84
+ [
85
+ "18799470100699658367834559797874857804183288553462108031963980039244731716542",
86
+ "13064227487174191981628537974951887429496059857753101852163607049188825592007",
87
+ "1"
88
+ ],
89
+ [
90
+ "17432501889058124609368103715904104425610382063762621017593209214189134571156",
91
+ "13406815149699834788256141097399354592751313348962590382887503595131085938635",
92
+ "1"
93
+ ],
94
+ [
95
+ "10320964835612716439094703312987075811498239445882526576970512041988148264481",
96
+ "9024164961646353611176283204118089412001502110138072989569118393359029324867",
97
+ "1"
98
+ ],
99
+ [
100
+ "718355081067365548229685160476620267257521491773976402837645005858953849298",
101
+ "14635482993933988261008156660773180150752190597753512086153001683711587601974",
102
+ "1"
103
+ ],
104
+ [
105
+ "11777720285956632126519898515392071627539405001940313098390150593689568177535",
106
+ "8483603647274280691250972408211651407952870456587066148445913156086740744515",
107
+ "1"
108
+ ]
109
+ ]
110
+ };
111
+
112
+ export default verificationKey;
@@ -1,25 +1,11 @@
1
- export const builder: (
1
+ export async function builder(
2
2
  code: Uint8Array,
3
- sanityCheck?: boolean
4
- ) => Promise<WitnessCalculator>;
3
+ sanityCheck: boolean
4
+ ): Promise<WitnessCalculator>;
5
5
 
6
6
  export class WitnessCalculator {
7
- constructor(instance: any, sanityCheck?: boolean);
8
-
9
- circom_version(): number;
10
-
11
- calculateWitness(
12
- input: Record<string, unknown>,
13
- sanityCheck?: boolean
14
- ): Promise<bigint[]>;
15
-
16
- calculateBinWitness(
17
- input: Record<string, unknown>,
18
- sanityCheck?: boolean
19
- ): Promise<Uint8Array>;
20
-
21
- calculateWTNSBin(
22
- input: Record<string, unknown>,
23
- sanityCheck?: boolean
24
- ): Promise<Uint8Array>;
7
+ public calculateWitness(
8
+ input: unknown,
9
+ sanityCheck: boolean
10
+ ): Promise<Array<bigint>>;
25
11
  }
@@ -1,6 +1,6 @@
1
1
  // File generated with https://github.com/iden3/circom
2
2
  // following the instructions from:
3
- // https://github.com/vacp2p/zerokit/tree/master/rln#advanced-custom-circuit-compilation
3
+ // https://github.com/vacp2p/zerokit/tree/master/rln#compiling-circuits
4
4
 
5
5
  export async function builder(code, options) {
6
6
  options = options || {};