diff --git a/ethereum/contracts/zksync/Verifier.sol b/ethereum/contracts/zksync/Verifier.sol index a46e4e706..a21cc01f4 100644 --- a/ethereum/contracts/zksync/Verifier.sol +++ b/ethereum/contracts/zksync/Verifier.sol @@ -284,38 +284,38 @@ contract Verifier is IVerifier { function _loadVerificationKey() internal pure virtual { assembly { // gate setup commitments - mstore(VK_GATE_SETUP_0_X_SLOT, 0x046e45fd137982bd0f6cf731b4650d2d520e8d675827744e1edf1308583599bb) - mstore(VK_GATE_SETUP_0_Y_SLOT, 0x177f14d16b716d4298be5e07b83add3fb61ff1ee08dce19f9a54fa8f04937f7e) - mstore(VK_GATE_SETUP_1_X_SLOT, 0x169ad5156d25b56f7b67ea6382f88b845ed5bae5b91aacfe51d8f0716afff2fb) - mstore(VK_GATE_SETUP_1_Y_SLOT, 0x2406e3268e4d5fa672142998ecf834034638a4a6f8b5e90205552c6aa1dde163) - mstore(VK_GATE_SETUP_2_X_SLOT, 0x05fd0ce0fdc590938d29c738c8dc956b32ca8e69c3babfbb49dc1c13a6d9a8d4) - mstore(VK_GATE_SETUP_2_Y_SLOT, 0x0a27dac323a04dd319d9805be879875c95063d0a55c96214cd45c913fba84460) - mstore(VK_GATE_SETUP_3_X_SLOT, 0x0d58a2a86b208a4976beb9bfd918514d448656e0ee66175eb344a4a17bba99f8) - mstore(VK_GATE_SETUP_3_Y_SLOT, 0x215fa609a1a425b84c9dc218c6cf999596d9eba6d35597ad7aaf2d077a6616ed) - mstore(VK_GATE_SETUP_4_X_SLOT, 0x1a26e6deccf91174ab13613363eb4939680828f0c6031f5039f9e6f264afa68c) - mstore(VK_GATE_SETUP_4_Y_SLOT, 0x1f5b2d6bffac1839edfd02cd0e41acc411f0ecbf6c5c4b1da0e12b68b99cb25d) + mstore(VK_GATE_SETUP_0_X_SLOT, 0x054b0ed7dd15637829a8311ff09e912292bb5009fa5293632b7f590f63fbb8e4) + mstore(VK_GATE_SETUP_0_Y_SLOT, 0x0c1b49eba175d4b85903f6021a2592945fb414ef82e57d8e8b18e769b79913a0) + mstore(VK_GATE_SETUP_1_X_SLOT, 0x165a927da6a4645835e465eeba4c60dca3aa2ca56b49e0a1b6170e3150fbef81) + mstore(VK_GATE_SETUP_1_Y_SLOT, 0x0aacc3d0830be4bf9bbca3b0329f9519e3127d13a126a4021f884c322f96e223) + mstore(VK_GATE_SETUP_2_X_SLOT, 0x1591549a8e5376ef07b216264bf5916f608fb49777750ba7f61406616da2c444) + mstore(VK_GATE_SETUP_2_Y_SLOT, 0x12d22c1cd67d82f57f14dc13e2d8923039d06300ff49df7d999bcaf64fdfd5d7) + mstore(VK_GATE_SETUP_3_X_SLOT, 0x215ff6c049d73d5b8bb1a02ce540d68490ef1fb52891e57d6f4b365bdf5729ed) + mstore(VK_GATE_SETUP_3_Y_SLOT, 0x264337a5471c7627dc3e46b655a2db5350bf3f48be739d61a54643116442be93) + mstore(VK_GATE_SETUP_4_X_SLOT, 0x072a1da16e0ccdc16e238b951e4179168d498336070d927a86f08192322012c9) + mstore(VK_GATE_SETUP_4_Y_SLOT, 0x2a7e401a43d51eb4fbbef6b3b9e1b3d13bc2fc670e1f8f3307e1dc3dbe97ed4c) mstore(VK_GATE_SETUP_5_X_SLOT, 0x09b71be2e8a45dcbe7654cf369c4f1f2e7eab4b97869a469fb7a149d989f7226) mstore(VK_GATE_SETUP_5_Y_SLOT, 0x197e1e2cefbd4f99558b89ca875e01fec0f14f05e5128bd869c87d6bf2f307fa) - mstore(VK_GATE_SETUP_6_X_SLOT, 0x0d7cef745da686fd44760403d452d72be504bb41b0a7f4fbe973a07558893871) - mstore(VK_GATE_SETUP_6_Y_SLOT, 0x1e9a863307cdfd3fdcf119f72279ddfda08b6f23c3672e8378dbb9d548734c29) - mstore(VK_GATE_SETUP_7_X_SLOT, 0x16af3f5d978446fdb37d84f5cf12e59f5c1088bde23f8260c0bb6792c5f78e99) - mstore(VK_GATE_SETUP_7_Y_SLOT, 0x167d3aeee50c0e53fd1e8a33941a806a34cfae5dc8b66578486e5d7207b5d546) + mstore(VK_GATE_SETUP_6_X_SLOT, 0x21708e89d408cd584078ff0aa9132fc8d5c1635502beb267db870e86a07a08e2) + mstore(VK_GATE_SETUP_6_Y_SLOT, 0x2a9b239cf563fdc1bd61485d50183672304d0a72e2bf82298de6e36255705ba9) + mstore(VK_GATE_SETUP_7_X_SLOT, 0x28f1fb0891ede6b5ee5754b3ff4ed95ff69712a8af36b344d86681f8299a41ac) + mstore(VK_GATE_SETUP_7_Y_SLOT, 0x191376f72d21d1f307d30a856e015f1635a5684cec2f5bba906954e26551e9cb) // gate selectors commitments - mstore(VK_GATE_SELECTORS_0_X_SLOT, 0x1addc8e154c74bed403dc19558096ce22f1ceb2c656a2a5e85e56d2be6580ed1) - mstore(VK_GATE_SELECTORS_0_Y_SLOT, 0x1420d38f0ef206828efc36d0f5ad2b4d85fe768097f358fc671b7b3ec0239234) + mstore(VK_GATE_SELECTORS_0_X_SLOT, 0x116738c4b76005b372f69974b9102c1a93135b691ac998984a5080e849e3f027) + mstore(VK_GATE_SELECTORS_0_Y_SLOT, 0x1875c1058b050df9f30326c0c946151e67f88ecf47edec3df9abc72445707dcf) mstore(VK_GATE_SELECTORS_1_X_SLOT, 0x2d5c06d0c8aa6a3520b8351f82341affcbb1a0bf27bceb9bab175e3e1d38cf47) mstore(VK_GATE_SELECTORS_1_Y_SLOT, 0x0ff8d923a0374308147f6dd4fc513f6d0640f5df699f4836825ef460df3f8d6a) // permutation commitments - mstore(VK_PERMUTATION_0_X_SLOT, 0x1de8943a8f67d9f6fcbda10a1f37a82de9e9ffd0a0102ea5ce0ce6dd13b4031b) - mstore(VK_PERMUTATION_0_Y_SLOT, 0x1e04b0824853ab5d7c3412a217a1c5b88a2b4011be7e7e849485be8ed7332e41) - mstore(VK_PERMUTATION_1_X_SLOT, 0x2aa1817b9cc40b6cc7a7b3f832f3267580f9fb8e539666c00541e1a77e34a3da) - mstore(VK_PERMUTATION_1_Y_SLOT, 0x0edb3cde226205b01212fc1861303c49ef3ff66f060b5833dc9a3f661ef31dd9) - mstore(VK_PERMUTATION_2_X_SLOT, 0x13f5ae93c8eccc1455a0095302923442d4b0b3c8233d66ded99ffcf2ad641c27) - mstore(VK_PERMUTATION_2_Y_SLOT, 0x2dd42d42ccdea8b1901435ace12bc9e52c7dbbeb409d20c517ba942ed0cc7519) - mstore(VK_PERMUTATION_3_X_SLOT, 0x1a15a70a016be11af71e46e9c8a8d31ece32a7e657ae90356dd9535e6566645f) - mstore(VK_PERMUTATION_3_Y_SLOT, 0x0381d23e115521c6fc233c5346f79a6777bfa8871b7ee623d990cdcb5d8c3ce1) + mstore(VK_PERMUTATION_0_X_SLOT, 0x05b56e128c5c961e289905f3e311d44bf3768e7ecbc34cb299ab512d95a67072) + mstore(VK_PERMUTATION_0_Y_SLOT, 0x0033321debc3d87f48ffe67bd408c0078b50586003904bc440529c6d635aeef7) + mstore(VK_PERMUTATION_1_X_SLOT, 0x264be88fe8356e4bc0b37ea534d1956630c6976410a38c703e8702d5d98584be) + mstore(VK_PERMUTATION_1_Y_SLOT, 0x1ce1186bd2681359c38a1fc70fd14e522f762692f8f9ed14ccebd95c5fdaf9de) + mstore(VK_PERMUTATION_2_X_SLOT, 0x18cb10d4373dc6eff5507b9572728fc7c1b0dc38b021eaad8b429d710ea419e5) + mstore(VK_PERMUTATION_2_Y_SLOT, 0x0d58bb86064f7f28e7e9f632f0dcfd630f792fa3939682b4e14db6a1ee198432) + mstore(VK_PERMUTATION_3_X_SLOT, 0x1f724cfe2fc22cdeb8cc323338759ac083d2a94631d5f48db74988862a404ee3) + mstore(VK_PERMUTATION_3_Y_SLOT, 0x2e0d1978ef73d1446d6d47269b57fe29842154788c18f90e7e052e5625ca7bf6) // lookup tables commitments mstore(VK_LOOKUP_TABLE_0_X_SLOT, 0x2c513ed74d9d57a5ec901e074032741036353a2c4513422e96e7b53b302d765b) diff --git a/tools/Cargo.toml b/tools/Cargo.toml index 480d91cb3..204440623 100644 --- a/tools/Cargo.toml +++ b/tools/Cargo.toml @@ -9,3 +9,5 @@ serde_json = "1.0" lazy_static = "1.4" structopt = "0.3.26" handlebars = "4.4.0" + +[workspace] diff --git a/tools/README.md b/tools/README.md index 7937224af..2f9db93a5 100644 --- a/tools/README.md +++ b/tools/README.md @@ -1,3 +1,9 @@ # Tool for generating `Verifier.sol` using json Verification key `cargo run --bin zksync_verifier_contract_generator --release -- --input_path /path/to/scheduler_verification_key.json --output_path /path/to/Verifier.sol` + +To generate the verifier from the scheduler key in 'data' directory, just run: + +```shell +cargo run --bin zksync_verifier_contract_generator --release -- --input_path data/scheduler_key.json --output_path ../ethereum/contracts/zksync/Verifier.sol +``` diff --git a/tools/data/scheduler_key.json b/tools/data/scheduler_key.json index 586ca4d9a..d792b2731 100644 --- a/tools/data/scheduler_key.json +++ b/tools/data/scheduler_key.json @@ -6,76 +6,76 @@ "gate_setup_commitments": [ { "x": [ - 2224517667504888251, - 5912818835784168526, - 1111535000905649453, - 319269576845656765 + 3134321788309977316, + 10573132553967014755, + 3001703164893106466, + 381414913732862840 ], "y": [ - 11120788872048639870, - 13123473843834118559, - 11006337926588718399, - 1693094874597911874 + 10023015411950883744, + 6896159948336889230, + 6414240783194755732, + 872372229201319096 ], "infinity": false }, { "x": [ - 5897728081958793979, - 6833573505420406014, - 8892333702386322308, - 1628848503250072943 + 13120971644342103937, + 11793287663204294817, + 3883340854702399708, + 1610760885102732376 ], "y": [ - 384262179703873891, - 5059975218394949890, - 8220240956645454851, - 2596011989961367462 + 2272149790438908451, + 16362277919451948034, + 11222024348659324185, + 769204936692720831 ], "infinity": false }, { "x": [ - 5322159730374322388, - 3659894232098455483, - 10171880280094971243, - 431515299767226515 + 17731804648385463364, + 6957978511947926439, + 554530057858945391, + 1554116369209063151 ], "y": [ - 14791449638831932512, - 10738337476109754900, - 1862661053125068636, - 731793996122181075 + 11068663668443960791, + 4165938511251890045, + 9157185920319394352, + 1356194940161196789 ], "infinity": false }, { "x": [ - 12917630644677941752, - 4937729565530658654, - 8556480575682662733, - 961697364679101001 + 8019563329680255469, + 10443600923825661309, + 10066002756835006084, + 2404912031772130651 ], "y": [ - 8840334103693104877, - 10869978277378103213, - 5520782129896593813, - 2404823286335940024 + 11909280006603456147, + 5818438825251413345, + 15870199885834935123, + 2757108579883054631 ], "infinity": false }, { "x": [ - 4177624058108552844, - 7496286594337546064, - 12327303478390769977, - 1884447338697134452 + 9723414060399071945, + 10180812700717519482, + 7936340440930941206, + 516257686460616129 ], "y": [ - 11592594644619014749, - 1292793399956228893, - 17148866035827453124, - 2259449579930654777 + 567977185774136652, + 4306281713268395827, + 18140207600873092049, + 3061955278209883828 ], "infinity": false }, @@ -96,31 +96,31 @@ }, { "x": [ - 16821965459015940209, - 16502520825403405563, - 4933134856324568875, - 971914902671623933 + 15818628187542915298, + 15402701417353228903, + 4645743436884029384, + 2409582523262225752 ], "y": [ - 8708758630145674281, - 11568462267224108675, - 15920534706957442557, - 2205222521283673407 + 10225110015471016873, + 3480449575574012457, + 13646267911522236018, + 3070086728021966273 ], "infinity": false }, { "x": [ - 13887807756011277977, - 6633952600242750048, - 12933639896153908639, - 1634594860965316349 + 15593293662666768812, + 17768691370516984644, + 17174288836059912543, + 2950415245130983093 ], "y": [ - 5219211762505995590, - 3805451927973946744, - 18239167495029817450, - 1620516238642646611 + 10405941745355450827, + 3865610534756768698, + 563805946543955734, + 1806918679491891699 ], "infinity": false } @@ -128,16 +128,16 @@ "gate_selectors_commitments": [ { "x": [ - 9648237812026707665, - 3394846795043056222, - 4629068839178038498, - 1935924284954725357 + 5354921692103962663, + 10597914855112022168, + 8283977291194706970, + 1254033438787241395 ], "y": [ - 7429667519719510580, - 9655284945806121212, - 10303170318619716429, - 1450391691397826178 + 17990692095059328463, + 7491895001046969405, + 17510882385599010078, + 1762527058736778745 ], "infinity": false }, @@ -160,61 +160,61 @@ "permutation_commitments": [ { "x": [ - 14847495908726407963, - 16855284351914487461, - 18211889533001639981, - 2155135400931744246 + 11073033365046587506, + 17543366073703943346, + 2925375977998636107, + 411355966917613086 ], "y": [ - 10702169610220940865, - 9956121846187196036, - 8949798846882497976, - 2163047794650360669 + 4634938960149933815, + 10038620738808728516, + 5260176309304737799, + 14410327903164543 ], "infinity": false }, { "x": [ - 378831953168999386, - 9293735894762022592, - 14386665413246396021, - 3071878788754443116 + 4505573069708166334, + 3514663015240928368, + 13885581324134225254, + 2759554901468343883 ], "y": [ - 15896087542596050393, - 17239768855300757555, - 1302380423903460425, - 1070516261187880368 + 14766134794032708062, + 3419963379718679828, + 14090109324006346322, + 2080971354192483161 ], "infinity": false }, { "x": [ - 15681530546748660775, - 15325947204107855582, - 6169941741627651138, - 1438247605769128980 + 10034756028637387237, + 13956897381252459181, + 17676764419229650887, + 1786540180828440303 ], "y": [ - 1709841937332991257, - 3205925128833409221, - 10381982057624226277, - 3302314191697651889 + 16234833038341145650, + 1114974762353197748, + 16711158590984748387, + 961724704749485864 ], "infinity": false }, { "x": [ - 7915449484973597791, - 14858122728404062261, - 17806747946577351454, - 1879592080912408858 + 13207237492056542947, + 9498840683026707597, + 13316073393799666368, + 2265958217127439582 ], "y": [ - 15677256576208223457, - 8628800709300512291, - 18168431650113296999, - 252714218130055622 + 9080715171198565366, + 9520983963961194766, + 7885036753736171049, + 3318336507646038340 ], "infinity": false }