From d1c18cb214581f6a9f34a1830dfd5fcd70fcedb1 Mon Sep 17 00:00:00 2001 From: "fryorcraken.eth" Date: Mon, 26 Sep 2022 10:51:04 +1000 Subject: [PATCH] fix: package verification key JSON file was not included in the bundle. JSON files are generally annoying to bundle, easier to just have the data in a JS file. --- src/resources/verification_key.js | 120 ++++++++++++++++++++++++++++ src/resources/verification_key.json | 119 --------------------------- src/rln.ts | 2 +- 3 files changed, 121 insertions(+), 120 deletions(-) create mode 100644 src/resources/verification_key.js delete mode 100644 src/resources/verification_key.json diff --git a/src/resources/verification_key.js b/src/resources/verification_key.js new file mode 100644 index 0000000..5606389 --- /dev/null +++ b/src/resources/verification_key.js @@ -0,0 +1,120 @@ +const verificationKey = { + "protocol": "groth16", + "curve": "bn128", + "nPublic": 6, + "vk_alpha_1": [ + "1805378556360488226980822394597799963030511477964155500103132920745199284516", + "11990395240534218699464972016456017378439762088320057798320175886595281336136", + "1" + ], + "vk_beta_2": [ + [ + "11031529986141021025408838211017932346992429731488270384177563837022796743627", + "16042159910707312759082561183373181639420894978640710177581040523252926273854" + ], + [ + "20112698439519222240302944148895052359035104222313380895334495118294612255131", + "19441583024670359810872018179190533814486480928824742448673677460151702019379" + ], + [ + "1", + "0" + ] + ], + "vk_gamma_2": [ + [ + "10857046999023057135944570762232829481370756359578518086990519993285655852781", + "11559732032986387107991004021392285783925812861821192530917403151452391805634" + ], + [ + "8495653923123431417604973247489272438418190587263600148770280649306958101930", + "4082367875863433681332203403145435568316851327593401208105741076214120093531" + ], + [ + "1", + "0" + ] + ], + "vk_delta_2": [ + [ + "1948496782571164085469528023647105317580208688174386157591917599801657832035", + "20445814069256658101339037520922621162739470138213615104905368409238414511981" + ], + [ + "10024680869920840984813249386422727863826862577760330492647062850849851925340", + "10512156247842686783409460795717734694774542185222602679117887145206209285142" + ], + [ + "1", + "0" + ] + ], + "vk_alphabeta_12": [ + [ + [ + "5151991366823434428398919091000210787450832786814248297320989361921939794156", + "15735191313289001022885148627913534790382722933676436876510746491415970766821" + ], + [ + "3387907257437913904447588318761906430938415556102110876587455322225272831272", + "1998779853452712881084781956683721603875246565720647583735935725110674288056" + ], + [ + "14280074182991498185075387990446437410077692353432005297922275464876153151820", + "17092408446352310039633488224969232803092763095456307462247653153107223117633" + ] + ], + [ + [ + "4359046709531668109201634396816565829237358165496082832279660960675584351266", + "4511888308846208349307186938266411423935335853916317436093178288331845821336" + ], + [ + "11429499807090785857812316277335883295048773373068683863667725283965356423273", + "16232274853200678548795010078253506586114563833318973594428907292096178657392" + ], + [ + "18068999605870933925311275504102553573815570223888590384919752303726860800970", + "17309569111965782732372130116757295842160193489132771344011460471298173784984" + ] + ] + ], + "IC": [ + [ + "18693301901828818437917730940595978397160482710354161265484535387752523310572", + "17985273354976640088538673802000794244421192643855111089693820179790551470769", + "1" + ], + [ + "21164641723988537620541455173278629777250883365474191521194244273980931825942", + "998385854410718613441067082771678946155853656328717326195057262123686425518", + "1" + ], + [ + "21666968581672145768705229094968410656430989593283335488162701230986314747515", + "17996457608540683483506630273632100555125353447506062045735279661096094677264", + "1" + ], + [ + "20137761979695192602424300886442379728165712610493092740175904438282083668117", + "19184814924890679891263780109959113289320127263583260218200636509492157834679", + "1" + ], + [ + "10943171273393803842589314082509655332154393332394322726077270895078286354146", + "10872472035685319847811233167729172672344935625121511932198535224727331126439", + "1" + ], + [ + "13049169779481227658517545034348883391527506091990880778783387628208561946597", + "10083689369261379027228809473568899816311684698866922944902456565434209079955", + "1" + ], + [ + "19633516378466409167014413361365552102431118630694133723053441455184566611083", + "8059525100726933978719058611146131904598011633549012007359165766216730722269", + "1" + ] + ] +} +export default verificationKey diff --git a/src/resources/verification_key.json b/src/resources/verification_key.json deleted file mode 100644 index 25f3866..0000000 --- a/src/resources/verification_key.json +++ /dev/null @@ -1,119 +0,0 @@ -{ - "protocol": "groth16", - "curve": "bn128", - "nPublic": 6, - "vk_alpha_1": [ - "1805378556360488226980822394597799963030511477964155500103132920745199284516", - "11990395240534218699464972016456017378439762088320057798320175886595281336136", - "1" - ], - "vk_beta_2": [ - [ - "11031529986141021025408838211017932346992429731488270384177563837022796743627", - "16042159910707312759082561183373181639420894978640710177581040523252926273854" - ], - [ - "20112698439519222240302944148895052359035104222313380895334495118294612255131", - "19441583024670359810872018179190533814486480928824742448673677460151702019379" - ], - [ - "1", - "0" - ] - ], - "vk_gamma_2": [ - [ - "10857046999023057135944570762232829481370756359578518086990519993285655852781", - "11559732032986387107991004021392285783925812861821192530917403151452391805634" - ], - [ - "8495653923123431417604973247489272438418190587263600148770280649306958101930", - "4082367875863433681332203403145435568316851327593401208105741076214120093531" - ], - [ - "1", - "0" - ] - ], - "vk_delta_2": [ - [ - "1948496782571164085469528023647105317580208688174386157591917599801657832035", - "20445814069256658101339037520922621162739470138213615104905368409238414511981" - ], - [ - "10024680869920840984813249386422727863826862577760330492647062850849851925340", - "10512156247842686783409460795717734694774542185222602679117887145206209285142" - ], - [ - "1", - "0" - ] - ], - "vk_alphabeta_12": [ - [ - [ - "5151991366823434428398919091000210787450832786814248297320989361921939794156", - "15735191313289001022885148627913534790382722933676436876510746491415970766821" - ], - [ - "3387907257437913904447588318761906430938415556102110876587455322225272831272", - "1998779853452712881084781956683721603875246565720647583735935725110674288056" - ], - [ - "14280074182991498185075387990446437410077692353432005297922275464876153151820", - "17092408446352310039633488224969232803092763095456307462247653153107223117633" - ] - ], - [ - [ - "4359046709531668109201634396816565829237358165496082832279660960675584351266", - "4511888308846208349307186938266411423935335853916317436093178288331845821336" - ], - [ - "11429499807090785857812316277335883295048773373068683863667725283965356423273", - "16232274853200678548795010078253506586114563833318973594428907292096178657392" - ], - [ - "18068999605870933925311275504102553573815570223888590384919752303726860800970", - "17309569111965782732372130116757295842160193489132771344011460471298173784984" - ] - ] - ], - "IC": [ - [ - "18693301901828818437917730940595978397160482710354161265484535387752523310572", - "17985273354976640088538673802000794244421192643855111089693820179790551470769", - "1" - ], - [ - "21164641723988537620541455173278629777250883365474191521194244273980931825942", - "998385854410718613441067082771678946155853656328717326195057262123686425518", - "1" - ], - [ - "21666968581672145768705229094968410656430989593283335488162701230986314747515", - "17996457608540683483506630273632100555125353447506062045735279661096094677264", - "1" - ], - [ - "20137761979695192602424300886442379728165712610493092740175904438282083668117", - "19184814924890679891263780109959113289320127263583260218200636509492157834679", - "1" - ], - [ - "10943171273393803842589314082509655332154393332394322726077270895078286354146", - "10872472035685319847811233167729172672344935625121511932198535224727331126439", - "1" - ], - [ - "13049169779481227658517545034348883391527506091990880778783387628208561946597", - "10083689369261379027228809473568899816311684698866922944902456565434209079955", - "1" - ], - [ - "19633516378466409167014413361365552102431118630694133723053441455184566611083", - "8059525100726933978719058611146131904598011633549012007359165766216730722269", - "1" - ] - ] -} \ No newline at end of file diff --git a/src/rln.ts b/src/rln.ts index bbc675e..d6b6f96 100644 --- a/src/rln.ts +++ b/src/rln.ts @@ -1,6 +1,6 @@ import init, * as zerokitRLN from "@waku/zerokit-rln-wasm"; -import verificationKey from "./resources/verification_key.json"; +import verificationKey from "./resources/verification_key.js"; import * as wc from "./witness_calculator.js"; /**