diff --git a/BE/service/package-lock.json b/BE/service/package-lock.json index 240d69b..c45aec4 100644 --- a/BE/service/package-lock.json +++ b/BE/service/package-lock.json @@ -17,6 +17,7 @@ "@nestjs/swagger": "^7.3.0", "@nestjs/typeorm": "^10.0.2", "@types/bcryptjs": "^2.4.6", + "@types/snarkjs": "^0.7.8", "bcryptjs": "^2.4.3", "joi": "^17.12.3", "moment": "^2.30.1", @@ -24,6 +25,7 @@ "nest-winston": "^1.9.4", "reflect-metadata": "^0.1.13", "rxjs": "^7.2.0", + "snarkjs": "^0.7.4", "swagger-ui-express": "^5.0.0", "typeorm": "^0.3.20", "uuid": "^9.0.1", @@ -976,6 +978,20 @@ "integrity": "sha512-6EwiSjwWYP7pTckG6I5eyFANjPhmPjUX9JRLUSfNPC7FX7zK9gyZAfUEaECL6ALTpGX5AjnBq3C9XmVWPitNpw==", "dev": true }, + "node_modules/@iden3/bigarray": { + "version": "0.0.2", + "resolved": "https://registry.npmjs.org/@iden3/bigarray/-/bigarray-0.0.2.tgz", + "integrity": "sha512-Xzdyxqm1bOFF6pdIsiHLLl3HkSLjbhqJHVyqaTxXt3RqXBEnmsUmEW47H7VOi/ak7TdkRpNkxjyK5Zbkm+y52g==" + }, + "node_modules/@iden3/binfileutils": { + "version": "0.0.12", + "resolved": "https://registry.npmjs.org/@iden3/binfileutils/-/binfileutils-0.0.12.tgz", + "integrity": "sha512-naAmzuDufRIcoNfQ1d99d7hGHufLA3wZSibtr4dMe6ZeiOPV1KwOZWTJ1YVz4HbaWlpDuzVU72dS4ATQS4PXBQ==", + "dependencies": { + "fastfile": "0.0.20", + "ffjavascript": "^0.3.0" + } + }, "node_modules/@isaacs/cliui": { "version": "8.0.2", "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", @@ -2323,6 +2339,11 @@ "@types/node": "*" } }, + "node_modules/@types/snarkjs": { + "version": "0.7.8", + "resolved": "https://registry.npmjs.org/@types/snarkjs/-/snarkjs-0.7.8.tgz", + "integrity": "sha512-x37Jsv1vx6I6RMJdfvYEmDUOLYgzYMecwlk13gniDOcN20xLVe9hy9DlQxWeCPirqpDY/jwugQSqCi2RxehU3g==" + }, "node_modules/@types/stack-utils": { "version": "2.0.3", "resolved": "https://registry.npmjs.org/@types/stack-utils/-/stack-utils-2.0.3.tgz", @@ -2946,6 +2967,11 @@ "proxy-from-env": "^1.1.0" } }, + "node_modules/b4a": { + "version": "1.6.6", + "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.6.tgz", + "integrity": "sha512-5Tk1HLk6b6ctmjIkAcU/Ujv/1WqiDl0F0JdRCR80VsOcUlHcu7pWeWRlOqQLHfDEsVx9YH/aif5AG4ehoCtTmg==" + }, "node_modules/babel-jest": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/babel-jest/-/babel-jest-28.1.3.tgz", @@ -3066,6 +3092,21 @@ "resolved": "https://registry.npmjs.org/bcryptjs/-/bcryptjs-2.4.3.tgz", "integrity": "sha512-V/Hy/X9Vt7f3BbPJEi8BdVFMByHi+jNXrYkW3huaybV/kQ0KJg0Y6PkEMbn+zeT+i+SiKZ/HMqJGIIt4LZDqNQ==" }, + "node_modules/bfj": { + "version": "7.1.0", + "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.1.0.tgz", + "integrity": "sha512-I6MMLkn+anzNdCUp9hMRyui1HaNEUCco50lxbvNS4+EyXg8lN3nJ48PjPWtbH8UVS9CuMoaKE9U2V3l29DaRQw==", + "dependencies": { + "bluebird": "^3.7.2", + "check-types": "^11.2.3", + "hoopy": "^0.1.4", + "jsonpath": "^1.1.1", + "tryer": "^1.0.1" + }, + "engines": { + "node": ">= 8.0.0" + } + }, "node_modules/binary-extensions": { "version": "2.2.0", "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.2.0.tgz", @@ -3100,6 +3141,20 @@ "node": ">= 6" } }, + "node_modules/blake2b-wasm": { + "version": "2.4.0", + "resolved": "https://registry.npmjs.org/blake2b-wasm/-/blake2b-wasm-2.4.0.tgz", + "integrity": "sha512-S1kwmW2ZhZFFFOghcx73+ZajEfKBqhP82JMssxtLVMxlaPea1p9uoLiUZ5WYyHn0KddwbLc+0vh4wR0KBNoT5w==", + "dependencies": { + "b4a": "^1.0.1", + "nanoassert": "^2.0.0" + } + }, + "node_modules/bluebird": { + "version": "3.7.2", + "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", + "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==" + }, "node_modules/body-parser": { "version": "1.20.2", "resolved": "https://registry.npmjs.org/body-parser/-/body-parser-1.20.2.tgz", @@ -3140,7 +3195,6 @@ "version": "1.1.11", "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-1.1.11.tgz", "integrity": "sha512-iCuPHDFgrHX7H2vEI/5xpz07zSHB00TpugqhmYtVmMO6518mCuRMoOYFldEBl0g187ufozdaHgWKcYFb61qGiA==", - "dev": true, "dependencies": { "balanced-match": "^1.0.0", "concat-map": "0.0.1" @@ -3350,6 +3404,11 @@ "integrity": "sha512-mT8iDcrh03qDGRRmoA2hmBJnxpllMR+0/0qlzjqZES6NdiWDcZkCNAk4rPFZ9Q85r27unkiNNg8ZOiwZXBHwcA==", "dev": true }, + "node_modules/check-types": { + "version": "11.2.3", + "resolved": "https://registry.npmjs.org/check-types/-/check-types-11.2.3.tgz", + "integrity": "sha512-+67P1GkJRaxQD6PKK0Et9DhwQB+vGg3PM5+aavopCpZT1lj9jeqfvpgTLAWErNj8qApkkmXlu/Ug74kmhagkXg==" + }, "node_modules/chokidar": { "version": "3.5.3", "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.5.3.tgz", @@ -3401,6 +3460,17 @@ "node": ">=8" } }, + "node_modules/circom_runtime": { + "version": "0.1.25", + "resolved": "https://registry.npmjs.org/circom_runtime/-/circom_runtime-0.1.25.tgz", + "integrity": "sha512-xBGsBFF5Uv6AKvbpgExYqpHfmfawH2HKe+LyjfKSRevqEV8u63i9KGHVIILsbJNW+0c5bm/66f0PUYQ7qZSkJA==", + "dependencies": { + "ffjavascript": "0.3.0" + }, + "bin": { + "calcwit": "calcwit.js" + } + }, "node_modules/cjs-module-lexer": { "version": "1.2.3", "resolved": "https://registry.npmjs.org/cjs-module-lexer/-/cjs-module-lexer-1.2.3.tgz", @@ -3636,8 +3706,7 @@ "node_modules/concat-map": { "version": "0.0.1", "resolved": "https://registry.npmjs.org/concat-map/-/concat-map-0.0.1.tgz", - "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==", - "dev": true + "integrity": "sha512-/Srv4dswyQNBfohGpz9o6Yb3Gz3SrUDqBH5rTuhGR7ahtlbYKnVxw2bCFMRljaA7EXHaXZ8wsHdodFvbkhKmqg==" }, "node_modules/concat-stream": { "version": "1.6.2", @@ -3802,8 +3871,7 @@ "node_modules/deep-is": { "version": "0.1.4", "resolved": "https://registry.npmjs.org/deep-is/-/deep-is-0.1.4.tgz", - "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==", - "dev": true + "integrity": "sha512-oIPzksmTg4/MriiaYGO+okXDT7ztn/w3Eptv/+gSIdMdKsJo0u4CfYNFJPy+4SKMuCqGw2wxnA+URMg3t8a/bQ==" }, "node_modules/deepmerge": { "version": "4.3.1", @@ -3975,6 +4043,20 @@ "resolved": "https://registry.npmjs.org/ee-first/-/ee-first-1.1.1.tgz", "integrity": "sha512-WMwm9LhRUo+WUaRN+vRuETqG89IgZphVSNkdFgeb6sS/E4OrDIN7t48CAewSHXc6C8lefD8KKfr5vY61brQlow==" }, + "node_modules/ejs": { + "version": "3.1.10", + "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", + "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", + "dependencies": { + "jake": "^10.8.5" + }, + "bin": { + "ejs": "bin/cli.js" + }, + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/electron-to-chromium": { "version": "1.4.667", "resolved": "https://registry.npmjs.org/electron-to-chromium/-/electron-to-chromium-1.4.667.tgz", @@ -4092,6 +4174,83 @@ "url": "https://github.com/sponsors/sindresorhus" } }, + "node_modules/escodegen": { + "version": "1.14.3", + "resolved": "https://registry.npmjs.org/escodegen/-/escodegen-1.14.3.tgz", + "integrity": "sha512-qFcX0XJkdg+PB3xjZZG/wKSuT1PnQWx57+TVSjIMmILd2yC/6ByYElPwJnslDsuWuSAp4AwJGumarAAmJch5Kw==", + "dependencies": { + "esprima": "^4.0.1", + "estraverse": "^4.2.0", + "esutils": "^2.0.2", + "optionator": "^0.8.1" + }, + "bin": { + "escodegen": "bin/escodegen.js", + "esgenerate": "bin/esgenerate.js" + }, + "engines": { + "node": ">=4.0" + }, + "optionalDependencies": { + "source-map": "~0.6.1" + } + }, + "node_modules/escodegen/node_modules/levn": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", + "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", + "dependencies": { + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/optionator": { + "version": "0.8.3", + "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", + "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", + "dependencies": { + "deep-is": "~0.1.3", + "fast-levenshtein": "~2.0.6", + "levn": "~0.3.0", + "prelude-ls": "~1.1.2", + "type-check": "~0.3.2", + "word-wrap": "~1.2.3" + }, + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/prelude-ls": { + "version": "1.1.2", + "resolved": "https://registry.npmjs.org/prelude-ls/-/prelude-ls-1.1.2.tgz", + "integrity": "sha512-ESF23V4SKG6lVSGZgYNpbsiaAkdab6ZgOxe52p7+Kid3W3u3bxR4Vfd/o21dmN7jSt0IwgZ4v5MUd26FEtXE9w==", + "engines": { + "node": ">= 0.8.0" + } + }, + "node_modules/escodegen/node_modules/source-map": { + "version": "0.6.1", + "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.6.1.tgz", + "integrity": "sha512-UjgapumWlbMhkBgzT7Ykc5YXUT46F0iKu8SGXq0bcwP5dz/h0Plj6enJqjz1Zbq2l5WaqYnrVbwWOWMyF3F47g==", + "optional": true, + "engines": { + "node": ">=0.10.0" + } + }, + "node_modules/escodegen/node_modules/type-check": { + "version": "0.3.2", + "resolved": "https://registry.npmjs.org/type-check/-/type-check-0.3.2.tgz", + "integrity": "sha512-ZCmOJdvOWDBYJlzAoFkC+Q0+bUyEOS1ltgp1MGU03fqHG+dbi9tBFU2Rd9QKiDZFAYrhPh2JUf7rZRIuHRKtOg==", + "dependencies": { + "prelude-ls": "~1.1.2" + }, + "engines": { + "node": ">= 0.8.0" + } + }, "node_modules/eslint": { "version": "8.56.0", "resolved": "https://registry.npmjs.org/eslint/-/eslint-8.56.0.tgz", @@ -4285,7 +4444,6 @@ "version": "4.0.1", "resolved": "https://registry.npmjs.org/esprima/-/esprima-4.0.1.tgz", "integrity": "sha512-eGuFFw7Upda+g4p+QHvnW0RyTX/SVeJBDM/gCtMARO0cLuT2HcEKnTPvhjV6aGeqrCB/sbNop0Kszm0jsaWU4A==", - "dev": true, "bin": { "esparse": "bin/esparse.js", "esvalidate": "bin/esvalidate.js" @@ -4340,7 +4498,6 @@ "version": "4.3.0", "resolved": "https://registry.npmjs.org/estraverse/-/estraverse-4.3.0.tgz", "integrity": "sha512-39nnKffWz8xN1BU/2c79n9nB9HDzo0niYUqx6xyqUnyoAnQyyWpOTdZEeiCch8BBu515t4wp9ZmgVfVhn9EBpw==", - "dev": true, "engines": { "node": ">=4.0" } @@ -4349,7 +4506,6 @@ "version": "2.0.3", "resolved": "https://registry.npmjs.org/esutils/-/esutils-2.0.3.tgz", "integrity": "sha512-kVscqXk4OCp68SZ0dkgEKVi6/8ij300KBWTJq32P/dYeWTSwK41WyTxalN1eRmA5Z9UU/LX9D7FWSmV9SAYx6g==", - "dev": true, "engines": { "node": ">=0.10.0" } @@ -4566,14 +4722,18 @@ "node_modules/fast-levenshtein": { "version": "2.0.6", "resolved": "https://registry.npmjs.org/fast-levenshtein/-/fast-levenshtein-2.0.6.tgz", - "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==", - "dev": true + "integrity": "sha512-DCXu6Ifhqcks7TZKY3Hxp3y6qphY5SJZmrWMDrKcERSOXWQdMhU9Ig/PYrzyw/ul9jOIyh0N4M0tbC5hodg8dw==" }, "node_modules/fast-safe-stringify": { "version": "2.1.1", "resolved": "https://registry.npmjs.org/fast-safe-stringify/-/fast-safe-stringify-2.1.1.tgz", "integrity": "sha512-W+KJc2dmILlPplD/H4K9l9LcAHAfPtP6BY84uVLXQ6Evcz9Lcg33Y2z1IVblT6xdY54PXYVHEv+0Wpq8Io6zkA==" }, + "node_modules/fastfile": { + "version": "0.0.20", + "resolved": "https://registry.npmjs.org/fastfile/-/fastfile-0.0.20.tgz", + "integrity": "sha512-r5ZDbgImvVWCP0lA/cGNgQcZqR+aYdFx3u+CtJqUE510pBUVGMn4ulL/iRTI4tACTYsNJ736uzFxEBXesPAktA==" + }, "node_modules/fastq": { "version": "1.17.1", "resolved": "https://registry.npmjs.org/fastq/-/fastq-1.17.1.tgz", @@ -4597,6 +4757,16 @@ "resolved": "https://registry.npmjs.org/fecha/-/fecha-4.2.3.tgz", "integrity": "sha512-OP2IUU6HeYKJi3i0z4A19kHMQoLVs4Hc+DPqqxI2h/DPZHTm/vjsfC6P0b4jCMy14XizLBqvndQ+UilD7707Jw==" }, + "node_modules/ffjavascript": { + "version": "0.3.0", + "resolved": "https://registry.npmjs.org/ffjavascript/-/ffjavascript-0.3.0.tgz", + "integrity": "sha512-l7sR5kmU3gRwDy8g0Z2tYBXy5ttmafRPFOqY7S6af5cq51JqJWt5eQ/lSR/rs2wQNbDYaYlQr5O+OSUf/oMLoQ==", + "dependencies": { + "wasmbuilder": "0.0.16", + "wasmcurves": "0.2.2", + "web-worker": "1.2.0" + } + }, "node_modules/figures": { "version": "3.2.0", "resolved": "https://registry.npmjs.org/figures/-/figures-3.2.0.tgz", @@ -4633,6 +4803,33 @@ "node": "^10.12.0 || >=12.0.0" } }, + "node_modules/filelist": { + "version": "1.0.4", + "resolved": "https://registry.npmjs.org/filelist/-/filelist-1.0.4.tgz", + "integrity": "sha512-w1cEuf3S+DrLCQL7ET6kz+gmlJdbq9J7yXCSjK/OZCPA+qEN1WyF4ZAf0YYJa4/shHJra2t/d/r8SV4Ji+x+8Q==", + "dependencies": { + "minimatch": "^5.0.1" + } + }, + "node_modules/filelist/node_modules/brace-expansion": { + "version": "2.0.1", + "resolved": "https://registry.npmjs.org/brace-expansion/-/brace-expansion-2.0.1.tgz", + "integrity": "sha512-XnAIvQ8eM+kC6aULx6wuQiwVsnzsi9d3WxzV3FpWTGA19F621kwdbsAcFKXgKUHZWsy+mY6iL1sHTxWEFCytDA==", + "dependencies": { + "balanced-match": "^1.0.0" + } + }, + "node_modules/filelist/node_modules/minimatch": { + "version": "5.1.6", + "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-5.1.6.tgz", + "integrity": "sha512-lKwV/1brpG6mBUFHtb7NUmtABCb2WZZmm2wNiOA5hAb8VdCS4B3dtMWyvcoViccwAW/COERjXLt0zP1zXUN26g==", + "dependencies": { + "brace-expansion": "^2.0.1" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/fill-range": { "version": "7.0.1", "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.0.1.tgz", @@ -5126,6 +5323,14 @@ "node": "*" } }, + "node_modules/hoopy": { + "version": "0.1.4", + "resolved": "https://registry.npmjs.org/hoopy/-/hoopy-0.1.4.tgz", + "integrity": "sha512-HRcs+2mr52W0K+x8RzcLzuPPmVIKMSv97RGHy0Ea9y/mpcaK+xTrjICA04KAHi4GRzxliNqNJEFYWHghy3rSfQ==", + "engines": { + "node": ">= 6.0.0" + } + }, "node_modules/html-escaper": { "version": "2.0.2", "resolved": "https://registry.npmjs.org/html-escaper/-/html-escaper-2.0.2.tgz", @@ -5539,6 +5744,23 @@ "@pkgjs/parseargs": "^0.11.0" } }, + "node_modules/jake": { + "version": "10.9.1", + "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.1.tgz", + "integrity": "sha512-61btcOHNnLnsOdtLgA5efqQWjnSi/vow5HbI7HMdKKWqvrKR1bLK3BPlJn9gcSaP2ewuamUSMB5XEy76KUIS2w==", + "dependencies": { + "async": "^3.2.3", + "chalk": "^4.0.2", + "filelist": "^1.0.4", + "minimatch": "^3.1.2" + }, + "bin": { + "jake": "bin/cli.js" + }, + "engines": { + "node": ">=10" + } + }, "node_modules/jest": { "version": "28.1.3", "resolved": "https://registry.npmjs.org/jest/-/jest-28.1.3.tgz", @@ -6125,6 +6347,11 @@ "@sideway/pinpoint": "^2.0.0" } }, + "node_modules/js-sha3": { + "version": "0.8.0", + "resolved": "https://registry.npmjs.org/js-sha3/-/js-sha3-0.8.0.tgz", + "integrity": "sha512-gF1cRrHhIzNfToc802P800N8PpXS+evLLXfsVpowqmAFR9uwbi89WvXg2QspOmXL8QL86J4T1EpFu+yUkwJY3Q==" + }, "node_modules/js-tokens": { "version": "4.0.0", "resolved": "https://registry.npmjs.org/js-tokens/-/js-tokens-4.0.0.tgz", @@ -6208,6 +6435,28 @@ "graceful-fs": "^4.1.6" } }, + "node_modules/jsonpath": { + "version": "1.1.1", + "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", + "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", + "dependencies": { + "esprima": "1.2.2", + "static-eval": "2.0.2", + "underscore": "1.12.1" + } + }, + "node_modules/jsonpath/node_modules/esprima": { + "version": "1.2.2", + "resolved": "https://registry.npmjs.org/esprima/-/esprima-1.2.2.tgz", + "integrity": "sha512-+JpPZam9w5DuJ3Q67SqsMGtiHKENSMRVoxvArfJZK01/BfLEObtZ6orJa/MtoGNR/rfMgp5837T41PAmTwAv/A==", + "bin": { + "esparse": "bin/esparse.js", + "esvalidate": "bin/esvalidate.js" + }, + "engines": { + "node": ">=0.4.0" + } + }, "node_modules/jsonwebtoken": { "version": "9.0.2", "resolved": "https://registry.npmjs.org/jsonwebtoken/-/jsonwebtoken-9.0.2.tgz", @@ -6415,6 +6664,11 @@ "node": ">=0.1.90" } }, + "node_modules/logplease": { + "version": "1.2.15", + "resolved": "https://registry.npmjs.org/logplease/-/logplease-1.2.15.tgz", + "integrity": "sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA==" + }, "node_modules/long": { "version": "5.2.3", "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", @@ -6587,7 +6841,6 @@ "version": "3.1.2", "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-3.1.2.tgz", "integrity": "sha512-J7p63hRiAjw1NDEww1W7i37+ByIrOWO5XQQAzZ3VOcL0PNybwpfmV/N05zFAzwQ9USyEcX6t3UO+K5aqBQOIHw==", - "dev": true, "dependencies": { "brace-expansion": "^1.1.7" }, @@ -6725,6 +6978,11 @@ "node": ">=12" } }, + "node_modules/nanoassert": { + "version": "2.0.0", + "resolved": "https://registry.npmjs.org/nanoassert/-/nanoassert-2.0.0.tgz", + "integrity": "sha512-7vO7n28+aYO4J+8w96AzhmU8G+Y/xpPDJz/se19ICsqj/momRbb9mh9ZUtkoJ5X3nTnPdhEJyc0qnM6yAsHBaA==" + }, "node_modules/natural-compare": { "version": "1.4.0", "resolved": "https://registry.npmjs.org/natural-compare/-/natural-compare-1.4.0.tgz", @@ -7378,6 +7636,17 @@ } ] }, + "node_modules/r1csfile": { + "version": "0.0.48", + "resolved": "https://registry.npmjs.org/r1csfile/-/r1csfile-0.0.48.tgz", + "integrity": "sha512-kHRkKUJNaor31l05f2+RFzvcH5XSa7OfEfd/l4hzjte6NL6fjRkSMfZ4BjySW9wmfdwPOtq3mXurzPvPGEf5Tw==", + "dependencies": { + "@iden3/bigarray": "0.0.2", + "@iden3/binfileutils": "0.0.12", + "fastfile": "0.0.20", + "ffjavascript": "0.3.0" + } + }, "node_modules/randombytes": { "version": "2.1.0", "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", @@ -7972,6 +8241,26 @@ "node": ">=8" } }, + "node_modules/snarkjs": { + "version": "0.7.4", + "resolved": "https://registry.npmjs.org/snarkjs/-/snarkjs-0.7.4.tgz", + "integrity": "sha512-x4cOCR4YXSyBlLtfnUUwfbZrw8wFd/Y0lk83eexJzKwZB8ELdpH+10ts8YtDsm2/a3WK7c7p514bbE8NpqxW8w==", + "dependencies": { + "@iden3/binfileutils": "0.0.12", + "bfj": "^7.0.2", + "blake2b-wasm": "^2.4.0", + "circom_runtime": "0.1.25", + "ejs": "^3.1.6", + "fastfile": "0.0.20", + "ffjavascript": "0.3.0", + "js-sha3": "^0.8.0", + "logplease": "^1.2.15", + "r1csfile": "0.0.48" + }, + "bin": { + "snarkjs": "build/cli.cjs" + } + }, "node_modules/source-map": { "version": "0.7.4", "resolved": "https://registry.npmjs.org/source-map/-/source-map-0.7.4.tgz", @@ -8043,6 +8332,14 @@ "node": ">=8" } }, + "node_modules/static-eval": { + "version": "2.0.2", + "resolved": "https://registry.npmjs.org/static-eval/-/static-eval-2.0.2.tgz", + "integrity": "sha512-N/D219Hcr2bPjLxPiV+TQE++Tsmrady7TqAJugLy7Xk1EumfDWS/f5dtBbkRCGE7wKKXuYockQoj8Rm2/pVKyg==", + "dependencies": { + "escodegen": "^1.8.1" + } + }, "node_modules/statuses": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/statuses/-/statuses-2.0.1.tgz", @@ -8506,6 +8803,11 @@ "node": ">= 14.0.0" } }, + "node_modules/tryer": { + "version": "1.0.1", + "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", + "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==" + }, "node_modules/ts-jest": { "version": "28.0.8", "resolved": "https://registry.npmjs.org/ts-jest/-/ts-jest-28.0.8.tgz", @@ -8970,6 +9272,11 @@ "node": ">=8" } }, + "node_modules/underscore": { + "version": "1.12.1", + "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", + "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==" + }, "node_modules/universalify": { "version": "2.0.1", "resolved": "https://registry.npmjs.org/universalify/-/universalify-2.0.1.tgz", @@ -9094,6 +9401,19 @@ "makeerror": "1.0.12" } }, + "node_modules/wasmbuilder": { + "version": "0.0.16", + "resolved": "https://registry.npmjs.org/wasmbuilder/-/wasmbuilder-0.0.16.tgz", + "integrity": "sha512-Qx3lEFqaVvp1cEYW7Bfi+ebRJrOiwz2Ieu7ZG2l7YyeSJIok/reEQCQCuicj/Y32ITIJuGIM9xZQppGx5LrQdA==" + }, + "node_modules/wasmcurves": { + "version": "0.2.2", + "resolved": "https://registry.npmjs.org/wasmcurves/-/wasmcurves-0.2.2.tgz", + "integrity": "sha512-JRY908NkmKjFl4ytnTu5ED6AwPD+8VJ9oc94kdq7h5bIwbj0L4TDJ69mG+2aLs2SoCmGfqIesMWTEJjtYsoQXQ==", + "dependencies": { + "wasmbuilder": "0.0.16" + } + }, "node_modules/watchpack": { "version": "2.4.0", "resolved": "https://registry.npmjs.org/watchpack/-/watchpack-2.4.0.tgz", @@ -9116,6 +9436,11 @@ "defaults": "^1.0.3" } }, + "node_modules/web-worker": { + "version": "1.2.0", + "resolved": "https://registry.npmjs.org/web-worker/-/web-worker-1.2.0.tgz", + "integrity": "sha512-PgF341avzqyx60neE9DD+XS26MMNMoUQRz9NOZwW32nPQrF6p77f1htcnjBSEV8BGMKZ16choqUG4hyI0Hx7mA==" + }, "node_modules/webidl-conversions": { "version": "3.0.1", "resolved": "https://registry.npmjs.org/webidl-conversions/-/webidl-conversions-3.0.1.tgz", @@ -9340,6 +9665,14 @@ "node": ">= 6" } }, + "node_modules/word-wrap": { + "version": "1.2.5", + "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", + "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", + "engines": { + "node": ">=0.10.0" + } + }, "node_modules/wrap-ansi": { "version": "7.0.0", "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", diff --git a/BE/service/package.json b/BE/service/package.json index 885b506..29722fb 100644 --- a/BE/service/package.json +++ b/BE/service/package.json @@ -33,6 +33,7 @@ "@nestjs/swagger": "^7.3.0", "@nestjs/typeorm": "^10.0.2", "@types/bcryptjs": "^2.4.6", + "@types/snarkjs": "^0.7.8", "bcryptjs": "^2.4.3", "joi": "^17.12.3", "moment": "^2.30.1", @@ -40,6 +41,7 @@ "nest-winston": "^1.9.4", "reflect-metadata": "^0.1.13", "rxjs": "^7.2.0", + "snarkjs": "^0.7.4", "swagger-ui-express": "^5.0.0", "typeorm": "^0.3.20", "uuid": "^9.0.1", diff --git a/BE/service/src/api/service/service-api.service.ts b/BE/service/src/api/service/service-api.service.ts index a9ffbdc..30dff3c 100644 --- a/BE/service/src/api/service/service-api.service.ts +++ b/BE/service/src/api/service/service-api.service.ts @@ -162,7 +162,7 @@ export class ServiceAPIService { async verifyProof(dto: ProofDto): Promise { return lastValueFrom( this.httpService - .post(this.VERIFY_PROOF, { params: { ...dto } }) + .post(this.VERIFY_PROOF, { ...dto }) .pipe(map((response) => response.data)), ); } diff --git a/BE/service/src/dto/proof.dto.ts b/BE/service/src/dto/proof.dto.ts index 8dc7b1d..e1fef5b 100644 --- a/BE/service/src/dto/proof.dto.ts +++ b/BE/service/src/dto/proof.dto.ts @@ -3,22 +3,19 @@ import { ApiProperty } from '@nestjs/swagger'; export class ProofDto { @ApiProperty({ description: 'Service Name', - example: 'One-sided love paper boat', + example: 'kataomoi-boat', }) readonly ServiceName: string; - @ApiProperty({ description: 'Holder pub key', example: 'hpubkey' }) + @ApiProperty({ + description: 'Holder pub key', + example: 'honorable-muscle.testnet', + }) readonly HolderPubKey: string; - @ApiProperty({ description: 'Proof (by json)', example: 'proof' }) + @ApiProperty({ description: 'proof', example: '-' }) readonly proof: string; - @ApiProperty({ description: 'Issuer pub key (by json)', example: 'ipubkey' }) - readonly IssuerPubKey: string; - - // @ApiProperty({ description: 'user pk', example: 'pk' }) - // readonly pk: string; - - @ApiProperty({ description: 'VKey (by json)', example: 'vkey' }) - readonly vKey: string; + @ApiProperty({ description: 'publicSignals', example: '-' }) + readonly publicSignals: string; } diff --git a/BE/verifier/src/common/const.ts b/BE/verifier/src/common/const.ts new file mode 100644 index 0000000..a143a5c --- /dev/null +++ b/BE/verifier/src/common/const.ts @@ -0,0 +1,1360 @@ +export const vkey = { + protocol: 'groth16', + curve: 'bn128', + nPublic: 256, + vk_alpha_1: [ + '6470905661450556615633487234658420172792282941654533713284814780493465095533', + '6507831322280900435959489979023213916727222464612843253822914194218524392490', + '1', + ], + vk_beta_2: [ + [ + '17225386197690267828137207625046323028337295236177266819162560355896609285717', + '21179317355221159122701426442457325120124147453527744197591256870199587863816', + ], + [ + '12913227685925943037484482959956696051227992210526313052025310279040419929981', + '19096518761244977797607657603083229740469283183979592713651168011421724633434', + ], + ['1', '0'], + ], + vk_gamma_2: [ + [ + '10857046999023057135944570762232829481370756359578518086990519993285655852781', + '11559732032986387107991004021392285783925812861821192530917403151452391805634', + ], + [ + '8495653923123431417604973247489272438418190587263600148770280649306958101930', + '4082367875863433681332203403145435568316851327593401208105741076214120093531', + ], + ['1', '0'], + ], + vk_delta_2: [ + [ + '3537778144764753927756865466402327053833541292286640840232836352501445079688', + '14211406527082518742289158966792969332455339153857636682745718474134871407302', + ], + [ + '15566025965355129412651751470540115885621012154649234092737662011365349626266', + '13002074882652259405515474010993162573223427296693166999734290312601591501921', + ], + ['1', '0'], + ], + vk_alphabeta_12: [ + [ + [ + '15159702925837076595560548264467981711292354346197284233633698198325043046567', + '9193977985515237562451165573845630812564362827864746610234216967981026679806', + ], + [ + '12849156130209345316645772603314365926860858658809960044283700266117757248644', + '14919202187669696106581254066365571028774637055479724695453080595641300295411', + ], + [ + '20632692634397740121518114313857369559033825469078085430809487768422890267918', + '1606667771567496084232449582574566025125435470630131283549614844101950031094', + ], + ], + [ + [ + '17613179676581712714587643973822464192010152090527881692178916428571621784527', + '16723853004996307171330301598605967668318134287343419233520036415704534015424', + ], + [ + '5762480850343556519859951514389835187728945432927083896197468384167277756112', + '6690845750272137462122437786360049854693731122371686791748135740237851837989', + ], + [ + '15527981458082210856491506325837423016088897185106381581186865670546993987435', + '13015589671409732815021723421504020241724095327192882241948434596740740562002', + ], + ], + ], + IC: [ + [ + '9102078230012224249005417700726590349035251259282286853229194275122537286200', + '18016729497736410071197046192710445275461636437264235705391221955998044534299', + '1', + ], + [ + '11517740478768029827455359249822165924758128446459388952855733224313049692428', + '12516375205593625710394793075139831288211799448380225793002942092709606639048', + '1', + ], + [ + '17453066626186315309517222068548169293303318694193703452750075390603659699132', + '21878901209350845868344427999638373413464305786946992673174043844745199595986', + '1', + ], + [ + '9239798513186822604604991000995259585530377822027622452499281692115253899691', + '17181173393207040738368735775488669222335947828514508160826813310799582182136', + '1', + ], + [ + '18841779545235341900789849706428394305353807635799889354034263526282692583966', + '7759038979700051167099627238340575932485075567020036612531486287821840296332', + '1', + ], + [ + '21000819182550051817153551955713196687695609460405972777043583484214503365721', + '21635309470465303578454652179304024925900736501017704266099389682985065489984', + '1', + ], + [ + '8500103738285854619422031985746606158298076062856065010556319035072808697369', + '18229636109512568141464947775866511021695399264712456354713852652901367330212', + '1', + ], + [ + '10477913016268262047131612631959929783697892695430360535029666033889514288471', + '11466199919935458378364018190106942339614459344822699577677085782253625296151', + '1', + ], + [ + '12746714125440589549750637169622601361518556959418759239764037322684994147239', + '2727733395227939426572590125358701643946272512806459927680564240294687647797', + '1', + ], + [ + '1999654564365012596514114300155624858250497630665004223683677521414866618488', + '5738532898264549800872054816149055665466696189000462601359568844391149436308', + '1', + ], + [ + '2486448526584501413760182111917796185891973556391088592447311894372204692400', + '10951973927849972688989588856897339194348195658939772191315559994194935944727', + '1', + ], + [ + '7715076721780043052361870190600899973522702097146285448405006355464362996783', + '20545574509671986940999233948046924958273590764929481480313000188644338416580', + '1', + ], + [ + '14646608845603773599463627865899918590594336419231339877633130107846921371898', + '18967049516037171087337343877534179706549759488021303039268162350379408141402', + '1', + ], + [ + '5639813383863268266573230532548033785632016174689301001963560877509685919943', + '18327848357821577200246940089475050319386958780998943100835461272552870283688', + '1', + ], + [ + '19140531992009314253518582363711026727386700276767488389626523899459246758806', + '20284431865127461899649064248243151865761068473728077675762316795012621029787', + '1', + ], + [ + '19840991328400623058427406565674521755824246863825302456087753918471769589490', + '9796288675070607436099224363318288037591958383123337680693646986466130268600', + '1', + ], + [ + '19289264399133321920646032082450941756846959120346701845324653252605365943694', + '9462019940179101135792058499232528154265824894617445908198623848194729778597', + '1', + ], + [ + '2909041093594957960903519281645768536744890638837055902247287403174923393373', + '7514188781985358940553585013511177052993423627556580788807641778766362785748', + '1', + ], + [ + '12169431490451218409931418240334581055045956752902879827235754457506176362759', + '4463811026051722684507748218824756495864476053190264838583080080144408550728', + '1', + ], + [ + '2100240422098211876764501943071098198069002471167333250323828467183829937859', + '601071668891973213644364922366922746013052831443996603642757058700395605380', + '1', + ], + [ + '18819465954299505677820076421929750067462203999624891603485268205524465159502', + '14225824171295924074482927937245418872213614240787333294569892634982173126325', + '1', + ], + [ + '14679938750540755847486389055616422291021146369908337633409697002703138233997', + '19754169846331920162328667103271780175444320742146625323853407717899118120517', + '1', + ], + [ + '21829575499261356131968375423353982486030954035417412428394670575003442669319', + '11090803321696112032302748048303564910851545349098356857447014042295162891904', + '1', + ], + [ + '593748431508663230568263599418755074750165582084671091081744929371236184677', + '17597132724509018744512014810902716543100957147815126716817422881050862830218', + '1', + ], + [ + '5046417933640467283428598918312011153587516833354149572798071843602375202603', + '16313439491898792810705680419364226371626445333887645014856384936021816195302', + '1', + ], + [ + '20033993221916981954893663316621493125054261538092378450882319187411461318982', + '8527909741716716716721561177078320038011562437633597709463198212761553476393', + '1', + ], + [ + '9347109314627285155294192260889778031622160186098809702989433494701900193351', + '7511840938790399864963206817625224411927947733627207222894006245410254033429', + '1', + ], + [ + '861525236658019408083229943772092770121101755256766673115823067647410464094', + '16721754498087830741124228791985968112328274157431114380972323083337662223193', + '1', + ], + [ + '17140469782474183358795207681893195074478985011282151745603733150753463728795', + '3310754674366271205838536315375731584831433008793879273902430239327593587734', + '1', + ], + [ + '14003417919685665090558051116305855114013775889143824402958278738275013888242', + '14591427008299704256601253539780912672184503525728497074988292468553865328780', + '1', + ], + [ + '6719480814587155196479487211663845947533021580191930460695842427984354611128', + '19177561189253169678437685311679994064394201527210397514096273776032458787728', + '1', + ], + [ + '14623414965224700272014097734344830393734749705512706727934881427496309185836', + '19850035620101603266452862676287746571773274775363981011758260005226237096963', + '1', + ], + [ + '4699351665162744501699031499520870722166830846863151648096210570315925880351', + '10203484470142106276796870729352318532243895249480520471790431513961513274069', + '1', + ], + [ + '838446257574544035554100421842629685010418280091048744223848362872109642321', + '9652521562194811450857066182439240221363041577124011312636997401344995612384', + '1', + ], + [ + '11609595006595848903961382687652301939590637273968077419074155817636482523590', + '6554888087589841730381056414972852932512683328340193786204157049119536924066', + '1', + ], + [ + '13097208860409528444115594570639030733984059353436716241980816634650702693070', + '19293553937475004330982804550250705871846730968510764220086635689961049436615', + '1', + ], + [ + '2935528824128361039685104713130602177214997063837057895468219351449857610315', + '18944875134737380415815307077693976037120136642669620114607838797077364208719', + '1', + ], + [ + '2570865989415510802165598917980956413849049671205820124705890642759755628142', + '9041609779498689901580581948846141202154520561571029851083594896261297770562', + '1', + ], + [ + '7020359254370460019779538899209543592461154190123899015008710073682758797809', + '5015594994698713558741788609619574259980469610454447995103311508836393515178', + '1', + ], + [ + '19190599671634748750333308398331775939449096314828841549784287197975067304517', + '14269879809312376110210160076736743113320105032407479315072131931738182345798', + '1', + ], + [ + '10995555395733017688220516884924891227953436207413682881230608911240595257037', + '9230241846964532294016833424258322126107450951269632486717549900696382420572', + '1', + ], + [ + '7448837771915662730076072868019962340140282706387808653848942811659568976101', + '8744122592532915632772078910103049880649918305111748102453708820400256089841', + '1', + ], + [ + '7336797870921008399431264241970870769538808347963079237516902201562804350489', + '14343363071406823184265660556411026360801235391698342518785377238302720667712', + '1', + ], + [ + '18129930090664859477501963122969517236655107336636020269474380108535358842317', + '9184364539810864670857546675547817045984692242105267042387519383271521519100', + '1', + ], + [ + '18489535907569586428152125449259531709377227309521854025840775882611692188551', + '10105224379613129677231258646441477454291221766192321729091362077161298052898', + '1', + ], + [ + '12610142641891164502519127600251098435179860096699893525140962327084334642118', + '4380190790275250340644112984319419132394492842010836429919162861928243145594', + '1', + ], + [ + '4285797055079514739121169786201917571373933547161481202608534265973039270190', + '9514386953619382069984831381607759879768169826170850414947706319469962561805', + '1', + ], + [ + '8425903313182311479827838210472358739020788146700334089318764202337667132580', + '11922866521253211374220058650171468294715423482317962931914339648237377131085', + '1', + ], + [ + '3590031774289969006332566327463561465313040876343219903616055130849522469705', + '18617229612532456322084409255961846904936725128718904211546016634857298631324', + '1', + ], + [ + '7075354276948736847652550562860234985866468066034508513982753487066020672388', + '18956815477704181360981494575884521008687264576316834925472514722281470438173', + '1', + ], + [ + '18174935017801630108811978462818268923376716290216264678253868038703426528867', + '16568491519409633272318677829460854875041049420896103618473649754700455056947', + '1', + ], + [ + '9295449406889429600879352408447973418684498485353756142994918691186253316303', + '17055756761967987934255523594706597962159436358072698851127257752710394766488', + '1', + ], + [ + '6066234666023076855107720819258233935938467935148606646303951272681010403532', + '3984798750076161671963332976551603173679983735938791503144441142825969633515', + '1', + ], + [ + '4480057450054885058322963112777290126571371534022526816968408821273550346721', + '10236562128024647553702492336407474651677104512705905932680106452086754883879', + '1', + ], + [ + '1743025146901762820380526826760705576210491158048558553157872845094930362486', + '1428591381618376845220083074701104657607629805241402508259593910341012324236', + '1', + ], + [ + '12365844333097403802182763274597117689995662659061231186289752021899834266699', + '21542894781983322900239441439372086440767243265135978328744335916036479777759', + '1', + ], + [ + '1349223901026636140977178197634977694360747100736136302525640587804210389179', + '7867555409687725347184145929562562155450580176483582521640477203937482425567', + '1', + ], + [ + '2124175347377327102732267872758049562158116505956247808475798313387586350523', + '11459601431927038058481343729539696010137339801938447296013358585217398063395', + '1', + ], + [ + '19057883351777772492456249840084822485808354746335152956198845835245773892097', + '3505362993491907346321888677146588482386111669592498739401720005541151562486', + '1', + ], + [ + '9624736928277646704915621305894210893425776035361696906184396566837884783507', + '3029063567460020888063741565526826518588370784758627133818204576876190695419', + '1', + ], + [ + '10018898734093857155616638761806602254555145864633492794932902047479421405580', + '7697417058411139019858257955998726411714836402387024399214119504879330132500', + '1', + ], + [ + '13148245193905666283242980670510628004322322330107011051580191037230060533067', + '10857013657255878950703555604183616548567681068102818818183895674148994296618', + '1', + ], + [ + '4013839380057485396995100758533293532036926053878698691974413910270866264357', + '9536853510230296033771353037411507758246154137817603423955833249378903565495', + '1', + ], + [ + '8980285294681572119318094759399408044079030517706608797619459436106378737948', + '16646958068484821694582485021380407034442552066297470429949835725080558442995', + '1', + ], + [ + '21006499539848162350199964449669849678370684808414521246898710759890960096248', + '16322389257109121491762899785650550542098249262160894362605051954176267863705', + '1', + ], + [ + '17584422266626958407023473702766724489835313995477705789771331439984665950860', + '4967794090344102272460643861877290198224046332939318149092146510876977550948', + '1', + ], + [ + '14876866149174597404877409623570419379582326289117521184525526850594165296678', + '10876720004294683956820250479076386824319683394159033128923611868111460513634', + '1', + ], + [ + '3549905884779222238311753663361833674195384359336333532356406012850753503149', + '8945026515876239612901535055232517275893915122012135992357987231228765752658', + '1', + ], + [ + '4129180582571301461791497513622327353086973852906181114065992437817543870292', + '7225624171483966278527268842169124031862134414737689272762211477228149753013', + '1', + ], + [ + '5004817846071488859202325605233197767752737551973612439679265635470416328968', + '8715185787258974473083703200962603907965989314773801668378801766469526540973', + '1', + ], + [ + '16564936327555788961792886183455979040712492205819226724508689339204889618432', + '13048685511514926821174616375514279765117797829800352951350188018874997563072', + '1', + ], + [ + '3078265209094126780938162635715394058995694292435608763576681290582546434894', + '6648464383830884200935782190054317271766007180050809034616489312636253495675', + '1', + ], + [ + '11960191210239701572089386094657506244254646446382196940177598444456627831282', + '6057413332006594019401479678253820529214609177232279804389616720888615286695', + '1', + ], + [ + '10714000028711991448642901933537738917985928152533196218175137406932929465035', + '5931075973460213731629275142186234588194441945173895970195835972127019031823', + '1', + ], + [ + '396628753870367798040236478841159741547087315136713257990169372929618895462', + '11842493593631962520825954307747894784458253356201574947571303966218898089722', + '1', + ], + [ + '997733195733429695468656963216870909552941603540222299684019474923159048424', + '3878804133840551159613495681548412246387181446649678507848085283488486225321', + '1', + ], + [ + '15656540944408325315071488374848040742061229676623592747069538496837712970151', + '21613304035620311262375164683871525433679514922776000287343738127835321261589', + '1', + ], + [ + '4958108971956393045341055247867476369233413382205833495908527680698847588016', + '8119714554944350329173549858503292373775834418177786028649114648182614946305', + '1', + ], + [ + '21046531805563699316063753683873974867464161397311100177170923984740863673687', + '509715792376248055295293349745076236040025307955755275417960949125354467724', + '1', + ], + [ + '2579407066535243517281663029601559344645340427717004915867559619393917603372', + '4270632015057357091131418995488352685611945015720752897762644475816607694226', + '1', + ], + [ + '11694810328419740292672723672320273091756103275464166778722709421080427317066', + '3164568814461792564706595319566802697285936585942171876748938556673310174943', + '1', + ], + [ + '14358758674579203827695698933315660659772107378467882344189528438989113371268', + '4540518752876705439897257310905006540917361912545573323440652460116310453774', + '1', + ], + [ + '6011915276859433614601009454539716713406773107169742263730841061795760043543', + '5049392779805478926950886517588643877387130258214903663174426230666066474314', + '1', + ], + [ + '4188714682565478148108753914697312456141259688845244005646594864400455333714', + '15831733396155976234231074900288098952208123189145683622670653053619237160629', + '1', + ], + [ + '12246914529324168589696383706086967441651015159062187097315244819505149461565', + '327297895661877458155956352600879524213674814930594056201222223584717429510', + '1', + ], + [ + '717376234951846836306105212682902657857967796590703657488350505516926840197', + '2170460229477070537065039432783203617317841129498429978138377944471061611466', + '1', + ], + [ + '5208297936045711020316426821805862618880655166610470759541147600125173008369', + '4652011103124836193629873433240567870114906082309167737728003697713994393164', + '1', + ], + [ + '20105768820854480738843139449552006197494949882261169857017467630903484722582', + '58559730015720950416651871466532988421281909073559022823714907322022949740', + '1', + ], + [ + '14972823269037486254426675789838281969600233601146878338426750917118827098797', + '21537420020712828411563296407419386154965427019884168037976626126490746645077', + '1', + ], + [ + '2063287957767613614777119193128926653736792870650201228203625379887076141208', + '13212471815376019698069215817312330186798316729813817526333851264239660950197', + '1', + ], + [ + '20536565786541586969646642633960974451880492404989223356621068699932404327318', + '13071367456642172515226660350994301188116476281115659678517407664568467702444', + '1', + ], + [ + '19913052419831068998835048891138167938281690827004896853248566703714018745355', + '7941601730636652343376086930749003244181272164408049215176697926441340510958', + '1', + ], + [ + '11867170394661342214971583628835868081284865332541939667358243896459602916125', + '13164482197297811703503789257439869071580596834712429041471186792521886558829', + '1', + ], + [ + '17536700805860549536860365499251853253808234837176049226960547436738139781973', + '4115980183235127174597504094286576034421979060816234229032292762366491301746', + '1', + ], + [ + '11730427048266956286596202476815916269521669634437583137444577805811668774199', + '15655874813738268880726963383274759993932630801889414080417250681126921643864', + '1', + ], + [ + '9684531091938328963248904992051016114569587947312968610997436858004274424392', + '11899688783622450643537200360334227937009534603430003080602216475608578513014', + '1', + ], + [ + '20888270292060972984175173897916832399341441104588236660019611715550961560084', + '9917263247022111537342344095098737156161112562584316474089146808789707910374', + '1', + ], + [ + '10012841711013956437820310746258100625231206536474040689144336250126259295166', + '2891779059150522242226026096717529130775301815754737787663716040479445595942', + '1', + ], + [ + '16101840956379907487253524029990523403812145436287112335742047128237640762880', + '21596987167322942681082043756117172804863301532152817243745105834154973415671', + '1', + ], + [ + '488883299641265759065503505957045028995801862365643590113160420312154837296', + '20087655493541415023064583932049629153828633399366237844942715915129904745388', + '1', + ], + [ + '15556007886683782559611834933629971321627119168793907786722936237685580042714', + '15982704409171749959326800580478021839994235118869340454616680643446620199531', + '1', + ], + [ + '5824685482528422388847806241308525259935422195020827771495438678028713290316', + '15778671744765498996172075748991256956441554402935347988026616847344334331430', + '1', + ], + [ + '13844554822928963691545249815250319430134973155091768222859682013216721427090', + '7765418662682270580343654395613267499883813882550176391171373860772041738039', + '1', + ], + [ + '8975298818514689639275556480863751283693369061891032350260412970115990361799', + '6713654246766902343542121059881220638727548009206669408939119756815197941197', + '1', + ], + [ + '20772207596945854665610764630339774095770427359897580857351509570449915518354', + '18060813253074351612863185239515073788640955819059193947752811921787973866071', + '1', + ], + [ + '12721298926881703616549341221953779952280731881785943986229212191761047706876', + '9654126763310980599559771151407995841744408482384899725153522637267111789908', + '1', + ], + [ + '10281505162167242631863837668822365560321075800121428017398660947525796012247', + '19742810131853517209026597954127332705967077061397035316468594504734934156669', + '1', + ], + [ + '2790203542474636222909744629574703406415835050131159785478963449771115547487', + '13503791643087384497289525380869655224270358549711357213989698271665150683517', + '1', + ], + [ + '7266320605766360658863369449783895114375770203839206651752255984259974875783', + '18792831428919040931415002539509589237275602826583411973405578582729946741211', + '1', + ], + [ + '7017732098046496428791313674310029982856588030250138480194227421372578082678', + '10720717337752573070989413312300072953488673378011593167645680093360676929301', + '1', + ], + [ + '18433064354263278302702549543685802780637161984658722162748573019197712809469', + '11864354991095800159169445698990773817112061540373067319950389665206097853987', + '1', + ], + [ + '15183791738077620139154733009571662951380669650757309439268212959074422686785', + '16152723210078712742649384942298020467861391067877577987398706927866946356819', + '1', + ], + [ + '17423271481272591506759626771117932129691718044765211048797130996097638910612', + '524700851549492436763885774812798221904635378937948712358551177250255042701', + '1', + ], + [ + '7593851864353138376200343716262571127114664428565461011056627885492587002121', + '20500020979169901354482955527569590715425202113623762789333105435960376848057', + '1', + ], + [ + '83786998556372299163714104555677520772119046767936787824441266107962352991', + '17421237191599268811661023472710774978498874584519503077279637065853953488073', + '1', + ], + [ + '9362608069206761046379851147994681905097304717463457246955814155000492256191', + '3627360384360667548851933559764368800227121291178285885361455188075810786546', + '1', + ], + [ + '8819031445522472909620501892411554803677042632494405101224427223872844854605', + '18432154239195618388438361886057096815142137516113072190736197629507263163133', + '1', + ], + [ + '11684730996557719639228166586902465178921513409616845578966699363880326053927', + '5200541234845119754672376662633295428308294998919784980107899324803064484059', + '1', + ], + [ + '16239764865646144858566508722183670822636746900175825618525245038880996431364', + '3294272523732974541839815241691222752664648637882375377265675976801749706828', + '1', + ], + [ + '13421464983592116369497573046922779529379749032594505266438212379790622113135', + '13009421074386461138024838267286212383363763962382008090149612332906373480249', + '1', + ], + [ + '18418296918022448499847139623196262879055232979179444401569960071619211370460', + '9008165842253068174575829595692777585660773548541736281138964646159610715513', + '1', + ], + [ + '10539735986395913475380413781582900599136763688385155186686618408478239317280', + '15065601395524861652478937611616888680411771284711388756995587204486015961572', + '1', + ], + [ + '5115456754996797965310819574278767590040061142774152333129732494295456780541', + '2717350050998719325383860678032662848079496253274701211867243642101515627648', + '1', + ], + [ + '20796594142936456540510530510733310767569407381489580009331815251968545923015', + '21104460163035531327894979477005390871083953612854865271129575020173322427328', + '1', + ], + [ + '15112294380366223694683622343951615064442932471757274273307529815756981268725', + '10954081237645592775429495788584457345670269738719736043268123801268866391709', + '1', + ], + [ + '12754379775941440111631564767722764339493750298189352415057645087473590698323', + '6601959955634286568467394724192035617802512363385039913534298709593216232832', + '1', + ], + [ + '2470849017596378568311152812838112239915447213707993985657346099087778430265', + '1989561916109327435010245222093357490531227448039028704166627110391396259673', + '1', + ], + [ + '16716106680766192778853005118037844783866051094887275137098218074246359791677', + '11807831931956128925075383006428337936664125301016038303372791278837098426017', + '1', + ], + [ + '8550082076462226836742063977633685509511418017014605099507534008600933077185', + '14883227508872352615148218008971841247345220235899101202874289680689823856892', + '1', + ], + [ + '12679116761027578261397549681719288799706355622598283928428970766283017802464', + '9577596670116035499462507835913287851293822779107504659453661876250090155325', + '1', + ], + [ + '18637336970630137392973330391693369647738269890330238395518086486815331782804', + '16778009380868199615539494214289392289670907040195923389885914513050735700189', + '1', + ], + [ + '18314200326876827454424185119190671728555221608035721184878014020757639493617', + '19667503473327602670039694444622480074529335043447160709494658980106518604277', + '1', + ], + [ + '5842315331832280274602596157332741375750824624998581572644393012683127237954', + '10383025734241683614166414513675818031466160880422172753926032218114989666727', + '1', + ], + [ + '11643981332154063784738988048006402771610650098308621702803568719135884820937', + '16359311834622570286296459752053180926119112891788041579492663080487283745697', + '1', + ], + [ + '7945708616433272950400334429794943050325707045613778907419580321281979554685', + '14602472921132592639826074694579778566728483452863145658953401934361760735319', + '1', + ], + [ + '7907629211601996961144253684191745578182636290498217944661977091252237405491', + '3499587633231901688979260807790274520496071175534350974092759793655102798661', + '1', + ], + [ + '7173482218132001150139710137551612083164341535206281739851470977580478545164', + '9485783708687622920028587963646343394786290039300067659965912927649128004241', + '1', + ], + [ + '7596200094751521911408890162990750081040643132984665450215929505041092067609', + '12736788571052872395742812276655128579349696759595363975896729112302059877633', + '1', + ], + [ + '6441415709959970518846922607717665696047911970593962613011097347911280790880', + '4450627143586143165869556880554922281321714995945209863152134905837015473660', + '1', + ], + [ + '9130862259973916885264552839752513787430691815741157503937448077120360222063', + '14681734400271477972980607003537838579012713294260648286652515106448162565286', + '1', + ], + [ + '17586871041274039603959971723023339634524127933111101729266904818074827551938', + '9090912626426221471057353303403640009443461302599153625210127631403087751430', + '1', + ], + [ + '8846844215811130506365410901032757931749852785543162777839620505637047845120', + '18317870365590163661462336541383046684427707741446998104873934935812780924806', + '1', + ], + [ + '14384331131884003578878578283344655617340542737004615801666725431495889043781', + '15713785635526707931767930100736219279285367077781490072642961311485915785329', + '1', + ], + [ + '7345887208747389080915790653858190809096101686757345579567449465053199875698', + '17478822843812474493323779165350983789068376394476201460539262603267639002262', + '1', + ], + [ + '9231617598048019755678862911824675082144906265426403213127207886799619976844', + '10053855672096899491572607330718683993773848054941477622801793282223685801366', + '1', + ], + [ + '19238607616156565915435676161907796474639042315186913885547943042158214756312', + '372613064823472667441888198695246254302603167089877804426105370400038610243', + '1', + ], + [ + '13946097475566216944193566171038229656520517332225646534400645336871153555114', + '11511965419125725154170435516123170404178915397036557173664786441816012419659', + '1', + ], + [ + '20030489768198963729148097704001818637664253598468293150482581304744212173910', + '11075171995143416961721441876750869773961545438891024814088668325457382614554', + '1', + ], + [ + '19655320113744255555202237448069507527539005967173747574691326304712729912243', + '12738349949485806081942030179784185220082700644096996561090187913521777269004', + '1', + ], + [ + '2818139058209349009923223922706303013385881553536669678030691017271665730570', + '20519395070145858256004883762481682918101909995023733643369248746009366553120', + '1', + ], + [ + '688635894800363729361282249725485574250614045943011144906276599797270934588', + '20965797087652713827864227696139397611744466917696745599468024791310520525757', + '1', + ], + [ + '4300113535850088762312383232243969539587601482668674090051212822468168947658', + '19440319435969725396302765961093420859764741575294866226397127022585182602250', + '1', + ], + [ + '13204785939221486694514225136906361650877137390268176148573759420215921427212', + '11258284674279602654153138157273144431907268257414115853496790569190246255038', + '1', + ], + [ + '11660005591875920594984242866800715874224979964795353463765250057360100903924', + '10046644693082217346706649910978134436374995693509791450299547746947866618853', + '1', + ], + [ + '9606801401400081421874512352995316661302380021136048088543867413012116286285', + '17770742714760093605687652150306678056077115705134997465132071806851124191548', + '1', + ], + [ + '4827323974285587901890633955152504584040137571499515286125986167665835099553', + '14143074652193923571827350268794145415583826750073671557761179170652654627897', + '1', + ], + [ + '6264671816073207756525557631327008272164601574962107385060581608051137441070', + '17264967312955228038781957683360945721610336256733895849570606412868612222935', + '1', + ], + [ + '12654687248170093066566157918648232082175154361381381670764987118769431580492', + '2665948260736350243621564252830032446227814790284528349543487974815768623988', + '1', + ], + [ + '17999465349072356259895004472121184209600086962831035126345812260310530591841', + '18090347466473367917173319605855813501734892709603628439085709624903252810579', + '1', + ], + [ + '11548231132599330080650142808888368552606176695014133106132356887991332496857', + '3717149974651352799073359947110112677465329980740632598215180825422713956214', + '1', + ], + [ + '3817065550962140110888087948933633480752430942122601593021042495390157834738', + '9600577181042853888834149275736093774571777570297655411325966561185879666164', + '1', + ], + [ + '12988012816819541976271697996550466539525265205962011852098250680047708543263', + '8963102747043449617407374465590270533750824539426067590464702226430534448245', + '1', + ], + [ + '1323379603307182314785109083917455249535064599381186702678823044618323679037', + '14572820233911497641156807916068995646427636941621551253246395995681943351452', + '1', + ], + [ + '20027683248265751901188636363249532319905250956029008344589998572483197833377', + '9218745325327534114118228363545932180387010497663729609238732380517890053369', + '1', + ], + [ + '1950393605043243878986169306748609354244778294418124294945822339546714177411', + '3507164237750807877827189514541327954809023709840723266655323983165218195030', + '1', + ], + [ + '2223010612204527636011427600021329115646880765763937444377207483560181017657', + '19958393190170942336606326438303539283894367128560808267334013872532414092472', + '1', + ], + [ + '18631623512157287207973498038296363632145321454315221090785024957322020978222', + '13375048030950247373674207556167994039112047361308772735794546147961367872169', + '1', + ], + [ + '12436688255603158458601211830033535687606443916076697297208046025396696382962', + '11692419608667074521760127982953407817440064071104132085197996686493201417517', + '1', + ], + [ + '19901392123042102203522375208475152306909985806585409613049663713255397109112', + '542373546142980168524906980094451807118068323174384448692284376742144292039', + '1', + ], + [ + '512785594735983108434848732467472521191844160956858226768985209954785981969', + '21618145587063504940130005371863881684418824316762065211709109975271157597750', + '1', + ], + [ + '14509736865478338230054876176711187668512392101544341806490114471876601738475', + '21252397332036116691019640872790044668464183089820663532947635034172362806189', + '1', + ], + [ + '15857044505050375793206298113247744574140858495217101136901871370352550966786', + '12334238482109443328252424324177549211356855747332957238283069630689365648322', + '1', + ], + [ + '19161817521853780717226797561470407884011474151014251706758924821377938785441', + '11813289434531310651090038143456060104173286651438839437359338719684280194565', + '1', + ], + [ + '10705969551254372058727375314500236870732221588271351356409184364986891277334', + '5621249117846450268458504537789608880368541965637779190922067330218732247218', + '1', + ], + [ + '12230798525079800167953741184149056654903663107079651289074220819525449477362', + '20497018062715482732411682023644566547453257428622418286461815157740967329576', + '1', + ], + [ + '3231541022471032593509191248182297719724224803071556358806555492202174991876', + '20393372104295227764341849184763101674598046002751036387207507047732416537061', + '1', + ], + [ + '20085689723139597970782891980296105253640311192011599416800846050038108795563', + '8767649754135094601438699306757015243353852479307498585440667750889402261460', + '1', + ], + [ + '12788474333639504739525072978840341702976272069765131612916648203074388784608', + '21744095216933228559700750414554982958666778401583160418874566476022574083825', + '1', + ], + [ + '5164035294172124193717999443132445427605884279498048827789692125817258253229', + '12789668959100025091915542738495976833046390853750765580702627111788409385420', + '1', + ], + [ + '12154038036233168176428323561302078595652445391725548014705718037872411750235', + '1976824972900731140924007313942062379800630766605497138008614890456376069429', + '1', + ], + [ + '14661870717291269962437118435479198881102707306471161747855476580639570523162', + '3881058088499795971007015911657334695063689579619559408118253198527145048270', + '1', + ], + [ + '8636698608458475330275709443839625406050722500547507855220944254879883239352', + '18350253962752160916232278681346887576137678282870808061871320038669156338600', + '1', + ], + [ + '1657997558178919499286166013521699704622198144041529351962918678767490518872', + '20160843212040747392847170390285522372615415732929606811931422090612959190369', + '1', + ], + [ + '13335456388090714808833689941933277693245051750418791828138578610004220287993', + '7313139212920853416895857042453993876751757091261492207906134845627349412166', + '1', + ], + [ + '19167191252898132082537989775400455427762184020978745806686509941201340633983', + '6207796152571613257782117990801665887170619456174119700680615636029706405462', + '1', + ], + [ + '15494228462010589731200081993612175083223336483704930473924917885097168934295', + '20299987671281241466017572868359073686156830529891892272026531333847943413181', + '1', + ], + [ + '5176393269410210175143929944773834738055151929557457417484509007526275317714', + '236746283004806827774731912507629403969104675765403387645442821598830187735', + '1', + ], + [ + '6400564571818372515465245491387865273557515101405286837026360765626571515635', + '1116044209534600630779058844426314726322884681733819917953096343775388194816', + '1', + ], + [ + '11301389868738155838221392617404342357564895055475183545237770097010138828154', + '9975240590879038674434607269313281876651219790386991182502887262706631602580', + '1', + ], + [ + '6826159373200448676502999592838687729380949924707678499731506946405751814480', + '3023804162406137263887665232350696085948834061535097064001716802586816721978', + '1', + ], + [ + '18384542973273638400663641313153711647674830565699076498166650360819588748222', + '21674512594763389063004663238618855006554801411080519613656526797945131896949', + '1', + ], + [ + '9100644160472314363152775419055139040532394034471323264216984019544906166475', + '6972039011276209745268025970813340044541834575620109462922971244314912425246', + '1', + ], + [ + '20721001942338182119992716880924696608250184029074326562059362357685572951780', + '536180340665117201099070003814570157663180699613895765543698300243858541001', + '1', + ], + [ + '5727694941575668305932301115617744262817661480016847645713598174004151550661', + '5564441463922900284064237763610980008189714062197149361709304508399149089102', + '1', + ], + [ + '15633964784154027666456909461974332559934025810723281845844422623231819281683', + '18690348215058981691489529833049294192772691401963724433936598970902491544207', + '1', + ], + [ + '6748459282582770403034402395561537528417203675522490832927331898742295705970', + '11356637157368128892826799845602851058452134709252001217383068988543943508180', + '1', + ], + [ + '1190592815417847646993820626938824644723711958422305293434749374722785436274', + '4493795322870336972118852201379481213778468103190653565811620070094652105039', + '1', + ], + [ + '9127418844300474210598562149601191530761734474815335029394125907245006877665', + '1629158661154774967971936169626427437313306335616072136861429915390620901912', + '1', + ], + [ + '2758258136389827311962153278051955542546968666241493964588981910760987734160', + '4611177856904493088323646708672794952047402819308880685883501976591122745642', + '1', + ], + [ + '2590652819335238308051100975021630291175352774129895433646952834858744459925', + '3887288028855368683495702202361286178885487789353706290343306214659208554634', + '1', + ], + [ + '16610561799550012529144669427051055723105762585555241803399776645511723545450', + '6444106295815559212251332262894609048164624286138395993871062555377795822903', + '1', + ], + [ + '13740993833161267554217460307268643662462086132450062502210443223280585085265', + '14321121618672458796857104948892601720282242540263759600857939335092227038742', + '1', + ], + [ + '6505583572828655901812738303821713269849673349676088773081527763618294342949', + '16768135532876226169559486385060365833177267519417181281284276611398295830946', + '1', + ], + [ + '476664413337874491868069257276121530228042367742983652632641609419235705359', + '9336822490125518061388689535270572584970372680185029783919786783673256956413', + '1', + ], + [ + '8228246894220245698906365365213336427962598224779575808617579051365596006377', + '10479238584737588997829402570433179184879568704242946521681535861446711406241', + '1', + ], + [ + '16797701685703945794509717066151949113451129957357096848729464517580226043245', + '12708299157160566086831864371689852441096113017827632169602170988627350929612', + '1', + ], + [ + '1137988305618842052138940953595750343032215310649785243920373031299367102905', + '3364312355217259686402405766203375889586090851464293860518655904288431519985', + '1', + ], + [ + '11818115966785096505118447521762303908596829955754633316882013653843591170811', + '15683756153643103963801745009572573244924668585085841369640866138366222931644', + '1', + ], + [ + '17598818354990554981283848229404057363569639106337638677704881264858204434188', + '7027150448928071195522593485103373207837358899425890327502817981769932771089', + '1', + ], + [ + '12380726462268497323182280572071905818653470933086169693581138635412402392960', + '7866551693153308881658797751839083294910144340667950801330646354627397584777', + '1', + ], + [ + '4596424809290072222861314442638736692852420577924568649549483988830983638492', + '1976215969290740647000218237197768225830396673677408826372755605017873136780', + '1', + ], + [ + '8021740165399451961769767405190747185352184712446911346492296180392230608924', + '15343691923038683132420728775131792058425988315943585120470005707167245186847', + '1', + ], + [ + '15866570968260892203079161054094646982249357593668592125487974267400954795915', + '8844998620446011362967359650945194675645523648766679516274319347632231691537', + '1', + ], + [ + '9202878400489596420608337154097839357278932376246573745905099809589061430655', + '4818391136565436220467181423727784845100402434799658936524248853808573697957', + '1', + ], + [ + '16292848888296622820962597969969964885114429639805398606042535174139892774696', + '11049704968375303145333967592890984877387576725881603918802115059820217107217', + '1', + ], + [ + '16303846641075667760482339743682664234261216179894207353071599277458794939855', + '12232339544440273791830359306122677439759478752722869689789424928309937302911', + '1', + ], + [ + '3002706788107347698261724579443657105804709281410475211114932526226489745917', + '6047690395907791868044132593823188004106925681065198932179763668084186399374', + '1', + ], + [ + '11715714178199343636772801093840983887296179248114606904924001360211639892848', + '9351152496354051461231102499563303016939057547983817377782832750885003602844', + '1', + ], + [ + '18344128738079530348406203712984936440607752116525613014350055522061276711512', + '9078660428373158267298022031744779547262396302332280964411523996203892074408', + '1', + ], + [ + '10825258491103846543498085459941839956313023517321040696109352180881746684722', + '6120573832375560486193501140043254105151967843468275168388928990754590443201', + '1', + ], + [ + '15854098362814934030355346680651794035518358939886767279614132640073624004482', + '13992656535527337086954275337807712322056495965325983644653581043164966379201', + '1', + ], + [ + '11951320022527084483542321795739058551790292137411460907634118646904608420174', + '8447121152699896300799754369410732356682327230294203583760708371228587146420', + '1', + ], + [ + '12309284153336084728658148801963729786586353127631516828029744939925411193087', + '10305524165016746978431398244141012841538551616532811410777783517203890791331', + '1', + ], + [ + '13293657758208833593590311060033833900799820552006061635922675914338942741080', + '14815580918705163714958718798762237060719271579482851038417292124380407176674', + '1', + ], + [ + '19616298622905686684698478465589004669136861832577647754172433528236390266785', + '9663543022556283336376591383943949330868653799908319283281056261797230679697', + '1', + ], + [ + '21702880559143724031056354993150875520041268232564462410199256751442364287117', + '7006558009439512828020794611652657311573754369773273768378625357810714967540', + '1', + ], + [ + '2680232633888379421055246984587900420019757959129588636954319270824830858067', + '11424721403844005072658554543090523983635080525204898087461214680416075233645', + '1', + ], + [ + '3177192476164550743997919115056412146418410685664867137466771755347931460536', + '18067235581715749396207196750563408978416013687748129462327335105590114689834', + '1', + ], + [ + '13476719715376840594991724406564548242591805002746507556806387043999621461951', + '10082341591097738874640760796515225913340676724360174098112593207312475056159', + '1', + ], + [ + '9964155802502644645252949421731556928628792220091848883808314351594287946295', + '20274181521972257967962245387493092268269368797949118989774590867349041623424', + '1', + ], + [ + '7240379602664053619775410852709338076284055368964895556223350799546020159372', + '13413114783285943263445251753532231949567521062848393550062916284070930587760', + '1', + ], + [ + '229519763810882144873475402636021908012395555177115671411169288618469517645', + '7256243989404317478054588068153988632981623075865338570618435853394011563859', + '1', + ], + [ + '7244710929343193775206723314132069879733852602465166984716172376009176305765', + '976620848842767147740618872627086098106796754533979514971640263207120354278', + '1', + ], + [ + '13879307174479770318910429647387704127648353628915758166883344939115251290925', + '13204020326385160024199689782224497414914823114541386299790457007003315374713', + '1', + ], + [ + '18490086857365169983411588783885982703551578001275878700243567861732482525565', + '4829783709527611439559363281031474825952756101285431610442073735656726468424', + '1', + ], + [ + '20821125566372326593012941303135843583700597357084278616889512869623687383671', + '8150285852614829477761968456954117856194859167052859260365814034210916827946', + '1', + ], + [ + '2552815275101484269685054657882048888236018624537501789408417696965937869110', + '17234601701186056018097269982476331063178215904481275810067842454473065322455', + '1', + ], + [ + '18400542645075558262510740265436140183216122095033031820274539189872331901481', + '5897119691547574860446647238916416231744913588688501086851285041862341321562', + '1', + ], + [ + '5854881563533809707776925974772590328150167753392958714512934379396355753393', + '21441672261490204956908371803027027110093016297562502075894858708508424267880', + '1', + ], + [ + '16322021682165311779207540091747401400988775590809441145837842561396999544446', + '401743956607022882266006866541190668272326635682627083736231868225144765979', + '1', + ], + [ + '13577255606910002330489540984006058017149718639546439354435563019474161209181', + '18346633383122323213932168681219559287600196149353327876238895092099277159222', + '1', + ], + [ + '15562235880168116018146030635932758988680711078179233046841532669058741203483', + '8127697254864600257312612493672115913026976008699199107525926370013351305526', + '1', + ], + [ + '4385376449666818147892762660637056188082485307320322000140285812332844754595', + '9069779788245995673952227290726559197019628496510214599101633112599653058662', + '1', + ], + [ + '14511156649811252217471011320119602992990585905090569769030221303222647570565', + '21178458828374520347815812464506873252495050279045960040890256369078310510480', + '1', + ], + [ + '9328541518764696596713597053071303895962760046332916486321960540514656026179', + '20302881033858630995358919101965042494467917793983044676130764432094180729898', + '1', + ], + [ + '17740361360082315273731959383696493920399003719195386045990048893380874676908', + '16159308661001611930717290032567682134170116178013628243140033936536660220683', + '1', + ], + [ + '6862643441989389980071346111817936361220614596733396852350992792434964165313', + '16520777515302301811673634451950089473707888135175094126311029541629032585656', + '1', + ], + [ + '17628407411626845428420642716104557589927134661323670267837725280714887237169', + '19247629888432138567426910970814714063464199492325398742317140877508400649883', + '1', + ], + [ + '5674205813133570003992514206414603435112491122464021042785601366592920458354', + '1088430645484911078956402733470714332263250059678530915122996959030644588163', + '1', + ], + [ + '18736984070552552341087384572174784862199839146344830525972703701769179975322', + '2446245940680517103831328395506987110400093538799341995031056623590147722868', + '1', + ], + [ + '20758685109377900172239704533726542358121076669094993102197074766643751992675', + '1979534573575570105455550858295446260990398265042100093966022253661231938704', + '1', + ], + [ + '13900319346223655865193236522692205816077154074901207572973805364042504589174', + '13096281884010303067554567819619184999610757826620707021904805194032705095626', + '1', + ], + [ + '17020614567134883118584882016569507127141045162751509527148460365138814948977', + '13688834204193345924012422451651965402209337052589959455649795619558542690461', + '1', + ], + [ + '14576338113769919116114723864020812061075879214430322725913526509760183016228', + '5620207026117378392229967740282872788564429237831618497032771469512954535001', + '1', + ], + [ + '17936737943532837345066594452587364242978929678605291098094442513660979233674', + '1246488667718050733311261923954964919541023297049140059568286751078573167197', + '1', + ], + [ + '10153289088882867841587863022643373254120171883744690248311572699764989149054', + '11027962461086154390331530732659058282367044751187234695107103434880556204564', + '1', + ], + [ + '21134219975200032953193412048819029619350965740776970025272459700867205176209', + '19204053386089776786791811944493602029666172925663742184431838062257918754785', + '1', + ], + ], +}; diff --git a/BE/verifier/src/dto/proof.dto.ts b/BE/verifier/src/dto/proof.dto.ts index 8dc7b1d..e1fef5b 100644 --- a/BE/verifier/src/dto/proof.dto.ts +++ b/BE/verifier/src/dto/proof.dto.ts @@ -3,22 +3,19 @@ import { ApiProperty } from '@nestjs/swagger'; export class ProofDto { @ApiProperty({ description: 'Service Name', - example: 'One-sided love paper boat', + example: 'kataomoi-boat', }) readonly ServiceName: string; - @ApiProperty({ description: 'Holder pub key', example: 'hpubkey' }) + @ApiProperty({ + description: 'Holder pub key', + example: 'honorable-muscle.testnet', + }) readonly HolderPubKey: string; - @ApiProperty({ description: 'Proof (by json)', example: 'proof' }) + @ApiProperty({ description: 'proof', example: '-' }) readonly proof: string; - @ApiProperty({ description: 'Issuer pub key (by json)', example: 'ipubkey' }) - readonly IssuerPubKey: string; - - // @ApiProperty({ description: 'user pk', example: 'pk' }) - // readonly pk: string; - - @ApiProperty({ description: 'VKey (by json)', example: 'vkey' }) - readonly vKey: string; + @ApiProperty({ description: 'publicSignals', example: '-' }) + readonly publicSignals: string; } diff --git a/BE/verifier/src/verifier/verifier-api.controller.ts b/BE/verifier/src/verifier/verifier-api.controller.ts index 5d318ea..4140b75 100644 --- a/BE/verifier/src/verifier/verifier-api.controller.ts +++ b/BE/verifier/src/verifier/verifier-api.controller.ts @@ -18,12 +18,11 @@ export class VerifierAPIController { summary: '생성된 Proof를 검증', }) async verifyProof(@Body() dto: ProofDto): Promise { - const { ServiceName, HolderPubKey, proof, IssuerPubKey, vKey } = dto; + const { ServiceName, HolderPubKey, proof, publicSignals } = dto; const verifyResult = await this.verifierAPIService.verifyProof( - proof, - IssuerPubKey, - vKey, + JSON.parse(publicSignals), + JSON.parse(proof), ); if (!verifyResult) return false; diff --git a/BE/verifier/src/verifier/verifier-api.service.ts b/BE/verifier/src/verifier/verifier-api.service.ts index 005d498..5c0ec10 100644 --- a/BE/verifier/src/verifier/verifier-api.service.ts +++ b/BE/verifier/src/verifier/verifier-api.service.ts @@ -1,7 +1,8 @@ import { Injectable } from '@nestjs/common'; import { NEARVerfiyResult } from '../types/types'; import { connectToNEARContract } from '../utils/utils'; -import { groth16 } from 'snarkjs'; +import { Groth16Proof, groth16 } from 'snarkjs'; +import { vkey } from 'src/common/const'; @Injectable() export class VerifierAPIService { @@ -9,18 +10,8 @@ export class VerifierAPIService { @ Use: Verifier Controller - verifyProof() @ Intend: 2차 인증 ZKP proof 검증을 wasm 파일로 수행 */ - async verifyProof( - proofJson: string, - IssuerPubKeyJson: string, - vKeyJson: string, - ): Promise { - const { proof, IssuerPubKey, vKey } = this.jsonConverter( - proofJson, - IssuerPubKeyJson, - vKeyJson, - ); - // verify success - const res = await groth16.verify(vKey, IssuerPubKey, proof); + async verifyProof(publicSignals: string[], proof: Groth16Proof) { + const res = await groth16.verify(vkey, publicSignals, proof); if (res === true) { console.log('Proof verified successfully'); @@ -56,16 +47,4 @@ export class VerifierAPIService { // return true; return response; } - - /* - @ Use: verifyProof() - @ Intend: json 파일로 변환 - */ - jsonConverter(proof: string, IssuerPubKey: string, vKey: string) { - return { - proof: JSON.parse(proof), - IssuerPubKey: JSON.parse(IssuerPubKey), - vKey: JSON.parse(vKey), - }; - } }