@waku/rln 0.0.7 → 0.0.8-4b656ce
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/index.js +1 -1
- package/bundle/{rln-4592cf99.js → rln-ae2fde2f.js} +131 -136
- package/dist/.tsbuildinfo +1 -1
- package/dist/encoder.d.ts +19 -0
- package/dist/encoder.js +54 -0
- package/dist/encoder.js.map +1 -0
- package/dist/index.d.ts +2 -2
- package/dist/resources/verification_key.d.ts +12 -0
- package/dist/resources/verification_key.js +121 -0
- package/dist/resources/verification_key.js.map +1 -0
- package/dist/rln.d.ts +2 -2
- package/dist/rln.js +13 -9
- package/dist/rln.js.map +1 -1
- package/package.json +3 -2
- package/src/encoder.ts +81 -0
- package/src/index.ts +2 -2
- package/src/rln.ts +21 -17
package/bundle/index.js
CHANGED
@@ -3,7 +3,7 @@ async function create() {
|
|
3
3
|
// A dependency graph that contains any wasm must all be imported
|
4
4
|
// asynchronously. This file does the single async import, so
|
5
5
|
// that no one else needs to worry about it again.
|
6
|
-
const rlnModule = await import('./rln-
|
6
|
+
const rlnModule = await import('./rln-ae2fde2f.js');
|
7
7
|
return await rlnModule.create();
|
8
8
|
}
|
9
9
|
|
@@ -576,133 +576,124 @@ async function init(input) {
|
|
576
576
|
return finalizeInit(instance, module);
|
577
577
|
}
|
578
578
|
|
579
|
-
|
580
|
-
|
581
|
-
|
582
|
-
|
583
|
-
|
584
|
-
|
585
|
-
|
586
|
-
|
587
|
-
|
588
|
-
|
589
|
-
|
590
|
-
|
591
|
-
|
592
|
-
|
593
|
-
|
594
|
-
|
595
|
-
|
596
|
-
|
597
|
-
|
598
|
-
|
599
|
-
|
600
|
-
]
|
601
|
-
|
602
|
-
|
603
|
-
|
604
|
-
|
605
|
-
|
606
|
-
|
607
|
-
|
608
|
-
|
609
|
-
|
610
|
-
|
611
|
-
|
612
|
-
|
613
|
-
|
614
|
-
]
|
615
|
-
|
616
|
-
|
617
|
-
|
618
|
-
|
619
|
-
|
620
|
-
|
621
|
-
|
622
|
-
|
623
|
-
|
624
|
-
|
625
|
-
|
626
|
-
|
627
|
-
|
628
|
-
]
|
629
|
-
|
630
|
-
|
631
|
-
|
632
|
-
|
633
|
-
|
634
|
-
|
635
|
-
|
636
|
-
|
637
|
-
|
638
|
-
|
639
|
-
|
640
|
-
|
641
|
-
|
642
|
-
|
643
|
-
|
644
|
-
|
645
|
-
|
646
|
-
|
647
|
-
|
648
|
-
|
649
|
-
|
650
|
-
|
651
|
-
|
652
|
-
|
653
|
-
|
654
|
-
|
655
|
-
|
656
|
-
|
657
|
-
|
658
|
-
]
|
659
|
-
|
660
|
-
|
661
|
-
|
662
|
-
|
663
|
-
|
664
|
-
|
665
|
-
|
666
|
-
|
667
|
-
|
668
|
-
|
669
|
-
|
670
|
-
|
671
|
-
|
672
|
-
|
673
|
-
|
674
|
-
|
675
|
-
|
676
|
-
|
677
|
-
|
678
|
-
|
679
|
-
|
680
|
-
|
681
|
-
|
682
|
-
|
683
|
-
|
684
|
-
|
685
|
-
|
686
|
-
|
687
|
-
|
688
|
-
|
689
|
-
|
690
|
-
|
691
|
-
|
692
|
-
|
693
|
-
|
694
|
-
|
695
|
-
]
|
696
|
-
|
697
|
-
protocol: protocol,
|
698
|
-
curve: curve,
|
699
|
-
nPublic: nPublic,
|
700
|
-
vk_alpha_1: vk_alpha_1,
|
701
|
-
vk_beta_2: vk_beta_2,
|
702
|
-
vk_gamma_2: vk_gamma_2,
|
703
|
-
vk_delta_2: vk_delta_2,
|
704
|
-
vk_alphabeta_12: vk_alphabeta_12,
|
705
|
-
IC: IC
|
579
|
+
const verificationKey = {
|
580
|
+
"protocol": "groth16",
|
581
|
+
"curve": "bn128",
|
582
|
+
"nPublic": 6,
|
583
|
+
"vk_alpha_1": [
|
584
|
+
"1805378556360488226980822394597799963030511477964155500103132920745199284516",
|
585
|
+
"11990395240534218699464972016456017378439762088320057798320175886595281336136",
|
586
|
+
"1"
|
587
|
+
],
|
588
|
+
"vk_beta_2": [
|
589
|
+
[
|
590
|
+
"11031529986141021025408838211017932346992429731488270384177563837022796743627",
|
591
|
+
"16042159910707312759082561183373181639420894978640710177581040523252926273854"
|
592
|
+
],
|
593
|
+
[
|
594
|
+
"20112698439519222240302944148895052359035104222313380895334495118294612255131",
|
595
|
+
"19441583024670359810872018179190533814486480928824742448673677460151702019379"
|
596
|
+
],
|
597
|
+
[
|
598
|
+
"1",
|
599
|
+
"0"
|
600
|
+
]
|
601
|
+
],
|
602
|
+
"vk_gamma_2": [
|
603
|
+
[
|
604
|
+
"10857046999023057135944570762232829481370756359578518086990519993285655852781",
|
605
|
+
"11559732032986387107991004021392285783925812861821192530917403151452391805634"
|
606
|
+
],
|
607
|
+
[
|
608
|
+
"8495653923123431417604973247489272438418190587263600148770280649306958101930",
|
609
|
+
"4082367875863433681332203403145435568316851327593401208105741076214120093531"
|
610
|
+
],
|
611
|
+
[
|
612
|
+
"1",
|
613
|
+
"0"
|
614
|
+
]
|
615
|
+
],
|
616
|
+
"vk_delta_2": [
|
617
|
+
[
|
618
|
+
"1948496782571164085469528023647105317580208688174386157591917599801657832035",
|
619
|
+
"20445814069256658101339037520922621162739470138213615104905368409238414511981"
|
620
|
+
],
|
621
|
+
[
|
622
|
+
"10024680869920840984813249386422727863826862577760330492647062850849851925340",
|
623
|
+
"10512156247842686783409460795717734694774542185222602679117887145206209285142"
|
624
|
+
],
|
625
|
+
[
|
626
|
+
"1",
|
627
|
+
"0"
|
628
|
+
]
|
629
|
+
],
|
630
|
+
"vk_alphabeta_12": [
|
631
|
+
[
|
632
|
+
[
|
633
|
+
"5151991366823434428398919091000210787450832786814248297320989361921939794156",
|
634
|
+
"15735191313289001022885148627913534790382722933676436876510746491415970766821"
|
635
|
+
],
|
636
|
+
[
|
637
|
+
"3387907257437913904447588318761906430938415556102110876587455322225272831272",
|
638
|
+
"1998779853452712881084781956683721603875246565720647583735935725110674288056"
|
639
|
+
],
|
640
|
+
[
|
641
|
+
"14280074182991498185075387990446437410077692353432005297922275464876153151820",
|
642
|
+
"17092408446352310039633488224969232803092763095456307462247653153107223117633"
|
643
|
+
]
|
644
|
+
],
|
645
|
+
[
|
646
|
+
[
|
647
|
+
"4359046709531668109201634396816565829237358165496082832279660960675584351266",
|
648
|
+
"4511888308846208349307186938266411423935335853916317436093178288331845821336"
|
649
|
+
],
|
650
|
+
[
|
651
|
+
"11429499807090785857812316277335883295048773373068683863667725283965356423273",
|
652
|
+
"16232274853200678548795010078253506586114563833318973594428907292096178657392"
|
653
|
+
],
|
654
|
+
[
|
655
|
+
"18068999605870933925311275504102553573815570223888590384919752303726860800970",
|
656
|
+
"17309569111965782732372130116757295842160193489132771344011460471298173784984"
|
657
|
+
]
|
658
|
+
]
|
659
|
+
],
|
660
|
+
"IC": [
|
661
|
+
[
|
662
|
+
"18693301901828818437917730940595978397160482710354161265484535387752523310572",
|
663
|
+
"17985273354976640088538673802000794244421192643855111089693820179790551470769",
|
664
|
+
"1"
|
665
|
+
],
|
666
|
+
[
|
667
|
+
"21164641723988537620541455173278629777250883365474191521194244273980931825942",
|
668
|
+
"998385854410718613441067082771678946155853656328717326195057262123686425518",
|
669
|
+
"1"
|
670
|
+
],
|
671
|
+
[
|
672
|
+
"21666968581672145768705229094968410656430989593283335488162701230986314747515",
|
673
|
+
"17996457608540683483506630273632100555125353447506062045735279661096094677264",
|
674
|
+
"1"
|
675
|
+
],
|
676
|
+
[
|
677
|
+
"20137761979695192602424300886442379728165712610493092740175904438282083668117",
|
678
|
+
"19184814924890679891263780109959113289320127263583260218200636509492157834679",
|
679
|
+
"1"
|
680
|
+
],
|
681
|
+
[
|
682
|
+
"10943171273393803842589314082509655332154393332394322726077270895078286354146",
|
683
|
+
"10872472035685319847811233167729172672344935625121511932198535224727331126439",
|
684
|
+
"1"
|
685
|
+
],
|
686
|
+
[
|
687
|
+
"13049169779481227658517545034348883391527506091990880778783387628208561946597",
|
688
|
+
"10083689369261379027228809473568899816311684698866922944902456565434209079955",
|
689
|
+
"1"
|
690
|
+
],
|
691
|
+
[
|
692
|
+
"19633516378466409167014413361365552102431118630694133723053441455184566611083",
|
693
|
+
"8059525100726933978719058611146131904598011633549012007359165766216730722269",
|
694
|
+
"1"
|
695
|
+
]
|
696
|
+
]
|
706
697
|
};
|
707
698
|
|
708
699
|
// File generated with https://github.com/iden3/circom
|
@@ -1079,7 +1070,7 @@ const shareXOffset = epochOffset + 32;
|
|
1079
1070
|
const shareYOffset = shareXOffset + 32;
|
1080
1071
|
const nullifierOffset = shareYOffset + 32;
|
1081
1072
|
const rlnIdentifierOffset = nullifierOffset + 32;
|
1082
|
-
class
|
1073
|
+
class Proof {
|
1083
1074
|
constructor(proofBytes) {
|
1084
1075
|
if (proofBytes.length < rlnIdentifierOffset)
|
1085
1076
|
throw "invalid proof";
|
@@ -1092,9 +1083,9 @@ class RateLimitProof {
|
|
1092
1083
|
this.nullifier = proofBytes.subarray(shareYOffset, nullifierOffset);
|
1093
1084
|
this.rlnIdentifier = proofBytes.subarray(nullifierOffset, rlnIdentifierOffset);
|
1094
1085
|
}
|
1095
|
-
|
1096
|
-
|
1097
|
-
|
1086
|
+
}
|
1087
|
+
function proofToBytes(p) {
|
1088
|
+
return concatenate(p.proof, p.merkleRoot, p.epoch, p.shareX, p.shareY, p.nullifier, p.rlnIdentifier);
|
1098
1089
|
}
|
1099
1090
|
class RLNInstance {
|
1100
1091
|
constructor(zkRLN, witnessCalculator) {
|
@@ -1134,14 +1125,18 @@ class RLNInstance {
|
|
1134
1125
|
const inputs = RLNWitnessToJson(this.zkRLN, rlnWitness);
|
1135
1126
|
const calculatedWitness = await this.witnessCalculator.calculateWitness(inputs, false); // no sanity check being used in zerokit
|
1136
1127
|
const proofBytes = generate_rln_proof_with_witness(this.zkRLN, calculatedWitness, rlnWitness);
|
1137
|
-
return new
|
1128
|
+
return new Proof(proofBytes);
|
1138
1129
|
}
|
1139
1130
|
verifyProof(proof) {
|
1140
|
-
|
1141
|
-
|
1131
|
+
let pBytes;
|
1132
|
+
if (proof instanceof Uint8Array) {
|
1133
|
+
pBytes = proof;
|
1134
|
+
}
|
1135
|
+
else {
|
1136
|
+
pBytes = proofToBytes(proof);
|
1142
1137
|
}
|
1143
|
-
return verifyProof(this.zkRLN,
|
1138
|
+
return verifyProof(this.zkRLN, pBytes);
|
1144
1139
|
}
|
1145
1140
|
}
|
1146
1141
|
|
1147
|
-
export { MembershipKey,
|
1142
|
+
export { MembershipKey, Proof, RLNInstance, create, toEpoch };
|
package/dist/.tsbuildinfo
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/@waku/zerokit-rln-wasm/rln_wasm.d.ts","../src/resources/verification_key.json","../src/witness_calculator.d.ts","../src/rln.ts","../src/index.ts","../src/witness_calculator.js","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"75c9b7689a1a1d946866a34ab936eaf661ad4ea6eb2dda6b56e1971934893cb5","2ec32014ec7c88e01850b7e13cfab97f141d9772fc7a7543ebe6cafacca5c537","18e63e4f6a513425aaf40a04e557d486a7b3bb6304807efea8493af640a157ce",{"version":"34917a723c02fec77ba8684c731f07998fb92f3e91209472d83e0b6c2b8c33f1","signature":"958d632d0ffa56404925d2d5e976e7f58a52c4293e2e9c4e5cd9a45d237c04f2"},{"version":"13e654f5895b859236a2664c79c768f297fabe8c034e7497d07cab9da4479c78","signature":"e3dd5733f8e4834a1a91c4499cdeb28337e40336da31fcec8e705319b2ea4c55"},{"version":"cb732dfea79ca2a9a5fd4ed240df67d6c47fd5b66fe188c645367efd1762ed24","signature":"39257e47f71a52d198342c47d3a6b35338a3c8618e4335b56530f2cb3b0dc511"},"0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"77f0b5c6a193a699c9f7d7fb0578e64e562d271afa740783665d2a827104a873","affectsGlobalScope":true},"e5979905796fe2740d85fbaf4f11f42b7ee1851421afe750823220813421b1af",{"version":"fcdcb42da18dd98dc286b1876dd425791772036012ae61263c011a76b13a190f","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","5b30f550565fd0a7524282c81c27fe8534099e2cd26170ca80852308f07ae68d","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","d97cd8a4a42f557fc62271369ed0461c8e50d47b7f9c8ad0b5462f53306f6060","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"bfea28e6162ed21a0aeed181b623dcf250aa79abf49e24a6b7e012655af36d81","affectsGlobalScope":true},"b8aca9d0c81abb02bec9b7621983ae65bde71da6727580070602bd2500a9ce2a","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","10d4796a130577d57003a77b95d8723530bbec84718e364aa2129fa8ffba0378","063f53ff674228c190efa19dd9448bcbd540acdbb48a928f4cf3a1b9f9478e43","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"287b21dc1d1b9701c92e15e7dd673dfe6044b15812956377adffb6f08825b1bc","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"4cd4cff679c9b3d9239fd7bf70293ca4594583767526916af8e5d5a47d0219c7","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"af9771b066ec35ffa1c7db391b018d2469d55e51b98ae95e62b6cbef1b0169ca","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","103d70bfbeb3cd3a3f26d1705bf986322d8738c2c143f38ebb743b1e228d7444","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7",{"version":"3a2da34079a2567161c1359316a32e712404b56566c45332ac9dcee015ecce9f","affectsGlobalScope":true},"28a2e7383fd898c386ffdcacedf0ec0845e5d1a86b5a43f25b86bc315f556b79","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"9cafe917bf667f1027b2bb62e2de454ecd2119c80873ad76fc41d941089753b8",{"version":"3f6d6465811321abc30a1e5f667feed63e5b3917b3d6c8d6645daf96c75f97ba","affectsGlobalScope":true}],"options":{"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"module":6,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":7,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[91],[48,91],[51,91],[52,57,91],[53,63,64,71,80,90,91],[53,54,63,71,91],[55,91],[56,57,64,72,91],[57,80,87,91],[58,60,63,71,91],[59,91],[60,61,91],[62,63,91],[63,91],[63,64,65,80,90,91],[63,64,65,80,91],[91,95],[66,71,80,90,91],[63,64,66,67,71,80,87,90,91],[66,68,80,87,90,91],[48,49,50,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,66,67,68,69,70,71,72,73,74,75,76,77,78,79,80,81,82,83,84,85,86,87,88,89,90,91,92,93,94,95,96,97],[63,69,91],[70,90,91],[60,63,71,80,91],[72,91],[73,91],[51,74,91],[75,89,91,95],[76,91],[77,91],[63,78,91],[78,79,91,93],[63,80,81,82,91],[80,82,91],[80,81,91],[83,91],[84,91],[63,85,86,91],[85,86,91],[57,71,80,87,91],[88,91],[71,89,91],[52,66,77,90,91],[57,91],[80,91,92],[91,93],[91,94],[52,57,63,65,74,80,90,91,93,95],[80,91,96],[45,91],[42,43,44,91],[45]],"referencedMap":[[99,1],[48,2],[49,2],[51,3],[52,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,12],[62,13],[63,14],[64,15],[65,16],[50,17],[97,1],[66,18],[67,19],[68,20],[98,21],[69,22],[70,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[82,34],[81,35],[83,36],[84,37],[85,38],[86,39],[87,40],[88,41],[89,42],[90,43],[91,44],[92,45],[93,46],[94,47],[95,48],[96,49],[42,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[34,1],[39,1],[40,1],[35,1],[36,1],[37,1],[38,1],[1,1],[41,1],[46,50],[43,1],[45,51],[44,1],[47,1]],"exportedModulesMap":[[99,1],[48,2],[49,2],[51,3],[52,4],[53,5],[54,6],[55,7],[56,8],[57,9],[58,10],[59,11],[60,12],[61,12],[62,13],[63,14],[64,15],[65,16],[50,17],[97,1],[66,18],[67,19],[68,20],[98,21],[69,22],[70,23],[71,24],[72,25],[73,26],[74,27],[75,28],[76,29],[77,30],[78,31],[79,32],[80,33],[82,34],[81,35],[83,36],[84,37],[85,38],[86,39],[87,40],[88,41],[89,42],[90,43],[91,44],[92,45],[93,46],[94,47],[95,48],[96,49],[42,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[34,1],[39,1],[40,1],[35,1],[36,1],[37,1],[38,1],[1,1],[41,1],[46,52],[43,1],[44,1]],"semanticDiagnosticsPerFile":[99,48,49,51,52,53,54,55,56,57,58,59,60,61,62,63,64,65,50,97,66,67,68,98,69,70,71,72,73,74,75,76,77,78,79,80,82,81,83,84,85,86,87,88,89,90,91,92,93,94,95,96,42,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,34,39,40,35,36,37,38,1,41,46,43,45,44,47]},"version":"4.8.2"}
|
1
|
+
{"program":{"fileNames":["../node_modules/typescript/lib/lib.es5.d.ts","../node_modules/typescript/lib/lib.es2015.d.ts","../node_modules/typescript/lib/lib.es2016.d.ts","../node_modules/typescript/lib/lib.es2017.d.ts","../node_modules/typescript/lib/lib.es2018.d.ts","../node_modules/typescript/lib/lib.es2019.d.ts","../node_modules/typescript/lib/lib.es2020.d.ts","../node_modules/typescript/lib/lib.dom.d.ts","../node_modules/typescript/lib/lib.es2015.core.d.ts","../node_modules/typescript/lib/lib.es2015.collection.d.ts","../node_modules/typescript/lib/lib.es2015.generator.d.ts","../node_modules/typescript/lib/lib.es2015.iterable.d.ts","../node_modules/typescript/lib/lib.es2015.promise.d.ts","../node_modules/typescript/lib/lib.es2015.proxy.d.ts","../node_modules/typescript/lib/lib.es2015.reflect.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.d.ts","../node_modules/typescript/lib/lib.es2015.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2016.array.include.d.ts","../node_modules/typescript/lib/lib.es2017.object.d.ts","../node_modules/typescript/lib/lib.es2017.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2017.string.d.ts","../node_modules/typescript/lib/lib.es2017.intl.d.ts","../node_modules/typescript/lib/lib.es2017.typedarrays.d.ts","../node_modules/typescript/lib/lib.es2018.asyncgenerator.d.ts","../node_modules/typescript/lib/lib.es2018.asynciterable.d.ts","../node_modules/typescript/lib/lib.es2018.intl.d.ts","../node_modules/typescript/lib/lib.es2018.promise.d.ts","../node_modules/typescript/lib/lib.es2018.regexp.d.ts","../node_modules/typescript/lib/lib.es2019.array.d.ts","../node_modules/typescript/lib/lib.es2019.object.d.ts","../node_modules/typescript/lib/lib.es2019.string.d.ts","../node_modules/typescript/lib/lib.es2019.symbol.d.ts","../node_modules/typescript/lib/lib.es2020.bigint.d.ts","../node_modules/typescript/lib/lib.es2020.date.d.ts","../node_modules/typescript/lib/lib.es2020.promise.d.ts","../node_modules/typescript/lib/lib.es2020.sharedmemory.d.ts","../node_modules/typescript/lib/lib.es2020.string.d.ts","../node_modules/typescript/lib/lib.es2020.symbol.wellknown.d.ts","../node_modules/typescript/lib/lib.es2020.intl.d.ts","../node_modules/typescript/lib/lib.es2020.number.d.ts","../node_modules/typescript/lib/lib.esnext.intl.d.ts","../node_modules/@types/ms/index.d.ts","../node_modules/@types/debug/index.d.ts","../node_modules/js-waku/dist/lib/constants.d.ts","../node_modules/@noble/secp256k1/lib/index.d.ts","../node_modules/js-waku/dist/lib/crypto.d.ts","../node_modules/js-waku/dist/lib/enr/constants.d.ts","../node_modules/multiformats/types/src/bases/interface.d.ts","../node_modules/multiformats/types/src/hashes/interface.d.ts","../node_modules/multiformats/types/src/cid.d.ts","../node_modules/@libp2p/interface-peer-id/dist/src/index.d.ts","../node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/js-waku/dist/lib/enr/keypair/types.d.ts","../node_modules/js-waku/dist/lib/enr/keypair/secp256k1.d.ts","../node_modules/js-waku/dist/lib/enr/keypair/index.d.ts","../node_modules/js-waku/dist/lib/enr/types.d.ts","../node_modules/js-waku/dist/lib/enr/waku2_codec.d.ts","../node_modules/js-waku/dist/lib/enr/enr.d.ts","../node_modules/js-waku/dist/lib/enr/index.d.ts","../node_modules/js-waku/dist/lib/utils.d.ts","../node_modules/uint8arraylist/dist/src/index.d.ts","../node_modules/protons-runtime/dist/src/codec.d.ts","../node_modules/protons-runtime/dist/src/decode.d.ts","../node_modules/protons-runtime/dist/src/encode.d.ts","../node_modules/protons-runtime/dist/src/codecs/enum.d.ts","../node_modules/protons-runtime/dist/src/codecs/message.d.ts","../node_modules/protons-runtime/dist/src/index.d.ts","../node_modules/js-waku/dist/proto/message.d.ts","../node_modules/js-waku/dist/proto/topic_only_message.d.ts","../node_modules/@libp2p/interface-connection/dist/src/status.d.ts","../node_modules/it-stream-types/dist/src/index.d.ts","../node_modules/@libp2p/interfaces/dist/src/index.d.ts","../node_modules/@libp2p/interface-connection/dist/src/index.d.ts","../node_modules/@libp2p/interfaces/dist/src/events.d.ts","../node_modules/@libp2p/interfaces/dist/src/startable.d.ts","../node_modules/@libp2p/interface-transport/node_modules/@multiformats/multiaddr/dist/src/protocols-table.d.ts","../node_modules/@libp2p/interface-transport/node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface-transport/dist/src/index.d.ts","../node_modules/@libp2p/interface-peer-info/node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface-peer-info/dist/src/index.d.ts","../node_modules/@libp2p/interface-content-routing/dist/src/index.d.ts","../node_modules/@libp2p/interface-address-manager/node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface-address-manager/dist/src/index.d.ts","../node_modules/@libp2p/interface-metrics/dist/src/index.d.ts","../node_modules/@libp2p/interface-peer-routing/dist/src/index.d.ts","../node_modules/@libp2p/interface-peer-store/node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface-record/dist/src/index.d.ts","../node_modules/@libp2p/interface-peer-store/dist/src/index.d.ts","../node_modules/@libp2p/interface-registrar/dist/src/index.d.ts","../node_modules/interface-store/dist/src/index.d.ts","../node_modules/multiformats/types/src/bases/base.d.ts","../node_modules/uint8arrays/types/src/util/bases.d.ts","../node_modules/uint8arrays/types/src/to-string.d.ts","../node_modules/interface-datastore/dist/src/key.d.ts","../node_modules/interface-datastore/dist/src/index.d.ts","../node_modules/it-pushable/dist/src/fifo.d.ts","../node_modules/it-pushable/dist/src/index.d.ts","../node_modules/@libp2p/interface-pubsub/dist/src/index.d.ts","../node_modules/@libp2p/interface-peer-discovery/dist/src/index.d.ts","../node_modules/@libp2p/interface-dht/dist/src/index.d.ts","../node_modules/@libp2p/interface-connection-manager/node_modules/@multiformats/multiaddr/dist/src/index.d.ts","../node_modules/@libp2p/interface-connection-manager/dist/src/index.d.ts","../node_modules/@libp2p/components/dist/src/index.d.ts","../node_modules/libp2p/dist/src/transport-manager.d.ts","../node_modules/libp2p/dist/src/identify/pb/message.d.ts","../node_modules/libp2p/dist/src/identify/index.d.ts","../node_modules/libp2p/dist/src/circuit/index.d.ts","../node_modules/@libp2p/interface-stream-muxer/dist/src/index.d.ts","../node_modules/@libp2p/interface-connection-encrypter/dist/src/index.d.ts","../node_modules/libp2p/dist/src/keychain/cms.d.ts","../node_modules/libp2p/dist/src/keychain/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/latency-monitor.d.ts","../node_modules/timeout-abort-controller/dist/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/dialer/dial-request.d.ts","../node_modules/libp2p/dist/src/connection-manager/dialer/index.d.ts","../node_modules/libp2p/dist/src/connection-manager/index.d.ts","../node_modules/libp2p/dist/src/ping/index.d.ts","../node_modules/libp2p/dist/src/fetch/index.d.ts","../node_modules/libp2p/dist/src/index.d.ts","../node_modules/js-waku/dist/proto/filter.d.ts","../node_modules/js-waku/dist/lib/waku_filter/filter_rpc.d.ts","../node_modules/js-waku/dist/lib/waku_filter/index.d.ts","../node_modules/js-waku/dist/proto/light_push.d.ts","../node_modules/js-waku/dist/lib/waku_light_push/index.d.ts","../node_modules/protobufjs/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message/rpc.d.ts","../node_modules/@libp2p/interface-keys/dist/src/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/types.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/message-cache.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-params.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score-thresholds.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-stats.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/compute-score.d.ts","../node_modules/denque/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/message-deliveries.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/metrics.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/peer-score.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/score/index.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/tracer.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/config.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/stream.d.ts","../node_modules/@chainsafe/libp2p-gossipsub/dist/src/index.d.ts","../node_modules/js-waku/dist/lib/waku_relay/index.d.ts","../node_modules/js-waku/dist/proto/store_v2beta3.d.ts","../node_modules/js-waku/dist/proto/store_v2beta4.d.ts","../node_modules/js-waku/dist/lib/waku_store/constants.d.ts","../node_modules/js-waku/dist/lib/waku_store/history_rpc.d.ts","../node_modules/js-waku/dist/lib/waku_store/index.d.ts","../node_modules/js-waku/dist/lib/interfaces.d.ts","../node_modules/js-waku/dist/lib/waku.d.ts","../node_modules/js-waku/dist/index.d.ts","../node_modules/@waku/zerokit-rln-wasm/rln_wasm.d.ts","../src/resources/verification_key.js","../src/witness_calculator.d.ts","../src/rln.ts","../src/encoder.ts","../src/index.ts","../src/witness_calculator.js","../node_modules/@types/node/assert.d.ts","../node_modules/@types/node/assert/strict.d.ts","../node_modules/@types/node/globals.d.ts","../node_modules/@types/node/async_hooks.d.ts","../node_modules/@types/node/buffer.d.ts","../node_modules/@types/node/child_process.d.ts","../node_modules/@types/node/cluster.d.ts","../node_modules/@types/node/console.d.ts","../node_modules/@types/node/constants.d.ts","../node_modules/@types/node/crypto.d.ts","../node_modules/@types/node/dgram.d.ts","../node_modules/@types/node/diagnostics_channel.d.ts","../node_modules/@types/node/dns.d.ts","../node_modules/@types/node/dns/promises.d.ts","../node_modules/@types/node/domain.d.ts","../node_modules/@types/node/events.d.ts","../node_modules/@types/node/fs.d.ts","../node_modules/@types/node/fs/promises.d.ts","../node_modules/@types/node/http.d.ts","../node_modules/@types/node/http2.d.ts","../node_modules/@types/node/https.d.ts","../node_modules/@types/node/inspector.d.ts","../node_modules/@types/node/module.d.ts","../node_modules/@types/node/net.d.ts","../node_modules/@types/node/os.d.ts","../node_modules/@types/node/path.d.ts","../node_modules/@types/node/perf_hooks.d.ts","../node_modules/@types/node/process.d.ts","../node_modules/@types/node/punycode.d.ts","../node_modules/@types/node/querystring.d.ts","../node_modules/@types/node/readline.d.ts","../node_modules/@types/node/repl.d.ts","../node_modules/@types/node/stream.d.ts","../node_modules/@types/node/stream/promises.d.ts","../node_modules/@types/node/stream/consumers.d.ts","../node_modules/@types/node/stream/web.d.ts","../node_modules/@types/node/string_decoder.d.ts","../node_modules/@types/node/timers.d.ts","../node_modules/@types/node/timers/promises.d.ts","../node_modules/@types/node/tls.d.ts","../node_modules/@types/node/trace_events.d.ts","../node_modules/@types/node/tty.d.ts","../node_modules/@types/node/url.d.ts","../node_modules/@types/node/util.d.ts","../node_modules/@types/node/v8.d.ts","../node_modules/@types/node/vm.d.ts","../node_modules/@types/node/wasi.d.ts","../node_modules/@types/node/worker_threads.d.ts","../node_modules/@types/node/zlib.d.ts","../node_modules/@types/node/globals.global.d.ts","../node_modules/@types/node/index.d.ts","../node_modules/@types/mocha/index.d.ts"],"fileInfos":[{"version":"f20c05dbfe50a208301d2a1da37b9931bce0466eb5a1f4fe240971b4ecc82b67","affectsGlobalScope":true},"dc47c4fa66b9b9890cf076304de2a9c5201e94b740cffdf09f87296d877d71f6","7a387c58583dfca701b6c85e0adaf43fb17d590fb16d5b2dc0a2fbd89f35c467","8a12173c586e95f4433e0c6dc446bc88346be73ffe9ca6eec7aa63c8f3dca7f9","5f4e733ced4e129482ae2186aae29fde948ab7182844c3a5a51dd346182c7b06","e6b724280c694a9f588847f754198fb96c43d805f065c3a5b28bbc9594541c84","1fc5ab7a764205c68fa10d381b08417795fc73111d6dd16b5b1ed36badb743d9",{"version":"9b087de7268e4efc5f215347a62656663933d63c0b1d7b624913240367b999ea","affectsGlobalScope":true},{"version":"adb996790133eb33b33aadb9c09f15c2c575e71fb57a62de8bf74dbf59ec7dfb","affectsGlobalScope":true},{"version":"8cc8c5a3bac513368b0157f3d8b31cfdcfe78b56d3724f30f80ed9715e404af8","affectsGlobalScope":true},{"version":"cdccba9a388c2ee3fd6ad4018c640a471a6c060e96f1232062223063b0a5ac6a","affectsGlobalScope":true},{"version":"c5c05907c02476e4bde6b7e76a79ffcd948aedd14b6a8f56e4674221b0417398","affectsGlobalScope":true},{"version":"0d5f52b3174bee6edb81260ebcd792692c32c81fd55499d69531496f3f2b25e7","affectsGlobalScope":true},{"version":"55f400eec64d17e888e278f4def2f254b41b89515d3b88ad75d5e05f019daddd","affectsGlobalScope":true},{"version":"181f1784c6c10b751631b24ce60c7f78b20665db4550b335be179217bacc0d5f","affectsGlobalScope":true},{"version":"3013574108c36fd3aaca79764002b3717da09725a36a6fc02eac386593110f93","affectsGlobalScope":true},{"version":"75ec0bdd727d887f1b79ed6619412ea72ba3c81d92d0787ccb64bab18d261f14","affectsGlobalScope":true},{"version":"3be5a1453daa63e031d266bf342f3943603873d890ab8b9ada95e22389389006","affectsGlobalScope":true},{"version":"17bb1fc99591b00515502d264fa55dc8370c45c5298f4a5c2083557dccba5a2a","affectsGlobalScope":true},{"version":"7ce9f0bde3307ca1f944119f6365f2d776d281a393b576a18a2f2893a2d75c98","affectsGlobalScope":true},{"version":"6a6b173e739a6a99629a8594bfb294cc7329bfb7b227f12e1f7c11bc163b8577","affectsGlobalScope":true},{"version":"81cac4cbc92c0c839c70f8ffb94eb61e2d32dc1c3cf6d95844ca099463cf37ea","affectsGlobalScope":true},{"version":"b0124885ef82641903d232172577f2ceb5d3e60aed4da1153bab4221e1f6dd4e","affectsGlobalScope":true},{"version":"0eb85d6c590b0d577919a79e0084fa1744c1beba6fd0d4e951432fa1ede5510a","affectsGlobalScope":true},{"version":"da233fc1c8a377ba9e0bed690a73c290d843c2c3d23a7bd7ec5cd3d7d73ba1e0","affectsGlobalScope":true},{"version":"d154ea5bb7f7f9001ed9153e876b2d5b8f5c2bb9ec02b3ae0d239ec769f1f2ae","affectsGlobalScope":true},{"version":"bb2d3fb05a1d2ffbca947cc7cbc95d23e1d053d6595391bd325deb265a18d36c","affectsGlobalScope":true},{"version":"c80df75850fea5caa2afe43b9949338ce4e2de086f91713e9af1a06f973872b8","affectsGlobalScope":true},{"version":"9d57b2b5d15838ed094aa9ff1299eecef40b190722eb619bac4616657a05f951","affectsGlobalScope":true},{"version":"6c51b5dd26a2c31dbf37f00cfc32b2aa6a92e19c995aefb5b97a3a64f1ac99de","affectsGlobalScope":true},{"version":"6e7997ef61de3132e4d4b2250e75343f487903ddf5370e7ce33cf1b9db9a63ed","affectsGlobalScope":true},{"version":"2ad234885a4240522efccd77de6c7d99eecf9b4de0914adb9a35c0c22433f993","affectsGlobalScope":true},{"version":"09aa50414b80c023553090e2f53827f007a301bc34b0495bfb2c3c08ab9ad1eb","affectsGlobalScope":true},{"version":"d7f680a43f8cd12a6b6122c07c54ba40952b0c8aa140dcfcf32eb9e6cb028596","affectsGlobalScope":true},{"version":"3787b83e297de7c315d55d4a7c546ae28e5f6c0a361b7a1dcec1f1f50a54ef11","affectsGlobalScope":true},{"version":"e7e8e1d368290e9295ef18ca23f405cf40d5456fa9f20db6373a61ca45f75f40","affectsGlobalScope":true},{"version":"faf0221ae0465363c842ce6aa8a0cbda5d9296940a8e26c86e04cc4081eea21e","affectsGlobalScope":true},{"version":"06393d13ea207a1bfe08ec8d7be562549c5e2da8983f2ee074e00002629d1871","affectsGlobalScope":true},{"version":"775d9c9fd150d5de79e0450f35bc8b8f94ae64e3eb5da12725ff2a649dccc777","affectsGlobalScope":true},{"version":"b248e32ca52e8f5571390a4142558ae4f203ae2f94d5bac38a3084d529ef4e58","affectsGlobalScope":true},{"version":"52d1bb7ab7a3306fd0375c8bff560feed26ed676a5b0457fa8027b563aecb9a4","affectsGlobalScope":true},"6a9c5127096b35264eb7cd21b2417bfc1d42cceca9ba4ce2bb0c3410b7816042","78828b06c0d3b586954015e9ebde5480b009e166c71244763bda328ec0920f41","6299d01ee802437d2fdb53f47a689062510a9f7a23c62fb74e375de1a7ae53af","32d21255d0e9e84cf7ec2b6619667f272dd2bf24ab65da803fd0550d978d207e","9c97b7b6137838f43665aa58080150368941b5be758d0d97be42ba5283e78112","02745a73c954228b9ee7fdb90451051e3f93a14f4a20ec3190113b37d101a021","930446bf32192f698b78f8ea4b309d8c2cfe02ab5ad78e4db907417405ebf5e7","5d3e07dbeabff37885262d9b4bd21c3185d95a09a268ab795f81135046a32bf4","7d309fbde13b5e30eff77c07a28b66451b0b50b83564d0cfa6a2a52c8b69aae6","7b542336a694a2f25b504dc444b52c77de252a775227bed2ca5e925fcef13d5a","27cd03a4713d26b0b52b5550a42090d9eef70114a4c3a83fcfe412e580adf0ba","a07051fa95231541a136adf29905db4b0f9f8c2616519673c55f90cc537c6808","7251b051302d5fb8c081d740a584df2b8a980a98b281382ae774b0f7d2348f5e","d0344d7d04ba77f5a158ffa9d8210b6fdd7e89e4d3fe5864cdf31df9a10eed10","1351122b0d74eb3b36904b3e61903e93d271424e5c276b84a3c291ece34f90bd","b0fe8eac1572e0b0a06fc85da636a0ddf475cc62e7eec90cb8e9b1973dba2a31","2440044d6f19586922ac3c16a348836eb4a93d111f65ace2929964b1f57e878f","64e84c0558ead00ce0c7b44c37b189a81f04c8abc987e3968331999b280cb043","fa83c09609a2eba873b864792931e6477855278d97bcc9fdd11bf4ff05ce80b9","f98f7fd5c208374f072a67a46306ab9b3f914554b4ebb673fb805e13a4119b6c","dd49c9b32796fc4d04995ff4e69a4d23b7fd36605a9223e33a090b7bf8e25980","cb5cbcc8bc0e686fc503dd4db148679f6eb1bf6d593fd1f0add504b7d8de4c7d","667c9ac7c2f61c4a36220c2fa02f848a170aa96d3a58be32a5831aad86330da2","eb15dfd1f8b6da5f546fe29a6a0f0de4ae6dbd4a5577af4eba4c8a54548ef0a2","01443e5da049881a99f223c72617d4bb1d8854930d03deceb628e4be83df1e4a","76513b0c51c81a929f4f90694edf4dcc85f71bb46121b4192b5530e0601f9d81","b266fc05b22d884f2b3d3f4b55f000c33bca5f9b9f936a243110b88368710e2e","2dd78be12842d8dc0816822645bcaf68f09ae3e3983ea5c0ba83d6cc7632b47e","5821f60fa027b9d7633ddbc56ccdb4c5ef90c0b2b95e717b565b4fa054afaa2c","6666d48a46dbfd565490e7f8789093e2392c5bdcc3a380dfdd91c77237e43101","02416ac1a9fe3c5ec70dfaed050f1a26aa65c50f655402dcb91223fbe51bccb4","26fe6126240601801a30c33b18616c4f798de6e866967f000a7f975a5392285c","928eca07b95937e5491919c6f5fa79025301d65364837d7c3f9f07d61cfc2e03","331f961a57d2ac8fd1f4b36e240e0dbae91f97ce3f49f6d2a8be4a5d3b2897df","16c594cd8a44be9f5398d3fc7dbc9575f0b67d91a6553f35bd3576136862b32b","27cd03a4713d26b0b52b5550a42090d9eef70114a4c3a83fcfe412e580adf0ba","2ea9a5510eb2d9ea6c1ea8273718ecf89a24e1efb21c2ed156d6fdbadcf9ccb0","38cc9434f53457647573eede8d402b6819531582b5acd2d7bc209d3142316356","2ea9a5510eb2d9ea6c1ea8273718ecf89a24e1efb21c2ed156d6fdbadcf9ccb0","edb50eace77052203c3bc6eb251fe31f44ab0107e2b6d949ec983a918726aaf4","fe6af38652dbbc61cd25ab3f462896fadf71449ab0364db2f58c0940ca97591b","2ea9a5510eb2d9ea6c1ea8273718ecf89a24e1efb21c2ed156d6fdbadcf9ccb0","a50f0a71401b3c8247ab8ac54d5e44a6ac9c39d47a58fbbd5a0cee79a98d33f5","f7a9d2ebac14acf7ccab184c61bdabefa9c61e0fca2bd544dcd8999eb153c777","0d014fe6ff00590303942d67fcf6725188eaef7662627404296d934837e4cf03","2ea9a5510eb2d9ea6c1ea8273718ecf89a24e1efb21c2ed156d6fdbadcf9ccb0","866f0c4f16380a56653adc6cbeac08c58c626dabb431f0fa6cc2ba07874836d8","dd0caaa689028bc3d8d3230e24c1f98da0339c54a465c2195edd9ee23ea33434","539bef6bb223dc9ac66a89acf514ad9b16bd5039a633452b3191e559873dcb59","ca657fafdab00d4bd4c92b72bd68d1bde04f7f4476446ad47c7fc7ce9151577e","729b819a6779d842c3a6908ba4ed93d9fe50e2533d989f05f55a4811b3dd9910","c6591dc2b834e9be50f97edb393c4673e9b66f5689c90d69a71c7da962a0563a","7c515715da56f17e695e2c3611cf073d2cebfd417497652b35f9042b7235d5b2","531556008024c69163c0d120823a69e7a6a5be1279ea87fc725a63dc386278b7","df99b5b6041e9e37b46c876cd487020e4bc9e02a519fa4a735cbe18f5c4f2f38","274bc8a207e66c24bf59952d15da5d4b70ec412b3182739a82b7f1bd67a5bcc7","b5b6d20512b7d92b6de850a19ac29c548c7e5a105bcc1f22967e0efd5310fb2b","ccbeec89ab92cd041ebc17c5cb5dcca14a1fa0a636a818a10d5f20089b54e7f2","70cbb43b1e838bb77b16e1085115494c8b6925a954edf7fbdd494ad56a88adb8","986b7e3cf584813d300921ae7aa5b4073192e8c0f50344db1f9961975a30a77f","2ea9a5510eb2d9ea6c1ea8273718ecf89a24e1efb21c2ed156d6fdbadcf9ccb0","88ad228320e3076d53e30f26bd4358b9322cb68fd0d0ccd9895fceeba235e960","0334ade018e6a48ba2ac1bf782758df77cd2dcd3ae0270edc257fe2f7942f249","56290429d838ecda4c6ebf20352c68eaeb5783f0750393ffa5566d5d976dd4af","0820608ae5bf3995d77eedf0fa7f987c0d5c7c9592fdc0bcb391fb742d5067a0","a00910424a6d9ba16e3acfbd9fbc5f80ebc8e9bd57f8740dab34a2caee60207c","a4884d181eaed3e9d77cbabf01047fd99f03dc713b93c0ac0a956d2ac337daa1","d651c9e54a1387fbf0a60bc4d54472aa86e6248fe99c8b60030104db291eb5de","e9421d9417a6f97b6f1fab42d1f92b4cdc1f1bc7df1eca572d6c015ab5936afb","995a3938e28f1a7e359847f83b43951c05727b6ca42398982778adc8b9a58609","fdf29515c4323693532f4e4f3cd8833d778ad8aa20465146377cd90ae766602c","d8a63ecc9188f8ef5fce8c82ea2c691acce9a152b8bd07d75a6531c7d4c07df9","f83ca4c2157040bc3dc3edc59900f83cb4ca98c08357b8547401119cac667f57","b474a024807159ea4e8d0922a86da3cdd0580bc23f1d8415f5bfe782f3329dae","1a4d7457432a0774351c3582c2c7afdd045d6dd9fcae9b25bc8196a1f3caddc9","1ba6fafef4b1847388480a86f7014af9fd3cf604978b08e3be8acca4cd28a754","2ff50746755e37483881b3f33a676fd1bbb3b4e7dcd6332197507bd268df68a0","9febe93b8dd42425ec39a4d8e20b35c038e005c590b92524991858136833be6d","7cf03ed8cb512625bbfe7074cd09264037cbfd2db889c56ff4026693f5effba6","ef9c484bef2e1a893aafb481c538eae694875a121627d6f443e87caed4f9e820","88aa0657df43db4d4a7f0b78e9108e02bd63f753b8cd6256ee34c50b6be279ce","e96858dc11f9174115b2a5f4e3af58a39c79245b1991adad5179130dcb13fa4c","7872c02afbba864693cb3a2129b070de5ae92f9ee61aa455ce1d697b6bbaaf8c","fb65c3df97aace64613c43d8926b99ec08c20c6033e82a71964e614632995f67","1558c642e03689d42843e7b047b9c20e77ee09ab388ff854484db5dcfbed11da","925a8770415572378b7b62dcd714e744b7ffed86de59bdbe1d25c68d9d1f7f51","0e4c4e3b7f9bddce2bfa2d4536da74ee8c9579ef0ef654e975d44ded342201a2","1c78addfbffb6d1ba38007875d7445b65cd076fc41d600a511cefe1263eebd01","a5fc37a5017ad0097ee70196f66018119db1e22b525a6afd4edc1ce6bbbd0b16","831f1ad45e156fa12bf736f4895329cb6e785f1c940fc58043718409d9845a43","32ffd3e74601a33cbf6a7596e00338eba67cf598faed2903be4281ba7ec076b5","f0e189b1e6f438e57ef5e091052193f69aa09103758940d926ef448802100e3c","bc78b25c3aaf139ca527952875c53bff67360e6b5812b82a8fa89fdefb720879","460f30d6ea494bbf076853e1588d30ec4651efcc26cbfcd2c91362f7efc87e89","b96a5c8de20ea0ec0bd266593fdafce71126c8d9f02cb292ed106dccc1bc45b5","2724c926dbbded3b51c9a7d3a141f8123cf9b0da102f91b2dda835bda27af606","579db9f817e749e6f4c373119fbf2a21f0e68ef9e2fff5f59a47ab779f364e6e","ce218e7127b5c109cc128316dcafb71146b483c3476cb6e30c4a84e38a4ea7e7","fbf1861ccb6cd611ab076684d2b95748c79aa8ea2b3193f4b19c93b056acbd35","60ca66c2e560e891c4bbac8a6664edeb14a2757c1269bc4a5be91859fe70b14e","e88e0b5cc0507cd875a465563d4cf2b15b587f0acfbb165ece0003355cb6ee29","a23ff524a4ef2fdd66e1f819e18aabca86d8dbafb3148fe5bdeff347cc7fd17f","c6eda7de7c92223f4f3bee04b23f3150aa1381d746691aed46d74b18b1d377f7","9b0ce3d469d412754e0c32473c53940407a8abb6492f2b0aefa8d0d344a2d074","a6d46e32b64a5734441a2f2013c22860ca0638f65eb09e5aea33bb7eeb008eea","ca0a8b3f2b5a49904787170788b158c7dd043903f253f960d4556f155355c401","2db27d0f3a1ca4b7ed5d731bad4b93b82c52d96846030e0d8d83f95abb2ef699","44a90a28932df305585f63fad8e60e44c2b8432ae11a3e2cb41a915d0ecbb8d1","f4f919d65c5a4aca999f026c07c763a5a7ea5ce2c23bbf0b7bd43612012b6bfc","93b1bbfb5aff051840f7566b4cbc3d9471dfa1b842433b392df460483d3d015b","bafc4f9ad6e84627b20ff4ba5ad7c17ebc87525e543b96bcd27e7521214d54b4","75c9b7689a1a1d946866a34ab936eaf661ad4ea6eb2dda6b56e1971934893cb5",{"version":"9abb5669e34589039c2d856596fdbb05af84df6c57dd948582bb6cf33c7786a5","signature":"8e87acd8260ebbda136579bdf35e3535475864e40a3fd7ed09f45bd731fa6c3a"},"18e63e4f6a513425aaf40a04e557d486a7b3bb6304807efea8493af640a157ce",{"version":"789c57056c5d7b3179501d684c4343d134d0aa5362ee9ba639991673bcf0e276","signature":"ad90697f53160f5469f8ef495711e455d508cc3e12cca792fe6a1367461eb024"},{"version":"61cc2dad0745cc35855fdeff2abc44a101772c953dd4e73782682f6fcb6ca031","signature":"258b7642bd378df176200916fae1ee62231d778d6981986bea9d5436fc5f4c60"},{"version":"3e45b2a6b3bbc06ff23aad94197f0324442e2df73476cccc5b6d49da16c03086","signature":"8ada006a318a00dda438914b6fe48ec28f172401963ad8041379f80547d631e6"},{"version":"cb732dfea79ca2a9a5fd4ed240df67d6c47fd5b66fe188c645367efd1762ed24","signature":"39257e47f71a52d198342c47d3a6b35338a3c8618e4335b56530f2cb3b0dc511"},"0cba3a5d7b81356222594442753cf90dd2892e5ccfe1d262aaca6896ba6c1380","a69c09dbea52352f479d3e7ac949fde3d17b195abe90b045d619f747b38d6d1a",{"version":"77f0b5c6a193a699c9f7d7fb0578e64e562d271afa740783665d2a827104a873","affectsGlobalScope":true},"e5979905796fe2740d85fbaf4f11f42b7ee1851421afe750823220813421b1af",{"version":"fcdcb42da18dd98dc286b1876dd425791772036012ae61263c011a76b13a190f","affectsGlobalScope":true},"1dab5ab6bcf11de47ab9db295df8c4f1d92ffa750e8f095e88c71ce4c3299628","f71f46ccd5a90566f0a37b25b23bc4684381ab2180bdf6733f4e6624474e1894",{"version":"54e65985a3ee3cec182e6a555e20974ea936fc8b8d1738c14e8ed8a42bd921d4","affectsGlobalScope":true},"82408ed3e959ddc60d3e9904481b5a8dc16469928257af22a3f7d1a3bc7fd8c4","5b30f550565fd0a7524282c81c27fe8534099e2cd26170ca80852308f07ae68d","34e5de87d983bc6aefef8b17658556e3157003e8d9555d3cb098c6bef0b5fbc8","d97cd8a4a42f557fc62271369ed0461c8e50d47b7f9c8ad0b5462f53306f6060","f27371653aded82b2b160f7a7033fb4a5b1534b6f6081ef7be1468f0f15327d3","c762cd6754b13a461c54b59d0ae0ab7aeef3c292c6cf889873f786ee4d8e75c9","f4ea7d5df644785bd9fbf419930cbaec118f0d8b4160037d2339b8e23c059e79",{"version":"bfea28e6162ed21a0aeed181b623dcf250aa79abf49e24a6b7e012655af36d81","affectsGlobalScope":true},"b8aca9d0c81abb02bec9b7621983ae65bde71da6727580070602bd2500a9ce2a","ae97e20f2e10dbeec193d6a2f9cd9a367a1e293e7d6b33b68bacea166afd7792","10d4796a130577d57003a77b95d8723530bbec84718e364aa2129fa8ffba0378","063f53ff674228c190efa19dd9448bcbd540acdbb48a928f4cf3a1b9f9478e43","bf73c576885408d4a176f44a9035d798827cc5020d58284cb18d7573430d9022","7ae078ca42a670445ae0c6a97c029cb83d143d62abd1730efb33f68f0b2c0e82",{"version":"e8b18c6385ff784228a6f369694fcf1a6b475355ba89090a88de13587a9391d5","affectsGlobalScope":true},"287b21dc1d1b9701c92e15e7dd673dfe6044b15812956377adffb6f08825b1bc","12eea70b5e11e924bb0543aea5eadc16ced318aa26001b453b0d561c2fd0bd1e","08777cd9318d294646b121838574e1dd7acbb22c21a03df84e1f2c87b1ad47f2","08a90bcdc717df3d50a2ce178d966a8c353fd23e5c392fd3594a6e39d9bb6304",{"version":"4cd4cff679c9b3d9239fd7bf70293ca4594583767526916af8e5d5a47d0219c7","affectsGlobalScope":true},"2a12d2da5ac4c4979401a3f6eaafa874747a37c365e4bc18aa2b171ae134d21b","002b837927b53f3714308ecd96f72ee8a053b8aeb28213d8ec6de23ed1608b66","1dc9c847473bb47279e398b22c740c83ea37a5c88bf66629666e3cf4c5b9f99c","a9e4a5a24bf2c44de4c98274975a1a705a0abbaad04df3557c2d3cd8b1727949","00fa7ce8bc8acc560dc341bbfdf37840a8c59e6a67c9bfa3fa5f36254df35db2","1b952304137851e45bc009785de89ada562d9376177c97e37702e39e60c2f1ff",{"version":"806ef4cac3b3d9fa4a48d849c8e084d7c72fcd7b16d76e06049a9ed742ff79c0","affectsGlobalScope":true},"44b8b584a338b190a59f4f6929d072431950c7bd92ec2694821c11bce180c8a5","5f0ed51db151c2cdc4fa3bb0f44ce6066912ad001b607a34e65a96c52eb76248",{"version":"af9771b066ec35ffa1c7db391b018d2469d55e51b98ae95e62b6cbef1b0169ca","affectsGlobalScope":true},"664d8f2d59164f2e08c543981453893bc7e003e4dfd29651ce09db13e9457980","103d70bfbeb3cd3a3f26d1705bf986322d8738c2c143f38ebb743b1e228d7444","f52fbf64c7e480271a9096763c4882d356b05cab05bf56a64e68a95313cd2ce2","59bdb65f28d7ce52ccfc906e9aaf422f8b8534b2d21c32a27d7819be5ad81df7",{"version":"3a2da34079a2567161c1359316a32e712404b56566c45332ac9dcee015ecce9f","affectsGlobalScope":true},"28a2e7383fd898c386ffdcacedf0ec0845e5d1a86b5a43f25b86bc315f556b79","3aff9c8c36192e46a84afe7b926136d520487155154ab9ba982a8b544ea8fc95","a880cf8d85af2e4189c709b0fea613741649c0e40fffb4360ec70762563d5de0","85bbf436a15bbeda4db888be3062d47f99c66fd05d7c50f0f6473a9151b6a070","9f9c49c95ecd25e0cb2587751925976cf64fd184714cb11e213749c80cf0f927","f0c75c08a71f9212c93a719a25fb0320d53f2e50ca89a812640e08f8ad8c408c",{"version":"ab9b9a36e5284fd8d3bf2f7d5fcbc60052f25f27e4d20954782099282c60d23e","affectsGlobalScope":true},"9cafe917bf667f1027b2bb62e2de454ecd2119c80873ad76fc41d941089753b8",{"version":"3f6d6465811321abc30a1e5f667feed63e5b3917b3d6c8d6645daf96c75f97ba","affectsGlobalScope":true}],"options":{"alwaysStrict":true,"declaration":true,"esModuleInterop":true,"module":6,"noFallthroughCasesInSwitch":true,"noImplicitAny":true,"noImplicitReturns":true,"noImplicitThis":true,"noUnusedLocals":true,"noUnusedParameters":true,"outDir":"./","rootDir":"../src","skipLibCheck":true,"sourceMap":true,"strict":true,"strictFunctionTypes":true,"strictNullChecks":true,"strictPropertyInitialization":true,"target":7,"tsBuildInfoFile":"./.tsbuildinfo"},"fileIdsList":[[203],[51,75,99,104,127,129,130,137,139,140,141,142,203],[127,129,203],[126,203],[127,129,132,203],[131,133,203],[131,132,138,203],[135,203],[104,129,131,133,134,136,137,203],[129,203],[62,74,203],[129,137,203],[51,53,99,127,128,203],[51,74,76,79,82,84,85,86,89,90,96,99,101,103,203],[75,78,203],[77,203],[51,72,203],[51,73,74,75,78,203],[51,53,62,71,72,73,203],[50,73,81,203],[50,51,73,81,100,203],[75,81,203],[49,50,203],[51,78,203],[51,73,81,203],[51,75,78,81,88,203],[51,62,74,75,98,203],[51,62,203],[51,74,203],[72,73,74,203],[72,73,74,75,78,203],[52,203],[42,203],[160,203],[163,203],[164,169,203],[165,175,176,183,192,202,203],[165,166,175,183,203],[167,203],[168,169,176,184,203],[169,192,199,203],[170,172,175,183,203],[171,203],[172,173,203],[174,175,203],[175,203],[175,176,177,192,202,203],[175,176,177,192,203],[203,207],[178,183,192,202,203],[175,176,178,179,183,192,199,202,203],[178,180,192,199,202,203],[160,161,162,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,178,179,180,181,182,183,184,185,186,187,188,189,190,191,192,193,194,195,196,197,198,199,200,201,202,203,204,205,206,207,208,209],[175,181,203],[182,202,203],[172,175,183,192,203],[184,203],[185,203],[163,186,203],[187,201,203,207],[188,203],[189,203],[175,190,203],[190,191,203,205],[175,192,193,194,203],[192,194,203],[192,193,203],[195,203],[196,203],[175,197,198,203],[197,198,203],[169,183,192,199,203],[200,203],[183,201,203],[164,178,189,202,203],[169,203],[192,203,204],[203,205],[203,206],[164,169,175,177,186,192,202,203,205,207],[192,203,208],[91,95,203],[94,203],[97,203],[44,46,60,61,69,70,123,125,144,149,151,203],[45,203],[51,53,56,57,58,203],[47,56,57,58,59,203],[51,54,55,203],[54,203],[51,53,74,120,123,125,144,149,151,203],[51,53,74,120,123,125,144,149,150,203],[121,203],[51,89,120,122,150,203],[51,89,120,124,150,203],[129,143,150,203],[62,145,146,147,203],[44,51,89,120,148,150,203],[62,68,203],[76,89,104,120,203],[53,73,74,116,203],[51,53,73,74,76,85,89,104,114,115,203],[51,53,73,74,75,76,89,103,104,113,116,203],[75,203],[51,73,74,76,90,104,203],[53,73,74,76,90,104,106,203],[51,53,73,74,75,76,79,81,82,85,86,89,90,96,99,100,101,103,105,107,108,109,110,112,117,118,119,203],[112,203],[51,104,111,203],[51,73,76,90,104,203],[53,73,74,75,76,79,104,203],[48,203],[48,49,203],[68,203],[63,203],[63,68,203],[62,63,203],[63,64,65,66,67,203],[93,203],[48,92,203],[43,150,152,156,203],[156,203],[150,153,154,155,203],[150,156],[156],[150]],"referencedMap":[[141,1],[143,2],[130,3],[127,4],[137,5],[134,6],[139,7],[136,8],[131,1],[132,1],[138,9],[133,10],[142,11],[140,12],[129,13],[104,14],[84,15],[83,16],[110,17],[103,18],[102,16],[74,19],[71,1],[82,20],[101,21],[128,1],[85,17],[100,22],[51,23],[81,24],[80,16],[86,25],[89,26],[87,16],[99,27],[88,28],[90,29],[109,30],[79,31],[78,16],[77,1],[75,1],[73,1],[76,1],[53,32],[52,1],[45,1],[43,33],[211,1],[42,1],[160,34],[161,34],[163,35],[164,36],[165,37],[166,38],[167,39],[168,40],[169,41],[170,42],[171,43],[172,44],[173,44],[174,45],[175,46],[176,47],[177,48],[162,49],[209,1],[178,50],[179,51],[180,52],[210,53],[181,54],[182,55],[183,56],[184,57],[185,58],[186,59],[187,60],[188,61],[189,62],[190,63],[191,64],[192,65],[194,66],[193,67],[195,68],[196,69],[197,70],[198,71],[199,72],[200,73],[201,74],[202,75],[203,76],[204,77],[205,78],[206,79],[207,80],[208,81],[153,1],[135,1],[96,82],[95,83],[91,1],[97,1],[98,84],[72,1],[152,85],[44,1],[46,86],[47,1],[59,87],[60,88],[56,89],[55,90],[54,1],[57,1],[58,1],[150,91],[61,1],[151,92],[122,93],[123,94],[125,95],[144,96],[147,1],[148,97],[149,98],[121,99],[124,99],[69,99],[145,99],[146,99],[70,99],[108,100],[115,101],[116,102],[117,103],[113,104],[119,105],[107,106],[106,99],[120,107],[111,108],[112,109],[118,110],[105,111],[92,112],[48,1],[50,113],[49,1],[126,1],[63,114],[66,115],[67,116],[64,117],[65,115],[68,118],[114,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[34,1],[39,1],[40,1],[35,1],[36,1],[37,1],[38,1],[1,1],[41,1],[62,1],[94,119],[93,120],[157,121],[158,122],[154,1],[156,123],[155,1],[159,1]],"exportedModulesMap":[[141,1],[143,2],[130,3],[127,4],[137,5],[134,6],[139,7],[136,8],[131,1],[132,1],[138,9],[133,10],[142,11],[140,12],[129,13],[104,14],[84,15],[83,16],[110,17],[103,18],[102,16],[74,19],[71,1],[82,20],[101,21],[128,1],[85,17],[100,22],[51,23],[81,24],[80,16],[86,25],[89,26],[87,16],[99,27],[88,28],[90,29],[109,30],[79,31],[78,16],[77,1],[75,1],[73,1],[76,1],[53,32],[52,1],[45,1],[43,33],[211,1],[42,1],[160,34],[161,34],[163,35],[164,36],[165,37],[166,38],[167,39],[168,40],[169,41],[170,42],[171,43],[172,44],[173,44],[174,45],[175,46],[176,47],[177,48],[162,49],[209,1],[178,50],[179,51],[180,52],[210,53],[181,54],[182,55],[183,56],[184,57],[185,58],[186,59],[187,60],[188,61],[189,62],[190,63],[191,64],[192,65],[194,66],[193,67],[195,68],[196,69],[197,70],[198,71],[199,72],[200,73],[201,74],[202,75],[203,76],[204,77],[205,78],[206,79],[207,80],[208,81],[153,1],[135,1],[96,82],[95,83],[91,1],[97,1],[98,84],[72,1],[152,85],[44,1],[46,86],[47,1],[59,87],[60,88],[56,89],[55,90],[54,1],[57,1],[58,1],[150,91],[61,1],[151,92],[122,93],[123,94],[125,95],[144,96],[147,1],[148,97],[149,98],[121,99],[124,99],[69,99],[145,99],[146,99],[70,99],[108,100],[115,101],[116,102],[117,103],[113,104],[119,105],[107,106],[106,99],[120,107],[111,108],[112,109],[118,110],[105,111],[92,112],[48,1],[50,113],[49,1],[126,1],[63,114],[66,115],[67,116],[64,117],[65,115],[68,118],[114,1],[8,1],[10,1],[9,1],[2,1],[11,1],[12,1],[13,1],[14,1],[15,1],[16,1],[17,1],[18,1],[3,1],[4,1],[22,1],[19,1],[20,1],[21,1],[23,1],[24,1],[25,1],[5,1],[26,1],[27,1],[28,1],[29,1],[6,1],[30,1],[31,1],[32,1],[33,1],[7,1],[34,1],[39,1],[40,1],[35,1],[36,1],[37,1],[38,1],[1,1],[41,1],[62,1],[94,119],[93,120],[157,124],[158,125],[156,126],[155,1]],"semanticDiagnosticsPerFile":[141,143,130,127,137,134,139,136,131,132,138,133,142,140,129,104,84,83,110,103,102,74,71,82,101,128,85,100,51,81,80,86,89,87,99,88,90,109,79,78,77,75,73,76,53,52,45,43,211,42,160,161,163,164,165,166,167,168,169,170,171,172,173,174,175,176,177,162,209,178,179,180,210,181,182,183,184,185,186,187,188,189,190,191,192,194,193,195,196,197,198,199,200,201,202,203,204,205,206,207,208,153,135,96,95,91,97,98,72,152,44,46,47,59,60,56,55,54,57,58,150,61,151,122,123,125,144,147,148,149,121,124,69,145,146,70,108,115,116,117,113,119,107,106,120,111,112,118,105,92,48,50,49,126,63,66,67,64,65,68,114,8,10,9,2,11,12,13,14,15,16,17,18,3,4,22,19,20,21,23,24,25,5,26,27,28,29,6,30,31,32,33,7,34,39,40,35,36,37,38,1,41,62,94,93,157,158,154,156,155,159]},"version":"4.8.2"}
|
@@ -0,0 +1,19 @@
|
|
1
|
+
import { Decoder, Encoder, Message, ProtoMessage } from "js-waku/lib/interfaces";
|
2
|
+
import { MembershipKey, RLNInstance } from "./rln.js";
|
3
|
+
export declare class RLNEncoder implements Encoder {
|
4
|
+
private encoder;
|
5
|
+
private rlnInstance;
|
6
|
+
private index;
|
7
|
+
contentTopic: string;
|
8
|
+
private readonly idKey;
|
9
|
+
constructor(encoder: Encoder, rlnInstance: RLNInstance, index: number, membershipKey: MembershipKey);
|
10
|
+
encode(message: Message): Promise<Uint8Array | undefined>;
|
11
|
+
encodeProto(message: Message): Promise<ProtoMessage | undefined>;
|
12
|
+
}
|
13
|
+
export declare class RLNDecoder implements Decoder<Message> {
|
14
|
+
private decoder;
|
15
|
+
contentTopic: string;
|
16
|
+
constructor(decoder: Decoder<Message>);
|
17
|
+
decodeProto(bytes: Uint8Array): Promise<ProtoMessage | undefined>;
|
18
|
+
decode(proto: ProtoMessage): Promise<Message | undefined>;
|
19
|
+
}
|
package/dist/encoder.js
ADDED
@@ -0,0 +1,54 @@
|
|
1
|
+
import debug from "debug";
|
2
|
+
import { proto_message, utils } from "js-waku";
|
3
|
+
const log = debug("waku:message:rln-encoder");
|
4
|
+
export class RLNEncoder {
|
5
|
+
constructor(encoder, rlnInstance, index, membershipKey) {
|
6
|
+
this.encoder = encoder;
|
7
|
+
this.rlnInstance = rlnInstance;
|
8
|
+
this.index = index;
|
9
|
+
if (index < 0)
|
10
|
+
throw "invalid membership index";
|
11
|
+
this.idKey = membershipKey.IDKey;
|
12
|
+
this.contentTopic = encoder.contentTopic;
|
13
|
+
}
|
14
|
+
async encode(message) {
|
15
|
+
const protoMessage = await this.encodeProto(message);
|
16
|
+
if (!protoMessage)
|
17
|
+
return;
|
18
|
+
return proto_message.WakuMessage.encode(protoMessage);
|
19
|
+
}
|
20
|
+
async encodeProto(message) {
|
21
|
+
const protoMessage = await this.encoder.encodeProto(message);
|
22
|
+
if (!protoMessage)
|
23
|
+
return;
|
24
|
+
const signal = toRLNSignal(message);
|
25
|
+
console.time("proof_gen_timer");
|
26
|
+
const proof = await this.rlnInstance.generateProof(signal, this.index, message.timestamp, this.idKey);
|
27
|
+
console.timeEnd("proof_gen_timer");
|
28
|
+
protoMessage.rateLimitProof = proof;
|
29
|
+
return protoMessage;
|
30
|
+
}
|
31
|
+
}
|
32
|
+
export class RLNDecoder {
|
33
|
+
constructor(decoder) {
|
34
|
+
this.decoder = decoder;
|
35
|
+
this.contentTopic = decoder.contentTopic;
|
36
|
+
}
|
37
|
+
decodeProto(bytes) {
|
38
|
+
const protoMessage = proto_message.WakuMessage.decode(bytes);
|
39
|
+
log("Message decoded", protoMessage);
|
40
|
+
return Promise.resolve(protoMessage);
|
41
|
+
}
|
42
|
+
async decode(proto) {
|
43
|
+
const msg = await this.decoder.decode(proto);
|
44
|
+
if (msg) {
|
45
|
+
msg.rateLimitProof = proto.rateLimitProof;
|
46
|
+
}
|
47
|
+
return msg;
|
48
|
+
}
|
49
|
+
}
|
50
|
+
function toRLNSignal(msg) {
|
51
|
+
const contentTopicBytes = utils.utf8ToBytes(msg.contentTopic ?? "");
|
52
|
+
return new Uint8Array([...(msg.payload ?? []), ...contentTopicBytes]);
|
53
|
+
}
|
54
|
+
//# sourceMappingURL=encoder.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"encoder.js","sourceRoot":"","sources":["../src/encoder.ts"],"names":[],"mappings":"AAAA,OAAO,KAAK,MAAM,OAAO,CAAC;AAC1B,OAAO,EAAE,aAAa,EAAE,KAAK,EAAE,MAAM,SAAS,CAAC;AAU/C,MAAM,GAAG,GAAG,KAAK,CAAC,0BAA0B,CAAC,CAAC;AAE9C,MAAM,OAAO,UAAU;IAIrB,YACU,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3C,CAAC;IAED,WAAW,CAAC,KAAiB;QAC3B,MAAM,YAAY,GAAG,aAAa,CAAC,WAAW,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7D,GAAG,CAAC,iBAAiB,EAAE,YAAY,CAAC,CAAC;QACrC,OAAO,OAAO,CAAC,OAAO,CAAC,YAAY,CAAC,CAAC;IACvC,CAAC;IAED,KAAK,CAAC,MAAM,CAAC,KAAmB;QAC9B,MAAM,GAAG,GAAG,MAAM,IAAI,CAAC,OAAO,CAAC,MAAM,CAAC,KAAK,CAAC,CAAC;QAC7C,IAAI,GAAG,EAAE;YACP,GAAG,CAAC,cAAc,GAAG,KAAK,CAAC,cAAc,CAAC;SAC3C;QACD,OAAO,GAAG,CAAC;IACb,CAAC;CACF;AAED,SAAS,WAAW,CAAC,GAAY;IAC/B,MAAM,iBAAiB,GAAG,KAAK,CAAC,WAAW,CAAC,GAAG,CAAC,YAAY,IAAI,EAAE,CAAC,CAAC;IACpE,OAAO,IAAI,UAAU,CAAC,CAAC,GAAG,CAAC,GAAG,CAAC,OAAO,IAAI,EAAE,CAAC,EAAE,GAAG,iBAAiB,CAAC,CAAC,CAAC;AACxE,CAAC"}
|
package/dist/index.d.ts
CHANGED
@@ -1,3 +1,3 @@
|
|
1
|
-
import type { MembershipKey,
|
1
|
+
import type { MembershipKey, Proof, RLNInstance } from "./rln.js";
|
2
2
|
export declare function create(): Promise<RLNInstance>;
|
3
|
-
export { RLNInstance, MembershipKey,
|
3
|
+
export { RLNInstance, MembershipKey, Proof };
|
@@ -0,0 +1,12 @@
|
|
1
|
+
export default verificationKey;
|
2
|
+
declare namespace verificationKey {
|
3
|
+
const protocol: string;
|
4
|
+
const curve: string;
|
5
|
+
const nPublic: number;
|
6
|
+
const vk_alpha_1: string[];
|
7
|
+
const vk_beta_2: string[][];
|
8
|
+
const vk_gamma_2: string[][];
|
9
|
+
const vk_delta_2: string[][];
|
10
|
+
const vk_alphabeta_12: string[][][];
|
11
|
+
const IC: string[][];
|
12
|
+
}
|
@@ -0,0 +1,121 @@
|
|
1
|
+
const verificationKey = {
|
2
|
+
"protocol": "groth16",
|
3
|
+
"curve": "bn128",
|
4
|
+
"nPublic": 6,
|
5
|
+
"vk_alpha_1": [
|
6
|
+
"1805378556360488226980822394597799963030511477964155500103132920745199284516",
|
7
|
+
"11990395240534218699464972016456017378439762088320057798320175886595281336136",
|
8
|
+
"1"
|
9
|
+
],
|
10
|
+
"vk_beta_2": [
|
11
|
+
[
|
12
|
+
"11031529986141021025408838211017932346992429731488270384177563837022796743627",
|
13
|
+
"16042159910707312759082561183373181639420894978640710177581040523252926273854"
|
14
|
+
],
|
15
|
+
[
|
16
|
+
"20112698439519222240302944148895052359035104222313380895334495118294612255131",
|
17
|
+
"19441583024670359810872018179190533814486480928824742448673677460151702019379"
|
18
|
+
],
|
19
|
+
[
|
20
|
+
"1",
|
21
|
+
"0"
|
22
|
+
]
|
23
|
+
],
|
24
|
+
"vk_gamma_2": [
|
25
|
+
[
|
26
|
+
"10857046999023057135944570762232829481370756359578518086990519993285655852781",
|
27
|
+
"11559732032986387107991004021392285783925812861821192530917403151452391805634"
|
28
|
+
],
|
29
|
+
[
|
30
|
+
"8495653923123431417604973247489272438418190587263600148770280649306958101930",
|
31
|
+
"4082367875863433681332203403145435568316851327593401208105741076214120093531"
|
32
|
+
],
|
33
|
+
[
|
34
|
+
"1",
|
35
|
+
"0"
|
36
|
+
]
|
37
|
+
],
|
38
|
+
"vk_delta_2": [
|
39
|
+
[
|
40
|
+
"1948496782571164085469528023647105317580208688174386157591917599801657832035",
|
41
|
+
"20445814069256658101339037520922621162739470138213615104905368409238414511981"
|
42
|
+
],
|
43
|
+
[
|
44
|
+
"10024680869920840984813249386422727863826862577760330492647062850849851925340",
|
45
|
+
"10512156247842686783409460795717734694774542185222602679117887145206209285142"
|
46
|
+
],
|
47
|
+
[
|
48
|
+
"1",
|
49
|
+
"0"
|
50
|
+
]
|
51
|
+
],
|
52
|
+
"vk_alphabeta_12": [
|
53
|
+
[
|
54
|
+
[
|
55
|
+
"5151991366823434428398919091000210787450832786814248297320989361921939794156",
|
56
|
+
"15735191313289001022885148627913534790382722933676436876510746491415970766821"
|
57
|
+
],
|
58
|
+
[
|
59
|
+
"3387907257437913904447588318761906430938415556102110876587455322225272831272",
|
60
|
+
"1998779853452712881084781956683721603875246565720647583735935725110674288056"
|
61
|
+
],
|
62
|
+
[
|
63
|
+
"14280074182991498185075387990446437410077692353432005297922275464876153151820",
|
64
|
+
"17092408446352310039633488224969232803092763095456307462247653153107223117633"
|
65
|
+
]
|
66
|
+
],
|
67
|
+
[
|
68
|
+
[
|
69
|
+
"4359046709531668109201634396816565829237358165496082832279660960675584351266",
|
70
|
+
"4511888308846208349307186938266411423935335853916317436093178288331845821336"
|
71
|
+
],
|
72
|
+
[
|
73
|
+
"11429499807090785857812316277335883295048773373068683863667725283965356423273",
|
74
|
+
"16232274853200678548795010078253506586114563833318973594428907292096178657392"
|
75
|
+
],
|
76
|
+
[
|
77
|
+
"18068999605870933925311275504102553573815570223888590384919752303726860800970",
|
78
|
+
"17309569111965782732372130116757295842160193489132771344011460471298173784984"
|
79
|
+
]
|
80
|
+
]
|
81
|
+
],
|
82
|
+
"IC": [
|
83
|
+
[
|
84
|
+
"18693301901828818437917730940595978397160482710354161265484535387752523310572",
|
85
|
+
"17985273354976640088538673802000794244421192643855111089693820179790551470769",
|
86
|
+
"1"
|
87
|
+
],
|
88
|
+
[
|
89
|
+
"21164641723988537620541455173278629777250883365474191521194244273980931825942",
|
90
|
+
"998385854410718613441067082771678946155853656328717326195057262123686425518",
|
91
|
+
"1"
|
92
|
+
],
|
93
|
+
[
|
94
|
+
"21666968581672145768705229094968410656430989593283335488162701230986314747515",
|
95
|
+
"17996457608540683483506630273632100555125353447506062045735279661096094677264",
|
96
|
+
"1"
|
97
|
+
],
|
98
|
+
[
|
99
|
+
"20137761979695192602424300886442379728165712610493092740175904438282083668117",
|
100
|
+
"19184814924890679891263780109959113289320127263583260218200636509492157834679",
|
101
|
+
"1"
|
102
|
+
],
|
103
|
+
[
|
104
|
+
"10943171273393803842589314082509655332154393332394322726077270895078286354146",
|
105
|
+
"10872472035685319847811233167729172672344935625121511932198535224727331126439",
|
106
|
+
"1"
|
107
|
+
],
|
108
|
+
[
|
109
|
+
"13049169779481227658517545034348883391527506091990880778783387628208561946597",
|
110
|
+
"10083689369261379027228809473568899816311684698866922944902456565434209079955",
|
111
|
+
"1"
|
112
|
+
],
|
113
|
+
[
|
114
|
+
"19633516378466409167014413361365552102431118630694133723053441455184566611083",
|
115
|
+
"8059525100726933978719058611146131904598011633549012007359165766216730722269",
|
116
|
+
"1"
|
117
|
+
]
|
118
|
+
]
|
119
|
+
};
|
120
|
+
export default verificationKey;
|
121
|
+
//# sourceMappingURL=verification_key.js.map
|
@@ -0,0 +1 @@
|
|
1
|
+
{"version":3,"file":"verification_key.js","sourceRoot":"","sources":["../../src/resources/verification_key.js"],"names":[],"mappings":"AAAA,MAAM,eAAe,GAAG;IACtB,UAAU,EAAE,SAAS;IACrB,OAAO,EAAE,OAAO;IAChB,SAAS,EAAE,CAAC;IACZ,YAAY,EAAE;QACZ,8EAA8E;QAC9E,+EAA+E;QAC/E,GAAG;KACJ;IACD,WAAW,EAAE;QACX;YACE,+EAA+E;YAC/E,+EAA+E;SAChF;QACD;YACE,+EAA+E;YAC/E,+EAA+E;SAChF;QACD;YACE,GAAG;YACH,GAAG;SACJ;KACF;IACD,YAAY,EAAE;QACZ;YACE,+EAA+E;YAC/E,+EAA+E;SAChF;QACD;YACE,8EAA8E;YAC9E,8EAA8E;SAC/E;QACD;YACE,GAAG;YACH,GAAG;SACJ;KACF;IACD,YAAY,EAAE;QACZ;YACE,8EAA8E;YAC9E,+EAA+E;SAChF;QACD;YACE,+EAA+E;YAC/E,+EAA+E;SAChF;QACD;YACE,GAAG;YACH,GAAG;SACJ;KACF;IACD,iBAAiB,EAAE;QACjB;YACE;gBACE,8EAA8E;gBAC9E,+EAA+E;aAChF;YACD;gBACE,8EAA8E;gBAC9E,8EAA8E;aAC/E;YACD;gBACE,+EAA+E;gBAC/E,+EAA+E;aAChF;SACF;QACD;YACE;gBACE,8EAA8E;gBAC9E,8EAA8E;aAC/E;YACD;gBACE,+EAA+E;gBAC/E,+EAA+E;aAChF;YACD;gBACE,+EAA+E;gBAC/E,+EAA+E;aAChF;SACF;KACF;IACD,IAAI,EAAE;QACJ;YACE,+EAA+E;YAC/E,+EAA+E;YAC/E,GAAG;SACJ;QACD;YACE,+EAA+E;YAC/E,6EAA6E;YAC7E,GAAG;SACJ;QACD;YACE,+EAA+E;YAC/E,+EAA+E;YAC/E,GAAG;SACJ;QACD;YACE,+EAA+E;YAC/E,+EAA+E;YAC/E,GAAG;SACJ;QACD;YACE,+EAA+E;YAC/E,+EAA+E;YAC/E,GAAG;SACJ;QACD;YACE,+EAA+E;YAC/E,+EAA+E;YAC/E,GAAG;SACJ;QACD;YACE,+EAA+E;YAC/E,8EAA8E;YAC9E,GAAG;SACJ;KACF;CACF,CAAA;AACD,eAAe,eAAe,CAAA"}
|
package/dist/rln.d.ts
CHANGED
@@ -1,3 +1,4 @@
|
|
1
|
+
import { RateLimitProof } from "js-waku/lib/interfaces";
|
1
2
|
/**
|
2
3
|
* Create an instance of RLN
|
3
4
|
* @returns RLNInstance
|
@@ -9,7 +10,7 @@ export declare class MembershipKey {
|
|
9
10
|
constructor(memKeys: Uint8Array);
|
10
11
|
}
|
11
12
|
export declare function toEpoch(timestamp: Date, epochUnitSeconds?: number): Uint8Array;
|
12
|
-
export declare class RateLimitProof {
|
13
|
+
export declare class Proof implements RateLimitProof {
|
13
14
|
readonly proof: Uint8Array;
|
14
15
|
readonly merkleRoot: Uint8Array;
|
15
16
|
readonly epoch: Uint8Array;
|
@@ -18,7 +19,6 @@ export declare class RateLimitProof {
|
|
18
19
|
readonly nullifier: Uint8Array;
|
19
20
|
readonly rlnIdentifier: Uint8Array;
|
20
21
|
constructor(proofBytes: Uint8Array);
|
21
|
-
toBytes(): Uint8Array;
|
22
22
|
}
|
23
23
|
export declare class RLNInstance {
|
24
24
|
private zkRLN;
|
package/dist/rln.js
CHANGED
@@ -1,5 +1,5 @@
|
|
1
1
|
import init, * as zerokitRLN from "@waku/zerokit-rln-wasm";
|
2
|
-
import verificationKey from "./resources/verification_key.
|
2
|
+
import verificationKey from "./resources/verification_key.js";
|
3
3
|
import * as wc from "./witness_calculator.js";
|
4
4
|
/**
|
5
5
|
* Concatenate Uint8Arrays
|
@@ -85,7 +85,7 @@ const shareXOffset = epochOffset + 32;
|
|
85
85
|
const shareYOffset = shareXOffset + 32;
|
86
86
|
const nullifierOffset = shareYOffset + 32;
|
87
87
|
const rlnIdentifierOffset = nullifierOffset + 32;
|
88
|
-
export class
|
88
|
+
export class Proof {
|
89
89
|
constructor(proofBytes) {
|
90
90
|
if (proofBytes.length < rlnIdentifierOffset)
|
91
91
|
throw "invalid proof";
|
@@ -98,9 +98,9 @@ export class RateLimitProof {
|
|
98
98
|
this.nullifier = proofBytes.subarray(shareYOffset, nullifierOffset);
|
99
99
|
this.rlnIdentifier = proofBytes.subarray(nullifierOffset, rlnIdentifierOffset);
|
100
100
|
}
|
101
|
-
|
102
|
-
|
103
|
-
|
101
|
+
}
|
102
|
+
function proofToBytes(p) {
|
103
|
+
return concatenate(p.proof, p.merkleRoot, p.epoch, p.shareX, p.shareY, p.nullifier, p.rlnIdentifier);
|
104
104
|
}
|
105
105
|
export class RLNInstance {
|
106
106
|
constructor(zkRLN, witnessCalculator) {
|
@@ -140,13 +140,17 @@ export class RLNInstance {
|
|
140
140
|
const inputs = zerokitRLN.RLNWitnessToJson(this.zkRLN, rlnWitness);
|
141
141
|
const calculatedWitness = await this.witnessCalculator.calculateWitness(inputs, false); // no sanity check being used in zerokit
|
142
142
|
const proofBytes = zerokitRLN.generate_rln_proof_with_witness(this.zkRLN, calculatedWitness, rlnWitness);
|
143
|
-
return new
|
143
|
+
return new Proof(proofBytes);
|
144
144
|
}
|
145
145
|
verifyProof(proof) {
|
146
|
-
|
147
|
-
|
146
|
+
let pBytes;
|
147
|
+
if (proof instanceof Uint8Array) {
|
148
|
+
pBytes = proof;
|
149
|
+
}
|
150
|
+
else {
|
151
|
+
pBytes = proofToBytes(proof);
|
148
152
|
}
|
149
|
-
return zerokitRLN.verifyProof(this.zkRLN,
|
153
|
+
return zerokitRLN.verifyProof(this.zkRLN, pBytes);
|
150
154
|
}
|
151
155
|
}
|
152
156
|
//# sourceMappingURL=rln.js.map
|
package/dist/rln.js.map
CHANGED
@@ -1 +1 @@
|
|
1
|
-
{"version":3,"file":"rln.js","sourceRoot":"","sources":["../src/rln.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,KAAK,UAAU,MAAM,wBAAwB,CAAC;
|
1
|
+
{"version":3,"file":"rln.js","sourceRoot":"","sources":["../src/rln.ts"],"names":[],"mappings":"AAAA,OAAO,IAAI,EAAE,KAAK,UAAU,MAAM,wBAAwB,CAAC;AAG3D,OAAO,eAAe,MAAM,iCAAiC,CAAC;AAC9D,OAAO,KAAK,EAAE,MAAM,yBAAyB,CAAC;AAE9C;;;;GAIG;AACH,SAAS,WAAW,CAAC,GAAG,KAAmB;IACzC,IAAI,WAAW,GAAG,CAAC,CAAC;IACpB,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;QACvB,WAAW,IAAI,GAAG,CAAC,MAAM,CAAC;KAC3B;IACD,MAAM,MAAM,GAAG,IAAI,UAAU,CAAC,WAAW,CAAC,CAAC;IAC3C,IAAI,MAAM,GAAG,CAAC,CAAC;IACf,KAAK,MAAM,GAAG,IAAI,KAAK,EAAE;QACvB,MAAM,CAAC,GAAG,CAAC,GAAG,EAAE,MAAM,CAAC,CAAC;QACxB,MAAM,IAAI,GAAG,CAAC,MAAM,CAAC;KACtB;IACD,OAAO,MAAM,CAAC;AAChB,CAAC;AAED,MAAM,aAAa,GAAG,IAAI,WAAW,EAAE,CAAC;AAExC,MAAM,KAAK,GAAG,EAAE,CAAC;AAEjB,KAAK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CAAC,IAAI,CAAC,KAAK,EAAE,MAAM,CAAC,CAAC;IACpD,CAAC;CACF"}
|
package/package.json
CHANGED
@@ -1,6 +1,6 @@
|
|
1
1
|
{
|
2
2
|
"name": "@waku/rln",
|
3
|
-
"version": "0.0.
|
3
|
+
"version": "0.0.8-4b656ce",
|
4
4
|
"description": "Rate Limit Nullifier for js-waku",
|
5
5
|
"types": "./dist/index.d.ts",
|
6
6
|
"module": "./dist/index.js",
|
@@ -34,7 +34,7 @@
|
|
34
34
|
"test:lint": "eslint src --ext .ts",
|
35
35
|
"test:prettier": "prettier \"src/**/*.ts\" \"./*.json\" \"*.*js\" \".github/**/*.yml\" --list-different",
|
36
36
|
"test:spelling": "cspell \"{*.md,.github/*.md,src/**/*.ts}\"",
|
37
|
-
"test:tsc": "tsc",
|
37
|
+
"test:tsc": "tsc -p tsconfig.dev.json",
|
38
38
|
"test:browser": "karma start karma.conf.cjs",
|
39
39
|
"watch:build": "tsc -p tsconfig.json -w",
|
40
40
|
"watch:test": "mocha --watch",
|
@@ -81,6 +81,7 @@
|
|
81
81
|
"husky": "^7.0.4",
|
82
82
|
"ignore-loader": "^0.1.2",
|
83
83
|
"isomorphic-fetch": "^3.0.0",
|
84
|
+
"js-waku": "^0.29.0-7714812",
|
84
85
|
"jsdom": "^19.0.0",
|
85
86
|
"jsdom-global": "^3.0.2",
|
86
87
|
"karma": "^6.3.12",
|
package/src/encoder.ts
ADDED
@@ -0,0 +1,81 @@
|
|
1
|
+
import debug from "debug";
|
2
|
+
import { proto_message, utils } from "js-waku";
|
3
|
+
import {
|
4
|
+
Decoder,
|
5
|
+
Encoder,
|
6
|
+
Message,
|
7
|
+
ProtoMessage,
|
8
|
+
} from "js-waku/lib/interfaces";
|
9
|
+
|
10
|
+
import { MembershipKey, RLNInstance } from "./rln.js";
|
11
|
+
|
12
|
+
const log = debug("waku:message:rln-encoder");
|
13
|
+
|
14
|
+
export class RLNEncoder implements Encoder {
|
15
|
+
public contentTopic: string;
|
16
|
+
private readonly idKey: Uint8Array;
|
17
|
+
|
18
|
+
constructor(
|
19
|
+
private encoder: Encoder,
|
20
|
+
private rlnInstance: RLNInstance,
|
21
|
+
private index: number,
|
22
|
+
membershipKey: MembershipKey
|
23
|
+
) {
|
24
|
+
if (index < 0) throw "invalid membership index";
|
25
|
+
this.idKey = membershipKey.IDKey;
|
26
|
+
this.contentTopic = encoder.contentTopic;
|
27
|
+
}
|
28
|
+
|
29
|
+
async encode(message: Message): Promise<Uint8Array | undefined> {
|
30
|
+
const protoMessage = await this.encodeProto(message);
|
31
|
+
if (!protoMessage) return;
|
32
|
+
return proto_message.WakuMessage.encode(protoMessage);
|
33
|
+
}
|
34
|
+
|
35
|
+
async encodeProto(message: Message): Promise<ProtoMessage | undefined> {
|
36
|
+
const protoMessage = await this.encoder.encodeProto(message);
|
37
|
+
if (!protoMessage) return;
|
38
|
+
|
39
|
+
const signal = toRLNSignal(message);
|
40
|
+
|
41
|
+
console.time("proof_gen_timer");
|
42
|
+
const proof = await this.rlnInstance.generateProof(
|
43
|
+
signal,
|
44
|
+
this.index,
|
45
|
+
message.timestamp,
|
46
|
+
this.idKey
|
47
|
+
);
|
48
|
+
console.timeEnd("proof_gen_timer");
|
49
|
+
|
50
|
+
protoMessage.rateLimitProof = proof;
|
51
|
+
|
52
|
+
return protoMessage;
|
53
|
+
}
|
54
|
+
}
|
55
|
+
|
56
|
+
export class RLNDecoder implements Decoder<Message> {
|
57
|
+
public contentTopic: string;
|
58
|
+
|
59
|
+
constructor(private decoder: Decoder<Message>) {
|
60
|
+
this.contentTopic = decoder.contentTopic;
|
61
|
+
}
|
62
|
+
|
63
|
+
decodeProto(bytes: Uint8Array): Promise<ProtoMessage | undefined> {
|
64
|
+
const protoMessage = proto_message.WakuMessage.decode(bytes);
|
65
|
+
log("Message decoded", protoMessage);
|
66
|
+
return Promise.resolve(protoMessage);
|
67
|
+
}
|
68
|
+
|
69
|
+
async decode(proto: ProtoMessage): Promise<Message | undefined> {
|
70
|
+
const msg = await this.decoder.decode(proto);
|
71
|
+
if (msg) {
|
72
|
+
msg.rateLimitProof = proto.rateLimitProof;
|
73
|
+
}
|
74
|
+
return msg;
|
75
|
+
}
|
76
|
+
}
|
77
|
+
|
78
|
+
function toRLNSignal(msg: Message): Uint8Array {
|
79
|
+
const contentTopicBytes = utils.utf8ToBytes(msg.contentTopic ?? "");
|
80
|
+
return new Uint8Array([...(msg.payload ?? []), ...contentTopicBytes]);
|
81
|
+
}
|
package/src/index.ts
CHANGED
@@ -1,4 +1,4 @@
|
|
1
|
-
import type { MembershipKey,
|
1
|
+
import type { MembershipKey, Proof, RLNInstance } from "./rln.js";
|
2
2
|
|
3
3
|
// reexport the create function, dynamically imported from rln.ts
|
4
4
|
export async function create(): Promise<RLNInstance> {
|
@@ -9,4 +9,4 @@ export async function create(): Promise<RLNInstance> {
|
|
9
9
|
return await rlnModule.create();
|
10
10
|
}
|
11
11
|
|
12
|
-
export { RLNInstance, MembershipKey,
|
12
|
+
export { RLNInstance, MembershipKey, Proof };
|
package/src/rln.ts
CHANGED
@@ -1,6 +1,7 @@
|
|
1
1
|
import init, * as zerokitRLN from "@waku/zerokit-rln-wasm";
|
2
|
+
import { RateLimitProof } from "js-waku/lib/interfaces";
|
2
3
|
|
3
|
-
import verificationKey from "./resources/verification_key.
|
4
|
+
import verificationKey from "./resources/verification_key.js";
|
4
5
|
import * as wc from "./witness_calculator.js";
|
5
6
|
|
6
7
|
/**
|
@@ -120,7 +121,7 @@ const shareYOffset = shareXOffset + 32;
|
|
120
121
|
const nullifierOffset = shareYOffset + 32;
|
121
122
|
const rlnIdentifierOffset = nullifierOffset + 32;
|
122
123
|
|
123
|
-
export class RateLimitProof {
|
124
|
+
export class Proof implements RateLimitProof {
|
124
125
|
readonly proof: Uint8Array;
|
125
126
|
readonly merkleRoot: Uint8Array;
|
126
127
|
readonly epoch: Uint8Array;
|
@@ -143,18 +144,18 @@ export class RateLimitProof {
|
|
143
144
|
rlnIdentifierOffset
|
144
145
|
);
|
145
146
|
}
|
147
|
+
}
|
146
148
|
|
147
|
-
|
148
|
-
|
149
|
-
|
150
|
-
|
151
|
-
|
152
|
-
|
153
|
-
|
154
|
-
|
155
|
-
|
156
|
-
|
157
|
-
}
|
149
|
+
function proofToBytes(p: RateLimitProof): Uint8Array {
|
150
|
+
return concatenate(
|
151
|
+
p.proof,
|
152
|
+
p.merkleRoot,
|
153
|
+
p.epoch,
|
154
|
+
p.shareX,
|
155
|
+
p.shareY,
|
156
|
+
p.nullifier,
|
157
|
+
p.rlnIdentifier
|
158
|
+
);
|
158
159
|
}
|
159
160
|
|
160
161
|
export class RLNInstance {
|
@@ -218,13 +219,16 @@ export class RLNInstance {
|
|
218
219
|
rlnWitness
|
219
220
|
);
|
220
221
|
|
221
|
-
return new
|
222
|
+
return new Proof(proofBytes);
|
222
223
|
}
|
223
224
|
|
224
225
|
verifyProof(proof: RateLimitProof | Uint8Array): boolean {
|
225
|
-
|
226
|
-
|
226
|
+
let pBytes: Uint8Array;
|
227
|
+
if (proof instanceof Uint8Array) {
|
228
|
+
pBytes = proof;
|
229
|
+
} else {
|
230
|
+
pBytes = proofToBytes(proof);
|
227
231
|
}
|
228
|
-
return zerokitRLN.verifyProof(this.zkRLN,
|
232
|
+
return zerokitRLN.verifyProof(this.zkRLN, pBytes);
|
229
233
|
}
|
230
234
|
}
|