From 513ee7d9715a731417dfcacf217d6e141d509989 Mon Sep 17 00:00:00 2001 From: RogerTaule Date: Wed, 8 Jan 2025 10:53:50 +0000 Subject: [PATCH 1/9] Separating FRI verification in a template --- package-lock.json | 4473 ----------------- src/pil2circom/circuits.bn128/fri.circom | 90 + .../circuits.bn128/stark_verifier.circom.ejs | 97 +- src/pil2circom/circuits.gl/fri.circom | 56 + .../circuits.gl/stark_verifier.circom.ejs | 93 +- src/vadcop/templates/recursive2.circom.ejs | 2 + 6 files changed, 168 insertions(+), 4643 deletions(-) delete mode 100644 package-lock.json create mode 100644 src/pil2circom/circuits.bn128/fri.circom create mode 100644 src/pil2circom/circuits.gl/fri.circom diff --git a/package-lock.json b/package-lock.json deleted file mode 100644 index 4616139..0000000 --- a/package-lock.json +++ /dev/null @@ -1,4473 +0,0 @@ -{ - "name": "zkevm-circuits", - "version": "1.0.0", - "lockfileVersion": 3, - "requires": true, - "packages": { - "": { - "name": "zkevm-circuits", - "version": "1.0.0", - "license": "ISC", - "dependencies": { - "@0xpolygonhermez/zkevm-commonjs": "github:0xpolygonhermez/zkevm-commonjs#v6.0.0-fork.9", - "circom_runtime": "^0.1.25", - "circomlib": "^2.0.5", - "circomlibjs": "^0.1.7", - "ethers": "^6.8.1", - "json-bigint": "^1.0.0", - "pil2-compiler": "https://github.com/0xPolygonHermez/pil2-compiler.git#develop", - "pilcom": "^0.0.24", - "protobufjs": "^7.3.2", - "r1csfile": "^0.0.47" - }, - "devDependencies": { - "@iden3/bigarray": "^0.0.2", - "chai": "^4.3.6", - "chai-as-promised": "^7.1.1", - "circom_tester": "^0.0.20", - "logplease": "^1.2.15", - "mocha": "^10.0.0", - "temporary": "^1.1.0", - "tmp-promise": "^3.0.3" - } - }, - "node_modules/@0xpolygonhermez/zkevm-commonjs": { - "version": "5.0.0", - "resolved": "git+ssh://git@github.com/0xpolygonhermez/zkevm-commonjs.git#1bc8b6729bd8873eba433376cb6f2565b8c9ad41", - "license": "pending", - "dependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/tx": "^3.4.0", - "@polygon-hermez/common": "2.6.4", - "@polygon-hermez/vm": "6.0.12", - "ethereumjs-util": "^7.1.4", - "ethers": "^5.5.4", - "ffjavascript": "^0.2.55", - "lodash": "^4.17.21", - "pg": "^8.7.1" - } - }, - "node_modules/@0xpolygonhermez/zkevm-commonjs/node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "node_modules/@adraffy/ens-normalize": { - "version": "1.10.1", - "resolved": "https://registry.npmjs.org/@adraffy/ens-normalize/-/ens-normalize-1.10.1.tgz", - "integrity": "sha512-96Z2IP3mYmF1Xg2cDm8f1gWGf/HUVedQ3FMifV4kG/PQ4yEP51xDtRAEfhVNt5f/uzpNkZHwWQuUcu6D6K+Ekw==" - }, - "node_modules/@ethereumjs/block": { - "version": "3.6.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/block/-/block-3.6.3.tgz", - "integrity": "sha512-CegDeryc2DVKnDkg5COQrE0bJfw/p0v3GBk2W5/Dj5dOVfEmb50Ux0GLnSPypooLnfqjwFaorGuT9FokWB3GRg==", - "dependencies": { - "@ethereumjs/common": "^2.6.5", - "@ethereumjs/tx": "^3.5.2", - "ethereumjs-util": "^7.1.5", - "merkle-patricia-tree": "^4.2.4" - } - }, - "node_modules/@ethereumjs/blockchain": { - "version": "5.5.3", - "resolved": "https://registry.npmjs.org/@ethereumjs/blockchain/-/blockchain-5.5.3.tgz", - "integrity": "sha512-bi0wuNJ1gw4ByNCV56H0Z4Q7D+SxUbwyG12Wxzbvqc89PXLRNR20LBcSUZRKpN0+YCPo6m0XZL/JLio3B52LTw==", - "dependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/common": "^2.6.4", - "@ethereumjs/ethash": "^1.1.0", - "debug": "^4.3.3", - "ethereumjs-util": "^7.1.5", - "level-mem": "^5.0.1", - "lru-cache": "^5.1.1", - "semaphore-async-await": "^1.5.1" - } - }, - "node_modules/@ethereumjs/common": { - "version": "2.6.5", - "resolved": "https://registry.npmjs.org/@ethereumjs/common/-/common-2.6.5.tgz", - "integrity": "sha512-lRyVQOeCDaIVtgfbowla32pzeDv2Obr8oR8Put5RdUBNRGr1VGPGQNGP6elWIpgK3YdpzqTOh4GyUGOureVeeA==", - "dependencies": { - "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.5" - } - }, - "node_modules/@ethereumjs/ethash": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@ethereumjs/ethash/-/ethash-1.1.0.tgz", - "integrity": "sha512-/U7UOKW6BzpA+Vt+kISAoeDie1vAvY4Zy2KF5JJb+So7+1yKmJeJEHOGSnQIj330e9Zyl3L5Nae6VZyh2TJnAA==", - "dependencies": { - "@ethereumjs/block": "^3.5.0", - "@types/levelup": "^4.3.0", - "buffer-xor": "^2.0.1", - "ethereumjs-util": "^7.1.1", - "miller-rabin": "^4.0.0" - } - }, - "node_modules/@ethereumjs/tx": { - "version": "3.5.2", - "resolved": "https://registry.npmjs.org/@ethereumjs/tx/-/tx-3.5.2.tgz", - "integrity": "sha512-gQDNJWKrSDGu2w7w0PzVXVBNMzb7wwdDOmOqczmhNjqFxFuIbhVJDwiGEnxFNC2/b8ifcZzY7MLcluizohRzNw==", - "dependencies": { - "@ethereumjs/common": "^2.6.4", - "ethereumjs-util": "^7.1.5" - } - }, - "node_modules/@ethersproject/abi": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abi/-/abi-5.7.0.tgz", - "integrity": "sha512-351ktp42TiRcYB3H1OP8yajPeAQstMW/yCFokj/AthP9bLHzQFPlOrxOcwYEDkUAICmOHljvN4K39OMTMUa9RA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/abstract-provider": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-provider/-/abstract-provider-5.7.0.tgz", - "integrity": "sha512-R41c9UkchKCpAqStMYUpdunjo3pkEvZC3FAwZn5S5MGbXoMQOHIdHItezTETxAO5bevtMApSyEhn9+CHcDsWBw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0" - } - }, - "node_modules/@ethersproject/abstract-signer": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/abstract-signer/-/abstract-signer-5.7.0.tgz", - "integrity": "sha512-a16V8bq1/Cz+TGCkE2OPMTOUDLS3grCpdjoJCYNnVBbdYEMSgKrU0+B90s8b6H+ByYTBZN7a3g76jdIJi7UfKQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0" - } - }, - "node_modules/@ethersproject/address": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/address/-/address-5.7.0.tgz", - "integrity": "sha512-9wYhYt7aghVGo758POM5nqcOMaE168Q6aRLJZwUmiqSrAungkG74gSSeKEIR7ukixesdRZGPgVqme6vmxs1fkA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/rlp": "^5.7.0" - } - }, - "node_modules/@ethersproject/base64": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/base64/-/base64-5.7.0.tgz", - "integrity": "sha512-Dr8tcHt2mEbsZr/mwTPIQAf3Ai0Bks/7gTw9dSqk1mQvhW3XvRlmDJr/4n+wg1JmCl16NZue17CDh8xb/vZ0sQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0" - } - }, - "node_modules/@ethersproject/basex": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/basex/-/basex-5.7.0.tgz", - "integrity": "sha512-ywlh43GwZLv2Voc2gQVTKBoVQ1mti3d8HK5aMxsfu/nRDnMmNqaSJ3r3n85HBByT8OpoY96SXM1FogC533T4zw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/properties": "^5.7.0" - } - }, - "node_modules/@ethersproject/bignumber": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bignumber/-/bignumber-5.7.0.tgz", - "integrity": "sha512-n1CAdIHRWjSucQO3MC1zPSVgV/6dy/fjL9pMrPP9peL+QxEg9wOsVqwD4+818B6LUEtaXzVHQiuivzRoxPxUGw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "bn.js": "^5.2.1" - } - }, - "node_modules/@ethersproject/bytes": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/bytes/-/bytes-5.7.0.tgz", - "integrity": "sha512-nsbxwgFXWh9NyYWo+U8atvmMsSdKJprTcICAkvbBffT75qDocbuggBU0SJiVK2MuTrp0q+xvLkTnGMPK1+uA9A==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/constants": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/constants/-/constants-5.7.0.tgz", - "integrity": "sha512-DHI+y5dBNvkpYUMiRQyxRBYBefZkJfo70VUkUAsRjcPs47muV9evftfZ0PJVCXYbAiCgght0DtcF9srFQmIgWA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0" - } - }, - "node_modules/@ethersproject/contracts": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/contracts/-/contracts-5.7.0.tgz", - "integrity": "sha512-5GJbzEU3X+d33CdfPhcyS+z8MzsTrBGk/sc+G+59+tPa9yFkl6HQ9D6L0QMgNTA9q8dT0XKxxkyp883XsQvbbg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abi": "^5.7.0", - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/transactions": "^5.7.0" - } - }, - "node_modules/@ethersproject/hash": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hash/-/hash-5.7.0.tgz", - "integrity": "sha512-qX5WrQfnah1EFnO5zJv1v46a8HW0+E5xuBBDTwMFZLuVTx0tbU2kkx15NqdjxecrLGatQN9FGQKpb1FKdHCt+g==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/hdnode": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/hdnode/-/hdnode-5.7.0.tgz", - "integrity": "sha512-OmyYo9EENBPPf4ERhR7oj6uAtUAhYGqOnIS+jE5pTXvdKBS99ikzq1E7Iv0ZQZ5V36Lqx1qZLeak0Ra16qpeOg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" - } - }, - "node_modules/@ethersproject/json-wallets": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/json-wallets/-/json-wallets-5.7.0.tgz", - "integrity": "sha512-8oee5Xgu6+RKgJTkvEMl2wDgSPSAQ9MB/3JYjFV9jlKvcYHUXZC+cQp0njgmxdHkYWn8s6/IqIZYm0YWCjO/0g==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/pbkdf2": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "aes-js": "3.0.0", - "scrypt-js": "3.0.1" - } - }, - "node_modules/@ethersproject/json-wallets/node_modules/aes-js": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-3.0.0.tgz", - "integrity": "sha512-H7wUZRn8WpTq9jocdxQ2c8x2sKo9ZVmzfRE13GiNJXfp7NcKYEdvl3vspKjXox6RIG2VtaRe4JFvxG4rqp2Zuw==" - }, - "node_modules/@ethersproject/keccak256": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/keccak256/-/keccak256-5.7.0.tgz", - "integrity": "sha512-2UcPboeL/iW+pSg6vZ6ydF8tCnv3Iu/8tUmLLzWWGzxWKFFqOBQFLo6uLUv6BDrLgCDfN28RJ/wtByx+jZ4KBg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "js-sha3": "0.8.0" - } - }, - "node_modules/@ethersproject/logger": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/logger/-/logger-5.7.0.tgz", - "integrity": "sha512-0odtFdXu/XHtjQXJYA3u9G0G8btm0ND5Cu8M7i5vhEcE8/HmF4Lbdqanwyv4uQTr2tx6b7fQRmgLrsnpQlmnig==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ] - }, - "node_modules/@ethersproject/networks": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/networks/-/networks-5.7.1.tgz", - "integrity": "sha512-n/MufjFYv3yFcUyfhnXotyDlNdFb7onmkSy8aQERi2PjNcnWQ66xXxa3XlS8nCcA8aJKJjIIMNJTC7tu80GwpQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/pbkdf2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/pbkdf2/-/pbkdf2-5.7.0.tgz", - "integrity": "sha512-oR/dBRZR6GTyaofd86DehG72hY6NpAjhabkhxgr3X2FpJtJuodEl2auADWBZfhDHgVCbu3/H/Ocq2uC6dpNjjw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/sha2": "^5.7.0" - } - }, - "node_modules/@ethersproject/properties": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/properties/-/properties-5.7.0.tgz", - "integrity": "sha512-J87jy8suntrAkIZtecpxEPxY//szqr1mlBaYlQ0r4RCaiD2hjheqF9s1LVE8vVuJCXisjIP+JgtK/Do54ej4Sw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/providers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/@ethersproject/providers/-/providers-5.7.2.tgz", - "integrity": "sha512-g34EWZ1WWAVgr4aptGlVBF8mhl3VWjv+8hoAnzStu8Ah22VHBsuGzP17eb6xDVRzw895G4W7vvx60lFFur/1Rg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/base64": "^5.7.0", - "@ethersproject/basex": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/networks": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/web": "^5.7.0", - "bech32": "1.1.4", - "ws": "7.4.6" - } - }, - "node_modules/@ethersproject/providers/node_modules/ws": { - "version": "7.4.6", - "resolved": "https://registry.npmjs.org/ws/-/ws-7.4.6.tgz", - "integrity": "sha512-YmhHDO4MzaDLB+M9ym/mDA5z0naX8j7SIlT8f8z+I0VtzsRbekxEutHSme7NPS2qE8StCYQNUnfWdXta/Yu85A==", - "engines": { - "node": ">=8.3.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": "^5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/@ethersproject/random": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/random/-/random-5.7.0.tgz", - "integrity": "sha512-19WjScqRA8IIeWclFme75VMXSBvi4e6InrUNuaR4s5pTF2qNhcGdCUwdxUVGtDDqC00sDLCO93jPQoDUH4HVmQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/rlp": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/rlp/-/rlp-5.7.0.tgz", - "integrity": "sha512-rBxzX2vK8mVF7b0Tol44t5Tb8gomOHkj5guL+HhzQ1yBh/ydjGnpw6at+X6Iw0Kp3OzzzkcKp8N9r0W4kYSs9w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/sha2": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/sha2/-/sha2-5.7.0.tgz", - "integrity": "sha512-gKlH42riwb3KYp0reLsFTokByAKoJdgFCwI+CCiX/k+Jm2mbNs6oOaCjYQSlI1+XBVejwH2KrmCbMAT/GnRDQw==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/signing-key": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/signing-key/-/signing-key-5.7.0.tgz", - "integrity": "sha512-MZdy2nL3wO0u7gkB4nA/pEf8lu1TlFswPNmy8AiYkfKTdO6eXBJyUdmHO/ehm/htHw9K/qF8ujnTyUAD+Ry54Q==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "bn.js": "^5.2.1", - "elliptic": "6.5.4", - "hash.js": "1.1.7" - } - }, - "node_modules/@ethersproject/signing-key/node_modules/elliptic": { - "version": "6.5.4", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.4.tgz", - "integrity": "sha512-iLhC6ULemrljPZb+QutR5TQGB+pdW6KGD5RSegS+8sorOZT+rdQFbsQFJgvN3eRqNALqJer4oQ16YvJHlU8hzQ==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/@ethersproject/signing-key/node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/@ethersproject/solidity": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/solidity/-/solidity-5.7.0.tgz", - "integrity": "sha512-HmabMd2Dt/raavyaGukF4XxizWKhKQ24DoLtdNbBmNKUOPqwjsKQSdV9GQtj9CBEea9DlzETlVER1gYeXXBGaA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/sha2": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/strings": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/strings/-/strings-5.7.0.tgz", - "integrity": "sha512-/9nu+lj0YswRNSH0NXYqrh8775XNyEdUQAuf3f+SmOrnVewcJ5SBNAjF7lpgehKi4abvNNXyf+HX86czCdJ8Mg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/transactions": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/transactions/-/transactions-5.7.0.tgz", - "integrity": "sha512-kmcNicCp1lp8qanMTC3RIikGgoJ80ztTyvtsFvCYpSCfkjhD0jZ2LOrnbcuxuToLIUYYf+4XwD1rP+B/erDIhQ==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/rlp": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0" - } - }, - "node_modules/@ethersproject/units": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/units/-/units-5.7.0.tgz", - "integrity": "sha512-pD3xLMy3SJu9kG5xDGI7+xhTEmGXlEqXU4OfNapmfnxLVY4EMSSRp7j1k7eezutBPH7RBN/7QPnwR7hzNlEFeg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/constants": "^5.7.0", - "@ethersproject/logger": "^5.7.0" - } - }, - "node_modules/@ethersproject/wallet": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wallet/-/wallet-5.7.0.tgz", - "integrity": "sha512-MhmXlJXEJFBFVKrDLB4ZdDzxcBxQ3rLyCkhNqVu3CDYvR97E+8r01UgrI+TI99Le+aYm/in/0vp86guJuM7FCA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abstract-provider": "^5.7.0", - "@ethersproject/abstract-signer": "^5.7.0", - "@ethersproject/address": "^5.7.0", - "@ethersproject/bignumber": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/hdnode": "^5.7.0", - "@ethersproject/json-wallets": "^5.7.0", - "@ethersproject/keccak256": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/random": "^5.7.0", - "@ethersproject/signing-key": "^5.7.0", - "@ethersproject/transactions": "^5.7.0", - "@ethersproject/wordlists": "^5.7.0" - } - }, - "node_modules/@ethersproject/web": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/@ethersproject/web/-/web-5.7.1.tgz", - "integrity": "sha512-Gueu8lSvyjBWL4cYsWsjh6MtMwM0+H4HvqFPZfB6dV8ctbP9zFAO73VG1cMWae0FLPCtz0peKPpZY8/ugJJX2w==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/base64": "^5.7.0", - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "node_modules/@ethersproject/wordlists": { - "version": "5.7.0", - "resolved": "https://registry.npmjs.org/@ethersproject/wordlists/-/wordlists-5.7.0.tgz", - "integrity": "sha512-S2TFNJNfHWVHNE6cNDjbVlZ6MgE17MIxMbMg2zv3wn+3XSJGosL1m9ZVv3GXCf/2ymSsQ+hRI5IzoMJTG6aoVA==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/bytes": "^5.7.0", - "@ethersproject/hash": "^5.7.0", - "@ethersproject/logger": "^5.7.0", - "@ethersproject/properties": "^5.7.0", - "@ethersproject/strings": "^5.7.0" - } - }, - "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.11", - "resolved": "https://registry.npmjs.org/@iden3/binfileutils/-/binfileutils-0.0.11.tgz", - "integrity": "sha512-LylnJoZ0CTdgErnKY8OxohvW4K+p6UHD3sxt+3P9AmMyBQjYR4IpoqoYZZ+9aMj89cmCQ21UvdhndAx04er3NA==", - "dependencies": { - "fastfile": "0.0.20", - "ffjavascript": "^0.2.48" - } - }, - "node_modules/@isaacs/cliui": { - "version": "8.0.2", - "resolved": "https://registry.npmjs.org/@isaacs/cliui/-/cliui-8.0.2.tgz", - "integrity": "sha512-O8jcjabXaleOG9DQ0+ARXWZBTfnP4WNAqzuiJK7ll44AmxGKv/J2M4TPjxjY3znBCfvBXFzucm1twdyFybFqEA==", - "dependencies": { - "string-width": "^5.1.2", - "string-width-cjs": "npm:string-width@^4.2.0", - "strip-ansi": "^7.0.1", - "strip-ansi-cjs": "npm:strip-ansi@^6.0.1", - "wrap-ansi": "^8.1.0", - "wrap-ansi-cjs": "npm:wrap-ansi@^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-regex": { - "version": "6.1.0", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-6.1.0.tgz", - "integrity": "sha512-7HSX4QQb4CspciLpVFwyRe79O3xsIZDDLER21kERQ71oaPodF8jL725AgJMFAYbooIqolJoRLuM81SpeUkpkvA==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-regex?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/ansi-styles": { - "version": "6.2.1", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-6.2.1.tgz", - "integrity": "sha512-bN798gFfQX+viw3R7yrGWRqnrN2oRkEkUjjl4JNn4E8GxxbjtG3FbrEIIY3l8/hrwUwIeCZvi4QuOTP4MErVug==", - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/emoji-regex": { - "version": "9.2.2", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-9.2.2.tgz", - "integrity": "sha512-L18DaJsXSUk2+42pv8mLs5jJT2hqFkFE4j21wOmgbUqsZ2hL72NsUU785g9RXgo3s0ZNgVl42TiHp3ZtOv/Vyg==" - }, - "node_modules/@isaacs/cliui/node_modules/string-width": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-5.1.2.tgz", - "integrity": "sha512-HnLOCR3vjcY8beoNLtcjZ5/nxn2afmME6lhrDrebokqMap+XbeW8n9TXpPDOqdGK5qcI3oT0GKTW6wC7EMiVqA==", - "dependencies": { - "eastasianwidth": "^0.2.0", - "emoji-regex": "^9.2.2", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/@isaacs/cliui/node_modules/strip-ansi": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-7.1.0.tgz", - "integrity": "sha512-iq6eVVI64nQQTRYq2KtEg2d2uU7LElhTJwsH4YzIHZshxlgZms/wIc4VoDQTlG/IvVIrBKG06CrZnp0qv7hkcQ==", - "dependencies": { - "ansi-regex": "^6.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/strip-ansi?sponsor=1" - } - }, - "node_modules/@isaacs/cliui/node_modules/wrap-ansi": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-8.1.0.tgz", - "integrity": "sha512-si7QWI6zUMq56bESFvagtmzMdGOtoxfR+Sez11Mobfc7tm+VkUckk9bW2UeffTGVUbOksxmSw0AA2gs8g71NCQ==", - "dependencies": { - "ansi-styles": "^6.1.0", - "string-width": "^5.0.1", - "strip-ansi": "^7.0.1" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/@noble/curves": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/@noble/curves/-/curves-1.2.0.tgz", - "integrity": "sha512-oYclrNgRaM9SsBUBVbb8M6DTV7ZHRTKugureoYEncY5c65HOmRzvSiTE3y5CYaPYJA/GVkrhXEoF0M3Ya9PMnw==", - "dependencies": { - "@noble/hashes": "1.3.2" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@noble/hashes": { - "version": "1.3.2", - "resolved": "https://registry.npmjs.org/@noble/hashes/-/hashes-1.3.2.tgz", - "integrity": "sha512-MVC8EAQp7MvEcm30KWENFjgR+Mkmf+D189XJTkFIlwohU5hcBbn1ZkKq7KVTi2Hme3PMGF390DaL52beVrIihQ==", - "engines": { - "node": ">= 16" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - } - }, - "node_modules/@one-ini/wasm": { - "version": "0.1.1", - "resolved": "https://registry.npmjs.org/@one-ini/wasm/-/wasm-0.1.1.tgz", - "integrity": "sha512-XuySG1E38YScSJoMlqovLru4KTUNSjgVTIjyh7qMX6aNN5HY5Ct5LhRJdxO79JtTzKfzV/bnWpz+zquYrISsvw==" - }, - "node_modules/@pkgjs/parseargs": { - "version": "0.11.0", - "resolved": "https://registry.npmjs.org/@pkgjs/parseargs/-/parseargs-0.11.0.tgz", - "integrity": "sha512-+1VkjdD0QBLPodGrJUeqarH8VAIvQODIbwh9XpP5Syisf7YoQgsJKPNFoqqLQlu+VQ/tVSshMR6loPMn8U+dPg==", - "optional": true, - "engines": { - "node": ">=14" - } - }, - "node_modules/@polygon-hermez/common": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/@polygon-hermez/common/-/common-2.6.4.tgz", - "integrity": "sha512-ZGl/K1MaXHaDagqKCqkQgCRu9EfJ+mbK+t4GeVnDywMYGCyi7jF1u71Pyh4Rch3XFd/8rW/eVL4x4jkGwN16JQ==", - "dependencies": { - "crc-32": "^1.2.0", - "ethereumjs-util": "^7.1.4" - } - }, - "node_modules/@polygon-hermez/vm": { - "version": "6.0.12", - "resolved": "https://registry.npmjs.org/@polygon-hermez/vm/-/vm-6.0.12.tgz", - "integrity": "sha512-X882QZUmbLFRBgD+uA5I4bP+i62bmixRgXsDu9vEhy7fVOfZvH4AbzgZ9lOivylkdj7oNfJO1WC5fvugiAa6pw==", - "dependencies": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", - "@polygon-hermez/zkevm-commonjs": "github:hermeznetwork/zkevm-commonjs#v1.0.0", - "async-eventemitter": "^0.2.4", - "core-js-pure": "^3.0.1", - "debug": "^4.3.3", - "ethereumjs-util": "^7.1.4", - "ethers": "^5.6.2", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.21", - "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.3", - "rustbn.js": "~0.2.0" - } - }, - "node_modules/@polygon-hermez/vm/node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "node_modules/@polygon-hermez/zkevm-commonjs": { - "name": "@0xpolygonhermez/zkevm-commonjs", - "version": "1.0.0", - "resolved": "git+ssh://git@github.com/hermeznetwork/zkevm-commonjs.git#34f72fe9f7a4c3c45965742476a87148c9e05c0f", - "license": "pending", - "dependencies": { - "@ethereumjs/block": "^3.6.2", - "@ethereumjs/tx": "^3.4.0", - "@polygon-hermez/common": "2.6.4", - "@polygon-hermez/vm": "5.7.30", - "ethereumjs-util": "^7.1.4", - "ethers": "^5.5.4", - "ffjavascript": "^0.2.55", - "lodash": "^4.17.21", - "pg": "^8.7.1" - } - }, - "node_modules/@polygon-hermez/zkevm-commonjs/node_modules/@polygon-hermez/vm": { - "version": "5.7.30", - "resolved": "https://registry.npmjs.org/@polygon-hermez/vm/-/vm-5.7.30.tgz", - "integrity": "sha512-HxmrGuRpYsgwd4rnvYNQ4OR77OKdAbUsAD1Z6PoEvV18NHsMv6JGpMnvnSAseiCBCyqTHjnFqWynoQ1nl0Qr6g==", - "dependencies": { - "@ethereumjs/block": "^3.6.1", - "@ethereumjs/blockchain": "^5.5.1", - "@ethereumjs/common": "^2.6.2", - "@ethereumjs/tx": "^3.5.0", - "@polygon-hermez/zkevm-commonjs": "github:hermeznetwork/zkevm-commonjs#v0.5.0.1", - "async-eventemitter": "^0.2.4", - "core-js-pure": "^3.0.1", - "debug": "^4.3.3", - "ethereumjs-util": "^7.1.4", - "ethers": "^5.6.2", - "functional-red-black-tree": "^1.0.1", - "lodash": "^4.17.21", - "mcl-wasm": "^0.7.1", - "merkle-patricia-tree": "^4.2.3", - "rustbn.js": "~0.2.0" - } - }, - "node_modules/@polygon-hermez/zkevm-commonjs/node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "node_modules/@protobufjs/aspromise": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/aspromise/-/aspromise-1.1.2.tgz", - "integrity": "sha512-j+gKExEuLmKwvz3OgROXtrJ2UG2x8Ch2YZUxahh+s1F2HZ+wAceUNLkvy6zKCPVRkU++ZWQrdxsUeQXmcg4uoQ==" - }, - "node_modules/@protobufjs/base64": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/base64/-/base64-1.1.2.tgz", - "integrity": "sha512-AZkcAA5vnN/v4PDqKyMR5lx7hZttPDgClv83E//FMNhR2TMcLUhfRUBHCmSl0oi9zMgDDqRUJkSxO3wm85+XLg==" - }, - "node_modules/@protobufjs/codegen": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/@protobufjs/codegen/-/codegen-2.0.4.tgz", - "integrity": "sha512-YyFaikqM5sH0ziFZCN3xDC7zeGaB/d0IUb9CATugHWbd1FRFwWwt4ld4OYMPWu5a3Xe01mGAULCdqhMlPl29Jg==" - }, - "node_modules/@protobufjs/eventemitter": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/eventemitter/-/eventemitter-1.1.0.tgz", - "integrity": "sha512-j9ednRT81vYJ9OfVuXG6ERSTdEL1xVsNgqpkxMsbIabzSo3goCjDIveeGv5d03om39ML71RdmrGNjG5SReBP/Q==" - }, - "node_modules/@protobufjs/fetch": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/fetch/-/fetch-1.1.0.tgz", - "integrity": "sha512-lljVXpqXebpsijW71PZaCYeIcE5on1w5DlQy5WH6GLbFryLUrBD4932W/E2BSpfRJWseIL4v/KPgBFxDOIdKpQ==", - "dependencies": { - "@protobufjs/aspromise": "^1.1.1", - "@protobufjs/inquire": "^1.1.0" - } - }, - "node_modules/@protobufjs/float": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/@protobufjs/float/-/float-1.0.2.tgz", - "integrity": "sha512-Ddb+kVXlXst9d+R9PfTIxh1EdNkgoRe5tOX6t01f1lYWOvJnSPDBlG241QLzcyPdoNTsblLUdujGSE4RzrTZGQ==" - }, - "node_modules/@protobufjs/inquire": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/inquire/-/inquire-1.1.0.tgz", - "integrity": "sha512-kdSefcPdruJiFMVSbn801t4vFK7KB/5gd2fYvrxhuJYg8ILrmn9SKSX2tZdV6V+ksulWqS7aXjBcRXl3wHoD9Q==" - }, - "node_modules/@protobufjs/path": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/@protobufjs/path/-/path-1.1.2.tgz", - "integrity": "sha512-6JOcJ5Tm08dOHAbdR3GrvP+yUUfkjG5ePsHYczMFLq3ZmMkAD98cDgcT2iA1lJ9NVwFd4tH/iSSoe44YWkltEA==" - }, - "node_modules/@protobufjs/pool": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/pool/-/pool-1.1.0.tgz", - "integrity": "sha512-0kELaGSIDBKvcgS4zkjz1PeddatrjYcmMWOlAuAPwAeccUrPHdUqo/J6LiymHHEiJT5NrF1UVwxY14f+fy4WQw==" - }, - "node_modules/@protobufjs/utf8": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/@protobufjs/utf8/-/utf8-1.1.0.tgz", - "integrity": "sha512-Vvn3zZrhQZkkBE8LSuW3em98c0FwgO4nxzv6OdSxPKJIEKY2bGbHn+mhGIPerzI4twdxaP8/0+06HBpwf345Lw==" - }, - "node_modules/@types/abstract-leveldown": { - "version": "7.2.5", - "resolved": "https://registry.npmjs.org/@types/abstract-leveldown/-/abstract-leveldown-7.2.5.tgz", - "integrity": "sha512-/2B0nQF4UdupuxeKTJA2+Rj1D+uDemo6P4kMwKCpbfpnzeVaWSELTsAw4Lxn3VJD6APtRrZOCuYo+4nHUQfTfg==" - }, - "node_modules/@types/bn.js": { - "version": "5.1.6", - "resolved": "https://registry.npmjs.org/@types/bn.js/-/bn.js-5.1.6.tgz", - "integrity": "sha512-Xh8vSwUeMKeYYrj3cX4lGQgFSF/N03r+tv4AiLl1SucqV+uTQpxRcnM8AkXKHwYP9ZPXOYXRr2KPXpVlIvqh9w==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/level-errors": { - "version": "3.0.2", - "resolved": "https://registry.npmjs.org/@types/level-errors/-/level-errors-3.0.2.tgz", - "integrity": "sha512-gyZHbcQ2X5hNXf/9KS2qGEmgDe9EN2WDM3rJ5Ele467C0nA1sLhtmv1bZiPMDYfAYCfPWft0uQIaTvXbASSTRA==" - }, - "node_modules/@types/levelup": { - "version": "4.3.3", - "resolved": "https://registry.npmjs.org/@types/levelup/-/levelup-4.3.3.tgz", - "integrity": "sha512-K+OTIjJcZHVlZQN1HmU64VtrC0jC3dXWQozuEIR9zVvltIk90zaGPM2AgT+fIkChpzHhFE3YnvFLCbLtzAmexA==", - "dependencies": { - "@types/abstract-leveldown": "*", - "@types/level-errors": "*", - "@types/node": "*" - } - }, - "node_modules/@types/node": { - "version": "22.7.8", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.8.tgz", - "integrity": "sha512-a922jJy31vqR5sk+kAdIENJjHblqcZ4RmERviFsER4WJcEONqxKcjNOlk0q7OUfrF5sddT+vng070cdfMlrPLg==", - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/@types/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/@types/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-uRwJqmiXmh9++aSu1VNEn3iIxWOhd8AHXNSdlaLfdAAdSTY9jYVeGWnzejM3dvrkbqE3/hyQkQQ29IFATEGlew==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/@types/secp256k1": { - "version": "4.0.6", - "resolved": "https://registry.npmjs.org/@types/secp256k1/-/secp256k1-4.0.6.tgz", - "integrity": "sha512-hHxJU6PAEUn0TP4S/ZOzuTUvJWuZ6eIKeNKb5RBpODvSl6hp1Wrw4s7ATY50rklRCScUDpHzVA/DQdSjJ3UoYQ==", - "dependencies": { - "@types/node": "*" - } - }, - "node_modules/abbrev": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/abbrev/-/abbrev-2.0.0.tgz", - "integrity": "sha512-6/mh1E2u2YgEsCHdY0Yx5oW+61gZU+1vXaoiHHrpKeuRNNgFvS+/jrwHiQhB5apAf5oB7UB7E19ol2R2LKH8hQ==", - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/abstract-leveldown": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.3.0.tgz", - "integrity": "sha512-TU5nlYgta8YrBMNpc9FwQzRbiXsj49gsALsXadbGHt9CROPzX5fB0rWDR5mtdpOOKa5XqRFpbj1QroPAoPzVjQ==", - "dependencies": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/aes-js": { - "version": "4.0.0-beta.5", - "resolved": "https://registry.npmjs.org/aes-js/-/aes-js-4.0.0-beta.5.tgz", - "integrity": "sha512-G965FqalsNyrPqgEGON7nIx1e/OVENSgiEIzyC63haUMuvNnwIgIjMs52hlTCKhkBny7A2ORNlfY9Zu+jmGk1Q==" - }, - "node_modules/ansi-colors": { - "version": "4.1.3", - "resolved": "https://registry.npmjs.org/ansi-colors/-/ansi-colors-4.1.3.tgz", - "integrity": "sha512-/6w/C21Pm1A7aZitlI5Ni/2J6FFQN8i1Cvz3kHABAAbw93v/NlvKdVOqz7CCWz/3iv/JplRSEEZ83XION15ovw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/ansi-regex": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/ansi-regex/-/ansi-regex-5.0.1.tgz", - "integrity": "sha512-quJQXlTSUGL2LH9SUXo8VwsY4soanhgo6LNSm84E1LBcE8s3O0wpdiRzyR9z/ZZJMlMWv37qOOb9pdJlMUEKFQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/ansi-styles": { - "version": "4.3.0", - "resolved": "https://registry.npmjs.org/ansi-styles/-/ansi-styles-4.3.0.tgz", - "integrity": "sha512-zbB9rCJAT1rbjiVDb2hqKFHNYLxgtk8NURxZ3IZwD3F6NtxbXZQCnnSi1Lkx+IDohdPlFp222wVALIheZJQSEg==", - "dependencies": { - "color-convert": "^2.0.1" - }, - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/chalk/ansi-styles?sponsor=1" - } - }, - "node_modules/anymatch": { - "version": "3.1.3", - "resolved": "https://registry.npmjs.org/anymatch/-/anymatch-3.1.3.tgz", - "integrity": "sha512-KMReFUr0B4t+D+OBkjR3KYqvocp2XaSzO55UcB6mgQMd3KbcE+mWTyvVV7D/zsdEbNnV6acZUutkiHQXvTr1Rw==", - "dependencies": { - "normalize-path": "^3.0.0", - "picomatch": "^2.0.4" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/argparse": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/argparse/-/argparse-2.0.1.tgz", - "integrity": "sha512-8+9WqebbFzpX9OR+Wa6O29asIogeRMzcGtAINdpMHHyAg10f05aSFVBbcEqGf/PXw1EjAZ+q2/bEBg3DvurK3Q==" - }, - "node_modules/assertion-error": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/assertion-error/-/assertion-error-1.1.0.tgz", - "integrity": "sha512-jgsaNduz+ndvGyFt3uSuWqvy4lCnIJiovtouQN5JZHOKCS2QuhEdbcQHFhVksz2N2U9hXJo8odG7ETyWlEeuDw==", - "engines": { - "node": "*" - } - }, - "node_modules/async": { - "version": "2.6.4", - "resolved": "https://registry.npmjs.org/async/-/async-2.6.4.tgz", - "integrity": "sha512-mzo5dfJYwAn29PeiJ0zvwTo04zj8HDJj0Mn8TD7sno7q12prdbnasKJHhkm2c1LgrhlJ0teaea8860oxi51mGA==", - "dependencies": { - "lodash": "^4.17.14" - } - }, - "node_modules/async-eventemitter": { - "version": "0.2.4", - "resolved": "https://registry.npmjs.org/async-eventemitter/-/async-eventemitter-0.2.4.tgz", - "integrity": "sha512-pd20BwL7Yt1zwDFy+8MX8F1+WCT8aQeKj0kQnTrH9WaeRETlRamVhD0JtRPmrV4GfOJ2F9CvdQkZeZhnh2TuHw==", - "dependencies": { - "async": "^2.4.0" - } - }, - "node_modules/available-typed-arrays": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/available-typed-arrays/-/available-typed-arrays-1.0.7.tgz", - "integrity": "sha512-wvUjBtSGN7+7SjNpq/9M2Tg350UZD3q62IFZLbRAR1bSMlCo1ZaeW+BJ+D090e4hIIZLBcTDWe4Mh4jvUDajzQ==", - "dev": true, - "dependencies": { - "possible-typed-array-names": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/b4a": { - "version": "1.6.7", - "resolved": "https://registry.npmjs.org/b4a/-/b4a-1.6.7.tgz", - "integrity": "sha512-OnAYlL5b7LEkALw87fUVafQw5rVR9RjwGd4KUwNQ6DrrNmaVaUCgLipfVlzrPQ4tWOR9P0IXGNOx50jYCCdSJg==" - }, - "node_modules/balanced-match": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/balanced-match/-/balanced-match-1.0.2.tgz", - "integrity": "sha512-3oSeUO0TMV67hN1AmbXsK4yaqU7tjiHlbxRDZOpH0KW9+CeX4bRAaX0Anxt0tx2MrpRpWwQaPwIlISEJhYU5Pw==" - }, - "node_modules/base-x": { - "version": "3.0.10", - "resolved": "https://registry.npmjs.org/base-x/-/base-x-3.0.10.tgz", - "integrity": "sha512-7d0s06rR9rYaIWHkpfLIFICM/tkSVdoPC9qYAQRpxn9DdKNWNsKC0uk++akckyLq16Tx2WIinnZ6WRriAt6njQ==", - "dependencies": { - "safe-buffer": "^5.0.1" - } - }, - "node_modules/base64-js": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/base64-js/-/base64-js-1.5.1.tgz", - "integrity": "sha512-AKpaYlHn8t4SVbOHCy+b5+KKgvR4vrsD8vbvrbiQJps7fKDTkjkDry6ji0rUJjC0kzbNePLwzxq8iypo41qeWA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/bech32": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/bech32/-/bech32-1.1.4.tgz", - "integrity": "sha512-s0IrSOzLlbvX7yp4WBfPITzpAU8sqQcpsmwXDiKwrG4r491vwCO/XpejasRNl0piBMe/DvP4Tz0mIS/X1DPJBQ==" - }, - "node_modules/bfj": { - "version": "7.1.0", - "resolved": "https://registry.npmjs.org/bfj/-/bfj-7.1.0.tgz", - "integrity": "sha512-I6MMLkn+anzNdCUp9hMRyui1HaNEUCco50lxbvNS4+EyXg8lN3nJ48PjPWtbH8UVS9CuMoaKE9U2V3l29DaRQw==", - "dev": true, - "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/bignumber.js": { - "version": "9.1.2", - "resolved": "https://registry.npmjs.org/bignumber.js/-/bignumber.js-9.1.2.tgz", - "integrity": "sha512-2/mKyZH9K85bzOEfhXDBFZTGd1CTs+5IHpeFQo9luiBG7hghdC851Pj2WAhb6E3R6b9tZj/XKhbg4fum+Kepug==", - "engines": { - "node": "*" - } - }, - "node_modules/binary-extensions": { - "version": "2.3.0", - "resolved": "https://registry.npmjs.org/binary-extensions/-/binary-extensions-2.3.0.tgz", - "integrity": "sha512-Ceh+7ox5qe7LJuLHoY0feh3pHuUDHAcRUeyL2VYghZwfpkNIy/+8Ocg0a3UuSoYzavmylwuLWQOf3hl0jjMMIw==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/blake-hash": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/blake-hash/-/blake-hash-2.0.0.tgz", - "integrity": "sha512-Igj8YowDu1PRkRsxZA7NVkdFNxH5rKv5cpLxQ0CVXSIA77pVYwCPRQJ2sMew/oneUpfuYRyjG6r8SmmmnbZb1w==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^3.0.0", - "node-gyp-build": "^4.2.2", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">= 10" - } - }, - "node_modules/blake2b": { - "version": "2.1.4", - "resolved": "https://registry.npmjs.org/blake2b/-/blake2b-2.1.4.tgz", - "integrity": "sha512-AyBuuJNI64gIvwx13qiICz6H6hpmjvYS5DGkG6jbXMOT8Z3WUJ3V1X0FlhIoT1b/5JtHE3ki+xjtMvu1nn+t9A==", - "dependencies": { - "blake2b-wasm": "^2.4.0", - "nanoassert": "^2.0.0" - } - }, - "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/blakejs": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/blakejs/-/blakejs-1.2.1.tgz", - "integrity": "sha512-QXUSXI3QVc/gJME0dBpXrag1kbzOqCjCX8/b54ntNyW6sjtoqxqRk3LTmXzaJoh71zMsDCjM+47jS7XiwN/+fQ==" - }, - "node_modules/bluebird": { - "version": "3.7.2", - "resolved": "https://registry.npmjs.org/bluebird/-/bluebird-3.7.2.tgz", - "integrity": "sha512-XpNj6GDQzdfW+r2Wnn7xiSAd7TM3jzkxGXBGTtWKuSXv1xUV+azxAm8jdWZN06QTQk+2N2XB9jRDkvbmQmcRtg==", - "dev": true - }, - "node_modules/bn.js": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-5.2.1.tgz", - "integrity": "sha512-eXRvHzWyYPBuB4NBy0cmYQjGitUrtqwbvlzP3G6VFnNRbsZQIxQ10PbKKHt8gZ/HW/D/747aDl+QkDqg3KQLMQ==" - }, - "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/braces": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/braces/-/braces-3.0.3.tgz", - "integrity": "sha512-yQbXgO/OSZVD2IsiLlro+7Hf6Q18EJrKSEsdoMzKePKXct3gvD8oLcOQdIzGupr5Fj+EDe8gO/lxc1BzfMpxvA==", - "dependencies": { - "fill-range": "^7.1.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/brorand": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/brorand/-/brorand-1.1.0.tgz", - "integrity": "sha512-cKV8tMCEpQs4hK/ik71d6LrPOnpkpGBR0wzxqr68g2m/LB2GxVYQroAjMJZRVM1Y4BCjCKc3vAamxSzOY2RP+w==" - }, - "node_modules/browser-stdout": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/browser-stdout/-/browser-stdout-1.3.1.tgz", - "integrity": "sha512-qhAVI1+Av2X7qelOfAIYwXONood6XlZE/fXaBSmW/T5SzLAmCgzi+eiWE7fUvbHaeNBQH13UftjpXxsfLkMpgw==" - }, - "node_modules/browserify-aes": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/browserify-aes/-/browserify-aes-1.2.0.tgz", - "integrity": "sha512-+7CHXqGuspUn/Sl5aO7Ea0xWGAtETPXNSAjHo48JfLdPWcMng33Xe4znFvQweqc/uzk5zSOI3H52CYnjCfb5hA==", - "dependencies": { - "buffer-xor": "^1.0.3", - "cipher-base": "^1.0.0", - "create-hash": "^1.1.0", - "evp_bytestokey": "^1.0.3", - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/browserify-aes/node_modules/buffer-xor": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-1.0.3.tgz", - "integrity": "sha512-571s0T7nZWK6vB67HI5dyUF7wXiNcfaPPPTl6zYCNApANjIvYJTg7hlud/+cJpdAhS7dVzqMLmfhfHR3rAcOjQ==" - }, - "node_modules/bs58": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/bs58/-/bs58-4.0.1.tgz", - "integrity": "sha512-Ok3Wdf5vOIlBrgCvTq96gBkJw+JUEzdBgyaza5HLtPm7yTHkjRy8+JzNyHF7BHa0bNWOQIp3m5YF0nnFcOIKLw==", - "dependencies": { - "base-x": "^3.0.2" - } - }, - "node_modules/bs58check": { - "version": "2.1.2", - "resolved": "https://registry.npmjs.org/bs58check/-/bs58check-2.1.2.tgz", - "integrity": "sha512-0TS1jicxdU09dwJMNZtVAfzPi6Q6QeN0pM1Fkzrjn+XYHvzMKPU3pHVpva+769iNVSfIYWf7LJ6WR+BuuMf8cA==", - "dependencies": { - "bs58": "^4.0.0", - "create-hash": "^1.1.0", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/buffer": { - "version": "5.7.1", - "resolved": "https://registry.npmjs.org/buffer/-/buffer-5.7.1.tgz", - "integrity": "sha512-EHcyIPBQ4BSGlvjB16k5KgAJ27CIsHY/2JBmCRReo48y9rQ3MaUzWX3KVlBa4U7MyX02HdVj0K7C3WaB3ju7FQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ], - "dependencies": { - "base64-js": "^1.3.1", - "ieee754": "^1.1.13" - } - }, - "node_modules/buffer-xor": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/buffer-xor/-/buffer-xor-2.0.2.tgz", - "integrity": "sha512-eHslX0bin3GB+Lx2p7lEYRShRewuNZL3fUl4qlVJGGiwoPGftmt8JQgk2Y9Ji5/01TnVDo33E5b5O3vUB1HdqQ==", - "dependencies": { - "safe-buffer": "^5.1.1" - } - }, - "node_modules/call-bind": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/call-bind/-/call-bind-1.0.7.tgz", - "integrity": "sha512-GHTSNSYICQ7scH7sZ+M2rFopRoLh8t2bLSW6BbgrtLsahOIB5iyAVJf9GjWK3cYTDaMj4XdBpM1cA6pIS0Kv2w==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "set-function-length": "^1.2.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/camelcase": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/camelcase/-/camelcase-6.3.0.tgz", - "integrity": "sha512-Gmy6FhYlCY7uOElZUSbxo2UCDH8owEk996gkbrpsgGtrJLM3J7jGxl9Ic7Qwwj4ivOE5AWZWRMecDdF7hqGjFA==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/chai": { - "version": "4.5.0", - "resolved": "https://registry.npmjs.org/chai/-/chai-4.5.0.tgz", - "integrity": "sha512-RITGBfijLkBddZvnn8jdqoTypxvqbOLYQkGGxXzeFjVHvudaPw0HNFD9x928/eUwYWd2dPCugVqspGALTZZQKw==", - "dependencies": { - "assertion-error": "^1.1.0", - "check-error": "^1.0.3", - "deep-eql": "^4.1.3", - "get-func-name": "^2.0.2", - "loupe": "^2.3.6", - "pathval": "^1.1.1", - "type-detect": "^4.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/chai-as-promised": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/chai-as-promised/-/chai-as-promised-7.1.2.tgz", - "integrity": "sha512-aBDHZxRzYnUYuIAIPBH2s511DjlKPzXNlXSGFC8CwmroWQLfrW0LtE1nK3MAwwNhJPa9raEjNCmRoFpG0Hurdw==", - "dev": true, - "dependencies": { - "check-error": "^1.0.2" - }, - "peerDependencies": { - "chai": ">= 2.1.2 < 6" - } - }, - "node_modules/chalk": { - "version": "4.1.2", - "resolved": "https://registry.npmjs.org/chalk/-/chalk-4.1.2.tgz", - "integrity": "sha512-oKnbhFyRIXpUuez8iBMmyEa4nbj4IOQyuhc/wy9kY7/WVPcwIO9VA668Pu8RkO7+0G76SLROeyw9CpQ061i4mA==", - "dependencies": { - "ansi-styles": "^4.1.0", - "supports-color": "^7.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/chalk?sponsor=1" - } - }, - "node_modules/chalk/node_modules/supports-color": { - "version": "7.2.0", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-7.2.0.tgz", - "integrity": "sha512-qpCAvRl9stuOHveKsn7HncJRvv501qIacKzQlO/+Lwxc9+0q2wLyv4Dfvt80/DPn2pqOBsJdDiogXGR9+OvwRw==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/check-error": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/check-error/-/check-error-1.0.3.tgz", - "integrity": "sha512-iKEoDYaRmd1mxM90a2OEfWhjsjPpYPuQ+lMYsoxB126+t8fw7ySEO48nmDg5COTjxDI65/Y2OWpeEHk3ZOe8zg==", - "dependencies": { - "get-func-name": "^2.0.2" - }, - "engines": { - "node": "*" - } - }, - "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==", - "dev": true - }, - "node_modules/chokidar": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/chokidar/-/chokidar-3.6.0.tgz", - "integrity": "sha512-7VT13fmjotKpGipCW9JEQAusEPE+Ei8nl6/g4FBAmIm0GOOLMua9NDDo/DWp0ZAxCr3cPq5ZpBqmPAQgDda2Pw==", - "dependencies": { - "anymatch": "~3.1.2", - "braces": "~3.0.2", - "glob-parent": "~5.1.2", - "is-binary-path": "~2.1.0", - "is-glob": "~4.0.1", - "normalize-path": "~3.0.0", - "readdirp": "~3.6.0" - }, - "engines": { - "node": ">= 8.10.0" - }, - "funding": { - "url": "https://paulmillr.com/funding/" - }, - "optionalDependencies": { - "fsevents": "~2.3.2" - } - }, - "node_modules/cipher-base": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/cipher-base/-/cipher-base-1.0.4.tgz", - "integrity": "sha512-Kkht5ye6ZGmwv40uUDZztayT2ThLQGfnj/T71N/XzeZeo3nf8foyW7zGTsPYkEya3m5f3cAypH+qe7YOrM1U2Q==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - } - }, - "node_modules/circom_runtime": { - "version": "0.1.28", - "resolved": "https://registry.npmjs.org/circom_runtime/-/circom_runtime-0.1.28.tgz", - "integrity": "sha512-ACagpQ7zBRLKDl5xRZ4KpmYIcZDUjOiNRuxvXLqhnnlLSVY1Dbvh73TI853nqoR0oEbihtWmMSjgc5f+pXf/jQ==", - "dependencies": { - "ffjavascript": "0.3.1" - }, - "bin": { - "calcwit": "calcwit.js" - } - }, - "node_modules/circom_runtime/node_modules/ffjavascript": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/ffjavascript/-/ffjavascript-0.3.1.tgz", - "integrity": "sha512-4PbK1WYodQtuF47D4pRI5KUg3Q392vuP5WjE1THSnceHdXwU3ijaoS0OqxTzLknCtz4Z2TtABzkBdBdMn3B/Aw==", - "dependencies": { - "wasmbuilder": "0.0.16", - "wasmcurves": "0.2.2", - "web-worker": "1.2.0" - } - }, - "node_modules/circom_tester": { - "version": "0.0.20", - "resolved": "https://registry.npmjs.org/circom_tester/-/circom_tester-0.0.20.tgz", - "integrity": "sha512-hhtqh3z1+/4RqhbAQxQTzekDvANFNd0M0+D8OdpxM1Ud4yQXoM+1n06AhJ7sULfCUD+LQrmnSjK5GD783KRSxg==", - "dev": true, - "dependencies": { - "chai": "^4.3.6", - "ffjavascript": "^0.2.60", - "fnv-plus": "^1.3.1", - "r1csfile": "^0.0.47", - "snarkjs": "^0.7.0", - "tmp-promise": "^3.0.3", - "util": "^0.12.5" - } - }, - "node_modules/circomlib": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/circomlib/-/circomlib-2.0.5.tgz", - "integrity": "sha512-O7NQ8OS+J4eshBuoy36z/TwQU0YHw8W3zxZcs4hVwpEll3e4hDm3mgkIPqItN8FDeLEKZFK3YeT/+k8TiLF3/A==" - }, - "node_modules/circomlibjs": { - "version": "0.1.7", - "resolved": "https://registry.npmjs.org/circomlibjs/-/circomlibjs-0.1.7.tgz", - "integrity": "sha512-GRAUoAlKAsiiTa+PA725G9RmEmJJRc8tRFxw/zKktUxlQISGznT4hH4ESvW8FNTsrGg/nNd06sGP/Wlx0LUHVg==", - "dependencies": { - "blake-hash": "^2.0.0", - "blake2b": "^2.1.3", - "ethers": "^5.5.1", - "ffjavascript": "^0.2.45" - } - }, - "node_modules/circomlibjs/node_modules/ethers": { - "version": "5.7.2", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-5.7.2.tgz", - "integrity": "sha512-wswUsmWo1aOK8rR7DIKiWSw9DbLWe6x98Jrn8wcTflTVvaXhAMaB5zGAXy0GYQEQp9iO1iSHWVyARQm11zUtyg==", - "funding": [ - { - "type": "individual", - "url": "https://gitcoin.co/grants/13/ethersjs-complete-simple-and-tiny-2" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@ethersproject/abi": "5.7.0", - "@ethersproject/abstract-provider": "5.7.0", - "@ethersproject/abstract-signer": "5.7.0", - "@ethersproject/address": "5.7.0", - "@ethersproject/base64": "5.7.0", - "@ethersproject/basex": "5.7.0", - "@ethersproject/bignumber": "5.7.0", - "@ethersproject/bytes": "5.7.0", - "@ethersproject/constants": "5.7.0", - "@ethersproject/contracts": "5.7.0", - "@ethersproject/hash": "5.7.0", - "@ethersproject/hdnode": "5.7.0", - "@ethersproject/json-wallets": "5.7.0", - "@ethersproject/keccak256": "5.7.0", - "@ethersproject/logger": "5.7.0", - "@ethersproject/networks": "5.7.1", - "@ethersproject/pbkdf2": "5.7.0", - "@ethersproject/properties": "5.7.0", - "@ethersproject/providers": "5.7.2", - "@ethersproject/random": "5.7.0", - "@ethersproject/rlp": "5.7.0", - "@ethersproject/sha2": "5.7.0", - "@ethersproject/signing-key": "5.7.0", - "@ethersproject/solidity": "5.7.0", - "@ethersproject/strings": "5.7.0", - "@ethersproject/transactions": "5.7.0", - "@ethersproject/units": "5.7.0", - "@ethersproject/wallet": "5.7.0", - "@ethersproject/web": "5.7.1", - "@ethersproject/wordlists": "5.7.0" - } - }, - "node_modules/cliui": { - "version": "7.0.4", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-7.0.4.tgz", - "integrity": "sha512-OcRE68cOsVMXp1Yvonl/fzkQOyjLSu/8bhPDfQt0e0/Eb283TKP20Fs2MqoPsr9SwA595rRCA+QMzYc9nBP+JQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.0", - "wrap-ansi": "^7.0.0" - } - }, - "node_modules/color-convert": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/color-convert/-/color-convert-2.0.1.tgz", - "integrity": "sha512-RRECPsj7iu/xb5oKYcsFHSppFNnsj/52OVTRKb4zP5onXwVF3zVmmToNcOfGC+CRDpfK/U584fMg38ZHCaElKQ==", - "dependencies": { - "color-name": "~1.1.4" - }, - "engines": { - "node": ">=7.0.0" - } - }, - "node_modules/color-name": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/color-name/-/color-name-1.1.4.tgz", - "integrity": "sha512-dOy+3AuW3a2wNbZHIuMZpTcgjGuLU/uBL/ubcZF9OXbDo8ff4O8yVp5Bf0efS8uEoYo5q4Fx7dY9OgQGXgAsQA==" - }, - "node_modules/commander": { - "version": "10.0.1", - "resolved": "https://registry.npmjs.org/commander/-/commander-10.0.1.tgz", - "integrity": "sha512-y4Mg2tXshplEbSGzx7amzPwKKOCGuoSRP/CjEdwwk0FOGlUbq6lKuoyDZTNZkmxHdJtp54hdfY/JUrdL7Xfdug==", - "engines": { - "node": ">=14" - } - }, - "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 - }, - "node_modules/config-chain": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/config-chain/-/config-chain-1.1.13.tgz", - "integrity": "sha512-qj+f8APARXHrM0hraqXYb2/bOVSV4PvJQlNZ/DVj0QrmNM2q2euizkeuVckQ57J+W0mRH6Hvi+k50M4Jul2VRQ==", - "dependencies": { - "ini": "^1.3.4", - "proto-list": "~1.2.1" - } - }, - "node_modules/core-js-pure": { - "version": "3.38.1", - "resolved": "https://registry.npmjs.org/core-js-pure/-/core-js-pure-3.38.1.tgz", - "integrity": "sha512-BY8Etc1FZqdw1glX0XNOq2FDwfrg/VGqoZOZCdaL+UmdaqDwQwYXkMJT4t6In+zfEfOJDcM9T0KdbBeJg8KKCQ==", - "hasInstallScript": true, - "funding": { - "type": "opencollective", - "url": "https://opencollective.com/core-js" - } - }, - "node_modules/crc-32": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/crc-32/-/crc-32-1.2.2.tgz", - "integrity": "sha512-ROmzCKrTnOwybPcJApAA6WBWij23HVfGVNKqqrZpuyZOHqK2CwHSvpGuyt/UNNvaIjEd8X5IFGp4Mh+Ie1IHJQ==", - "bin": { - "crc32": "bin/crc32.njs" - }, - "engines": { - "node": ">=0.8" - } - }, - "node_modules/create-hash": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/create-hash/-/create-hash-1.2.0.tgz", - "integrity": "sha512-z00bCGNHDG8mHAkP7CtT1qVu+bFQUPjYq/4Iv3C3kWjTFV10zIjfSoeqXo9Asws8gwSHDGj/hl2u4OGIjapeCg==", - "dependencies": { - "cipher-base": "^1.0.1", - "inherits": "^2.0.1", - "md5.js": "^1.3.4", - "ripemd160": "^2.0.1", - "sha.js": "^2.4.0" - } - }, - "node_modules/create-hmac": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/create-hmac/-/create-hmac-1.1.7.tgz", - "integrity": "sha512-MJG9liiZ+ogc4TzUwuvbER1JRdgvUFSB5+VR/g5h82fGaIRWMWddtKBHi7/sVhfjQZ6SehlyhvQYrcYkaUIpLg==", - "dependencies": { - "cipher-base": "^1.0.3", - "create-hash": "^1.1.0", - "inherits": "^2.0.1", - "ripemd160": "^2.0.0", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - } - }, - "node_modules/cross-spawn": { - "version": "7.0.3", - "resolved": "https://registry.npmjs.org/cross-spawn/-/cross-spawn-7.0.3.tgz", - "integrity": "sha512-iRDPJKUPVEND7dHPO8rkbOnPpyDygcDFtWjpeWNCgy8WP2rXcxXL8TskReQl6OrB2G7+UJrags1q15Fudc7G6w==", - "dependencies": { - "path-key": "^3.1.0", - "shebang-command": "^2.0.0", - "which": "^2.0.1" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/debug": { - "version": "4.3.7", - "resolved": "https://registry.npmjs.org/debug/-/debug-4.3.7.tgz", - "integrity": "sha512-Er2nc/H7RrMXZBFCEim6TCmMk02Z8vLC2Rbi1KEBggpo0fS6l0S1nnapwmIi3yW/+GOJap1Krg4w0Hg80oCqgQ==", - "dependencies": { - "ms": "^2.1.3" - }, - "engines": { - "node": ">=6.0" - }, - "peerDependenciesMeta": { - "supports-color": { - "optional": true - } - } - }, - "node_modules/decamelize": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/decamelize/-/decamelize-4.0.0.tgz", - "integrity": "sha512-9iE1PgSik9HeIIw2JO94IidnE3eBoQrFJ3w7sFuzSX4DpmZ3v5sZpUiV5Swcf6mQEF+Y0ru8Neo+p+nyh2J+hQ==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/deep-eql": { - "version": "4.1.4", - "resolved": "https://registry.npmjs.org/deep-eql/-/deep-eql-4.1.4.tgz", - "integrity": "sha512-SUwdGfqdKOwxCPeVYjwSyRpJ7Z+fhpwIAtmCUdZIWZ/YP5R9WAsyuSgpLVDi9bjWoN2LXHNss/dk3urXtdQxGg==", - "dependencies": { - "type-detect": "^4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/deep-equal-in-any-order": { - "version": "2.0.6", - "resolved": "https://registry.npmjs.org/deep-equal-in-any-order/-/deep-equal-in-any-order-2.0.6.tgz", - "integrity": "sha512-RfnWHQzph10YrUjvWwhd15Dne8ciSJcZ3U6OD7owPwiVwsdE5IFSoZGg8rlwJD11ES+9H5y8j3fCofviRHOqLQ==", - "dependencies": { - "lodash.mapvalues": "^4.6.0", - "sort-any": "^2.0.0" - } - }, - "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 - }, - "node_modules/deferred-leveldown": { - "version": "5.3.0", - "resolved": "https://registry.npmjs.org/deferred-leveldown/-/deferred-leveldown-5.3.0.tgz", - "integrity": "sha512-a59VOT+oDy7vtAbLRCZwWgxu2BaCfd5Hk7wxJd48ei7I+nsg8Orlb9CLG0PMZienk9BSUKgeAqkO2+Lw+1+Ukw==", - "dependencies": { - "abstract-leveldown": "~6.2.1", - "inherits": "^2.0.3" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/deferred-leveldown/node_modules/abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "dependencies": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/define-data-property": { - "version": "1.1.4", - "resolved": "https://registry.npmjs.org/define-data-property/-/define-data-property-1.1.4.tgz", - "integrity": "sha512-rBMvIzlpA8v6E+SJZoo++HAYqsLrkg7MSfIinMPFhmkorw7X+dOXVJQs+QT69zGkzMyfDnIMN2Wid1+NbL3T+A==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0", - "es-errors": "^1.3.0", - "gopd": "^1.0.1" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/diff": { - "version": "5.2.0", - "resolved": "https://registry.npmjs.org/diff/-/diff-5.2.0.tgz", - "integrity": "sha512-uIFDxqpRZGZ6ThOk84hEfqWoHx2devRFvpTZcTHur85vImfaxUbTW9Ryh4CpCuDnToOP1CEtXKIgytHBPVff5A==", - "engines": { - "node": ">=0.3.1" - } - }, - "node_modules/eastasianwidth": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/eastasianwidth/-/eastasianwidth-0.2.0.tgz", - "integrity": "sha512-I88TYZWc9XiYHRQ4/3c5rjjfgkjhLyW2luGIheGERbNQ6OY7yTybanSpDXZa8y7VUP9YmDcYa+eyq4ca7iLqWA==" - }, - "node_modules/editorconfig": { - "version": "1.0.4", - "resolved": "https://registry.npmjs.org/editorconfig/-/editorconfig-1.0.4.tgz", - "integrity": "sha512-L9Qe08KWTlqYMVvMcTIvMAdl1cDUubzRNYL+WfA4bLDMHe4nemKkpmYzkznE1FwLKu0EEmy6obgQKzMJrg4x9Q==", - "dependencies": { - "@one-ini/wasm": "0.1.1", - "commander": "^10.0.0", - "minimatch": "9.0.1", - "semver": "^7.5.3" - }, - "bin": { - "editorconfig": "bin/editorconfig" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/editorconfig/node_modules/minimatch": { - "version": "9.0.1", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.1.tgz", - "integrity": "sha512-0jWhJpD/MdhPXwPuiRkCbfYfSKp2qnn2eOc279qI7f+osl/l+prKSrvhg157zSYvx/1nmgn2NqdT6k2Z7zSH9w==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/ejs": { - "version": "3.1.10", - "resolved": "https://registry.npmjs.org/ejs/-/ejs-3.1.10.tgz", - "integrity": "sha512-UeJmFfOrAQS8OJWPZ4qtgHyWExa088/MtK5UEyoJGFH67cDEXkZSviOiKRCZ4Xij0zxI3JECgYs3oKx+AizQBA==", - "dev": true, - "dependencies": { - "jake": "^10.8.5" - }, - "bin": { - "ejs": "bin/cli.js" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/elliptic": { - "version": "6.5.7", - "resolved": "https://registry.npmjs.org/elliptic/-/elliptic-6.5.7.tgz", - "integrity": "sha512-ESVCtTwiA+XhY3wyh24QqRGBoP3rEdDUl3EDUUo9tft074fi19IrdpH7hLCMMP3CIj7jb3W96rn8lt/BqIlt5Q==", - "dependencies": { - "bn.js": "^4.11.9", - "brorand": "^1.1.0", - "hash.js": "^1.0.0", - "hmac-drbg": "^1.0.1", - "inherits": "^2.0.4", - "minimalistic-assert": "^1.0.1", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "node_modules/elliptic/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/emoji-regex": { - "version": "8.0.0", - "resolved": "https://registry.npmjs.org/emoji-regex/-/emoji-regex-8.0.0.tgz", - "integrity": "sha512-MSjYzcWNOA0ewAHpz0MxpYFvwg6yjy1NG3xteoqz644VCo/RPgnr1/GGt+ic3iJTzQ8Eu3TdM14SawnVUmGE6A==" - }, - "node_modules/encoding-down": { - "version": "6.3.0", - "resolved": "https://registry.npmjs.org/encoding-down/-/encoding-down-6.3.0.tgz", - "integrity": "sha512-QKrV0iKR6MZVJV08QY0wp1e7vF6QbhnbQhb07bwpEyuz4uZiZgPlEGdkCROuFkUwdxlFaiPIhjyarH1ee/3vhw==", - "dependencies": { - "abstract-leveldown": "^6.2.1", - "inherits": "^2.0.3", - "level-codec": "^9.0.0", - "level-errors": "^2.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/errno": { - "version": "0.1.8", - "resolved": "https://registry.npmjs.org/errno/-/errno-0.1.8.tgz", - "integrity": "sha512-dJ6oBr5SQ1VSd9qkk7ByRgb/1SH4JZjCHSW/mr63/QcXO9zLVxvJ6Oy13nio03rxpSnVDDjFor75SjVeZWPW/A==", - "dependencies": { - "prr": "~1.0.1" - }, - "bin": { - "errno": "cli.js" - } - }, - "node_modules/es-define-property": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/es-define-property/-/es-define-property-1.0.0.tgz", - "integrity": "sha512-jxayLKShrEqqzJ0eumQbVhTYQM27CfT1T35+gCgDFoL82JLsXqTJ76zv6A0YLOgEnLUMvLzsDsGIrl8NFpT2gQ==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.2.4" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/es-errors": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/es-errors/-/es-errors-1.3.0.tgz", - "integrity": "sha512-Zf5H2Kxt2xjTvbJvP2ZWLEICxA6j+hAmMzIlypy4xcBg1vKVnx89Wy0GbS+kf5cwCVFFzdCFh2XSCFNULS6csw==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/escalade": { - "version": "3.2.0", - "resolved": "https://registry.npmjs.org/escalade/-/escalade-3.2.0.tgz", - "integrity": "sha512-WUj2qlxaQtO4g6Pq5c29GTcWGDyd8itL8zTlipgECz3JesAiiOKotd8JU6otB3PACgG6xkJUyVhboMS+bje/jA==", - "engines": { - "node": ">=6" - } - }, - "node_modules/escape-string-regexp": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/escape-string-regexp/-/escape-string-regexp-4.0.0.tgz", - "integrity": "sha512-TtpcNJ3XAzx3Gq8sWRzJaVajRs0uVxA2YAkdb1jm2YkPz4G6egUFAyA3n5vtEIZefPk5Wa4UXbKuS5fKkJWdgA==", - "engines": { - "node": ">=10" - }, - "funding": { - "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==", - "dev": true, - "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/esprima": { - "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" - }, - "engines": { - "node": ">=4" - } - }, - "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==", - "dev": true, - "bin": { - "esparse": "bin/esparse.js", - "esvalidate": "bin/esvalidate.js" - }, - "engines": { - "node": ">=0.4.0" - } - }, - "node_modules/estraverse": { - "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" - } - }, - "node_modules/esutils": { - "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" - } - }, - "node_modules/ethereum-cryptography": { - "version": "0.1.3", - "resolved": "https://registry.npmjs.org/ethereum-cryptography/-/ethereum-cryptography-0.1.3.tgz", - "integrity": "sha512-w8/4x1SGGzc+tO97TASLja6SLd3fRIK2tLVcV2Gx4IB21hE19atll5Cq9o3d0ZmAYC/8aw0ipieTSiekAea4SQ==", - "dependencies": { - "@types/pbkdf2": "^3.0.0", - "@types/secp256k1": "^4.0.1", - "blakejs": "^1.1.0", - "browserify-aes": "^1.2.0", - "bs58check": "^2.1.2", - "create-hash": "^1.2.0", - "create-hmac": "^1.1.7", - "hash.js": "^1.1.7", - "keccak": "^3.0.0", - "pbkdf2": "^3.0.17", - "randombytes": "^2.1.0", - "safe-buffer": "^5.1.2", - "scrypt-js": "^3.0.0", - "secp256k1": "^4.0.1", - "setimmediate": "^1.0.5" - } - }, - "node_modules/ethereumjs-util": { - "version": "7.1.5", - "resolved": "https://registry.npmjs.org/ethereumjs-util/-/ethereumjs-util-7.1.5.tgz", - "integrity": "sha512-SDl5kKrQAudFBUe5OJM9Ac6WmMyYmXX/6sTmLZ3ffG2eY6ZIGBes3pEDxNN6V72WyOw4CPD5RomKdsa8DAAwLg==", - "dependencies": { - "@types/bn.js": "^5.1.0", - "bn.js": "^5.1.2", - "create-hash": "^1.1.2", - "ethereum-cryptography": "^0.1.3", - "rlp": "^2.2.4" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/ethers": { - "version": "6.13.4", - "resolved": "https://registry.npmjs.org/ethers/-/ethers-6.13.4.tgz", - "integrity": "sha512-21YtnZVg4/zKkCQPjrDj38B1r4nQvTZLopUGMLQ1ePU2zV/joCfDC3t3iKQjWRzjjjbzR+mdAIoikeBRNkdllA==", - "funding": [ - { - "type": "individual", - "url": "https://github.com/sponsors/ethers-io/" - }, - { - "type": "individual", - "url": "https://www.buymeacoffee.com/ricmoo" - } - ], - "dependencies": { - "@adraffy/ens-normalize": "1.10.1", - "@noble/curves": "1.2.0", - "@noble/hashes": "1.3.2", - "@types/node": "22.7.5", - "aes-js": "4.0.0-beta.5", - "tslib": "2.7.0", - "ws": "8.17.1" - }, - "engines": { - "node": ">=14.0.0" - } - }, - "node_modules/ethers/node_modules/@types/node": { - "version": "22.7.5", - "resolved": "https://registry.npmjs.org/@types/node/-/node-22.7.5.tgz", - "integrity": "sha512-jML7s2NAzMWc//QSJ1a3prpk78cOPchGvXJsC3C6R6PSMoooztvRVQEz89gmBTBY1SPMaqo5teB4uNHPdetShQ==", - "dependencies": { - "undici-types": "~6.19.2" - } - }, - "node_modules/evp_bytestokey": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/evp_bytestokey/-/evp_bytestokey-1.0.3.tgz", - "integrity": "sha512-/f2Go4TognH/KvCISP7OUsHn85hT9nUkxxA9BEWxFn+Oj9o8ZNLm/40hdlgSLyuOimsrTKLUMEorQexp/aPQeA==", - "dependencies": { - "md5.js": "^1.3.4", - "safe-buffer": "^5.1.1" - } - }, - "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 - }, - "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/ffjavascript": { - "version": "0.2.63", - "resolved": "https://registry.npmjs.org/ffjavascript/-/ffjavascript-0.2.63.tgz", - "integrity": "sha512-dBgdsfGks58b66JnUZeZpGxdMIDQ4QsD3VYlRJyFVrKQHb2kJy4R2gufx5oetrTxXPT+aEjg0dOvOLg1N0on4A==", - "dependencies": { - "wasmbuilder": "0.0.16", - "wasmcurves": "0.2.2", - "web-worker": "1.2.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==", - "dev": true, - "dependencies": { - "minimatch": "^5.0.1" - } - }, - "node_modules/fill-range": { - "version": "7.1.1", - "resolved": "https://registry.npmjs.org/fill-range/-/fill-range-7.1.1.tgz", - "integrity": "sha512-YsGpe3WHLK8ZYi4tWDg2Jy3ebRz2rXowDxnld4bkQB00cc/1Zw9AWnC0i9ztDJitivtQvaI9KaLyKrc+hBW0yg==", - "dependencies": { - "to-regex-range": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/find-up": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/find-up/-/find-up-5.0.0.tgz", - "integrity": "sha512-78/PXT1wlLLDgTzDs7sjq9hzz0vXD+zn+7wypEe4fXQxCmdmqfGsEPQxmiCSQI3ajFV91bVSsvNtrJRiW6nGng==", - "dependencies": { - "locate-path": "^6.0.0", - "path-exists": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/flat": { - "version": "5.0.2", - "resolved": "https://registry.npmjs.org/flat/-/flat-5.0.2.tgz", - "integrity": "sha512-b6suED+5/3rTpUBdG1gupIl8MPFCAMA0QXwmljLhvCUKcUvdE4gWky9zpuGCcXHOsz4J9wPGNWq6OKpmIzz3hQ==", - "bin": { - "flat": "cli.js" - } - }, - "node_modules/fnv-plus": { - "version": "1.3.1", - "resolved": "https://registry.npmjs.org/fnv-plus/-/fnv-plus-1.3.1.tgz", - "integrity": "sha512-Gz1EvfOneuFfk4yG458dJ3TLJ7gV19q3OM/vVvvHf7eT02Hm1DleB4edsia6ahbKgAYxO9gvyQ1ioWZR+a00Yw==", - "dev": true - }, - "node_modules/for-each": { - "version": "0.3.3", - "resolved": "https://registry.npmjs.org/for-each/-/for-each-0.3.3.tgz", - "integrity": "sha512-jqYfLp7mo9vIyQf8ykW2v7A+2N4QjeCeI5+Dz9XraiO1ign81wjiH7Fb9vSOWvQfNtmSa4H2RoQTrrXivdUZmw==", - "dev": true, - "dependencies": { - "is-callable": "^1.1.3" - } - }, - "node_modules/foreground-child": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/foreground-child/-/foreground-child-3.3.0.tgz", - "integrity": "sha512-Ld2g8rrAyMYFXBhEqMz8ZAHBi4J4uS1i/CxGMDnjyFWddMXLVcDp051DZfu+t7+ab7Wv6SMqpWmyFIj5UbfFvg==", - "dependencies": { - "cross-spawn": "^7.0.0", - "signal-exit": "^4.0.1" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/fs.realpath": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/fs.realpath/-/fs.realpath-1.0.0.tgz", - "integrity": "sha512-OO0pH2lK6a0hZnAdau5ItzHPI6pUlvI7jMVnxUQRtw4owF2wk8lOSabtGDCTP4Ggrg2MbGnWO9X8K1t4+fGMDw==" - }, - "node_modules/fsevents": { - "version": "2.3.3", - "resolved": "https://registry.npmjs.org/fsevents/-/fsevents-2.3.3.tgz", - "integrity": "sha512-5xoDfX+fL7faATnagmWPpbFtwh/R77WmMMqqHGS65C3vvB0YHrgF+B1YmZ3441tMj5n63k0212XNoJwzlhffQw==", - "hasInstallScript": true, - "optional": true, - "os": [ - "darwin" - ], - "engines": { - "node": "^8.16.0 || ^10.6.0 || >=11.0.0" - } - }, - "node_modules/function-bind": { - "version": "1.1.2", - "resolved": "https://registry.npmjs.org/function-bind/-/function-bind-1.1.2.tgz", - "integrity": "sha512-7XHNxH7qX9xG5mIwxkhumTox/MIRNcOgDrxWsMt2pAr23WHp6MrRlN7FBSFpCpr+oVO0F744iUgR82nJMfG2SA==", - "dev": true, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/functional-red-black-tree": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/functional-red-black-tree/-/functional-red-black-tree-1.0.1.tgz", - "integrity": "sha512-dsKNQNdj6xA3T+QlADDA7mOSlX0qiMINjn0cgr+eGHGsbSHzTabcIogz2+p/iqP1Xs6EP/sS2SbqH+brGTbq0g==" - }, - "node_modules/get-caller-file": { - "version": "2.0.5", - "resolved": "https://registry.npmjs.org/get-caller-file/-/get-caller-file-2.0.5.tgz", - "integrity": "sha512-DyFP3BM/3YHTQOCUL/w0OZHR0lpKeGrxotcHWcqNEdnltqFwXVfhEBQ94eIo34AfQpo0rGki4cyIiftY06h2Fg==", - "engines": { - "node": "6.* || 8.* || >= 10.*" - } - }, - "node_modules/get-func-name": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/get-func-name/-/get-func-name-2.0.2.tgz", - "integrity": "sha512-8vXOvuE167CtIc3OyItco7N/dpRtBbYOsPsXCz7X/PMnlGjYjSGuZJgM1Y7mmew7BKf9BqvLX2tnOVy1BBUsxQ==", - "engines": { - "node": "*" - } - }, - "node_modules/get-intrinsic": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/get-intrinsic/-/get-intrinsic-1.2.4.tgz", - "integrity": "sha512-5uYhsJH8VJBTv7oslg4BznJYhDoRI6waYCxMmCdnTrcCrHA/fCFKoTFz2JKKE0HdDFUF7/oQuhzumXJK7paBRQ==", - "dev": true, - "dependencies": { - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "has-proto": "^1.0.1", - "has-symbols": "^1.0.3", - "hasown": "^2.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/glob": { - "version": "8.1.0", - "resolved": "https://registry.npmjs.org/glob/-/glob-8.1.0.tgz", - "integrity": "sha512-r8hpEjiQEYlF2QU0df3dS+nxxSIreXQS1qRhMJM0Q5NDdR386C7jb7Hwwod8Fgiuex+k0GFjgft18yvxm5XoCQ==", - "deprecated": "Glob versions prior to v9 are no longer supported", - "dependencies": { - "fs.realpath": "^1.0.0", - "inflight": "^1.0.4", - "inherits": "2", - "minimatch": "^5.0.1", - "once": "^1.3.0" - }, - "engines": { - "node": ">=12" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/glob-parent": { - "version": "5.1.2", - "resolved": "https://registry.npmjs.org/glob-parent/-/glob-parent-5.1.2.tgz", - "integrity": "sha512-AOIgSQCepiJYwP3ARnGx+5VnTu2HBYdzbGP45eLw1vr3zB3vZLeyed1sC9hnbcOc9/SrMyM5RPQrkGz4aS9Zow==", - "dependencies": { - "is-glob": "^4.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/gopd": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/gopd/-/gopd-1.0.1.tgz", - "integrity": "sha512-d65bNlIadxvpb/A2abVdlqKqV563juRnZ1Wtk6s1sIR8uNsXR70xqIzVqxVf1eTqDunwT2MkczEeaezCKTZhwA==", - "dev": true, - "dependencies": { - "get-intrinsic": "^1.1.3" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-flag": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/has-flag/-/has-flag-4.0.0.tgz", - "integrity": "sha512-EykJT/Q1KjTWctppgIAgfSO0tKVuZUjhgMr17kqTumMl6Afv3EISleU7qZUzoXDFTAHTDC4NOoG/ZxU3EvlMPQ==", - "engines": { - "node": ">=8" - } - }, - "node_modules/has-property-descriptors": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-property-descriptors/-/has-property-descriptors-1.0.2.tgz", - "integrity": "sha512-55JNKuIW+vq4Ke1BjOTjM2YctQIvCT7GFzHwmfZPGo5wnrgkid0YQtnAleFSqumZm4az3n2BS+erby5ipJdgrg==", - "dev": true, - "dependencies": { - "es-define-property": "^1.0.0" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-proto": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-proto/-/has-proto-1.0.3.tgz", - "integrity": "sha512-SJ1amZAJUiZS+PhsVLf5tGydlaVB8EdFpaSO4gmiUKUOxk8qzn5AIy4ZeJUmh22znIdk/uMAUT2pl3FxzVUH+Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-symbols": { - "version": "1.0.3", - "resolved": "https://registry.npmjs.org/has-symbols/-/has-symbols-1.0.3.tgz", - "integrity": "sha512-l3LCuF6MgDNwTDKkdYGEihYjt5pRPbEg46rtlmnSPlUbgmB8LOIrKJbYYFBSbnPaJexMKtiPO8hmeRjRz2Td+A==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/has-tostringtag": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/has-tostringtag/-/has-tostringtag-1.0.2.tgz", - "integrity": "sha512-NqADB8VjPFLM2V0VvHUewwwsw0ZWBaIdgo+ieHtK3hasLz4qeCRjYcqfB6AQrBggRKppKF8L52/VqdVsO47Dlw==", - "dev": true, - "dependencies": { - "has-symbols": "^1.0.3" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/hash-base": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/hash-base/-/hash-base-3.1.0.tgz", - "integrity": "sha512-1nmYp/rhMDiE7AYkDw+lLwlAzz0AntGIe51F3RfFfEqyQ3feY2eI/NcwC6umIQVOASPMsWJLJScWKSSvzL9IVA==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.6.0", - "safe-buffer": "^5.2.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/hash.js": { - "version": "1.1.7", - "resolved": "https://registry.npmjs.org/hash.js/-/hash.js-1.1.7.tgz", - "integrity": "sha512-taOaskGt4z4SOANNseOviYDvjEJinIkRgmp7LbKP2YTTmVxWBl87s/uzK9r+44BclBSp2X7K1hqeNfz9JbBeXA==", - "dependencies": { - "inherits": "^2.0.3", - "minimalistic-assert": "^1.0.1" - } - }, - "node_modules/hasown": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/hasown/-/hasown-2.0.2.tgz", - "integrity": "sha512-0hJU9SCPvmMzIBdZFqNPXWa6dqh7WdH0cII9y+CyS8rG3nL48Bclra9HmKhVVUHyPWNH5Y7xDwAB7bfgSjkUMQ==", - "dev": true, - "dependencies": { - "function-bind": "^1.1.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/he": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/he/-/he-1.2.0.tgz", - "integrity": "sha512-F/1DnUGPopORZi0ni+CvrCgHQ5FyEAHRLSApuYWMmrbSwoN2Mn/7k+Gl38gJnR7yyDZk6WLXwiGod1JOWNDKGw==", - "bin": { - "he": "bin/he" - } - }, - "node_modules/hmac-drbg": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/hmac-drbg/-/hmac-drbg-1.0.1.tgz", - "integrity": "sha512-Tti3gMqLdZfhOQY1Mzf/AanLiqh1WTiJgEj26ZuYQ9fbkLomzGchCws4FyrSd4VkpBfiNhaE1On+lOz894jvXg==", - "dependencies": { - "hash.js": "^1.0.3", - "minimalistic-assert": "^1.0.0", - "minimalistic-crypto-utils": "^1.0.1" - } - }, - "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==", - "dev": true, - "engines": { - "node": ">= 6.0.0" - } - }, - "node_modules/ieee754": { - "version": "1.2.1", - "resolved": "https://registry.npmjs.org/ieee754/-/ieee754-1.2.1.tgz", - "integrity": "sha512-dcyqhDvX1C46lXZcVqCpK+FtMRQVdIMN6/Df5js2zouUsqG7I6sFxitIC+7KYK29KdXOLHdu9zL4sFnoVQnqaA==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/immediate": { - "version": "3.3.0", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.3.0.tgz", - "integrity": "sha512-HR7EVodfFUdQCTIeySw+WDRFJlPcLOJbXfwwZ7Oom6tjsvZ3bOkCDJHehQC3nxJrv7+f9XecwazynjU8e4Vw3Q==" - }, - "node_modules/inflight": { - "version": "1.0.6", - "resolved": "https://registry.npmjs.org/inflight/-/inflight-1.0.6.tgz", - "integrity": "sha512-k92I/b08q4wvFscXCLvqfsHCrjrF7yiXsQuIVvVE7N82W3+aqpzuUdBbfhWcy/FZR3/4IgflMgKLOsvPDrGCJA==", - "deprecated": "This module is not supported, and leaks memory. Do not use it. Check out lru-cache if you want a good and tested way to coalesce async requests by a key value, which is much more comprehensive and powerful.", - "dependencies": { - "once": "^1.3.0", - "wrappy": "1" - } - }, - "node_modules/inherits": { - "version": "2.0.4", - "resolved": "https://registry.npmjs.org/inherits/-/inherits-2.0.4.tgz", - "integrity": "sha512-k/vGaX4/Yla3WzyMCvTQOXYeIHvqOKtnqBduzTHpzpQZzAskKMhZ2K+EnBiSM9zGSoIFeMpXKxa4dYeZIQqewQ==" - }, - "node_modules/ini": { - "version": "1.3.8", - "resolved": "https://registry.npmjs.org/ini/-/ini-1.3.8.tgz", - "integrity": "sha512-JV/yugV2uzW5iMRSiZAyDtQd+nxtUnjeLt0acNdw98kKLrvuRVyB80tsREOE7yvGVgalhZ6RNXCmEHkUKBKxew==" - }, - "node_modules/is-arguments": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/is-arguments/-/is-arguments-1.1.1.tgz", - "integrity": "sha512-8Q7EARjzEnKpt/PCD7e1cgUS0a6X8u5tdSiMqXhojOdoV9TsMsiO+9VLC5vAmO8N7/GmXn7yjR8qnA6bVAEzfA==", - "dev": true, - "dependencies": { - "call-bind": "^1.0.2", - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-binary-path": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-binary-path/-/is-binary-path-2.1.0.tgz", - "integrity": "sha512-ZMERYes6pDydyuGidse7OsHxtbI7WVeUEozgR/g7rd0xUimYNlvZRE/K2MgZTjWy725IfelLeVcEM97mmtRGXw==", - "dependencies": { - "binary-extensions": "^2.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/is-callable": { - "version": "1.2.7", - "resolved": "https://registry.npmjs.org/is-callable/-/is-callable-1.2.7.tgz", - "integrity": "sha512-1BC0BVFhS/p0qtw6enp8e+8OD0UrK0oFLztSjNzhcKA3WDuJxxAPXzPuPtKkjEY9UUoEWlX/8fgKeu2S8i9JTA==", - "dev": true, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-extglob": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/is-extglob/-/is-extglob-2.1.1.tgz", - "integrity": "sha512-SbKbANkN603Vi4jEZv49LeVJMn4yGwsbzZworEoyEiutsN3nJYdbO36zfhGJ6QEDpOZIFkDtnq5JRxmvl3jsoQ==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-fullwidth-code-point": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/is-fullwidth-code-point/-/is-fullwidth-code-point-3.0.0.tgz", - "integrity": "sha512-zymm5+u+sCsSWyD9qNaejV3DFvhCKclKdizYaJUuHA83RLjb7nSuGnddCHGv0hk+KY7BMAlsWeK4Ueg6EV6XQg==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-generator-function": { - "version": "1.0.10", - "resolved": "https://registry.npmjs.org/is-generator-function/-/is-generator-function-1.0.10.tgz", - "integrity": "sha512-jsEjy9l3yiXEQ+PsXdmBwEPcOxaXWLspKdplFUVI9vq1iZgIekeC0L167qeu86czQaxed3q/Uzuw0swL0irL8A==", - "dev": true, - "dependencies": { - "has-tostringtag": "^1.0.0" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-glob": { - "version": "4.0.3", - "resolved": "https://registry.npmjs.org/is-glob/-/is-glob-4.0.3.tgz", - "integrity": "sha512-xelSayHH36ZgE7ZWhli7pW34hNbNl8Ojv5KVmkJD4hBdD3th8Tfk9vYasLM+mXWOZhFkgZfxhLSnrwRr4elSSg==", - "dependencies": { - "is-extglob": "^2.1.1" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/is-number": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/is-number/-/is-number-7.0.0.tgz", - "integrity": "sha512-41Cifkg6e8TylSpdtTpeLVMqvSBEVzTttHvERD741+pnZ8ANv0004MRL43QKPDlK9cGvNp6NZWZUBlbGXYxxng==", - "engines": { - "node": ">=0.12.0" - } - }, - "node_modules/is-plain-obj": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/is-plain-obj/-/is-plain-obj-2.1.0.tgz", - "integrity": "sha512-YWnfyRwxL/+SsrWYfOpUtz5b3YD+nyfkHvjbcanzk8zgyO4ASD67uVMRt8k5bM4lLMDnXfriRhOpemw+NfT1eA==", - "engines": { - "node": ">=8" - } - }, - "node_modules/is-typed-array": { - "version": "1.1.13", - "resolved": "https://registry.npmjs.org/is-typed-array/-/is-typed-array-1.1.13.tgz", - "integrity": "sha512-uZ25/bUAlUY5fR4OKT4rZQEBrzQWYV9ZJYGGsUmEJ6thodVJ1HX64ePQ6Z0qPWP+m+Uq6e9UugrE38jeYsDSMw==", - "dev": true, - "dependencies": { - "which-typed-array": "^1.1.14" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/is-unicode-supported": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/is-unicode-supported/-/is-unicode-supported-0.1.0.tgz", - "integrity": "sha512-knxG2q4UC3u8stRGyAVJCOdxFmv5DZiRcdlIaAQXAbSfJya+OhopNotLQrstBhququ4ZpuKbDc/8S6mgXgPFPw==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/isexe": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/isexe/-/isexe-2.0.0.tgz", - "integrity": "sha512-RHxMLp9lnKHGHRng9QFhRCMbYAcVpn69smSGcq3f36xjgVVWThj4qqLbTLlq7Ssj8B+fIQ1EuCEGI2lKsyQeIw==" - }, - "node_modules/jackspeak": { - "version": "3.4.3", - "resolved": "https://registry.npmjs.org/jackspeak/-/jackspeak-3.4.3.tgz", - "integrity": "sha512-OGlZQpz2yfahA/Rd1Y8Cd9SIEsqvXkLVoSw/cgwhnhFMDbsQFeZYoJJ7bIZBS9BcamUW96asq/npPWugM+RQBw==", - "dependencies": { - "@isaacs/cliui": "^8.0.2" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - }, - "optionalDependencies": { - "@pkgjs/parseargs": "^0.11.0" - } - }, - "node_modules/jake": { - "version": "10.9.2", - "resolved": "https://registry.npmjs.org/jake/-/jake-10.9.2.tgz", - "integrity": "sha512-2P4SQ0HrLQ+fw6llpLnOaGAvN2Zu6778SJMrCUwns4fOoG9ayrTiZk3VV8sCPkVZF8ab0zksVpS8FDY5pRCNBA==", - "dev": true, - "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/jake/node_modules/async": { - "version": "3.2.6", - "resolved": "https://registry.npmjs.org/async/-/async-3.2.6.tgz", - "integrity": "sha512-htCUDlxyyCLMgaM3xXg0C0LW2xqfuQ6p05pCEIsXuyQ+a1koYKTuBMzRNwmybfLgvJDMd0r1LTn4+E0Ti6C2AA==", - "dev": true - }, - "node_modules/jake/node_modules/brace-expansion": { - "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" - } - }, - "node_modules/jake/node_modules/minimatch": { - "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" - }, - "engines": { - "node": "*" - } - }, - "node_modules/js-beautify": { - "version": "1.15.1", - "resolved": "https://registry.npmjs.org/js-beautify/-/js-beautify-1.15.1.tgz", - "integrity": "sha512-ESjNzSlt/sWE8sciZH8kBF8BPlwXPwhR6pWKAw8bw4Bwj+iZcnKW6ONWUutJ7eObuBZQpiIb8S7OYspWrKt7rA==", - "dependencies": { - "config-chain": "^1.1.13", - "editorconfig": "^1.0.4", - "glob": "^10.3.3", - "js-cookie": "^3.0.5", - "nopt": "^7.2.0" - }, - "bin": { - "css-beautify": "js/bin/css-beautify.js", - "html-beautify": "js/bin/html-beautify.js", - "js-beautify": "js/bin/js-beautify.js" - }, - "engines": { - "node": ">=14" - } - }, - "node_modules/js-beautify/node_modules/glob": { - "version": "10.4.5", - "resolved": "https://registry.npmjs.org/glob/-/glob-10.4.5.tgz", - "integrity": "sha512-7Bv8RF0k6xjo7d4A/PxYLbUCfb6c+Vpd2/mB2yRDlew7Jb5hEXiCD9ibfO7wpk8i4sevK6DFny9h7EYbM3/sHg==", - "dependencies": { - "foreground-child": "^3.1.0", - "jackspeak": "^3.1.2", - "minimatch": "^9.0.4", - "minipass": "^7.1.2", - "package-json-from-dist": "^1.0.0", - "path-scurry": "^1.11.1" - }, - "bin": { - "glob": "dist/esm/bin.mjs" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/js-beautify/node_modules/minimatch": { - "version": "9.0.5", - "resolved": "https://registry.npmjs.org/minimatch/-/minimatch-9.0.5.tgz", - "integrity": "sha512-G6T0ZX48xgozx7587koeX9Ys2NYy6Gmv//P89sEte9V9whIapMNF4idKxnW2QtCcLiTWlb/wfCabAtAFWhhBow==", - "dependencies": { - "brace-expansion": "^2.0.1" - }, - "engines": { - "node": ">=16 || 14 >=14.17" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/js-cookie": { - "version": "3.0.5", - "resolved": "https://registry.npmjs.org/js-cookie/-/js-cookie-3.0.5.tgz", - "integrity": "sha512-cEiJEAEoIbWfCZYKWhVwFuvPX1gETRYPw6LlaTKoxD3s2AkXzkCjnp6h0V77ozyqj0jakteJ4YqDJT830+lVGw==", - "engines": { - "node": ">=14" - } - }, - "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-yaml": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/js-yaml/-/js-yaml-4.1.0.tgz", - "integrity": "sha512-wpxZs9NoxZaJESJGIZTyDEaYpl0FKSA+FB9aJiyemKhMwkxQg63h4T1KJgUGHpTqPDNRcmmYLugrRjJlBtWvRA==", - "dependencies": { - "argparse": "^2.0.1" - }, - "bin": { - "js-yaml": "bin/js-yaml.js" - } - }, - "node_modules/json-bigint": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/json-bigint/-/json-bigint-1.0.0.tgz", - "integrity": "sha512-SiPv/8VpZuWbvLSMtTDU8hEfrZWg/mH/nV/b4o0CYbSxu1UIQPLdwKOCIyLQX+VIPO5vrLX3i8qtqFyhdPSUSQ==", - "dependencies": { - "bignumber.js": "^9.0.0" - } - }, - "node_modules/jsonpath": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/jsonpath/-/jsonpath-1.1.1.tgz", - "integrity": "sha512-l6Cg7jRpixfbgoWgkrl77dgEj8RPvND0wMH6TwQmi9Qs4TFfS9u5cUFnbeKTwj5ga5Y3BTGGNI28k117LJ009w==", - "dev": true, - "dependencies": { - "esprima": "1.2.2", - "static-eval": "2.0.2", - "underscore": "1.12.1" - } - }, - "node_modules/keccak": { - "version": "3.0.4", - "resolved": "https://registry.npmjs.org/keccak/-/keccak-3.0.4.tgz", - "integrity": "sha512-3vKuW0jV8J3XNTzvfyicFR5qvxrSAGl7KIhvgOu5cmWwM7tZRj3fMbj/pfIf4be7aznbc+prBWGjywox/g2Y6Q==", - "hasInstallScript": true, - "dependencies": { - "node-addon-api": "^2.0.0", - "node-gyp-build": "^4.2.0", - "readable-stream": "^3.6.0" - }, - "engines": { - "node": ">=10.0.0" - } - }, - "node_modules/keccak/node_modules/node-addon-api": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-2.0.2.tgz", - "integrity": "sha512-Ntyt4AIXyaLIuMHF6IOoTakB3K+RWxwtsHNRxllEoA6vPwP9o4866g6YWDLUdnucilZhmkxiHwHr11gAENw+QA==" - }, - "node_modules/level-codec": { - "version": "9.0.2", - "resolved": "https://registry.npmjs.org/level-codec/-/level-codec-9.0.2.tgz", - "integrity": "sha512-UyIwNb1lJBChJnGfjmO0OR+ezh2iVu1Kas3nvBS/BzGnx79dv6g7unpKIDNPMhfdTEGoc7mC8uAu51XEtX+FHQ==", - "dependencies": { - "buffer": "^5.6.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-concat-iterator": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-concat-iterator/-/level-concat-iterator-2.0.1.tgz", - "integrity": "sha512-OTKKOqeav2QWcERMJR7IS9CUo1sHnke2C0gkSmcR7QuEtFNLLzHQAvnMw8ykvEcv0Qtkg0p7FOwP1v9e5Smdcw==", - "engines": { - "node": ">=6" - } - }, - "node_modules/level-errors": { - "version": "2.0.1", - "resolved": "https://registry.npmjs.org/level-errors/-/level-errors-2.0.1.tgz", - "integrity": "sha512-UVprBJXite4gPS+3VznfgDSU8PTRuVX0NXwoWW50KLxd2yw4Y1t2JUR5In1itQnudZqRMT9DlAM3Q//9NCjCFw==", - "dependencies": { - "errno": "~0.1.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-iterator-stream": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/level-iterator-stream/-/level-iterator-stream-4.0.2.tgz", - "integrity": "sha512-ZSthfEqzGSOMWoUGhTXdX9jv26d32XJuHz/5YnuHZzH6wldfWMOVwI9TBtKcya4BKTyTt3XVA0A3cF3q5CY30Q==", - "dependencies": { - "inherits": "^2.0.4", - "readable-stream": "^3.4.0", - "xtend": "^4.0.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-mem": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/level-mem/-/level-mem-5.0.1.tgz", - "integrity": "sha512-qd+qUJHXsGSFoHTziptAKXoLX87QjR7v2KMbqncDXPxQuCdsQlzmyX+gwrEHhlzn08vkf8TyipYyMmiC6Gobzg==", - "dependencies": { - "level-packager": "^5.0.3", - "memdown": "^5.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-packager": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/level-packager/-/level-packager-5.1.1.tgz", - "integrity": "sha512-HMwMaQPlTC1IlcwT3+swhqf/NUO+ZhXVz6TY1zZIIZlIR0YSn8GtAAWmIvKjNY16ZkEg/JcpAuQskxsXqC0yOQ==", - "dependencies": { - "encoding-down": "^6.3.0", - "levelup": "^4.3.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-supports": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/level-supports/-/level-supports-1.0.1.tgz", - "integrity": "sha512-rXM7GYnW8gsl1vedTJIbzOrRv85c/2uCMpiiCzO2fndd06U/kUXEEU9evYn4zFggBOg36IsBW8LzqIpETwwQzg==", - "dependencies": { - "xtend": "^4.0.2" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/level-ws": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/level-ws/-/level-ws-2.0.0.tgz", - "integrity": "sha512-1iv7VXx0G9ec1isqQZ7y5LmoZo/ewAsyDHNA8EFDW5hqH2Kqovm33nSFkSdnLLAK+I5FlT+lo5Cw9itGe+CpQA==", - "dependencies": { - "inherits": "^2.0.3", - "readable-stream": "^3.1.0", - "xtend": "^4.0.1" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/levelup": { - "version": "4.4.0", - "resolved": "https://registry.npmjs.org/levelup/-/levelup-4.4.0.tgz", - "integrity": "sha512-94++VFO3qN95cM/d6eBXvd894oJE0w3cInq9USsyQzzoJxmiYzPAocNcuGCPGGjoXqDVJcr3C1jzt1TSjyaiLQ==", - "dependencies": { - "deferred-leveldown": "~5.3.0", - "level-errors": "~2.0.0", - "level-iterator-stream": "~4.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/levn": { - "version": "0.3.0", - "resolved": "https://registry.npmjs.org/levn/-/levn-0.3.0.tgz", - "integrity": "sha512-0OO4y2iOHix2W6ujICbKIaEQXvFQHue65vUG3pb5EUomzPI90z9hsA1VsO/dbIIpC53J8gxM9Q4Oho0jrCM/yA==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2", - "type-check": "~0.3.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/locate-path": { - "version": "6.0.0", - "resolved": "https://registry.npmjs.org/locate-path/-/locate-path-6.0.0.tgz", - "integrity": "sha512-iPZK6eYjbxRu3uB4/WZ3EsEIMJFMqAoopl3R+zuq0UjcAm/MO6KCweDgPfP3elTztoKP3KtnVHxTn2NHBSDVUw==", - "dependencies": { - "p-locate": "^5.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/lodash": { - "version": "4.17.21", - "resolved": "https://registry.npmjs.org/lodash/-/lodash-4.17.21.tgz", - "integrity": "sha512-v2kDEe57lecTulaDIuNTPy3Ry4gLGJ6Z1O3vE1krgXZNrsQ+LFTGHVxVjcXPs17LhbZVGedAJv8XZ1tvj5FvSg==" - }, - "node_modules/lodash.mapvalues": { - "version": "4.6.0", - "resolved": "https://registry.npmjs.org/lodash.mapvalues/-/lodash.mapvalues-4.6.0.tgz", - "integrity": "sha512-JPFqXFeZQ7BfS00H58kClY7SPVeHertPE0lNuCyZ26/XlN8TvakYD7b9bGyNmXbT/D3BbtPAAmq90gPWqLkxlQ==" - }, - "node_modules/log-symbols": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/log-symbols/-/log-symbols-4.1.0.tgz", - "integrity": "sha512-8XPvpAA8uyhfteu8pIvQxpJZ7SYYdpUivZpGy6sFsBuKRY/7rQGavedeB8aK+Zkyq6upMFVL/9AW6vOYzfRyLg==", - "dependencies": { - "chalk": "^4.1.0", - "is-unicode-supported": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/logplease": { - "version": "1.2.15", - "resolved": "https://registry.npmjs.org/logplease/-/logplease-1.2.15.tgz", - "integrity": "sha512-jLlHnlsPSJjpwUfcNyUxXCl33AYg2cHhIf9QhGL2T4iPT0XPB+xP1LRKFPgIg1M/sg9kAJvy94w9CzBNrfnstA==", - "dev": true - }, - "node_modules/long": { - "version": "5.2.3", - "resolved": "https://registry.npmjs.org/long/-/long-5.2.3.tgz", - "integrity": "sha512-lcHwpNoggQTObv5apGNCTdJrO69eHOZMi4BNC+rTLER8iHAqGrUVeLh/irVIM7zTw2bOXA8T6uNPeujwOLg/2Q==" - }, - "node_modules/loupe": { - "version": "2.3.7", - "resolved": "https://registry.npmjs.org/loupe/-/loupe-2.3.7.tgz", - "integrity": "sha512-zSMINGVYkdpYSOBmLi0D1Uo7JU9nVdQKrHxC8eYlV+9YKK9WePqAlL7lSlorG/U2Fw1w0hTBmaa/jrQ3UbPHtA==", - "dependencies": { - "get-func-name": "^2.0.1" - } - }, - "node_modules/lru-cache": { - "version": "5.1.1", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-5.1.1.tgz", - "integrity": "sha512-KpNARQA3Iwv+jTA0utUVVbrh+Jlrr1Fv0e56GGzAFOXN7dk/FviaDW8LHmK52DlcH4WP2n6gI8vN1aesBFgo9w==", - "dependencies": { - "yallist": "^3.0.2" - } - }, - "node_modules/ltgt": { - "version": "2.2.1", - "resolved": "https://registry.npmjs.org/ltgt/-/ltgt-2.2.1.tgz", - "integrity": "sha512-AI2r85+4MquTw9ZYqabu4nMwy9Oftlfa/e/52t9IjtfG+mGBbTNdAoZ3RQKLHR6r0wQnwZnPIEh/Ya6XTWAKNA==" - }, - "node_modules/mcl-wasm": { - "version": "0.7.9", - "resolved": "https://registry.npmjs.org/mcl-wasm/-/mcl-wasm-0.7.9.tgz", - "integrity": "sha512-iJIUcQWA88IJB/5L15GnJVnSQJmf/YaxxV6zRavv83HILHaJQb6y0iFyDMdDO0gN8X37tdxmAOrH/P8B6RB8sQ==", - "engines": { - "node": ">=8.9.0" - } - }, - "node_modules/md5.js": { - "version": "1.3.5", - "resolved": "https://registry.npmjs.org/md5.js/-/md5.js-1.3.5.tgz", - "integrity": "sha512-xitP+WxNPcTTOgnTJcrhM0xvdPepipPSf3I8EIpGKeFLjt3PlJLIDG3u8EX53ZIubkb+5U2+3rELYpEhHhzdkg==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1", - "safe-buffer": "^5.1.2" - } - }, - "node_modules/memdown": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/memdown/-/memdown-5.1.0.tgz", - "integrity": "sha512-B3J+UizMRAlEArDjWHTMmadet+UKwHd3UjMgGBkZcKAxAYVPS9o0Yeiha4qvz7iGiL2Sb3igUft6p7nbFWctpw==", - "dependencies": { - "abstract-leveldown": "~6.2.1", - "functional-red-black-tree": "~1.0.1", - "immediate": "~3.2.3", - "inherits": "~2.0.1", - "ltgt": "~2.2.0", - "safe-buffer": "~5.2.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/memdown/node_modules/abstract-leveldown": { - "version": "6.2.3", - "resolved": "https://registry.npmjs.org/abstract-leveldown/-/abstract-leveldown-6.2.3.tgz", - "integrity": "sha512-BsLm5vFMRUrrLeCcRc+G0t2qOaTzpoJQLOubq2XM72eNpjF5UdU5o/5NvlNhx95XHcAvcl8OMXr4mlg/fRgUXQ==", - "dependencies": { - "buffer": "^5.5.0", - "immediate": "^3.2.3", - "level-concat-iterator": "~2.0.0", - "level-supports": "~1.0.0", - "xtend": "~4.0.0" - }, - "engines": { - "node": ">=6" - } - }, - "node_modules/memdown/node_modules/immediate": { - "version": "3.2.3", - "resolved": "https://registry.npmjs.org/immediate/-/immediate-3.2.3.tgz", - "integrity": "sha512-RrGCXRm/fRVqMIhqXrGEX9rRADavPiDFSoMb/k64i9XMk8uH4r/Omi5Ctierj6XzNecwDbO4WuFbDD1zmpl3Tg==" - }, - "node_modules/merkle-patricia-tree": { - "version": "4.2.4", - "resolved": "https://registry.npmjs.org/merkle-patricia-tree/-/merkle-patricia-tree-4.2.4.tgz", - "integrity": "sha512-eHbf/BG6eGNsqqfbLED9rIqbsF4+sykEaBn6OLNs71tjclbMcMOk1tEPmJKcNcNCLkvbpY/lwyOlizWsqPNo8w==", - "dependencies": { - "@types/levelup": "^4.3.0", - "ethereumjs-util": "^7.1.4", - "level-mem": "^5.0.1", - "level-ws": "^2.0.0", - "readable-stream": "^3.6.0", - "semaphore-async-await": "^1.5.1" - } - }, - "node_modules/miller-rabin": { - "version": "4.0.1", - "resolved": "https://registry.npmjs.org/miller-rabin/-/miller-rabin-4.0.1.tgz", - "integrity": "sha512-115fLhvZVqWwHPbClyntxEVfVDfl9DLLTuJvq3g2O/Oxi8AiNouAHvDSzHS0viUJc+V5vm3eq91Xwqn9dp4jRA==", - "dependencies": { - "bn.js": "^4.0.0", - "brorand": "^1.0.1" - }, - "bin": { - "miller-rabin": "bin/miller-rabin" - } - }, - "node_modules/miller-rabin/node_modules/bn.js": { - "version": "4.12.0", - "resolved": "https://registry.npmjs.org/bn.js/-/bn.js-4.12.0.tgz", - "integrity": "sha512-c98Bf3tPniI+scsdk237ku1Dc3ujXQTSgyiPUDEOe7tRkhrqridvh8klBv0HCEso1OLOYcHuCv/cS6DNxKH+ZA==" - }, - "node_modules/minimalistic-assert": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-assert/-/minimalistic-assert-1.0.1.tgz", - "integrity": "sha512-UtJcAD4yEaGtjPezWuO9wC4nwUnVH/8/Im3yEHQP4b67cXlD/Qr9hdITCU1xDbSEXg2XKNaP8jsReV7vQd00/A==" - }, - "node_modules/minimalistic-crypto-utils": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/minimalistic-crypto-utils/-/minimalistic-crypto-utils-1.0.1.tgz", - "integrity": "sha512-JIYlbt6g8i5jKfJ3xz7rF0LXmv2TkDxBLUkiBeZ7bAx4GnnNMr8xFpGnOxn6GhTEHx3SjRrZEoU+j04prX1ktg==" - }, - "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/minipass": { - "version": "7.1.2", - "resolved": "https://registry.npmjs.org/minipass/-/minipass-7.1.2.tgz", - "integrity": "sha512-qOOzS1cBTWYF4BH8fVePDBOO9iptMnGUEZwNc/cMWnTV2nVLZ7VoNWEPHkYczZA0pdoA7dl6e7FL659nX9S2aw==", - "engines": { - "node": ">=16 || 14 >=14.17" - } - }, - "node_modules/mocha": { - "version": "10.7.3", - "resolved": "https://registry.npmjs.org/mocha/-/mocha-10.7.3.tgz", - "integrity": "sha512-uQWxAu44wwiACGqjbPYmjo7Lg8sFrS3dQe7PP2FQI+woptP4vZXSMcfMyFL/e1yFEeEpV4RtyTpZROOKmxis+A==", - "dependencies": { - "ansi-colors": "^4.1.3", - "browser-stdout": "^1.3.1", - "chokidar": "^3.5.3", - "debug": "^4.3.5", - "diff": "^5.2.0", - "escape-string-regexp": "^4.0.0", - "find-up": "^5.0.0", - "glob": "^8.1.0", - "he": "^1.2.0", - "js-yaml": "^4.1.0", - "log-symbols": "^4.1.0", - "minimatch": "^5.1.6", - "ms": "^2.1.3", - "serialize-javascript": "^6.0.2", - "strip-json-comments": "^3.1.1", - "supports-color": "^8.1.1", - "workerpool": "^6.5.1", - "yargs": "^16.2.0", - "yargs-parser": "^20.2.9", - "yargs-unparser": "^2.0.0" - }, - "bin": { - "_mocha": "bin/_mocha", - "mocha": "bin/mocha.js" - }, - "engines": { - "node": ">= 14.0.0" - } - }, - "node_modules/ms": { - "version": "2.1.3", - "resolved": "https://registry.npmjs.org/ms/-/ms-2.1.3.tgz", - "integrity": "sha512-6FlzubTLZG3J2a/NVCAleEhjzq5oxgHyaCU9yYXvcLsvoVaHJq/s5xXI6/XXP6tz7R9xAOtHnSO/tXtF3WRTlA==" - }, - "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/node-addon-api": { - "version": "3.2.1", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-3.2.1.tgz", - "integrity": "sha512-mmcei9JghVNDYydghQmeDX8KoAm0FAiYyIcUt/N4nhyAipB17pllZQDOJD2fotxABnt4Mdz+dKTO7eftLg4d0A==" - }, - "node_modules/node-gyp-build": { - "version": "4.8.2", - "resolved": "https://registry.npmjs.org/node-gyp-build/-/node-gyp-build-4.8.2.tgz", - "integrity": "sha512-IRUxE4BVsHWXkV/SFOut4qTlagw2aM8T5/vnTsmrHJvVoKueJHRc/JaFND7QDDc61kLYUJ6qlZM3sqTSyx2dTw==", - "bin": { - "node-gyp-build": "bin.js", - "node-gyp-build-optional": "optional.js", - "node-gyp-build-test": "build-test.js" - } - }, - "node_modules/nopt": { - "version": "7.2.1", - "resolved": "https://registry.npmjs.org/nopt/-/nopt-7.2.1.tgz", - "integrity": "sha512-taM24ViiimT/XntxbPyJQzCG+p4EKOpgD3mxFwW38mGjVUrfERQOeY4EDHjdnptttfHuHQXFx+lTP08Q+mLa/w==", - "dependencies": { - "abbrev": "^2.0.0" - }, - "bin": { - "nopt": "bin/nopt.js" - }, - "engines": { - "node": "^14.17.0 || ^16.13.0 || >=18.0.0" - } - }, - "node_modules/normalize-path": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/normalize-path/-/normalize-path-3.0.0.tgz", - "integrity": "sha512-6eZs5Ls3WtCisHWp9S2GUy8dqkpGi4BVSz3GaqiE6ezub0512ESztXUwUB6C6IKbQkY2Pnb/mD4WYojCRwcwLA==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/once": { - "version": "1.4.0", - "resolved": "https://registry.npmjs.org/once/-/once-1.4.0.tgz", - "integrity": "sha512-lNaJgI+2Q5URQBkccEKHTQOPaXdUxnZZElQTZY0MFUAuaEqe1E+Nyvgdz/aIyNi6Z9MzO5dv1H8n58/GELp3+w==", - "dependencies": { - "wrappy": "1" - } - }, - "node_modules/optionator": { - "version": "0.8.3", - "resolved": "https://registry.npmjs.org/optionator/-/optionator-0.8.3.tgz", - "integrity": "sha512-+IW9pACdk3XWmmTXG8m3upGUJst5XRGzxMRjXzAuJ1XnIFNvfhjjIuYkDvysnPQ7qzqVzLt78BCruntqRhWQbA==", - "dev": true, - "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/p-limit": { - "version": "3.1.0", - "resolved": "https://registry.npmjs.org/p-limit/-/p-limit-3.1.0.tgz", - "integrity": "sha512-TYOanM3wGwNGsZN2cVTYPArw454xnXj5qmWF1bEoAc4+cU/ol7GVh7odevjp1FNHduHc3KZMcFduxU5Xc6uJRQ==", - "dependencies": { - "yocto-queue": "^0.1.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/p-locate": { - "version": "5.0.0", - "resolved": "https://registry.npmjs.org/p-locate/-/p-locate-5.0.0.tgz", - "integrity": "sha512-LaNjtRWUBY++zB5nE/NwcaoMylSPk+S+ZHNB1TzdbMJMny6dynpAGt7X/tl/QYq3TIeE6nxHppbo2LGymrG5Pw==", - "dependencies": { - "p-limit": "^3.0.2" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/package-json-from-dist": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/package-json-from-dist/-/package-json-from-dist-1.0.1.tgz", - "integrity": "sha512-UEZIS3/by4OC8vL3P2dTXRETpebLI2NiI5vIrjaD/5UtrkFX/tNbwjTSRAGC/+7CAo2pIcBaRgWmcBBHcsaCIw==" - }, - "node_modules/path-exists": { - "version": "4.0.0", - "resolved": "https://registry.npmjs.org/path-exists/-/path-exists-4.0.0.tgz", - "integrity": "sha512-ak9Qy5Q7jYb2Wwcey5Fpvg2KoAc/ZIhLSLOSBmRmygPsGwkVVt0fZa0qrtMz+m6tJTAHfZQ8FnmB4MG4LWy7/w==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-key": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/path-key/-/path-key-3.1.1.tgz", - "integrity": "sha512-ojmeN0qd+y0jszEtoY48r0Peq5dwMEkIlCOu6Q5f41lfkswXuKtYrhgoTpLnyIcHm24Uhqx+5Tqm2InSwLhE6Q==", - "engines": { - "node": ">=8" - } - }, - "node_modules/path-scurry": { - "version": "1.11.1", - "resolved": "https://registry.npmjs.org/path-scurry/-/path-scurry-1.11.1.tgz", - "integrity": "sha512-Xa4Nw17FS9ApQFJ9umLiJS4orGjm7ZzwUrwamcGQuHSzDyth9boKDaycYdDcZDuqYATXw4HFXgaqWTctW/v1HA==", - "dependencies": { - "lru-cache": "^10.2.0", - "minipass": "^5.0.0 || ^6.0.2 || ^7.0.0" - }, - "engines": { - "node": ">=16 || 14 >=14.18" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/path-scurry/node_modules/lru-cache": { - "version": "10.4.3", - "resolved": "https://registry.npmjs.org/lru-cache/-/lru-cache-10.4.3.tgz", - "integrity": "sha512-JNAzZcXrCt42VGLuYz0zfAzDfAvJWW6AfYlDBQyDV5DClI2m5sAmK+OIO7s59XfsRsWHp02jAJrRadPRGTt6SQ==" - }, - "node_modules/pathval": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pathval/-/pathval-1.1.1.tgz", - "integrity": "sha512-Dp6zGqpTdETdR63lehJYPeIOqpiNBNtc7BpWSLrOje7UaIsE5aY92r/AunQA7rsXvet3lrJ3JnZX29UPTKXyKQ==", - "engines": { - "node": "*" - } - }, - "node_modules/pbkdf2": { - "version": "3.1.2", - "resolved": "https://registry.npmjs.org/pbkdf2/-/pbkdf2-3.1.2.tgz", - "integrity": "sha512-iuh7L6jA7JEGu2WxDwtQP1ddOpaJNC4KlDEFfdQajSGgGPNi4OyDc2R7QnbY2bR9QjBVGwgvTdNJZoE7RaxUMA==", - "dependencies": { - "create-hash": "^1.1.2", - "create-hmac": "^1.1.4", - "ripemd160": "^2.0.1", - "safe-buffer": "^5.0.1", - "sha.js": "^2.4.8" - }, - "engines": { - "node": ">=0.12" - } - }, - "node_modules/pg": { - "version": "8.13.0", - "resolved": "https://registry.npmjs.org/pg/-/pg-8.13.0.tgz", - "integrity": "sha512-34wkUTh3SxTClfoHB3pQ7bIMvw9dpFU1audQQeZG837fmHfHpr14n/AELVDoOYVDW2h5RDWU78tFjkD+erSBsw==", - "dependencies": { - "pg-connection-string": "^2.7.0", - "pg-pool": "^3.7.0", - "pg-protocol": "^1.7.0", - "pg-types": "^2.1.0", - "pgpass": "1.x" - }, - "engines": { - "node": ">= 8.0.0" - }, - "optionalDependencies": { - "pg-cloudflare": "^1.1.1" - }, - "peerDependencies": { - "pg-native": ">=3.0.1" - }, - "peerDependenciesMeta": { - "pg-native": { - "optional": true - } - } - }, - "node_modules/pg-cloudflare": { - "version": "1.1.1", - "resolved": "https://registry.npmjs.org/pg-cloudflare/-/pg-cloudflare-1.1.1.tgz", - "integrity": "sha512-xWPagP/4B6BgFO+EKz3JONXv3YDgvkbVrGw2mTo3D6tVDQRh1e7cqVGvyR3BE+eQgAvx1XhW/iEASj4/jCWl3Q==", - "optional": true - }, - "node_modules/pg-connection-string": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/pg-connection-string/-/pg-connection-string-2.7.0.tgz", - "integrity": "sha512-PI2W9mv53rXJQEOb8xNR8lH7Hr+EKa6oJa38zsK0S/ky2er16ios1wLKhZyxzD7jUReiWokc9WK5nxSnC7W1TA==" - }, - "node_modules/pg-int8": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/pg-int8/-/pg-int8-1.0.1.tgz", - "integrity": "sha512-WCtabS6t3c8SkpDBUlb1kjOs7l66xsGdKpIPZsg4wR+B3+u9UAum2odSsF9tnvxg80h4ZxLWMy4pRjOsFIqQpw==", - "engines": { - "node": ">=4.0.0" - } - }, - "node_modules/pg-pool": { - "version": "3.7.0", - "resolved": "https://registry.npmjs.org/pg-pool/-/pg-pool-3.7.0.tgz", - "integrity": "sha512-ZOBQForurqh4zZWjrgSwwAtzJ7QiRX0ovFkZr2klsen3Nm0aoh33Ls0fzfv3imeH/nw/O27cjdz5kzYJfeGp/g==", - "peerDependencies": { - "pg": ">=8.0" - } - }, - "node_modules/pg-protocol": { - "version": "1.7.0", - "resolved": "https://registry.npmjs.org/pg-protocol/-/pg-protocol-1.7.0.tgz", - "integrity": "sha512-hTK/mE36i8fDDhgDFjy6xNOG+LCorxLG3WO17tku+ij6sVHXh1jQUJ8hYAnRhNla4QVD2H8er/FOjc/+EgC6yQ==" - }, - "node_modules/pg-types": { - "version": "2.2.0", - "resolved": "https://registry.npmjs.org/pg-types/-/pg-types-2.2.0.tgz", - "integrity": "sha512-qTAAlrEsl8s4OiEQY69wDvcMIdQN6wdz5ojQiOy6YRMuynxenON0O5oCpJI6lshc6scgAY8qvJ2On/p+CXY0GA==", - "dependencies": { - "pg-int8": "1.0.1", - "postgres-array": "~2.0.0", - "postgres-bytea": "~1.0.0", - "postgres-date": "~1.0.4", - "postgres-interval": "^1.1.0" - }, - "engines": { - "node": ">=4" - } - }, - "node_modules/pgpass": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/pgpass/-/pgpass-1.0.5.tgz", - "integrity": "sha512-FdW9r/jQZhSeohs1Z3sI1yxFQNFvMcnmfuj4WBMUTxOrAyLMaTcE1aAMBiTlbMNaXvBCQuVi0R7hd8udDSP7ug==", - "dependencies": { - "split2": "^4.1.0" - } - }, - "node_modules/picomatch": { - "version": "2.3.1", - "resolved": "https://registry.npmjs.org/picomatch/-/picomatch-2.3.1.tgz", - "integrity": "sha512-JU3teHTNjmE2VCGFzuY8EXzCDVwEqB2a8fsIvwaStHhAWJEeVd1o1QD80CU6+ZdEXXSLbSsuLwJjkCBWqRQUVA==", - "engines": { - "node": ">=8.6" - }, - "funding": { - "url": "https://github.com/sponsors/jonschlinkert" - } - }, - "node_modules/pil2-compiler": { - "version": "1.0.0", - "resolved": "git+ssh://git@github.com/0xPolygonHermez/pil2-compiler.git#a40137fa6e3051df59de34a22811ea4c1d520d3d", - "license": "AGPL-3.0-or-later", - "dependencies": { - "chai": "^4.3.6", - "deep-equal-in-any-order": "^2.0.6", - "ffjavascript": "^0.2.55", - "js-beautify": "^1.15.1", - "lodash": "^4.17.21", - "long": "^5.2.3", - "mocha": "^10.4.0", - "prettier": "^3.3.3", - "protobufjs": "^7.2.3", - "yargs": "^17.2.1" - }, - "bin": { - "pil2com": "src/pil.js" - } - }, - "node_modules/pil2-compiler/node_modules/cliui": { - "version": "8.0.1", - "resolved": "https://registry.npmjs.org/cliui/-/cliui-8.0.1.tgz", - "integrity": "sha512-BSeNnyus75C4//NQ9gQt1/csTXyo/8Sb+afLAkzAptFuMsod9HFokGNudZpi/oQV73hnVK+sR+5PVRMd+Dr7YQ==", - "dependencies": { - "string-width": "^4.2.0", - "strip-ansi": "^6.0.1", - "wrap-ansi": "^7.0.0" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/pil2-compiler/node_modules/yargs": { - "version": "17.7.2", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-17.7.2.tgz", - "integrity": "sha512-7dSzzRQ++CKnNI/krKnYRV7JKKPUXMEh61soaHKg9mrWEhzFWhFnxPxGl+69cD1Ou63C13NUPCnmIcrvqCuM6w==", - "dependencies": { - "cliui": "^8.0.1", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.3", - "y18n": "^5.0.5", - "yargs-parser": "^21.1.1" - }, - "engines": { - "node": ">=12" - } - }, - "node_modules/pil2-compiler/node_modules/yargs-parser": { - "version": "21.1.1", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-21.1.1.tgz", - "integrity": "sha512-tVpsJW7DdjecAiFpbIB1e3qxIQsE6NoPc5/eTdrbbIC4h0LVsWhnoa3g+m2HclBIujHzsxZ4VJVA+GUuc2/LBw==", - "engines": { - "node": ">=12" - } - }, - "node_modules/pilcom": { - "version": "0.0.24", - "resolved": "https://registry.npmjs.org/pilcom/-/pilcom-0.0.24.tgz", - "integrity": "sha512-9Kp0xlzKCCUMrdwuE6kja6bdm6witgPwD2N8NS1vMon9EDFbazHCcA8DzpniHRmq477L/PYr63Rq9kaxqQmkKw==", - "bin": { - "pilcom": "src/pil.js", - "pilverifier": "src/main_pilverifier.js" - } - }, - "node_modules/possible-typed-array-names": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/possible-typed-array-names/-/possible-typed-array-names-1.0.0.tgz", - "integrity": "sha512-d7Uw+eZoloe0EHDIYoe+bQ5WXnGMOpmiZFTuMWCwpjzzkL2nTjcKiAk4hh8TjnGye2TwWOk3UXucZ+3rbmBa8Q==", - "dev": true, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/postgres-array": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/postgres-array/-/postgres-array-2.0.0.tgz", - "integrity": "sha512-VpZrUqU5A69eQyW2c5CA1jtLecCsN2U/bD6VilrFDWq5+5UIEVO7nazS3TEcHf1zuPYO/sqGvUvW62g86RXZuA==", - "engines": { - "node": ">=4" - } - }, - "node_modules/postgres-bytea": { - "version": "1.0.0", - "resolved": "https://registry.npmjs.org/postgres-bytea/-/postgres-bytea-1.0.0.tgz", - "integrity": "sha512-xy3pmLuQqRBZBXDULy7KbaitYqLcmxigw14Q5sj8QBVLqEwXfeybIKVWiqAXTlcvdvb0+xkOtDbfQMOf4lST1w==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-date": { - "version": "1.0.7", - "resolved": "https://registry.npmjs.org/postgres-date/-/postgres-date-1.0.7.tgz", - "integrity": "sha512-suDmjLVQg78nMK2UZ454hAG+OAW+HQPZ6n++TNDUX+L0+uUlLywnoxJKDou51Zm+zTCjrCl0Nq6J9C5hP9vK/Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/postgres-interval": { - "version": "1.2.0", - "resolved": "https://registry.npmjs.org/postgres-interval/-/postgres-interval-1.2.0.tgz", - "integrity": "sha512-9ZhXKM/rw350N1ovuWHbGxnGh/SNJ4cnxHiM0rxE4VN41wsg8P8zWn9hv/buK00RP4WvlOyr/RBDiptyxVbkZQ==", - "dependencies": { - "xtend": "^4.0.0" - }, - "engines": { - "node": ">=0.10.0" - } - }, - "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==", - "dev": true, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/prettier": { - "version": "3.3.3", - "resolved": "https://registry.npmjs.org/prettier/-/prettier-3.3.3.tgz", - "integrity": "sha512-i2tDNA0O5IrMO757lfrdQZCc2jPNDVntV0m/+4whiDfWaTKfMNgR7Qz0NAeGz/nRqF4m5/6CLzbP4/liHt12Ew==", - "bin": { - "prettier": "bin/prettier.cjs" - }, - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/prettier/prettier?sponsor=1" - } - }, - "node_modules/proto-list": { - "version": "1.2.4", - "resolved": "https://registry.npmjs.org/proto-list/-/proto-list-1.2.4.tgz", - "integrity": "sha512-vtK/94akxsTMhe0/cbfpR+syPuszcuwhqVjJq26CuNDgFGj682oRBXOP5MJpv2r7JtE8MsiepGIqvvOTBwn2vA==" - }, - "node_modules/protobufjs": { - "version": "7.4.0", - "resolved": "https://registry.npmjs.org/protobufjs/-/protobufjs-7.4.0.tgz", - "integrity": "sha512-mRUWCc3KUU4w1jU8sGxICXH/gNS94DvI1gxqDvBzhj1JpcsimQkYiOJfwsPUykUI5ZaspFbSgmBLER8IrQ3tqw==", - "hasInstallScript": true, - "dependencies": { - "@protobufjs/aspromise": "^1.1.2", - "@protobufjs/base64": "^1.1.2", - "@protobufjs/codegen": "^2.0.4", - "@protobufjs/eventemitter": "^1.1.0", - "@protobufjs/fetch": "^1.1.0", - "@protobufjs/float": "^1.0.2", - "@protobufjs/inquire": "^1.1.0", - "@protobufjs/path": "^1.1.2", - "@protobufjs/pool": "^1.1.0", - "@protobufjs/utf8": "^1.1.0", - "@types/node": ">=13.7.0", - "long": "^5.0.0" - }, - "engines": { - "node": ">=12.0.0" - } - }, - "node_modules/prr": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/prr/-/prr-1.0.1.tgz", - "integrity": "sha512-yPw4Sng1gWghHQWj0B3ZggWUm4qVbPwPFcRG8KyxiU7J2OHFSoEHKS+EZ3fv5l1t9CyCiop6l/ZYeWbrgoQejw==" - }, - "node_modules/r1csfile": { - "version": "0.0.47", - "resolved": "https://registry.npmjs.org/r1csfile/-/r1csfile-0.0.47.tgz", - "integrity": "sha512-oI4mAwuh1WwuFg95eJDNDDL8hCaZkwnPuNZrQdLBWvDoRU7EG+L/MOHL7SwPW2Y+ZuYcTLpj3rBkgllBQZN/JA==", - "dependencies": { - "@iden3/bigarray": "0.0.2", - "@iden3/binfileutils": "0.0.11", - "fastfile": "0.0.20", - "ffjavascript": "0.2.60" - } - }, - "node_modules/r1csfile/node_modules/ffjavascript": { - "version": "0.2.60", - "resolved": "https://registry.npmjs.org/ffjavascript/-/ffjavascript-0.2.60.tgz", - "integrity": "sha512-T/9bnEL5xAZRDbQoEMf+pM9nrhK+C3JyZNmqiWub26EQorW7Jt+jR54gpqDhceA4Nj0YctPQwYnl8xa52/A26A==", - "dependencies": { - "wasmbuilder": "0.0.16", - "wasmcurves": "0.2.2", - "web-worker": "^1.2.0" - } - }, - "node_modules/randombytes": { - "version": "2.1.0", - "resolved": "https://registry.npmjs.org/randombytes/-/randombytes-2.1.0.tgz", - "integrity": "sha512-vYl3iOX+4CKUWuxGi9Ukhie6fsqXqS9FE2Zaic4tNFD2N2QQaXOMFbuKK4QmDHC0JO6B1Zp41J0LpT0oR68amQ==", - "dependencies": { - "safe-buffer": "^5.1.0" - } - }, - "node_modules/readable-stream": { - "version": "3.6.2", - "resolved": "https://registry.npmjs.org/readable-stream/-/readable-stream-3.6.2.tgz", - "integrity": "sha512-9u/sniCrY3D5WdsERHzHE4G2YCXqoG5FTHUiCC4SIbr6XcLZBY05ya9EKjYek9O5xOAwjGq+1JdGBAS7Q9ScoA==", - "dependencies": { - "inherits": "^2.0.3", - "string_decoder": "^1.1.1", - "util-deprecate": "^1.0.1" - }, - "engines": { - "node": ">= 6" - } - }, - "node_modules/readdirp": { - "version": "3.6.0", - "resolved": "https://registry.npmjs.org/readdirp/-/readdirp-3.6.0.tgz", - "integrity": "sha512-hOS089on8RduqdbhvQ5Z37A0ESjsqz6qnRcffsMU3495FuTdqSm+7bhJ29JvIOsBDEEnan5DPu9t3To9VRlMzA==", - "dependencies": { - "picomatch": "^2.2.1" - }, - "engines": { - "node": ">=8.10.0" - } - }, - "node_modules/require-directory": { - "version": "2.1.1", - "resolved": "https://registry.npmjs.org/require-directory/-/require-directory-2.1.1.tgz", - "integrity": "sha512-fGxEI7+wsG9xrvdjsrlmL22OMTTiHRwAMroiEeMgq8gzoLC/PQr7RsRDSTLUg/bZAZtF+TVIkHc6/4RIKrui+Q==", - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/ripemd160": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/ripemd160/-/ripemd160-2.0.2.tgz", - "integrity": "sha512-ii4iagi25WusVoiC4B4lq7pbXfAp3D9v5CwfkY33vffw2+pkDjY1D8GaN7spsxvCSx8dkPqOZCEZyfxcmJG2IA==", - "dependencies": { - "hash-base": "^3.0.0", - "inherits": "^2.0.1" - } - }, - "node_modules/rlp": { - "version": "2.2.7", - "resolved": "https://registry.npmjs.org/rlp/-/rlp-2.2.7.tgz", - "integrity": "sha512-d5gdPmgQ0Z+AklL2NVXr/IoSjNZFfTVvQWzL/AM2AOcSzYP2xjlb0AC8YyCLc41MSNf6P6QVtjgPdmVtzb+4lQ==", - "dependencies": { - "bn.js": "^5.2.0" - }, - "bin": { - "rlp": "bin/rlp" - } - }, - "node_modules/rustbn.js": { - "version": "0.2.0", - "resolved": "https://registry.npmjs.org/rustbn.js/-/rustbn.js-0.2.0.tgz", - "integrity": "sha512-4VlvkRUuCJvr2J6Y0ImW7NvTCriMi7ErOAqWk1y69vAdoNIzCF3yPmgeNzx+RQTLEDFq5sHfscn1MwHxP9hNfA==" - }, - "node_modules/safe-buffer": { - "version": "5.2.1", - "resolved": "https://registry.npmjs.org/safe-buffer/-/safe-buffer-5.2.1.tgz", - "integrity": "sha512-rp3So07KcdmmKbGvgaNxQSJr7bGVSVk5S9Eq1F+ppbRo70+YeaDxkw5Dd8NPN+GD6bjnYm2VuPuCXmpuYvmCXQ==", - "funding": [ - { - "type": "github", - "url": "https://github.com/sponsors/feross" - }, - { - "type": "patreon", - "url": "https://www.patreon.com/feross" - }, - { - "type": "consulting", - "url": "https://feross.org/support" - } - ] - }, - "node_modules/scrypt-js": { - "version": "3.0.1", - "resolved": "https://registry.npmjs.org/scrypt-js/-/scrypt-js-3.0.1.tgz", - "integrity": "sha512-cdwTTnqPu0Hyvf5in5asVdZocVDTNRmR7XEcJuIzMjJeSHybHl7vpB66AzwTaIg6CLSbtjcxc8fqcySfnTkccA==" - }, - "node_modules/secp256k1": { - "version": "4.0.4", - "resolved": "https://registry.npmjs.org/secp256k1/-/secp256k1-4.0.4.tgz", - "integrity": "sha512-6JfvwvjUOn8F/jUoBY2Q1v5WY5XS+rj8qSe0v8Y4ezH4InLgTEeOOPQsRll9OV429Pvo6BCHGavIyJfr3TAhsw==", - "hasInstallScript": true, - "dependencies": { - "elliptic": "^6.5.7", - "node-addon-api": "^5.0.0", - "node-gyp-build": "^4.2.0" - }, - "engines": { - "node": ">=18.0.0" - } - }, - "node_modules/secp256k1/node_modules/node-addon-api": { - "version": "5.1.0", - "resolved": "https://registry.npmjs.org/node-addon-api/-/node-addon-api-5.1.0.tgz", - "integrity": "sha512-eh0GgfEkpnoWDq+VY8OyvYhFEzBk6jIYbRKdIlyTiAXIVJ8PyBaKb0rp7oDtoddbdoHWhq8wwr+XZ81F1rpNdA==" - }, - "node_modules/semaphore-async-await": { - "version": "1.5.1", - "resolved": "https://registry.npmjs.org/semaphore-async-await/-/semaphore-async-await-1.5.1.tgz", - "integrity": "sha512-b/ptP11hETwYWpeilHXXQiV5UJNJl7ZWWooKRE5eBIYWoom6dZ0SluCIdCtKycsMtZgKWE01/qAw6jblw1YVhg==", - "engines": { - "node": ">=4.1" - } - }, - "node_modules/semver": { - "version": "7.6.3", - "resolved": "https://registry.npmjs.org/semver/-/semver-7.6.3.tgz", - "integrity": "sha512-oVekP1cKtI+CTDvHWYFUcMtsK/00wmAEfyqKfNdARm8u1wNVhSgaX7A8d4UuIlUI5e84iEwOhs7ZPYRmzU9U6A==", - "bin": { - "semver": "bin/semver.js" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/serialize-javascript": { - "version": "6.0.2", - "resolved": "https://registry.npmjs.org/serialize-javascript/-/serialize-javascript-6.0.2.tgz", - "integrity": "sha512-Saa1xPByTTq2gdeFZYLLo+RFE35NHZkAbqZeWNd3BpzppeVisAqpDjcp8dyf6uIvEqJRd46jemmyA4iFIeVk8g==", - "dependencies": { - "randombytes": "^2.1.0" - } - }, - "node_modules/set-function-length": { - "version": "1.2.2", - "resolved": "https://registry.npmjs.org/set-function-length/-/set-function-length-1.2.2.tgz", - "integrity": "sha512-pgRc4hJ4/sNjWCSS9AmnS40x3bNMDTknHgL5UaMBTMyJnU90EgWh1Rz+MC9eFu4BuN/UwZjKQuY/1v3rM7HMfg==", - "dev": true, - "dependencies": { - "define-data-property": "^1.1.4", - "es-errors": "^1.3.0", - "function-bind": "^1.1.2", - "get-intrinsic": "^1.2.4", - "gopd": "^1.0.1", - "has-property-descriptors": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - } - }, - "node_modules/setimmediate": { - "version": "1.0.5", - "resolved": "https://registry.npmjs.org/setimmediate/-/setimmediate-1.0.5.tgz", - "integrity": "sha512-MATJdZp8sLqDl/68LfQmbP8zKPLQNV6BIZoIgrscFDQ+RsvK/BxeDQOgyxKKoh0y/8h3BqVFnCqQ/gd+reiIXA==" - }, - "node_modules/sha.js": { - "version": "2.4.11", - "resolved": "https://registry.npmjs.org/sha.js/-/sha.js-2.4.11.tgz", - "integrity": "sha512-QMEp5B7cftE7APOjk5Y6xgrbWu+WkLVQwk8JNjZ8nKRciZaByEW6MubieAiToS7+dwvrjGhH8jRXz3MVd0AYqQ==", - "dependencies": { - "inherits": "^2.0.1", - "safe-buffer": "^5.0.1" - }, - "bin": { - "sha.js": "bin.js" - } - }, - "node_modules/shebang-command": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/shebang-command/-/shebang-command-2.0.0.tgz", - "integrity": "sha512-kHxr2zZpYtdmrN1qDjrrX/Z1rR1kG8Dx+gkpK1G4eXmvXswmcE1hTWBWYUzlraYw1/yZp6YuDY77YtvbN0dmDA==", - "dependencies": { - "shebang-regex": "^3.0.0" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/shebang-regex": { - "version": "3.0.0", - "resolved": "https://registry.npmjs.org/shebang-regex/-/shebang-regex-3.0.0.tgz", - "integrity": "sha512-7++dFhtcx3353uBaq8DDR4NuxBetBzC7ZQOhmTQInHEd6bSrXdiEyzCvG07Z44UYdLShWUyXt5M/yhz8ekcb1A==", - "engines": { - "node": ">=8" - } - }, - "node_modules/signal-exit": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/signal-exit/-/signal-exit-4.1.0.tgz", - "integrity": "sha512-bzyZ1e88w9O1iNJbKnOlvYTrWPDl46O1bG0D3XInv+9tkPrxrN8jUUTiFlDkkmKWgn1M6CfIA13SuGqOa9Korw==", - "engines": { - "node": ">=14" - }, - "funding": { - "url": "https://github.com/sponsors/isaacs" - } - }, - "node_modules/snarkjs": { - "version": "0.7.5", - "resolved": "https://registry.npmjs.org/snarkjs/-/snarkjs-0.7.5.tgz", - "integrity": "sha512-h+3c4rXZKLhLuHk4LHydZCk/h5GcNvk5GjVKRRkHmfb6Ntf8gHOA9zea3g656iclRuhqQ3iKDWFgiD9ypLrKiA==", - "dev": true, - "dependencies": { - "@iden3/binfileutils": "0.0.12", - "bfj": "^7.0.2", - "blake2b-wasm": "^2.4.0", - "circom_runtime": "0.1.28", - "ejs": "^3.1.6", - "fastfile": "0.0.20", - "ffjavascript": "0.3.1", - "js-sha3": "^0.8.0", - "logplease": "^1.2.15", - "r1csfile": "0.0.48" - }, - "bin": { - "snarkjs": "build/cli.cjs" - } - }, - "node_modules/snarkjs/node_modules/@iden3/binfileutils": { - "version": "0.0.12", - "resolved": "https://registry.npmjs.org/@iden3/binfileutils/-/binfileutils-0.0.12.tgz", - "integrity": "sha512-naAmzuDufRIcoNfQ1d99d7hGHufLA3wZSibtr4dMe6ZeiOPV1KwOZWTJ1YVz4HbaWlpDuzVU72dS4ATQS4PXBQ==", - "dev": true, - "dependencies": { - "fastfile": "0.0.20", - "ffjavascript": "^0.3.0" - } - }, - "node_modules/snarkjs/node_modules/ffjavascript": { - "version": "0.3.1", - "resolved": "https://registry.npmjs.org/ffjavascript/-/ffjavascript-0.3.1.tgz", - "integrity": "sha512-4PbK1WYodQtuF47D4pRI5KUg3Q392vuP5WjE1THSnceHdXwU3ijaoS0OqxTzLknCtz4Z2TtABzkBdBdMn3B/Aw==", - "dev": true, - "dependencies": { - "wasmbuilder": "0.0.16", - "wasmcurves": "0.2.2", - "web-worker": "1.2.0" - } - }, - "node_modules/snarkjs/node_modules/r1csfile": { - "version": "0.0.48", - "resolved": "https://registry.npmjs.org/r1csfile/-/r1csfile-0.0.48.tgz", - "integrity": "sha512-kHRkKUJNaor31l05f2+RFzvcH5XSa7OfEfd/l4hzjte6NL6fjRkSMfZ4BjySW9wmfdwPOtq3mXurzPvPGEf5Tw==", - "dev": true, - "dependencies": { - "@iden3/bigarray": "0.0.2", - "@iden3/binfileutils": "0.0.12", - "fastfile": "0.0.20", - "ffjavascript": "0.3.0" - } - }, - "node_modules/snarkjs/node_modules/r1csfile/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==", - "dev": true, - "dependencies": { - "wasmbuilder": "0.0.16", - "wasmcurves": "0.2.2", - "web-worker": "1.2.0" - } - }, - "node_modules/sort-any": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/sort-any/-/sort-any-2.0.0.tgz", - "integrity": "sha512-T9JoiDewQEmWcnmPn/s9h/PH9t3d/LSWi0RgVmXSuDYeZXTZOZ1/wrK2PHaptuR1VXe3clLLt0pD6sgVOwjNEA==", - "dependencies": { - "lodash": "^4.17.21" - } - }, - "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==", - "dev": true, - "optional": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/split2": { - "version": "4.2.0", - "resolved": "https://registry.npmjs.org/split2/-/split2-4.2.0.tgz", - "integrity": "sha512-UcjcJOWknrNkF6PLX83qcHM6KHgVKNkV62Y8a5uYDVv9ydGQVwAHMKqHdJje1VTWpljG0WYpCDhrCdAOYH4TWg==", - "engines": { - "node": ">= 10.x" - } - }, - "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==", - "dev": true, - "dependencies": { - "escodegen": "^1.8.1" - } - }, - "node_modules/string_decoder": { - "version": "1.3.0", - "resolved": "https://registry.npmjs.org/string_decoder/-/string_decoder-1.3.0.tgz", - "integrity": "sha512-hkRX8U1WjJFd8LsDJ2yQ/wWWxaopEsABU1XfkM8A+j0+85JAGppt16cr1Whg6KIbb4okU6Mql6BOj+uup/wKeA==", - "dependencies": { - "safe-buffer": "~5.2.0" - } - }, - "node_modules/string-width": { - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/string-width-cjs": { - "name": "string-width", - "version": "4.2.3", - "resolved": "https://registry.npmjs.org/string-width/-/string-width-4.2.3.tgz", - "integrity": "sha512-wKyQRQpjJ0sIp62ErSZdGsjMJWsap5oRNihHhu6G7JVO/9jIB6UyevL+tXuOqrng8j/cxKTWyWUwvSTriiZz/g==", - "dependencies": { - "emoji-regex": "^8.0.0", - "is-fullwidth-code-point": "^3.0.0", - "strip-ansi": "^6.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi": { - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-ansi-cjs": { - "name": "strip-ansi", - "version": "6.0.1", - "resolved": "https://registry.npmjs.org/strip-ansi/-/strip-ansi-6.0.1.tgz", - "integrity": "sha512-Y38VPSHcqkFrCpFnQ9vuSXmquuv5oXOKpGeT6aGrr3o3Gc9AlVa6JBfUSOCnbxGGZF+/0ooI7KrPuUSztUdU5A==", - "dependencies": { - "ansi-regex": "^5.0.1" - }, - "engines": { - "node": ">=8" - } - }, - "node_modules/strip-json-comments": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/strip-json-comments/-/strip-json-comments-3.1.1.tgz", - "integrity": "sha512-6fPc+R4ihwqP6N/aIv2f1gMH8lOVtWQHoqC4yK6oSDVVocumAsfCqjkXnqiYMhmMwS/mEHLp7Vehlt3ql6lEig==", - "engines": { - "node": ">=8" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - }, - "node_modules/supports-color": { - "version": "8.1.1", - "resolved": "https://registry.npmjs.org/supports-color/-/supports-color-8.1.1.tgz", - "integrity": "sha512-MpUEN2OodtUzxvKQl72cUF7RQ5EiHsGvSsVG0ia9c5RbWGL2CI4C7EpPS8UTBIplnlzZiNuV56w+FuNxy3ty2Q==", - "dependencies": { - "has-flag": "^4.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/supports-color?sponsor=1" - } - }, - "node_modules/temporary": { - "version": "1.1.0", - "resolved": "https://registry.npmjs.org/temporary/-/temporary-1.1.0.tgz", - "integrity": "sha512-geB3U/E75RLr++koy9EBw4mZ1BCfxg72SYJQdQld1iRvka+fyijfbiXrVpWQB9bJKNsgAB4lIHOeJtVSvyiJiQ==", - "dev": true - }, - "node_modules/tmp": { - "version": "0.2.3", - "resolved": "https://registry.npmjs.org/tmp/-/tmp-0.2.3.tgz", - "integrity": "sha512-nZD7m9iCPC5g0pYmcaxogYKggSfLsdxl8of3Q/oIbqCqLLIO9IAF0GWjX1z9NZRHPiXv8Wex4yDCaZsgEw0Y8w==", - "dev": true, - "engines": { - "node": ">=14.14" - } - }, - "node_modules/tmp-promise": { - "version": "3.0.3", - "resolved": "https://registry.npmjs.org/tmp-promise/-/tmp-promise-3.0.3.tgz", - "integrity": "sha512-RwM7MoPojPxsOBYnyd2hy0bxtIlVrihNs9pj5SUvY8Zz1sQcQG2tG1hSr8PDxfgEB8RNKDhqbIlroIarSNDNsQ==", - "dev": true, - "dependencies": { - "tmp": "^0.2.0" - } - }, - "node_modules/to-regex-range": { - "version": "5.0.1", - "resolved": "https://registry.npmjs.org/to-regex-range/-/to-regex-range-5.0.1.tgz", - "integrity": "sha512-65P7iz6X5yEr1cwcgvQxbbIw7Uk3gOy5dIdtZ4rDveLqhrdJP+Li/Hx6tyK0NEb+2GCyneCMJiGqrADCSNk8sQ==", - "dependencies": { - "is-number": "^7.0.0" - }, - "engines": { - "node": ">=8.0" - } - }, - "node_modules/tryer": { - "version": "1.0.1", - "resolved": "https://registry.npmjs.org/tryer/-/tryer-1.0.1.tgz", - "integrity": "sha512-c3zayb8/kWWpycWYg87P71E1S1ZL6b6IJxfb5fvsUgsf0S2MVGaDhDXXjDMpdCpfWXqptc+4mXwmiy1ypXqRAA==", - "dev": true - }, - "node_modules/tslib": { - "version": "2.7.0", - "resolved": "https://registry.npmjs.org/tslib/-/tslib-2.7.0.tgz", - "integrity": "sha512-gLXCKdN1/j47AiHiOkJN69hJmcbGTHI0ImLmbYLHykhgeN0jVGola9yVjFgzCUklsZQMW55o+dW7IXv3RCXDzA==" - }, - "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==", - "dev": true, - "dependencies": { - "prelude-ls": "~1.1.2" - }, - "engines": { - "node": ">= 0.8.0" - } - }, - "node_modules/type-detect": { - "version": "4.1.0", - "resolved": "https://registry.npmjs.org/type-detect/-/type-detect-4.1.0.tgz", - "integrity": "sha512-Acylog8/luQ8L7il+geoSxhEkazvkslg7PSNKOX59mbB9cOveP5aq9h74Y7YU8yDpJwetzQQrfIwtf4Wp4LKcw==", - "engines": { - "node": ">=4" - } - }, - "node_modules/underscore": { - "version": "1.12.1", - "resolved": "https://registry.npmjs.org/underscore/-/underscore-1.12.1.tgz", - "integrity": "sha512-hEQt0+ZLDVUMhebKxL4x1BTtDY7bavVofhZ9KZ4aI26X9SRaE+Y3m83XUL1UP2jn8ynjndwCCpEHdUG+9pP1Tw==", - "dev": true - }, - "node_modules/undici-types": { - "version": "6.19.8", - "resolved": "https://registry.npmjs.org/undici-types/-/undici-types-6.19.8.tgz", - "integrity": "sha512-ve2KP6f/JnbPBFyobGHuerC9g1FYGn/F8n1LWTwNxCEzd6IfqTwUQcNXgEtmmQ6DlRrC1hrSrBnCZPokRrDHjw==" - }, - "node_modules/util": { - "version": "0.12.5", - "resolved": "https://registry.npmjs.org/util/-/util-0.12.5.tgz", - "integrity": "sha512-kZf/K6hEIrWHI6XqOFUiiMa+79wE/D8Q+NCNAWclkyg3b4d2k7s0QGepNjiABc+aR3N1PAyHL7p6UcLY6LmrnA==", - "dev": true, - "dependencies": { - "inherits": "^2.0.3", - "is-arguments": "^1.0.4", - "is-generator-function": "^1.0.7", - "is-typed-array": "^1.1.3", - "which-typed-array": "^1.1.2" - } - }, - "node_modules/util-deprecate": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/util-deprecate/-/util-deprecate-1.0.2.tgz", - "integrity": "sha512-EPD5q1uXyFxJpCrLnCc1nHnq3gOa6DZBocAIiI2TaSCA7VCJ1UJDMagCzIkXNsUYfD1daK//LTEQ8xiIbrHtcw==" - }, - "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/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/which": { - "version": "2.0.2", - "resolved": "https://registry.npmjs.org/which/-/which-2.0.2.tgz", - "integrity": "sha512-BLI3Tl1TW3Pvl70l3yq3Y64i+awpwXqsGBYWkkqMtnbXgrMD+yj7rhW0kuEDxzJaYXGjEW5ogapKNMEKNMjibA==", - "dependencies": { - "isexe": "^2.0.0" - }, - "bin": { - "node-which": "bin/node-which" - }, - "engines": { - "node": ">= 8" - } - }, - "node_modules/which-typed-array": { - "version": "1.1.15", - "resolved": "https://registry.npmjs.org/which-typed-array/-/which-typed-array-1.1.15.tgz", - "integrity": "sha512-oV0jmFtUky6CXfkqehVvBP/LSWJ2sy4vWMioiENyJLePrBO/yKyV9OyJySfAKosh+RYkIl5zJCNZ8/4JncrpdA==", - "dev": true, - "dependencies": { - "available-typed-arrays": "^1.0.7", - "call-bind": "^1.0.7", - "for-each": "^0.3.3", - "gopd": "^1.0.1", - "has-tostringtag": "^1.0.2" - }, - "engines": { - "node": ">= 0.4" - }, - "funding": { - "url": "https://github.com/sponsors/ljharb" - } - }, - "node_modules/word-wrap": { - "version": "1.2.5", - "resolved": "https://registry.npmjs.org/word-wrap/-/word-wrap-1.2.5.tgz", - "integrity": "sha512-BN22B5eaMMI9UMtjrGd5g5eCYPpCPDUy0FJXbYsaT5zYxjFOckS53SQDE3pWkVoWpHXVb3BrYcEN4Twa55B5cA==", - "dev": true, - "engines": { - "node": ">=0.10.0" - } - }, - "node_modules/workerpool": { - "version": "6.5.1", - "resolved": "https://registry.npmjs.org/workerpool/-/workerpool-6.5.1.tgz", - "integrity": "sha512-Fs4dNYcsdpYSAfVxhnl1L5zTksjvOJxtC5hzMNl+1t9B8hTJTdKDyZ5ju7ztgPy+ft9tBFXoOlDNiOT9WUXZlA==" - }, - "node_modules/wrap-ansi": { - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrap-ansi-cjs": { - "name": "wrap-ansi", - "version": "7.0.0", - "resolved": "https://registry.npmjs.org/wrap-ansi/-/wrap-ansi-7.0.0.tgz", - "integrity": "sha512-YVGIj2kamLSTxw6NsZjoBxfSwsn0ycdesmc4p+Q21c5zPuZ1pl+NfxVdxPtdHvmNVOQ6XSYG4AUtyt/Fi7D16Q==", - "dependencies": { - "ansi-styles": "^4.0.0", - "string-width": "^4.1.0", - "strip-ansi": "^6.0.0" - }, - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/chalk/wrap-ansi?sponsor=1" - } - }, - "node_modules/wrappy": { - "version": "1.0.2", - "resolved": "https://registry.npmjs.org/wrappy/-/wrappy-1.0.2.tgz", - "integrity": "sha512-l4Sp/DRseor9wL6EvV2+TuQn63dMkPjZ/sp9XkghTEbV9KlPS1xUsZ3u7/IQO4wxtcFB4bgpQPRcR3QCvezPcQ==" - }, - "node_modules/ws": { - "version": "8.17.1", - "resolved": "https://registry.npmjs.org/ws/-/ws-8.17.1.tgz", - "integrity": "sha512-6XQFvXTkbfUOZOKKILFG1PDK2NDQs4azKQl26T0YS5CxqWLgXajbPZ+h4gZekJyRqFU8pvnbAbbs/3TgRPy+GQ==", - "engines": { - "node": ">=10.0.0" - }, - "peerDependencies": { - "bufferutil": "^4.0.1", - "utf-8-validate": ">=5.0.2" - }, - "peerDependenciesMeta": { - "bufferutil": { - "optional": true - }, - "utf-8-validate": { - "optional": true - } - } - }, - "node_modules/xtend": { - "version": "4.0.2", - "resolved": "https://registry.npmjs.org/xtend/-/xtend-4.0.2.tgz", - "integrity": "sha512-LKYU1iAXJXUgAXn9URjiu+MWhyUXHsvfp7mcuYm9dSUKK0/CjtrUwFAxD82/mCWbtLsGjFIad0wIsod4zrTAEQ==", - "engines": { - "node": ">=0.4" - } - }, - "node_modules/y18n": { - "version": "5.0.8", - "resolved": "https://registry.npmjs.org/y18n/-/y18n-5.0.8.tgz", - "integrity": "sha512-0pfFzegeDWJHJIAmTLRP2DwHjdF5s7jo9tuztdQxAhINCdvS+3nGINqPd00AphqJR/0LhANUS6/+7SCb98YOfA==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yallist": { - "version": "3.1.1", - "resolved": "https://registry.npmjs.org/yallist/-/yallist-3.1.1.tgz", - "integrity": "sha512-a4UGQaWPH59mOXUYnAG2ewncQS4i4F43Tv3JoAM+s2VDAmS9NsK8GpDMLrCHPksFT7h3K6TOoUNn2pb7RoXx4g==" - }, - "node_modules/yargs": { - "version": "16.2.0", - "resolved": "https://registry.npmjs.org/yargs/-/yargs-16.2.0.tgz", - "integrity": "sha512-D1mvvtDG0L5ft/jGWkLpG1+m0eQxOfaBvTNELraWj22wSVUMWxZUvYgJYcKh6jGGIkJFhH4IZPQhR4TKpc8mBw==", - "dependencies": { - "cliui": "^7.0.2", - "escalade": "^3.1.1", - "get-caller-file": "^2.0.5", - "require-directory": "^2.1.1", - "string-width": "^4.2.0", - "y18n": "^5.0.5", - "yargs-parser": "^20.2.2" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-parser": { - "version": "20.2.9", - "resolved": "https://registry.npmjs.org/yargs-parser/-/yargs-parser-20.2.9.tgz", - "integrity": "sha512-y11nGElTIV+CT3Zv9t7VKl+Q3hTQoT9a1Qzezhhl6Rp21gJ/IVTW7Z3y9EWXhuUBC2Shnf+DX0antecpAwSP8w==", - "engines": { - "node": ">=10" - } - }, - "node_modules/yargs-unparser": { - "version": "2.0.0", - "resolved": "https://registry.npmjs.org/yargs-unparser/-/yargs-unparser-2.0.0.tgz", - "integrity": "sha512-7pRTIA9Qc1caZ0bZ6RYRGbHJthJWuakf+WmHK0rVeLkNrrGhfoabBNdue6kdINI6r4if7ocq9aD/n7xwKOdzOA==", - "dependencies": { - "camelcase": "^6.0.0", - "decamelize": "^4.0.0", - "flat": "^5.0.2", - "is-plain-obj": "^2.1.0" - }, - "engines": { - "node": ">=10" - } - }, - "node_modules/yocto-queue": { - "version": "0.1.0", - "resolved": "https://registry.npmjs.org/yocto-queue/-/yocto-queue-0.1.0.tgz", - "integrity": "sha512-rVksvsnNCdJ/ohGc6xgPwyN8eheCxsiLM8mxuE/t/mOVqJewPuO1miLpTHQiRgTKCLexL4MeAFVagts7HmNZ2Q==", - "engines": { - "node": ">=10" - }, - "funding": { - "url": "https://github.com/sponsors/sindresorhus" - } - } - } -} diff --git a/src/pil2circom/circuits.bn128/fri.circom b/src/pil2circom/circuits.bn128/fri.circom new file mode 100644 index 0000000..63689bd --- /dev/null +++ b/src/pil2circom/circuits.bn128/fri.circom @@ -0,0 +1,90 @@ +/* + Verify that FRI polynomials are built properly +*/ +template parallel VerifyFRI(prevStepBits, currStepBits, nextStepBits, e0, e1) { + var nextStep = currStepBits - nextStepBits; + var step = prevStepBits - currStepBits; + + signal input {binary} queriesFRI[currStepBits]; + signal input {maxNum} challengeFRIStep[3]; + signal input {maxNum} s_vals_curr[1 << step][3]; + signal input {maxNum} s_vals_next[1 << nextStep][3]; + signal input {binary} enable; + + var q = 0xFFFFFFFFFFFFFFFF; + + signal {maxNum} s_sx[currStepBits - 1]; + s_sx.maxNum = q; + + signal {maxNum} inp[currStepBits - 2]; + inp.maxNum = q; + + signal {maxNum} ina; + signal {maxNum} inb; + ina.maxNum = q; + inb.maxNum = q; + + ina <== queriesFRI[0] * (e1 - e0) + e0; + inb <== queriesFRI[1] * (invroots(prevStepBits - 1) -1) + 1; + s_sx[0] <== GLMul()(ina, inb); + for (var i=1; i< currStepBits - 1; i++) { + inp[i - 1] <== queriesFRI[i + 1] * (invroots(prevStepBits - (i + 1)) -1) + 1; + s_sx[i] <== GLMul()(s_sx[i-1], inp[i - 1]); + } + + signal {maxNum} s_X[3]; + if(currStepBits > 1) { + s_X.maxNum = s_sx.maxNum; + s_X <== [s_sx[currStepBits - 2], 0, 0]; + } else { + signal {maxNum} inp1 <== GLConst(e0)(); + signal {maxNum} inp2; + inp2.maxNum = q; + inp2 <== queriesFRI[0] * (invroots(prevStepBits) -1) + 1; + + signal {maxNum} mul <== GLMul()(inp1, inp2); + s_X.maxNum = mul.maxNum; + s_X <== [mul, 0, 0]; + } + + signal {maxNum} coefs[1 << step][3] <== FFT(step, 1)(s_vals_curr); + signal {maxNum} evalXprime[3] <== GLCMul()(challengeFRIStep, s_X); + signal {maxNum} evalPol[3] <== EvalPol(1 << step)(coefs, evalXprime); + + signal {binary} s_keys_lowValues[nextStep]; + for(var i = 0; i < nextStep; i++) { s_keys_lowValues[i] <== queriesFRI[i + nextStepBits]; } + signal {maxNum} lowValues[3] <== TreeSelector(nextStep, 3)(s_vals_next, s_keys_lowValues); + + signal {maxNum} vals[3] <== GLCSub()(evalPol, lowValues); + signal {maxNum} normC[3] <== GLCNorm()(vals); + + enable * normC[0] === 0; + enable * normC[1] === 0; + enable * normC[2] === 0; +} + +template parallel VerifyFinalPol(lastStepBits, maxDegBits) { + var lastStepSize = 1 << lastStepBits; + var maxDegSize = 1 << maxDegBits; + + /////// + // Check Degree last pol + /////// + signal input {maxNum} finalPol[lastStepSize][3]; + signal input {binary} enable; + + // Calculate the IFFT to get the coefficients of finalPol + signal lastIFFT[lastStepSize][3] <== FFT(lastStepBits, 1)(finalPol); + + // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding + for (var k= maxDegSize; k< lastStepSize; k++) { + for (var e=0; e<3; e++) { + enable * lastIFFT[k][e] === 0; + } + } + + // The coefficients of lower degree can have any value + for (var k= 0; k < maxDegSize; k++) { + _ <== lastIFFT[k]; + } +} \ No newline at end of file diff --git a/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs b/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs index a01c671..fbe8071 100644 --- a/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs @@ -283,6 +283,7 @@ include "poseidon.circom"; include "bitifyT.circom"; include "bn1togl3.circom"; include "treeselector.circom"; +include "fri.circom"; <% if (!options.skipMain) { -%> include "compconstant64.circom"; include "bitify.circom"; @@ -445,71 +446,6 @@ template Transcript() { <% } -%> -/* - Verify that FRI polynomials are built properly -*/ -template parallel VerifyFRI(prevStepBits, currStepBits, nextStepBits, e0, e1) { - var nextStep = currStepBits - nextStepBits; - var step = prevStepBits - currStepBits; - - signal input {binary} queriesFRI[currStepBits]; - signal input {maxNum} challengeFRIStep[3]; - signal input {maxNum} s_vals_curr[1 << step][3]; - signal input {maxNum} s_vals_next[1 << nextStep][3]; - signal input {binary} enable; - - var q = 0xFFFFFFFFFFFFFFFF; - - signal {maxNum} s_sx[currStepBits - 1]; - s_sx.maxNum = q; - - signal {maxNum} inp[currStepBits - 2]; - inp.maxNum = q; - - signal {maxNum} ina; - signal {maxNum} inb; - ina.maxNum = q; - inb.maxNum = q; - - ina <== queriesFRI[0] * (e1 - e0) + e0; - inb <== queriesFRI[1] * (invroots(prevStepBits - 1) -1) + 1; - s_sx[0] <== GLMul()(ina, inb); - for (var i=1; i< currStepBits - 1; i++) { - inp[i - 1] <== queriesFRI[i + 1] * (invroots(prevStepBits - (i + 1)) -1) + 1; - s_sx[i] <== GLMul()(s_sx[i-1], inp[i - 1]); - } - - signal {maxNum} s_X[3]; - if(currStepBits > 1) { - s_X.maxNum = s_sx.maxNum; - s_X <== [s_sx[currStepBits - 2], 0, 0]; - } else { - signal {maxNum} inp1 <== GLConst(e0)(); - signal {maxNum} inp2; - inp2.maxNum = q; - inp2 <== queriesFRI[0] * (invroots(prevStepBits) -1) + 1; - - signal {maxNum} mul <== GLMul()(inp1, inp2); - s_X.maxNum = mul.maxNum; - s_X <== [mul, 0, 0]; - } - - signal {maxNum} coefs[1 << step][3] <== FFT(step, 1)(s_vals_curr); - signal {maxNum} evalXprime[3] <== GLCMul()(challengeFRIStep, s_X); - signal {maxNum} evalPol[3] <== EvalPol(1 << step)(coefs, evalXprime); - - signal {binary} s_keys_lowValues[nextStep]; - for(var i = 0; i < nextStep; i++) { s_keys_lowValues[i] <== queriesFRI[i + nextStepBits]; } - signal {maxNum} lowValues[3] <== TreeSelector(nextStep, 3)(s_vals_next, s_keys_lowValues); - - signal {maxNum} vals[3] <== GLCSub()(evalPol, lowValues); - signal {maxNum} normC[3] <== GLCNorm()(vals); - - enable * normC[0] === 0; - enable * normC[1] === 0; - enable * normC[2] === 0; -} - /* Verify that all committed polynomials are calculated correctly */ @@ -838,33 +774,6 @@ template MapValues() { <% } -%> } - -template parallel VerifyFinalPol() { - /////// - // Check Degree last pol - /////// - signal input {maxNum} finalPol[<%- 1 << starkStruct.steps[starkStruct.steps.length-1].nBits %>][3]; - signal input {binary} enable; - -<% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> -<% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> - // Calculate the IFFT to get the coefficients of finalPol - signal lastIFFT[<%- 1 << nLastBits %>][3] <== FFT(<%- nLastBits %>, 1)(finalPol); - - // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding - // This means ?????? in terms of IFFT - for (var k= <%- 1 << maxDegBits %>; k< <%- 1 << nLastBits %>; k++) { - for (var e=0; e<3; e++) { - enable * lastIFFT[k][e] === 0; - } - } - - // The coefficients of lower degree can have any value - for (var k= 0; k < <%- 1 << maxDegBits %>; k++) { - _ <== lastIFFT[k]; - } -} - template StarkVerifier() { <% if(starkInfo.nPublics > 0) { -%> signal input publics[<%- starkInfo.nPublics %>]; @@ -1246,7 +1155,9 @@ template StarkVerifier() { <% } -%> } - VerifyFinalPol()(finalPolGL, enabled); +<% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> +<% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> + VerifyFinalPol(<%- nLastBits %>, <%- maxDegBits %>)(finalPolGL, enabled); } <% if (!options.skipMain) { -%> diff --git a/src/pil2circom/circuits.gl/fri.circom b/src/pil2circom/circuits.gl/fri.circom new file mode 100644 index 0000000..b16d4b9 --- /dev/null +++ b/src/pil2circom/circuits.gl/fri.circom @@ -0,0 +1,56 @@ +template VerifyFRI(nBitsExt, prevStepBits, currStepBits, nextStepBits, e0) { + var nextStep = currStepBits - nextStepBits; + var step = prevStepBits - currStepBits; + + signal input {binary} queriesFRI[currStepBits]; + signal input friChallenge[3]; + signal input s_vals_curr[1<< step][3]; + signal input s_vals_next[1<< nextStep][3]; + signal input {binary} enable; + + signal sx[currStepBits]; + + sx[0] <== e0 *( queriesFRI[0] * (invroots(prevStepBits) -1) + 1); + for (var i=1; i< currStepBits; i++) { + sx[i] <== sx[i-1] * ( queriesFRI[i] * (invroots(prevStepBits -i) -1) +1); + } + + // Perform an IFFT to obtain the coefficients of the polynomial given s_vals and evaluate it + signal coefs[1 << step][3] <== FFT(step, 3, 1)(s_vals_curr); + signal evalXprime[3] <== [friChallenge[0] * sx[currStepBits - 1], friChallenge[1] * sx[currStepBits - 1], friChallenge[2] * sx[currStepBits - 1]]; + signal evalPol[3] <== EvalPol(1 << step)(coefs, evalXprime); + + signal {binary} keys_lowValues[nextStep]; + for(var i = 0; i < nextStep; i++) { keys_lowValues[i] <== queriesFRI[i + nextStepBits]; } + signal lowValues[3] <== TreeSelector(nextStep, 3)(s_vals_next, keys_lowValues); + + enable * (lowValues[0] - evalPol[0]) === 0; + enable * (lowValues[1] - evalPol[1]) === 0; + enable * (lowValues[2] - evalPol[2]) === 0; +} + +template VerifyFinalPol(lastStepBits, maxDegBits) { + var lastStepSize = 1 << lastStepBits; + var maxDegSize = 1 << maxDegBits; + + /////// + // Check Degree last pol + /////// + signal input finalPol[lastStepSize][3]; + signal input {binary} enable; + + // Calculate the IFFT to get the coefficients of finalPol + signal lastIFFT[lastStepSize][3] <== FFT(lastStepBits, 3, 1)(finalPol); + + // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding + for (var k= maxDegSize; k < lastStepSize; k++) { + for (var e=0; e<3; e++) { + enable * lastIFFT[k][e] === 0; + } + } + + // The coefficients of lower degree can have any value + for (var k= 0; k < maxDegSize; k++) { + _ <== lastIFFT[k]; + } +} diff --git a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs index 64ff4a7..c54a484 100644 --- a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs @@ -241,6 +241,7 @@ include "cinv.circom"; include "poseidon.circom"; include "bitify.circom"; include "fft.circom"; +include "fri.circom"; include "evalpol.circom"; include "treeselector4.circom"; <% if(starkStruct.splitLinearHash) { -%> @@ -395,44 +396,6 @@ template <%- transcriptName %>() { <% } -%> -/* - Verify that FRI polynomials are built properly -*/ -<% let verifyFriName = "VerifyFRI"; -%> -<% if(airgroupId !== undefined) { -%> -<% verifyFriName += airgroupId; -%> -<% } -%> -template <%- verifyFriName %>(nBitsExt, prevStepBits, currStepBits, nextStepBits, e0) { - var nextStep = currStepBits - nextStepBits; - var step = prevStepBits - currStepBits; - - signal input {binary} queriesFRI[currStepBits]; - signal input friChallenge[3]; - signal input s_vals_curr[1<< step][3]; - signal input s_vals_next[1<< nextStep][3]; - signal input {binary} enable; - - signal sx[currStepBits]; - - sx[0] <== e0 *( queriesFRI[0] * (invroots(prevStepBits) -1) + 1); - for (var i=1; i< currStepBits; i++) { - sx[i] <== sx[i-1] * ( queriesFRI[i] * (invroots(prevStepBits -i) -1) +1); - } - - // Perform an IFFT to obtain the coefficients of the polynomial given s_vals and evaluate it - signal coefs[1 << step][3] <== FFT(step, 3, 1)(s_vals_curr); - signal evalXprime[3] <== [friChallenge[0] * sx[currStepBits - 1], friChallenge[1] * sx[currStepBits - 1], friChallenge[2] * sx[currStepBits - 1]]; - signal evalPol[3] <== EvalPol(1 << step)(coefs, evalXprime); - - signal {binary} keys_lowValues[nextStep]; - for(var i = 0; i < nextStep; i++) { keys_lowValues[i] <== queriesFRI[i + nextStepBits]; } - signal lowValues[3] <== TreeSelector(nextStep, 3)(s_vals_next, keys_lowValues); - - enable * (lowValues[0] - evalPol[0]) === 0; - enable * (lowValues[1] - evalPol[1]) === 0; - enable * (lowValues[2] - evalPol[2]) === 0; -} - /* Verify that all committed polynomials are calculated correctly */ @@ -718,35 +681,6 @@ template <%- mapValuesName %>() { <% } -%> } -<% let verifyFinalPolName = "VerifyFinalPol"; -%> -<% if(airgroupId !== undefined) { -%> -<% verifyFinalPolName += airgroupId; -%> -<% } -%> -template <%- verifyFinalPolName %>() { - /////// - // Check Degree last pol - /////// - signal input finalPol[<%- 1 << starkStruct.steps[starkStruct.steps.length-1].nBits %>][3]; - signal input {binary} enable; - -<% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> -<% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> - // Calculate the IFFT to get the coefficients of finalPol - signal lastIFFT[<%- 1 << nLastBits %>][3] <== FFT(<%- nLastBits %>, 3, 1)(finalPol); - - // Check that the degree of the final polynomial is bounded by the degree defined in the last step of the folding - for (var k= <%- 1 << maxDegBits %>; k< <%- 1 << nLastBits %>; k++) { - for (var e=0; e<3; e++) { - enable * lastIFFT[k][e] === 0; - } - } - - // The coefficients of lower degree can have any value - for (var k= 0; k < <%- 1 << maxDegBits %>; k++) { - _ <== lastIFFT[k]; - } -} - <% let verifierName = "StarkVerifier"; -%> <% if(airgroupId !== undefined) { -%> <% verifierName += airgroupId; -%> @@ -999,6 +933,7 @@ template <%- verifierName %>() { } <% } -%> +<% if(!options.recursive2) { -%> <% for (let s=1; s signal {binary} s<%- s %>_keys_merkle[<%- starkStruct.nQueries %>][<%- starkStruct.steps[s].nBits %>]; for (var q=0; q<<%- starkStruct.nQueries %>; q++) { @@ -1007,6 +942,7 @@ template <%- verifierName %>() { VerifyMerkleHash(3, <%- 1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits) %>, <%- 1 << starkStruct.steps[s].nBits %>)(s<%- s %>_vals_p[q], s<%- s %>_siblings[q], s<%- s %>_keys_merkle[q], s<%- s %>_root, enabled); } <% } -%> +<% } -%> /////////// @@ -1029,8 +965,15 @@ template <%- verifierName %>() { -%> // Reconstruct FRI polinomial from evaluations queryVals[q] <== <%- calculateFRIPolName %>()(queriesFRI[q], challengeXi, challengesFRI, evals, <%- queryVals.join(", ") %>); - } +<% let nextValsPol = 0 < starkStruct.steps.length-1 ? "s1_vals_p[q]" : "finalPol"; + let nextStep = 0 < starkStruct.steps.length-1 ? starkStruct.steps[1].nBits : 0; +-%> + // Verify that the query is properly constructed. This is done by checking that the linear combination of the set of + // polynomials committed during the different rounds evaluated at z matches with the commitment of the FRI polynomial + <%- verifyQueryName %>(<%- starkStruct.steps[0].nBits %>, <%- nextStep %>)(queriesFRI[q], queryVals[q], <%- nextValsPol %>, enabled); +} +<% if(!options.recursive2) { -%> /////////// // Verify FRI Polinomial /////////// @@ -1039,13 +982,6 @@ template <%- verifierName %>() { <% } -%> for (var q=0; q<<%- starkStruct.nQueries %>; q++) { -<% let nextValsPol = 0 < starkStruct.steps.length-1 ? "s1_vals_p[q]" : "finalPol"; - let nextStep = 0 < starkStruct.steps.length-1 ? starkStruct.steps[1].nBits : 0; --%> - // Verify that the query is properly constructed. This is done by checking that the linear combination of the set of - // polynomials committed during the different rounds evaluated at z matches with the commitment of the FRI polynomial - <%- verifyQueryName %>(<%- starkStruct.steps[0].nBits %>, <%- nextStep %>)(queriesFRI[q], queryVals[q], <%- nextValsPol %>, enabled); - /////////// // Verify FRI construction /////////// @@ -1061,11 +997,14 @@ template <%- verifierName %>() { <% const exponent = s === 0 ? 0 : 1 << (starkStruct.nBitsExt -starkStruct.steps[s-1].nBits); -%> <% const prevStepBits = s === 0 ? starkStruct.steps[s].nBits : starkStruct.steps[s-1].nBits; -%> <% const e0 = F.inv(F.exp(F.shift, exponent)) -%> - <%- verifyFriName %>(<%- starkStruct.nBitsExt %>, <%- prevStepBits %>, <%- starkStruct.steps[s].nBits %>, <%- nextStepFRI %>, <%- e0 %>)(s<%- s %>_queriesFRI[q], challengesFRISteps[<%- s %>], s<%- s %>_vals_p[q], <%- nextPolFRI %>, enabled); + VerifyFRI(<%- starkStruct.nBitsExt %>, <%- prevStepBits %>, <%- starkStruct.steps[s].nBits %>, <%- nextStepFRI %>, <%- e0 %>)(s<%- s %>_queriesFRI[q], challengesFRISteps[<%- s %>], s<%- s %>_vals_p[q], <%- nextPolFRI %>, enabled); <% } -%> } - <%- verifyFinalPolName %>()(finalPol, enabled); +<% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> +<% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> + VerifyFinalPol(<%- nLastBits %>, <%- maxDegBits %>)(finalPol, enabled); +<% } -%> } <% if (!options.skipMain) { -%> diff --git a/src/vadcop/templates/recursive2.circom.ejs b/src/vadcop/templates/recursive2.circom.ejs index 2b6e28d..9c8a5b7 100644 --- a/src/vadcop/templates/recursive2.circom.ejs +++ b/src/vadcop/templates/recursive2.circom.ejs @@ -53,6 +53,8 @@ template Recursive2() { <%- include('src/main_templates/vadcop/agg_vadcop_inputs.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> + // TODO! VERIFY SINGLE FRI + for (var i=0; i<4; i++) { vA.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; vB.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; From 02e351b137ab79908f5b782eea4aad87fb6c43ab Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Fri, 10 Jan 2025 11:50:40 +0000 Subject: [PATCH 2/9] Improving circuits doc --- .../define_stark_inputs.circom.ejs | 38 +++++++++------- .../vadcop/init_vadcop_inputs.circom.ejs | 2 +- .../templates/calculate_hashes.circom.ejs | 45 ++++++++++--------- src/vadcop/templates/compressor.circom.ejs | 18 ++++---- 4 files changed, 54 insertions(+), 49 deletions(-) diff --git a/src/main_templates/define_stark_inputs.circom.ejs b/src/main_templates/define_stark_inputs.circom.ejs index 309c06f..69c729a 100644 --- a/src/main_templates/define_stark_inputs.circom.ejs +++ b/src/main_templates/define_stark_inputs.circom.ejs @@ -2,28 +2,41 @@ <% if(options.addPublics && nPublics > 0) { -%> signal input <%- prefix_ %>publics[<%- nPublics %>]; <% } -%> -<% if(starkInfo.airgroupValuesMap && starkInfo.airgroupValuesMap.length > 0) { -%> - signal input <%- prefix_ %>airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; -<% } -%> <% if(starkInfo.airValuesMap && starkInfo.airValuesMap.length > 0) { -%> signal input <%- prefix_ %>airvalues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> +<% if(starkInfo.airgroupValuesMap && starkInfo.airgroupValuesMap.length > 0) { -%> + signal input <%- prefix_ %>airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; +<% } -%> + <% if(starkInfo.proofValuesMap && starkInfo.proofValuesMap.length > 0) { -%> signal input <%- prefix_ %>proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> <% for (let s=1; s<=starkInfo.nStages + 1; ++s) { -%> <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> - signal input <%- prefix_ %>root<%- s %>; + signal input <%- prefix_ %>root<%- s %>; // Merkle tree root of the witness columns of Stage <%- s %> <% } else { -%> - signal input <%- prefix_ %>root<%- s %>[4]; + signal input <%- prefix_ %>root<%- s %>[4]; // Merkle tree root of the witness columns of Stage <%- s %> <% } -%> <% } -%> - signal input <%- prefix_ %>evals[<%- starkInfo.evMap.length %>][3]; // Evaluations of the set polynomials at a challenge value z and gz + signal input <%- prefix_ %>evals[<%- starkInfo.evMap.length %>][3]; // Set of evaluations around the out-of-domain sample +<% for (let s=1; s +<% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> + signal input <%- prefix_ %>s<%- s %>_root; // Merkle tree root of the FRI polynomial for Layer <%- s %> during the commit phase +<% } else { -%> + signal input <%- prefix_ %>s<%- s %>_root[4]; // Merkle tree root of the FRI polynomial for Layer <%- s %> during the commit phase +<% } -%> +<% } -%> + + signal input <%- prefix_ %>finalPol[<%- 1 << parseInt(starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits) %>][3]; // Polynomial sent in clear in the last iteration of the FRI commit phase + + // Set of evaluations and Merkle proofs for each of the <%- starkInfo.starkStruct.nQueries %> queries + // performed during the FRI query phase, covering all involved polynomials. signal input <%- prefix_ %>s0_valsC[<%- starkInfo.starkStruct.nQueries %>][<%- starkInfo.nConstants %>]; <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> signal input <%- prefix_ %>s0_siblingsC[<%- starkInfo.starkStruct.nQueries %>][<%- Math.floor((parseInt(starkInfo.starkStruct.steps[0].nBits) - 1)/Math.log2(starkInfo.starkStruct.merkleTreeArity))+1 %>][<%- starkInfo.starkStruct.merkleTreeArity %>]; @@ -51,14 +64,6 @@ <% } -%> <% } -%> -<% for (let s=1; s -<% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> - signal input <%- prefix_ %>s<%- s %>_root; -<% } else { -%> - signal input <%- prefix_ %>s<%- s %>_root[4]; -<% } -%> -<% } -%> - <% for (let s=1; s< starkInfo.starkStruct.steps.length; s++) { -%> signal input <%- prefix_ %>s<%- s %>_vals[<%- starkInfo.starkStruct.nQueries %>][<%- (1 << parseInt(starkInfo.starkStruct.steps[s-1].nBits - starkInfo.starkStruct.steps[s].nBits))*3 %>]; <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> @@ -66,6 +71,5 @@ <% } else { -%> signal input <%- prefix_ %>s<%- s %>_siblings[<%- starkInfo.starkStruct.nQueries %>][<%- starkInfo.starkStruct.steps[s].nBits %>][4]; <% } -%> -<% } -%> - - signal input <%- prefix_ %>finalPol[<%- 1 << parseInt(starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits) %>][3]; \ No newline at end of file +<% } -%> +-%> \ No newline at end of file diff --git a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs index 2cc7da3..9e61ff8 100644 --- a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs @@ -73,4 +73,4 @@ <% } -%> <% } -%> - <%- prefix_ %>finalPolHash <== CalculateFinalPolHash()(<%- prefixStark_ %>finalPol); \ No newline at end of file + <%- prefix_ %>finalPolHash <== CalculateFRILastLayerPolHash()(<%- prefixStark_ %>finalPol); \ No newline at end of file diff --git a/src/vadcop/helpers/templates/calculate_hashes.circom.ejs b/src/vadcop/helpers/templates/calculate_hashes.circom.ejs index a1b205f..3d333a1 100644 --- a/src/vadcop/helpers/templates/calculate_hashes.circom.ejs +++ b/src/vadcop/helpers/templates/calculate_hashes.circom.ejs @@ -24,13 +24,13 @@ class Transcript { } updateState() { - let signalName = "transcriptHash"; + let signalName = "partialHash"; if(this.name) signalName += "_" + this.name; if(this.hCnt > 0) { const firstUnused = Math.max(this.hiCnt, 4); if(firstUnused < 12) { this.code.push(`for(var i = ${firstUnused}; i < 12; i++){ - _ <== ${signalName}_${this.hCnt -1}[i]; // Unused transcript values + _ <== ${signalName}_${this.hCnt -1}[i]; // Unused hash values }`) } } @@ -76,7 +76,7 @@ class Transcript { } getPermutations(v, n, nBits) { - let signalName = "transcriptHash"; + let signalName = "partialHash"; if(this.name) signalName += "_" + this.name; const totalBits = n*nBits; const n2b = []; @@ -87,7 +87,7 @@ class Transcript { } if(this.hiCnt < 12) { this.code.push(`for(var i = ${this.hiCnt}; i < 12; i++){ - _ <== ${signalName}_${this.hCnt - 1}[i]; // Unused transcript values + _ <== ${signalName}_${this.hCnt - 1}[i]; // Unused hash values }\n`) } this.code.push(`// From each transcript hash converted to bits, we assign those bits to queriesFRI[q] to define the query positions`) @@ -121,20 +121,20 @@ class Transcript { } } -%> - +-%> template CalculateStage1Hash() { - signal input rootC[4]; - signal input root1[4]; + signal input rootFixedCols[4]; // Merkle tree root of the fixed columns + signal input rootWitnessCols[4]; // Merkle tree root of the witness columns of Stage 1 <% if(starkInfo.airValuesMap.filter(a => a.stage == 1).length > 0) { -%> - signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; + signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; // AIR values of Stage 1 <% } -%> signal output stageHash[4]; <% const transcriptStage = new Transcript(); -%> -<% transcriptStage.put("rootC", 4); -%> -<% transcriptStage.put("root1", 4); -%> +<% transcriptStage.put("rootFixedCols", 4); -%> +<% transcriptStage.put("rootWitnessCols", 4); -%> <% for (let j=0; j <% if(starkInfo.airValuesMap[j].stage == 1) { -%> <% transcriptStage.put(`airValues[${j}]`, 1); -%> @@ -149,13 +149,14 @@ template CalculateStage1Hash() { <% for (let i = 1; i < starkInfo.nStages; ++i) { -%> <% if(starkInfo.airValuesMap.filter(a => a.stage == i + 1).length > 0) { -%> template CalculateStage<%- i+1 %>Hash() { - signal input root[4]; - signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; + signal input rootWitnessCols[4]; // Merkle tree root of the witness columns of Stage <%- i+1 %> + + signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; // AIR values of Stage <%- i+1 %> signal output stageHash[4]; <% const transcriptStage = new Transcript(); -%> -<% transcriptStage.put("root", 4); -%> +<% transcriptStage.put("rootWitnessCols", 4); -%> <% for (let j=0; j <% if(starkInfo.airValuesMap[j].stage == i + 1) { -%> <% const dim = i == 0 ? 1 : 3; -%> @@ -171,9 +172,9 @@ template CalculateStage<%- i+1 %>Hash() { <% } -%> template CalculateEvalsHash() { - signal input evals[<%- starkInfo.evMap.length %>][3]; + signal input evals[<%- starkInfo.evMap.length %>][3]; // Set of evaluations around the out-of-domain sample - signal output evalsHash[4]; + signal output evalsHash[4]; -%> <% const transcriptEvals = new Transcript(); -%> <% for (let i=0; i } -template CalculateFinalPolHash() { - signal input finalPol[<%- 1 << starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits %>][3]; +template CalculateFRILastLayerPolHash() { + signal input lastLayerPol[<%- 1 << starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits %>][3]; // Polynomial sent in clear in the last iteration of the FRI commit phase - signal output finalPolHash[4]; + signal output lastLayerPolHash[4]; -%> -<% const transcriptFinalPol = new Transcript(); -%> +<% const transcriptlastLayerPol = new Transcript(); -%> <% for (let j=0; j< 1< -<%- transcriptFinalPol.getCode(); %> + transcriptlastLayerPol.getState("lastLayerPolHash"); -%> +<%- transcriptlastLayerPol.getCode(); %> } \ No newline at end of file diff --git a/src/vadcop/templates/compressor.circom.ejs b/src/vadcop/templates/compressor.circom.ejs index c1176e8..dffe92f 100644 --- a/src/vadcop/templates/compressor.circom.ejs +++ b/src/vadcop/templates/compressor.circom.ejs @@ -2,26 +2,26 @@ pragma circom 2.1.0; pragma custom_templates; <% for (let i = 0; i < verifierFilenames.length; ++i) { -%> - include "<%- verifierFilenames[i] %>"; +include "<%- verifierFilenames[i] %>"; <% } -%> <%- include('src/vadcop/helpers/templates/calculate_hashes.circom.ejs', { starkInfo, vadcopInfo }); %> template Compressor() { - -<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false} }); %> - +-%> <% if(vadcopInfo.nPublics > 0) { -%> signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; - signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; - -<%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, starkInfo, prefix: "sv", airgroupId: starkInfo.airgroupId, options: {...options, isInput: false} }); %> + signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; -%> +<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false} }); %> +-%> +<%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, starkInfo, prefix: "sv", airgroupId: starkInfo.airgroupId, options: {...options, isInput: false} }); %> +-%> <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "sV", prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false } }); %> - +-%> <% if(vadcopInfo.nPublics > 0) { -%> for (var i=0; i< <%- vadcopInfo.nPublics %>; i++) { sV.publics[i] <== publics[i]; @@ -32,4 +32,4 @@ template Compressor() { } -component main {public [<%- vadcopInfo.nPublics > 0 ? "publics," : "" %>challenges, challengesFRISteps]} = Compressor(); +component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps]} = Compressor(); From 925ce51d35efb1d5b943d5de309534abd4b05583 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Sun, 12 Jan 2025 16:48:15 +0000 Subject: [PATCH 3/9] Separating the aggregation logic from the accumulation logic --- .../define_stark_inputs.circom.ejs | 16 +++--- .../vadcop/acc_vadcop_inputs.circom.ejs | 21 ++++++++ .../vadcop/agg_airgroup_values.circom.ejs | 24 +++++++++ .../vadcop/agg_vadcop_inputs.circom.ejs | 43 ---------------- src/vadcop/helpers/circuits/acc_values.circom | 51 +++++++++++++++++++ src/vadcop/helpers/circuits/agg_values.circom | 47 ----------------- src/vadcop/templates/recursive1.circom.ejs | 2 +- src/vadcop/templates/recursive2.circom.ejs | 36 +++++++++---- 8 files changed, 132 insertions(+), 108 deletions(-) create mode 100644 src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs create mode 100644 src/main_templates/vadcop/agg_airgroup_values.circom.ejs delete mode 100644 src/main_templates/vadcop/agg_vadcop_inputs.circom.ejs create mode 100644 src/vadcop/helpers/circuits/acc_values.circom diff --git a/src/main_templates/define_stark_inputs.circom.ejs b/src/main_templates/define_stark_inputs.circom.ejs index 69c729a..0936dc2 100644 --- a/src/main_templates/define_stark_inputs.circom.ejs +++ b/src/main_templates/define_stark_inputs.circom.ejs @@ -15,25 +15,29 @@ signal input <%- prefix_ %>proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> + // Merkle tree roots of the witness columns at each stage <% for (let s=1; s<=starkInfo.nStages + 1; ++s) { -%> <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> - signal input <%- prefix_ %>root<%- s %>; // Merkle tree root of the witness columns of Stage <%- s %> + signal input <%- prefix_ %>root<%- s %>; <% } else { -%> - signal input <%- prefix_ %>root<%- s %>[4]; // Merkle tree root of the witness columns of Stage <%- s %> + signal input <%- prefix_ %>root<%- s %>[4]; <% } -%> <% } -%> - signal input <%- prefix_ %>evals[<%- starkInfo.evMap.length %>][3]; // Set of evaluations around the out-of-domain sample + // Set of evaluations around the out-of-domain sample + signal input <%- prefix_ %>evals[<%- starkInfo.evMap.length %>][3]; + // Merkle tree roots of the FRI polynomials for each layer during the commit phase <% for (let s=1; s <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> - signal input <%- prefix_ %>s<%- s %>_root; // Merkle tree root of the FRI polynomial for Layer <%- s %> during the commit phase + signal input <%- prefix_ %>s<%- s %>_root; <% } else { -%> - signal input <%- prefix_ %>s<%- s %>_root[4]; // Merkle tree root of the FRI polynomial for Layer <%- s %> during the commit phase + signal input <%- prefix_ %>s<%- s %>_root[4]; <% } -%> <% } -%> - signal input <%- prefix_ %>finalPol[<%- 1 << parseInt(starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits) %>][3]; // Polynomial sent in clear in the last iteration of the FRI commit phase + // Polynomial sent in clear in the last iteration of the FRI commit phase + signal input <%- prefix_ %>finalPol[<%- 1 << parseInt(starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits) %>][3]; // Set of evaluations and Merkle proofs for each of the <%- starkInfo.starkStruct.nQueries %> queries // performed during the FRI query phase, covering all involved polynomials. diff --git a/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs new file mode 100644 index 0000000..998bc66 --- /dev/null +++ b/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs @@ -0,0 +1,21 @@ +<% if(vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) { -%> +<% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; ++i) { -%> + <%- prefix %>_root<%- i+1 %> <== AccumulateValuesNull()(<%- prefix1 %>_root<%- i+1 %>, <%- prefix2 %>_root<%- i+1 %>, <%- prefix1%>_isNull, <%- prefix2%>_isNull); +<% } -%> + + <%- prefix %>_evalsHash <== AccumulateValuesNull()(<%- prefix1 %>_evalsHash, <%- prefix2 %>_evalsHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); +<% for(let i = 1; i < vadcopInfo.stepsFRI.length; i++) { -%> + <%- prefix %>_s<%- i %>_root <== AccumulateValuesNull()(<%- prefix1 %>_s<%- i %>_root, <%- prefix2 %>_s<%- i %>_root, <%- prefix1%>_isNull, <%- prefix2%>_isNull); +<% } -%> +<%- prefix %>_finalPolHash <== AccumulateValuesNull()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); +<% } else { -%> +<% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; ++i) { -%> + <%- prefix %>_root<%- i+1 %> <== AccumulateValues()(<%- prefix1 %>_root<%- i+1 %>, <%- prefix2 %>_root<%- i+1 %>); +<% } -%> + + <%- prefix %>_evalsHash <== AccumulateValues()(<%- prefix1 %>_evalsHash, <%- prefix2 %>_evalsHash); +<% for(let i = 1; i < vadcopInfo.stepsFRI.length; i++) { -%> + <%- prefix %>_s<%- i %>_root <== AccumulateValues()(<%- prefix1 %>_s<%- i %>_root, <%- prefix2 %>_s<%- i %>_root); +<% } -%> +<%- prefix %>_finalPolHash <== AccumulateValues()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash); +<% } -%> \ No newline at end of file diff --git a/src/main_templates/vadcop/agg_airgroup_values.circom.ejs b/src/main_templates/vadcop/agg_airgroup_values.circom.ejs new file mode 100644 index 0000000..cae61ae --- /dev/null +++ b/src/main_templates/vadcop/agg_airgroup_values.circom.ejs @@ -0,0 +1,24 @@ +<%- prefix %>_circuitType <== <%- (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) ? 1 : 0 %>; + +<% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> + <%- prefix %>_aggregationTypes <== aggregationTypes; + signal {binary} aggTypes[<%- vadcopInfo.aggTypes[airgroupId].length %>]; + for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { + <%- prefix %>_aggregationTypes[i] * (<%- prefix %>_aggregationTypes[i] - 1) === 0; + aggTypes[i] <== <%- prefix %>_aggregationTypes[i]; + } +<% } -%> + +<% if(vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) { -%> +<% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> + for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { + <%- prefix %>_airgroupvalues[i] <== AggregateAirgroupValuesNull()(<%- prefix1 %>_airgroupvalues[i], <%- prefix2 %>_airgroupvalues[i], aggTypes[i], <%- prefix1%>_isNull, <%- prefix2%>_isNull); + } +<% } -%> +<% } else { -%> +<% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> + for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { + <%- prefix %>_airgroupvalues[i] <== AggregateAirgroupValues()(<%- prefix1 %>_airgroupvalues[i], <%- prefix2 %>_airgroupvalues[i], aggTypes[i]); + } +<% } -%> +<% } -%> \ No newline at end of file diff --git a/src/main_templates/vadcop/agg_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/agg_vadcop_inputs.circom.ejs deleted file mode 100644 index 91f2169..0000000 --- a/src/main_templates/vadcop/agg_vadcop_inputs.circom.ejs +++ /dev/null @@ -1,43 +0,0 @@ - <%- prefix %>_circuitType <== <%- (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) ? 1 : 0 %>; - -<% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> - <%- prefix %>_aggregationTypes <== aggregationTypes; - signal {binary} aggTypes[<%- vadcopInfo.aggTypes[airgroupId].length %>]; - for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { - <%- prefix %>_aggregationTypes[i] * (<%- prefix %>_aggregationTypes[i] - 1) === 0; - aggTypes[i] <== <%- prefix %>_aggregationTypes[i]; - } -<% } -%> -<% if(vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) { -%> -<% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> - for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { - <%- prefix %>_airgroupvalues[i] <== AggregateAirgroupValuesNull()(<%- prefix1 %>_airgroupvalues[i], <%- prefix2 %>_airgroupvalues[i], aggTypes[i], <%- prefix1%>_isNull, <%- prefix2%>_isNull); - } -<% } -%> - -<% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; ++i) { -%> - <%- prefix %>_root<%- i+1 %> <== AggregateValuesNull()(<%- prefix1 %>_root<%- i+1 %>, <%- prefix2 %>_root<%- i+1 %>, <%- prefix1%>_isNull, <%- prefix2%>_isNull); -<% } -%> - - <%- prefix %>_evalsHash <== AggregateValuesNull()(<%- prefix1 %>_evalsHash, <%- prefix2 %>_evalsHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); -<% for(let i = 1; i < vadcopInfo.stepsFRI.length; i++) { -%> - <%- prefix %>_s<%- i %>_root <== AggregateValuesNull()(<%- prefix1 %>_s<%- i %>_root, <%- prefix2 %>_s<%- i %>_root, <%- prefix1%>_isNull, <%- prefix2%>_isNull); -<% } -%> -<%- prefix %>_finalPolHash <== AggregateValuesNull()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); -<% } else { -%> -<% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> - for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { - <%- prefix %>_airgroupvalues[i] <== AggregateAirgroupValues()(<%- prefix1 %>_airgroupvalues[i], <%- prefix2 %>_airgroupvalues[i], aggTypes[i]); - } -<% } -%> - -<% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; ++i) { -%> - <%- prefix %>_root<%- i+1 %> <== AggregateValues()(<%- prefix1 %>_root<%- i+1 %>, <%- prefix2 %>_root<%- i+1 %>); -<% } -%> - - <%- prefix %>_evalsHash <== AggregateValues()(<%- prefix1 %>_evalsHash, <%- prefix2 %>_evalsHash); -<% for(let i = 1; i < vadcopInfo.stepsFRI.length; i++) { -%> - <%- prefix %>_s<%- i %>_root <== AggregateValues()(<%- prefix1 %>_s<%- i %>_root, <%- prefix2 %>_s<%- i %>_root); -<% } -%> - <%- prefix %>_finalPolHash <== AggregateValues()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash); -<% } -%> \ No newline at end of file diff --git a/src/vadcop/helpers/circuits/acc_values.circom b/src/vadcop/helpers/circuits/acc_values.circom new file mode 100644 index 0000000..0493082 --- /dev/null +++ b/src/vadcop/helpers/circuits/acc_values.circom @@ -0,0 +1,51 @@ +pragma circom 2.1.0; +pragma custom_templates; + +include "poseidon.circom"; +include "mux1.circom"; + +template AccumulateValues() { + signal input valueA[4]; + signal input valueB[4]; + + signal output valueAB[4]; + + // Calculate the hash of valueA and valueB + signal hash[12] <== Poseidon(12)([valueA[0], valueA[1], valueA[2], valueA[3], valueB[0], valueB[1], valueB[2], valueB[3]], [0,0,0,0]); + valueAB <== [hash[0], hash[1], hash[2], hash[3]]; +} + +template AccumulateValuesNull() { + signal input valueA[4]; + signal input valueB[4]; + signal input {binary} isNullA; // 1 if is circuit type A is 0 (null), 0 otherwise + signal input {binary} isNullB; // 1 if is circuit type B is 0 (null), 0 otherwise + + signal output valueAB[4]; + + // Calculate the hash of valueA and valueB + signal hash[12] <== Poseidon(12)([valueA[0], valueA[1], valueA[2], valueA[3], valueB[0], valueB[1], valueB[2], valueB[3]], [0,0,0,0]); + signal hashAB[4] <== [hash[0], hash[1], hash[2], hash[3]]; + + // If valueA or valueB is [0,0,0], it means that the particular airgroupvalue does not have that stage. Therefore we should proceed the same way as if circuitType is null + signal isValueA1Zero <== IsZero()(valueA[0]); + signal isValueA2Zero <== IsZero()(valueA[1]); + signal isValueA3Zero <== IsZero()(valueA[2]); + signal isValueA4Zero <== IsZero()(valueA[3]); + signal isValueAZero <== IsZero()(4 - (isValueA1Zero + isValueA2Zero + isValueA3Zero + isValueA4Zero)); + + signal isValueB1Zero <== IsZero()(valueB[0]); + signal isValueB2Zero <== IsZero()(valueB[1]); + signal isValueB3Zero <== IsZero()(valueB[2]); + signal isValueB4Zero <== IsZero()(valueB[3]); + signal isValueBZero <== IsZero()(4 - (isValueB1Zero + isValueB2Zero + isValueB3Zero + isValueB4Zero)); + + + // If circuit type A is null || valueA === 0 and circuit type B is null || valueB === 0, then the valueAB is 0 + // If circuit type A is not null && valueA !== 0 and circuit type B is null || valueB === 0, then the valueAB is valueA + // If circuit type A is null || valueA === 0 and circuit type B is not null && valueB !== 0, then the valueAB is valueB + // If circuit type A is not null && valueA !== 0 and circuit type B is not null && valueB !== 0, then the valueAB is hashAB + + signal {binary} s[2] <== [(1 - isNullA)*(1 - isValueAZero), (1 - isNullB)*(1 - isValueBZero)]; + valueAB <== MultiMux2(4)([[0,0,0,0], valueA, valueB, hashAB], s); +} \ No newline at end of file diff --git a/src/vadcop/helpers/circuits/agg_values.circom b/src/vadcop/helpers/circuits/agg_values.circom index f4e573f..c9b5222 100644 --- a/src/vadcop/helpers/circuits/agg_values.circom +++ b/src/vadcop/helpers/circuits/agg_values.circom @@ -4,17 +4,6 @@ pragma custom_templates; include "poseidon.circom"; include "mux1.circom"; -template AggregateValues() { - signal input valueA[4]; - signal input valueB[4]; - - signal output valueAB[4]; - - // Calculate the hash of valueA and valueB - signal hash[12] <== Poseidon(12)([valueA[0], valueA[1], valueA[2], valueA[3], valueB[0], valueB[1], valueB[2], valueB[3]], [0,0,0,0]); - valueAB <== [hash[0], hash[1], hash[2], hash[3]]; -} - template AggregateAirgroupValues() { signal input airgroupValueA[3]; signal input airgroupValueB[3]; @@ -31,42 +20,6 @@ template AggregateAirgroupValues() { airgroupValueAB <== MultiMux1(3)(values, aggregationType); } - -template AggregateValuesNull() { - signal input valueA[4]; - signal input valueB[4]; - signal input {binary} isNullA; // 1 if is circuit type A is 0 (null), 0 otherwise - signal input {binary} isNullB; // 1 if is circuit type B is 0 (null), 0 otherwise - - signal output valueAB[4]; - - // Calculate the hash of valueA and valueB - signal hash[12] <== Poseidon(12)([valueA[0], valueA[1], valueA[2], valueA[3], valueB[0], valueB[1], valueB[2], valueB[3]], [0,0,0,0]); - signal hashAB[4] <== [hash[0], hash[1], hash[2], hash[3]]; - - // If valueA or valueB is [0,0,0], it means that the particular airgroupvalue does not have that stage. Therefore we should proceed the same way as if circuitType is null - signal isValueA1Zero <== IsZero()(valueA[0]); - signal isValueA2Zero <== IsZero()(valueA[1]); - signal isValueA3Zero <== IsZero()(valueA[2]); - signal isValueA4Zero <== IsZero()(valueA[3]); - signal isValueAZero <== IsZero()(4 - (isValueA1Zero + isValueA2Zero + isValueA3Zero + isValueA4Zero)); - - signal isValueB1Zero <== IsZero()(valueB[0]); - signal isValueB2Zero <== IsZero()(valueB[1]); - signal isValueB3Zero <== IsZero()(valueB[2]); - signal isValueB4Zero <== IsZero()(valueB[3]); - signal isValueBZero <== IsZero()(4 - (isValueB1Zero + isValueB2Zero + isValueB3Zero + isValueB4Zero)); - - - // If circuit type A is null || valueA === 0 and circuit type B is null || valueB === 0, then the valueAB is 0 - // If circuit type A is not null && valueA !== 0 and circuit type B is null || valueB === 0, then the valueAB is valueA - // If circuit type A is null || valueA === 0 and circuit type B is not null && valueB !== 0, then the valueAB is valueB - // If circuit type A is not null && valueA !== 0 and circuit type B is not null && valueB !== 0, then the valueAB is hashAB - - signal {binary} s[2] <== [(1 - isNullA)*(1 - isValueAZero), (1 - isNullB)*(1 - isValueBZero)]; - valueAB <== MultiMux2(4)([[0,0,0,0], valueA, valueB, hashAB], s); -} - template AggregateAirgroupValuesNull() { signal input airgroupValueA[3]; signal input airgroupValueB[3]; diff --git a/src/vadcop/templates/recursive1.circom.ejs b/src/vadcop/templates/recursive1.circom.ejs index 68f264c..61fc735 100644 --- a/src/vadcop/templates/recursive1.circom.ejs +++ b/src/vadcop/templates/recursive1.circom.ejs @@ -36,7 +36,7 @@ template Recursive1() { } <% if(!options.hasCompressor) { -%> - component main {public [<%- vadcopInfo.nPublics > 0 ? "publics," : "" %>challenges, challengesFRISteps, rootCAgg]} = Recursive1(); + component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps, rootCAgg]} = Recursive1(); <% } else { -%> <% if(vadcopInfo.nPublics > 0) publicsNames.push("publics"); -%> <% publicsNames.push(...["challenges", "challengesFRISteps", "rootCAgg"]); -%> diff --git a/src/vadcop/templates/recursive2.circom.ejs b/src/vadcop/templates/recursive2.circom.ejs index 9c8a5b7..bcde3b5 100644 --- a/src/vadcop/templates/recursive2.circom.ejs +++ b/src/vadcop/templates/recursive2.circom.ejs @@ -3,6 +3,7 @@ pragma custom_templates; include "select_vk.circom"; include "agg_values.circom"; +include "acc_values.circom"; <% for (let i = 0; i < verifierFilenames.length; ++i) { -%> include "<%- verifierFilenames[i] %>"; @@ -37,29 +38,42 @@ template Recursive2() { <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "sv", vadcopInfo, airgroupId, starkInfo, options: {...options, isInput: false} }); %> + // Verify the first STARK proof <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "vA", prefix: "a", starkInfo, nPublics: vadcopInfo.nPublics }); %> -<%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "vB", prefix: "b", starkInfo, nPublics: vadcopInfo.nPublics }); %> - <%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vA", vadcopInfo, prefix: "a_sv", prefixStark: "a", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> -<%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vB", vadcopInfo, prefix: "b_sv", prefixStark: "b", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> + + for (var i = 0; i < 4; i++) { + vA.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; + } <% if(vadcopInfo.air_groups.length === 1 && vadcopInfo.airs[0].length === 1) { -%> vA.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootCBasics, rootCAgg); - vB.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootCBasics, rootCAgg); <% } else { -%> vA.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootCBasics, rootCAgg); - vB.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootCBasics, rootCAgg); <% } -%> -<%- include('src/main_templates/vadcop/agg_vadcop_inputs.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> + // Verify the second STARK proof +<%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "vB", prefix: "b", starkInfo, nPublics: vadcopInfo.nPublics }); %> +<%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vB", vadcopInfo, prefix: "b_sv", prefixStark: "b", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> - // TODO! VERIFY SINGLE FRI - - for (var i=0; i<4; i++) { - vA.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; + for (var i = 0; i < 4; i++) { vB.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; } + +<% if(vadcopInfo.air_groups.length === 1 && vadcopInfo.airs[0].length === 1) { -%> + vB.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootCBasics, rootCAgg); +<% } else { -%> + vB.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootCBasics, rootCAgg); +<% } -%> + + // Aggregate the AIR group values + <%- include('src/main_templates/vadcop/agg_airgroup_values.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> + + // Accumulate the proof elements + <%- include('src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> + + // TODO! VERIFY SINGLE FRI } -component main {public [<%- vadcopInfo.nPublics > 0 ? "publics," : "" %>challenges, challengesFRISteps, rootCAgg]} = Recursive2(); +component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps, rootCAgg]} = Recursive2(); From 5f01b4ef081e69ac349071c1b03fd9f8672d7675 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Mon, 13 Jan 2025 09:34:04 +0000 Subject: [PATCH 4/9] Reordering and renaming --- .../assign_stark_inputs.circom.ejs | 2 +- .../define_stark_inputs.circom.ejs | 2 +- .../vadcop/agg_airgroup_values.circom.ejs | 4 +- .../vadcop/assign_vadcop_inputs.circom.ejs | 6 +-- .../vadcop/define_vadcop_inputs.circom.ejs | 5 ++- .../vadcop/init_vadcop_inputs.circom.ejs | 2 +- .../circuits.bn128/stark_verifier.circom.ejs | 8 ++-- .../circuits.gl/stark_verifier.circom.ejs | 8 ++-- .../verify_global_constraints.circom.ejs | 4 +- src/vadcop/templates/final.circom.ejs | 2 +- src/vadcop/templates/recursive2.circom.ejs | 39 ++++++++++++------- 11 files changed, 48 insertions(+), 34 deletions(-) diff --git a/src/main_templates/assign_stark_inputs.circom.ejs b/src/main_templates/assign_stark_inputs.circom.ejs index a017ba9..717717b 100644 --- a/src/main_templates/assign_stark_inputs.circom.ejs +++ b/src/main_templates/assign_stark_inputs.circom.ejs @@ -18,7 +18,7 @@ <% } -%> <% if(starkInfo.airgroupValuesMap.length > 0) { -%> - <%- componentName %>.airgroupvalues <== <%- prefix_ %>airgroupvalues; + <%- componentName %>.airgroupValues <== <%- prefix_ %>airgroupValues; <% } -%> <% if(starkInfo.airValuesMap.length > 0) { -%> diff --git a/src/main_templates/define_stark_inputs.circom.ejs b/src/main_templates/define_stark_inputs.circom.ejs index 0936dc2..2f11328 100644 --- a/src/main_templates/define_stark_inputs.circom.ejs +++ b/src/main_templates/define_stark_inputs.circom.ejs @@ -8,7 +8,7 @@ <% } -%> <% if(starkInfo.airgroupValuesMap && starkInfo.airgroupValuesMap.length > 0) { -%> - signal input <%- prefix_ %>airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; + signal input <%- prefix_ %>airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; <% } -%> <% if(starkInfo.proofValuesMap && starkInfo.proofValuesMap.length > 0) { -%> diff --git a/src/main_templates/vadcop/agg_airgroup_values.circom.ejs b/src/main_templates/vadcop/agg_airgroup_values.circom.ejs index cae61ae..521e011 100644 --- a/src/main_templates/vadcop/agg_airgroup_values.circom.ejs +++ b/src/main_templates/vadcop/agg_airgroup_values.circom.ejs @@ -12,13 +12,13 @@ <% if(vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) { -%> <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { - <%- prefix %>_airgroupvalues[i] <== AggregateAirgroupValuesNull()(<%- prefix1 %>_airgroupvalues[i], <%- prefix2 %>_airgroupvalues[i], aggTypes[i], <%- prefix1%>_isNull, <%- prefix2%>_isNull); + <%- prefix %>_airgroupValues[i] <== AggregateAirgroupValuesNull()(<%- prefix1 %>_airgroupValues[i], <%- prefix2 %>_airgroupValues[i], aggTypes[i], <%- prefix1%>_isNull, <%- prefix2%>_isNull); } <% } -%> <% } else { -%> <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { - <%- prefix %>_airgroupvalues[i] <== AggregateAirgroupValues()(<%- prefix1 %>_airgroupvalues[i], <%- prefix2 %>_airgroupvalues[i], aggTypes[i]); + <%- prefix %>_airgroupValues[i] <== AggregateAirgroupValues()(<%- prefix1 %>_airgroupValues[i], <%- prefix2 %>_airgroupValues[i], aggTypes[i]); } <% } -%> <% } -%> \ No newline at end of file diff --git a/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs index 192dece..b3226c8 100644 --- a/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs @@ -11,9 +11,9 @@ <% nPublicsInps += vadcopInfo.aggTypes[airgroupId].length ; -%> for(var i = 0; i < <%- vadcopInfo.aggTypes[airgroupId].length %>; i++) { - <%- componentName %>.publics[<%- nPublicsInps %> + 3*i] <== <%- prefix_ %>airgroupvalues[i][0]; - <%- componentName %>.publics[<%- nPublicsInps %> + 3*i + 1] <== <%- prefix_ %>airgroupvalues[i][1]; - <%- componentName %>.publics[<%- nPublicsInps %> + 3*i + 2] <== <%- prefix_ %>airgroupvalues[i][2]; + <%- componentName %>.publics[<%- nPublicsInps %> + 3*i] <== <%- prefix_ %>airgroupValues[i][0]; + <%- componentName %>.publics[<%- nPublicsInps %> + 3*i + 1] <== <%- prefix_ %>airgroupValues[i][1]; + <%- componentName %>.publics[<%- nPublicsInps %> + 3*i + 2] <== <%- prefix_ %>airgroupValues[i][2]; } <% nPublicsInps += 3*vadcopInfo.aggTypes[airgroupId].length ; -%> <% } -%> diff --git a/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs index 7e08cc3..be859a7 100644 --- a/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs @@ -9,8 +9,9 @@ signal <%- signalType %> <%- prefix_ %>aggregationTypes[<%- vadcopInfo.aggTypes[airgroupId].length %>]; <% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}aggregationTypes`) -%> <% } -%> - signal <%- signalType %> <%- prefix_ %>airgroupvalues[<%- vadcopInfo.aggTypes[airgroupId].length %>][3]; -<% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}airgroupvalues`) -%> + + signal <%- signalType %> <%- prefix_ %>airgroupValues[<%- vadcopInfo.aggTypes[airgroupId].length %>][3]; +<% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}airgroupValues`) -%> <% } -%> diff --git a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs index 9e61ff8..1c9550a 100644 --- a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs @@ -36,7 +36,7 @@ <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> <% for (let i = 0; i < vadcopInfo.aggTypes[airgroupId].length; ++i) { -%> - <%- prefix_ %>airgroupvalues[<%- i %>] <== <%- prefixStark_ %>airgroupvalues[<%- i %>]; + <%- prefix_ %>airgroupValues[<%- i %>] <== <%- prefixStark_ %>airgroupValues[<%- i %>]; <% } -%> <% } -%> diff --git a/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs b/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs index fbe8071..0fb3bb8 100644 --- a/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.bn128/stark_verifier.circom.ejs @@ -181,7 +181,7 @@ class Transcript { <% } else if (r.type == "const") { -%> <% return "consts[" + r.id + "]"; -%> <% } else if (r.type === "airgroupvalue") { -%> -<% return "airgroupvalues[" + r.id + "]"; -%> +<% return "airgroupValues[" + r.id + "]"; -%> <% } else if (r.type == "number") { -%> <% let val = r.value; -%> <% if(val < 0n) val = F.add(BigInt(val),18446744069414584321n); -%> @@ -462,7 +462,7 @@ template parallel VerifyEvaluations() { signal input {maxNum} publics[<%- starkInfo.nPublics %>]; <% } -%> <% if(starkInfo.airgroupValuesMap.length > 0) { -%> - signal input airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; + signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; <% } -%> signal input {binary} enable; @@ -779,7 +779,7 @@ template StarkVerifier() { signal input publics[<%- starkInfo.nPublics %>]; <% } -%> <% if(starkInfo.airgroupValuesMap.length > 0) { -%> - signal input airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; // airgroupvalue values + signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; // airgroupvalue values <% } -%> <% for(let i=0; i < starkInfo.nStages; i++) { -%> <% const stage = i + 1; -%> @@ -867,7 +867,7 @@ template StarkVerifier() { signal {maxNum} airgroupValuesGL[<%- starkInfo.airgroupValuesMap.length %>][3]; for(var i = 0; i < <%- starkInfo.airgroupValuesMap.length %>; i++){ for(var j = 0; j < 3; j++) { - airgroupValuesGL[i][j] <== LessThan64Bits()(airgroupvalues[i][j]); + airgroupValuesGL[i][j] <== LessThan64Bits()(airgroupValues[i][j]); } } <% } -%> diff --git a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs index c54a484..7b33536 100644 --- a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs @@ -47,7 +47,7 @@ pragma custom_templates; } else if (r.type == "number") { return r.value; } else if (r.type === "airgroupvalue") { - return "airgroupvalues[" + r.id + "]"; + return "airgroupValues[" + r.id + "]"; } else if (r.type === "airvalue") { if(r.dim == 1) { return "airvalues[" + r.id + "][0]"; @@ -417,7 +417,7 @@ template <%- verifyEvaluationsName %>() { signal input publics[<%- starkInfo.nPublics %>]; <% } -%> <% if(starkInfo.airgroupValuesMap.length > 0) { -%> - signal input airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; + signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; <% } -%> <% if(starkInfo.airValuesMap.length > 0) { -%> signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; @@ -690,7 +690,7 @@ template <%- verifierName %>() { signal input publics[<%- starkInfo.nPublics %>]; // publics polynomials <% } -%> <% if(starkInfo.airgroupValuesMap.length > 0) { -%> - signal input airgroupvalues[<%- starkInfo.airgroupValuesMap.length %>][3]; // airgroupvalue values + signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; // airgroupvalue values <% } -%> <% if(starkInfo.airValuesMap.length > 0) { -%> signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; // air values @@ -841,7 +841,7 @@ template <%- verifierName %>() { <% verifyEvalsInputs.push("challengeXi"); -%> <% verifyEvalsInputs.push("evals"); -%> <% if(starkInfo.nPublics > 0) verifyEvalsInputs.push("publics"); -%> -<% if(starkInfo.airgroupValuesMap.length > 0) verifyEvalsInputs.push("airgroupvalues"); -%> +<% if(starkInfo.airgroupValuesMap.length > 0) verifyEvalsInputs.push("airgroupValues"); -%> <% if(starkInfo.airValuesMap.length > 0) verifyEvalsInputs.push("airvalues"); -%> <% if(starkInfo.proofValuesMap.length > 0) verifyEvalsInputs.push("proofvalues"); -%> <% verifyEvalsInputs.push("enabled"); -%> diff --git a/src/vadcop/helpers/templates/verify_global_constraints.circom.ejs b/src/vadcop/helpers/templates/verify_global_constraints.circom.ejs index 470311f..1bfda6d 100644 --- a/src/vadcop/helpers/templates/verify_global_constraints.circom.ejs +++ b/src/vadcop/helpers/templates/verify_global_constraints.circom.ejs @@ -15,7 +15,7 @@ } else if (r.type == "challenge") { return "challenges[" + r.id + "]"; } else if (r.type === "airgroupvalue") { - return "s" + r.airgroupId + "_airgroupvalues[" + r.id + "]"; + return "s" + r.airgroupId + "_airgroupValues[" + r.id + "]"; } else { throw new Error("Invalid Ref: " +r.type); } @@ -70,7 +70,7 @@ template VerifyGlobalConstraints() { <% for(let i = 0; i < vadcopInfo.aggTypes.length; ++i) { -%> - signal input s<%- i %>_airgroupvalues[<%- vadcopInfo.aggTypes[i].length %>][3]; + signal input s<%- i %>_airgroupValues[<%- vadcopInfo.aggTypes[i].length %>][3]; <% } -%> <% if(vadcopInfo.nPublics > 0) { -%> signal input publics[<%- vadcopInfo.nPublics %>]; diff --git a/src/vadcop/templates/final.circom.ejs b/src/vadcop/templates/final.circom.ejs index 874984a..bdcc12c 100644 --- a/src/vadcop/templates/final.circom.ejs +++ b/src/vadcop/templates/final.circom.ejs @@ -85,7 +85,7 @@ template Final() { verifyGlobalConstraints.challenges <== challenges; <% for(let i = 0; i < vadcopInfo.aggTypes.length; ++i) { -%> <% if(vadcopInfo.aggTypes[i].length > 0) { -%> - verifyGlobalConstraints.s<%- i %>_airgroupvalues <== s<%- i %>_sv_airgroupvalues; + verifyGlobalConstraints.s<%- i %>_airgroupValues <== s<%- i %>_sv_airgroupValues; <% } -%> <% } -%> } diff --git a/src/vadcop/templates/recursive2.circom.ejs b/src/vadcop/templates/recursive2.circom.ejs index bcde3b5..7db8442 100644 --- a/src/vadcop/templates/recursive2.circom.ejs +++ b/src/vadcop/templates/recursive2.circom.ejs @@ -11,15 +11,20 @@ include "<%- verifierFilenames[i] %>"; template Recursive2() { - var rootCBasics[<%- vadcopInfo.airs[airgroupId].length %>][4]; + // Merkle tree roots for the fixed columns of each AIR within AIR group <%- airgroupId %> + var rootFixedAIRs[<%- vadcopInfo.airs[airgroupId].length %>][4]; -%> <% for(let i = 0; i < vadcopInfo.airs[airgroupId].length; ++i) { -%> - rootCBasics[<%- i %>] = [<%- basicVK[i].join(",") %>]; + rootFixedAIRs[<%- i %>] = [<%- basicVK[i].join(",") %>]; <% } -%> -<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "a", starkInfo, nPublics: vadcopInfo.nPublics, addPublics: false }); %> -<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "b", starkInfo, nPublics: vadcopInfo.nPublics, addPublics: false }); %> + // Merkle tree root for the fixed columns of the aggregation + signal input rootFixedAgg[4]; + + // Note: `rootFixedAIRs` is used for proof verification in the base layer of the aggregation tree, + // while `rootFixedAgg` is used for proof verification in the higher layers + // Get the global VADCOP data <% if(vadcopInfo.nPublics > 0) { -%> signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> @@ -27,15 +32,23 @@ template Recursive2() { signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1%>][3]; - signal input rootCAgg[4]; - <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> signal input aggregationTypes[<%- vadcopInfo.aggTypes[airgroupId].length %>]; <% } -%> + // Get the first STARK proof data (prefix "a") +<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "a", starkInfo, nPublics: vadcopInfo.nPublics, addPublics: false }); %> + + // Get the second STARK proof data (prefix "b") +<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "b", starkInfo, nPublics: vadcopInfo.nPublics, addPublics: false }); %> + + // Get the VADCOP data for the first STARK proof (prefix "a_sv") <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "a_sv", vadcopInfo, airgroupId, starkInfo, options: {...options, addPublics: false, isInput: true, isAggregation: true} }); %> + + // Get the VADCOP data for the second STARK proof (prefix "b_sv") <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "b_sv", vadcopInfo, airgroupId, starkInfo, options: {...options, addPublics: false, isInput: true, isAggregation: true} }); %> + // Define the outputs <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "sv", vadcopInfo, airgroupId, starkInfo, options: {...options, isInput: false} }); %> // Verify the first STARK proof @@ -43,13 +56,13 @@ template Recursive2() { <%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vA", vadcopInfo, prefix: "a_sv", prefixStark: "a", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> for (var i = 0; i < 4; i++) { - vA.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; + vA.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootFixedAgg[i]; } <% if(vadcopInfo.air_groups.length === 1 && vadcopInfo.airs[0].length === 1) { -%> - vA.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootCBasics, rootCAgg); + vA.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootFixedAIRs, rootFixedAgg); <% } else { -%> - vA.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootCBasics, rootCAgg); + vA.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootFixedAIRs, rootFixedAgg); <% } -%> // Verify the second STARK proof @@ -57,13 +70,13 @@ template Recursive2() { <%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vB", vadcopInfo, prefix: "b_sv", prefixStark: "b", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> for (var i = 0; i < 4; i++) { - vB.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootCAgg[i]; + vB.publics[<%- starkInfo.nPublics - 4 %> + i] <== rootFixedAgg[i]; } <% if(vadcopInfo.air_groups.length === 1 && vadcopInfo.airs[0].length === 1) { -%> - vB.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootCBasics, rootCAgg); + vB.rootC <== SelectVerificationKey(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootFixedAIRs, rootFixedAgg); <% } else { -%> - vB.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootCBasics, rootCAgg); + vB.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootFixedAIRs, rootFixedAgg); <% } -%> // Aggregate the AIR group values @@ -76,4 +89,4 @@ template Recursive2() { } -component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps, rootCAgg]} = Recursive2(); +component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps, rootFixedAgg]} = Recursive2(); From b78b9c374a7158f47eab5c4afdd7d258f24db7f7 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Mon, 13 Jan 2025 17:53:50 +0000 Subject: [PATCH 5/9] Keeping refactoring the circuits --- .../assign_stark_inputs.circom.ejs | 1 + .../define_stark_inputs.circom.ejs | 4 +- .../vadcop/init_vadcop_inputs.circom.ejs | 4 +- .../circuits.gl/stark_verifier.circom.ejs | 170 ++++++++---------- .../templates/calculate_hashes.circom.ejs | 12 +- src/vadcop/templates/compressor.circom.ejs | 20 ++- 6 files changed, 97 insertions(+), 114 deletions(-) diff --git a/src/main_templates/assign_stark_inputs.circom.ejs b/src/main_templates/assign_stark_inputs.circom.ejs index 717717b..88cdde2 100644 --- a/src/main_templates/assign_stark_inputs.circom.ejs +++ b/src/main_templates/assign_stark_inputs.circom.ejs @@ -11,6 +11,7 @@ component <%- componentName %> = StarkVerifier(); <% } -%> + // Assign the AIR STARK proof data <% if(options.addPublics && nPublics > 0) { -%> for (var i=0; i< <%- nPublics %>; i++) { <%- componentName %>.publics[i] <== <%- prefix_ %>publics[i]; diff --git a/src/main_templates/define_stark_inputs.circom.ejs b/src/main_templates/define_stark_inputs.circom.ejs index 2f11328..72f5fbc 100644 --- a/src/main_templates/define_stark_inputs.circom.ejs +++ b/src/main_templates/define_stark_inputs.circom.ejs @@ -6,11 +6,11 @@ <% if(starkInfo.airValuesMap && starkInfo.airValuesMap.length > 0) { -%> signal input <%- prefix_ %>airvalues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> - +-%> <% if(starkInfo.airgroupValuesMap && starkInfo.airgroupValuesMap.length > 0) { -%> signal input <%- prefix_ %>airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; <% } -%> - +-%> <% if(starkInfo.proofValuesMap && starkInfo.proofValuesMap.length > 0) { -%> signal input <%- prefix_ %>proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> diff --git a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs index 1c9550a..9c4d9d0 100644 --- a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs @@ -3,6 +3,7 @@ <% let c = 0; -%> + // Assign the VADCOP data <% for(let i = 0; i < vadcopInfo.numChallenges.length; ++i) { -%> <% for(let j = 0; j < vadcopInfo.numChallenges[i]; ++j) { -%> <% if(i < starkInfo.nStages && j < starkInfo.challengesMap.filter(c => c.stage == i + 1).length) { -%> @@ -26,7 +27,7 @@ <% } -%> <%- componentName %>.challengesFRISteps[<%- starkInfo.starkStruct.steps.length %>] <== challengesFRISteps[<%- vadcopInfo.stepsFRI.length %>]; - + // --> Compute the outputs <% let circuitType = (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) ? starkInfo.airId + 2 : starkInfo.airId + 1; -%> <%- prefix_ %>circuitType <== <%- circuitType %>; @@ -41,6 +42,7 @@ <% } -%> + // Assign the prover messages as outputs, compressing them if there are more than one at the same stage <% for (let i = 0; i < starkInfo.nStages; ++i) { -%> <% if(i == 0) { -%> <% if(starkInfo.airValuesMap.filter(a => a.stage == i + 1).length > 0) { -%> diff --git a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs index 7b33536..9817d57 100644 --- a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs @@ -686,98 +686,89 @@ template <%- mapValuesName %>() { <% verifierName += airgroupId; -%> <% } -%> template <%- verifierName %>() { + // Signal used to enable or disable the constraints + signal {binary} enabled; + <% if (options.enableInput) { -%> + signal input enable; + enable * (enable -1) === 0; + enabled <== enable; + <% } else { -%> + enabled <== 1; + <% } -%> + <% if(starkInfo.nPublics > 0) { -%> - signal input publics[<%- starkInfo.nPublics %>]; // publics polynomials + signal input publics[<%- starkInfo.nPublics %>]; <% } -%> -<% if(starkInfo.airgroupValuesMap.length > 0) { -%> - signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; // airgroupvalue values -<% } -%> + <% if(starkInfo.airValuesMap.length > 0) { -%> - signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; // air values + signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; +<% } -%> +<% if(starkInfo.airgroupValuesMap.length > 0) { -%> + signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; <% } -%> <% if(starkInfo.proofValuesMap.length > 0) { -%> - signal input proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; // air values + signal input proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> + + // Merkle tree roots of the witness columns at each stage <% for(let i=0; i < starkInfo.nStages; i++) { -%> <% const stage = i + 1; -%> - signal input root<%- stage %>[4]; // Merkle tree root of stage <%- stage %> + signal input root<%- stage %>[4]; <% } -%> - signal input root<%- qStage %>[4]; // Merkle tree root of the evaluations of the quotient Q1 and Q2 polynomials + signal input root<%- qStage %>[4]; + // Merkle tree roots of the fixed columns <% if (options.verkeyInput) { -%> <% /* Depending on the STARK being verified, the rootC will be hardcoded or passed as an input */%> - signal input rootC[4]; // Merkle tree root of the evaluations of constant polynomials + signal input rootC[4]; <% } else { -%> <% if (options.inputChallenges) { -%> - signal output rootC[4] <== [<%- constRoot.join(',') %> ]; // Merkle tree root of the evaluations of constant polynomials + signal output rootC[4] <== [<%- constRoot.join(',') %> ]; <% } else { -%> - signal rootC[4] <== [<%- constRoot.join(',') %> ]; // Merkle tree root of the evaluations of constant polynomials + signal rootC[4] <== [<%- constRoot.join(',') %> ]; <% } -%> <% } -%> - signal input evals[<%- starkInfo.evMap.length %>][3]; // Evaluations of the set polynomials at a challenge value z and gz + // Set of evaluations around the out-of-domain sample + signal input evals[<%- starkInfo.evMap.length %>][3]; - // Leaves values of the merkle tree used to check all the queries -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> - signal input s0_vals<%- stage %>[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${stage}`] %>]; -<% } -%> -<% } -%> - signal input s0_vals<%- qStage %>[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${qStage}`] %>]; + // Merkle tree roots of the FRI polynomials for each layer during the commit phase +<% let si_roots = []; -%> +<% for (let s=1; s +<% si_roots.push(`s${s}_root`); -%> + signal input s<%- s %>_root[4]; +<% } -%> + + // Polynomial sent in clear in the last iteration of the FRI commit phase + signal input finalPol[<%- 1 << starkStruct.steps[starkStruct.steps.length-1].nBits %>][3]; + + // Set of evaluations and Merkle proofs for each of the <%- starkStruct.nQueries %> queries + // performed during the FRI query phase, covering all involved polynomials signal input s0_valsC[<%- starkStruct.nQueries %>][<%- starkInfo.nConstants %>]; + signal input s0_siblingsC[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; -<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> +<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> signal input s0_vals_<%- starkInfo.customCommits[i].name %>_0[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>]; -<% }-%> + signal input s0_siblings_<%- starkInfo.customCommits[i].name %>_0[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; +<% } -%> - // Merkle proofs for each of the evaluations -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> - signal input s0_siblings<%- stage %>[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; +<% for (let i = 1; i < starkInfo.nStages + 1; ++i) { -%> +<% if (starkInfo.mapSectionsN[`cm${i}`] > 0) { -%> + signal input s0_vals<%- i %>[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${i}`] %>]; + signal input s0_siblings<%- i %>[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; <% } -%> -<% } -%> +<% } -%> + signal input s0_vals<%- qStage %>[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${qStage}`] %>]; signal input s0_siblings<%- qStage %>[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; - signal input s0_siblingsC[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; -<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> - signal input s0_siblings_<%- starkInfo.customCommits[i].name %>_0[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; -<% } -%> - // Contains the root of the original polynomial and all the intermediate FRI polynomials except for the last step -<% let si_roots = []; -%> -<% for (let s=1; s -<% si_roots.push(`s${s}_root`); -%> - signal input s<%- s %>_root[4]; -<% } -%> - // For each intermediate FRI polynomial and the last one, we store at vals the values needed to check the queries. - // Given a query r, the verifier needs b points to check it out, being b = 2^u, where u is the difference between two consecutive step - // and the sibling paths for each query. <% for (let s=1; s signal input s<%- s %>_vals[<%- starkStruct.nQueries %>][<%- (1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits))*3 %>]; signal input s<%- s %>_siblings[<%- starkStruct.nQueries %>][<%- starkStruct.steps[s].nBits %>][4]; <% } -%> - // Evaluations of the final FRI polynomial over a set of points of size bounded its degree - signal input finalPol[<%- 1 << starkStruct.steps[starkStruct.steps.length-1].nBits %>][3]; - - signal {binary} enabled; -<% if (options.enableInput) { -%> - signal input enable; - enable * (enable -1) === 0; - enabled <== enable; -<% } else { -%> - enabled <== 1; -<% } -%> - -<% if (options.multiFRI) { -%> - signal output queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; -<% } else { -%> - signal queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; -<% } -%> - <% if (!options.inputChallenges) { -%> <% let challengeNames = []; -%> + // Proof challenges <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> signal challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; @@ -789,11 +780,6 @@ template <%- verifierName %>() { signal challengesFRI[2][3]; <% challengeNames.push(...["challengeQ", "challengeXi", "challengesFRI"]); -%> - - // challengesFRISteps contains the random value provided by the verifier at each step of the folding so that - // the prover can commit the polynomial. - // Remember that, when folding, the prover does as follows: f0 = g_0 + X*g_1 + ... + (X^b)*g_b and then the - // verifier provides a random X so that the prover can commit it. This value is stored here. signal challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; // Challenges from which we derive all the queries @@ -801,7 +787,7 @@ template <%- verifierName %>() { /////////// - // Calculate challenges, challengesFRISteps and queriesFRI + // Derive challenges, challengesFRISteps and queriesFRI /////////// <% const stageRoots = []; -%> @@ -809,6 +795,7 @@ template <%- verifierName %>() { (<%- challengeNames.join(",") %>,challengesFRISteps,queriesFRI) <== <%- transcriptName %>()(<%- starkInfo.nPublics > 0 ? "publics," : "" %>rootC,<%- stageRoots.join(",") %>,root<%- qStage %>,evals<%- si_roots.length > 0 ? "," + si_roots.join(",") : "" %>,finalPol); <% } else { -%> + // Get the challenges <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> signal input challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; @@ -817,20 +804,21 @@ template <%- verifierName %>() { signal input challengeQ[3]; signal input challengeXi[3]; signal input challengesFRI[2][3]; - - // challengesFRISteps contains the random value provided by the verifier at each step of the folding so that - // the prover can commit the polynomial. - // Remember that, when folding, the prover does as follows: f0 = g_0 + X*g_1 + ... + (X^b)*g_b and then the - // verifier provides a random X so that the prover can commit it. This value is stored here. signal input challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; + // Calculate the FRI queries from the hash of the last layer polynomial in the FRI commit phase signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>] <== <%- calculateFriQueriesName %>()(challengesFRISteps[<%- starkStruct.steps.length -%>]); <% } -%> +<% if (options.multiFRI) { -%> + signal output queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; +<% } -%> + /////////// - // Check constraints polynomial in the evaluation point + // Main verifier logic /////////// + // --> Perform the consistency check around the out-of-domain sample Xi <% const verifyEvalsInputs = []; -%> <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% const stage = i + 1; -%> @@ -848,9 +836,7 @@ template <%- verifierName %>() { <%- verifyEvaluationsName %>()(<%- verifyEvalsInputs.join(", ") %>); - /////////// - // Preprocess s_i vals - /////////// + // --> Preprocess the query answers sent in the query phase of FRI // Preprocess the s_i vals given as inputs so that we can use anonymous components. // Two different processings are done: @@ -904,11 +890,7 @@ template <%- verifierName %>() { } } - /////////// - // Verify Merkle Roots - /////////// - - //Calculate merkle root for s0 vals + // --> Verify the Merkle roots for each of the <%- starkStruct.nQueries %> queries <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% const stage = i + 1; -%> <% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> @@ -937,18 +919,16 @@ template <%- verifierName %>() { <% for (let s=1; s signal {binary} s<%- s %>_keys_merkle[<%- starkStruct.nQueries %>][<%- starkStruct.steps[s].nBits %>]; for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - // Calculate merkle root for s<%- s %> vals for(var i = 0; i < <%-starkStruct.steps[s].nBits %>; i++) { s<%- s %>_keys_merkle[q][i] <== queriesFRI[q][i]; } VerifyMerkleHash(3, <%- 1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits) %>, <%- 1 << starkStruct.steps[s].nBits %>)(s<%- s %>_vals_p[q], s<%- s %>_siblings[q], s<%- s %>_keys_merkle[q], s<%- s %>_root, enabled); } <% } -%> <% } -%> - - /////////// - // Calculate FRI Polinomial - /////////// - + // --> Verify that, for each of the queries, the FRI polynomial is properly constructed +<% if (!options.multiFRI) { -%> + signal queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; +<% } -%> for (var q=0; q<<%- starkStruct.nQueries %>; q++) { <% let queryVals = []; for(let i = 0; i < starkInfo.nStages; ++i) { @@ -963,30 +943,23 @@ template <%- verifierName %>() { queryVals.push(`s0_vals_${starkInfo.customCommits[i].name}_0[q]`); } -%> - // Reconstruct FRI polinomial from evaluations + // Reconstruct the FRI polinomial from evaluations queryVals[q] <== <%- calculateFRIPolName %>()(queriesFRI[q], challengeXi, challengesFRI, evals, <%- queryVals.join(", ") %>); <% let nextValsPol = 0 < starkStruct.steps.length-1 ? "s1_vals_p[q]" : "finalPol"; let nextStep = 0 < starkStruct.steps.length-1 ? starkStruct.steps[1].nBits : 0; -%> - // Verify that the query is properly constructed. This is done by checking that the linear combination of the set of - // polynomials committed during the different rounds evaluated at z matches with the commitment of the FRI polynomial + // Verify that it matches with the FRI polynomial evaluation <%- verifyQueryName %>(<%- starkStruct.steps[0].nBits %>, <%- nextStep %>)(queriesFRI[q], queryVals[q], <%- nextValsPol %>, enabled); -} + } <% if(!options.recursive2) { -%> - /////////// - // Verify FRI Polinomial - /////////// + // --> Verify that, for each of the queries, the FRI commit phase is correct <% for (let s=1; s signal {binary} s<%- s %>_queriesFRI[<%- starkStruct.nQueries -%>][<%- starkStruct.steps[s].nBits%>]; <% } -%> - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - /////////// - // Verify FRI construction - /////////// - - // For each folding level we need to check that the polynomial is properly constructed + for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { + // For each layer we need to check that polynomial is properly constructed // Remember that if the step between polynomials is b = 2^l, the next polynomial p_(i+1) will have degree deg(p_i) / b <% for (let s=1; s @@ -1003,6 +976,7 @@ template <%- verifierName %>() { <% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> <% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> + // --> Verify that the final polynomial is of correct degree VerifyFinalPol(<%- nLastBits %>, <%- maxDegBits %>)(finalPol, enabled); <% } -%> } diff --git a/src/vadcop/helpers/templates/calculate_hashes.circom.ejs b/src/vadcop/helpers/templates/calculate_hashes.circom.ejs index 3d333a1..de4d27c 100644 --- a/src/vadcop/helpers/templates/calculate_hashes.circom.ejs +++ b/src/vadcop/helpers/templates/calculate_hashes.circom.ejs @@ -123,8 +123,8 @@ class Transcript { -%> -%> template CalculateStage1Hash() { - signal input rootFixedCols[4]; // Merkle tree root of the fixed columns - signal input rootWitnessCols[4]; // Merkle tree root of the witness columns of Stage 1 + signal input rootFixed[4]; // Merkle tree root of the fixed columns + signal input rootWitness[4]; // Merkle tree root of the witness columns of Stage 1 <% if(starkInfo.airValuesMap.filter(a => a.stage == 1).length > 0) { -%> signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; // AIR values of Stage 1 @@ -133,8 +133,8 @@ template CalculateStage1Hash() { signal output stageHash[4]; <% const transcriptStage = new Transcript(); -%> -<% transcriptStage.put("rootFixedCols", 4); -%> -<% transcriptStage.put("rootWitnessCols", 4); -%> +<% transcriptStage.put("rootFixed", 4); -%> +<% transcriptStage.put("rootWitness", 4); -%> <% for (let j=0; j <% if(starkInfo.airValuesMap[j].stage == 1) { -%> <% transcriptStage.put(`airValues[${j}]`, 1); -%> @@ -149,14 +149,14 @@ template CalculateStage1Hash() { <% for (let i = 1; i < starkInfo.nStages; ++i) { -%> <% if(starkInfo.airValuesMap.filter(a => a.stage == i + 1).length > 0) { -%> template CalculateStage<%- i+1 %>Hash() { - signal input rootWitnessCols[4]; // Merkle tree root of the witness columns of Stage <%- i+1 %> + signal input rootWitness[4]; // Merkle tree root of the witness columns of Stage <%- i+1 %> signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; // AIR values of Stage <%- i+1 %> signal output stageHash[4]; <% const transcriptStage = new Transcript(); -%> -<% transcriptStage.put("rootWitnessCols", 4); -%> +<% transcriptStage.put("rootWitness", 4); -%> <% for (let j=0; j <% if(starkInfo.airValuesMap[j].stage == i + 1) { -%> <% const dim = i == 0 ? 1 : 3; -%> diff --git a/src/vadcop/templates/compressor.circom.ejs b/src/vadcop/templates/compressor.circom.ejs index dffe92f..428a780 100644 --- a/src/vadcop/templates/compressor.circom.ejs +++ b/src/vadcop/templates/compressor.circom.ejs @@ -8,22 +8,28 @@ include "<%- verifierFilenames[i] %>"; <%- include('src/vadcop/helpers/templates/calculate_hashes.circom.ejs', { starkInfo, vadcopInfo }); %> template Compressor() { --%> + // --> Get the public inputs <% if(vadcopInfo.nPublics > 0) { -%> + // AIR inputs signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> + // VADCOP inputs signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; - signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; -%> + signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; -<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false} }); %> --%> + // --> Get the AIR STARK proof data + <%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false} }); %> + + // --> Define the outputs <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, starkInfo, prefix: "sv", airgroupId: starkInfo.airgroupId, options: {...options, isInput: false} }); %> --%> + + // --> Verify the STARK proof <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "sV", prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false } }); %> --%> + + // Assign the public inputs <% if(vadcopInfo.nPublics > 0) { -%> - for (var i=0; i< <%- vadcopInfo.nPublics %>; i++) { + for (var i = 0; i < <%- vadcopInfo.nPublics %>; i++) { sV.publics[i] <== publics[i]; } <% } -%> From 36a0383a596b902f9d8050f2f2a003f36f923cd9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Tue, 14 Jan 2025 12:01:44 +0000 Subject: [PATCH 6/9] Keep organizing the code --- .../define_stark_inputs.circom.ejs | 2 +- .../vadcop/assign_vadcop_inputs.circom.ejs | 5 ++- .../vadcop/init_vadcop_inputs.circom.ejs | 3 +- .../templates/calculate_hashes.circom.ejs | 38 ++++++++++++------- src/vadcop/templates/recursive1.circom.ejs | 26 ++++++++----- 5 files changed, 45 insertions(+), 29 deletions(-) diff --git a/src/main_templates/define_stark_inputs.circom.ejs b/src/main_templates/define_stark_inputs.circom.ejs index 72f5fbc..95b18d9 100644 --- a/src/main_templates/define_stark_inputs.circom.ejs +++ b/src/main_templates/define_stark_inputs.circom.ejs @@ -40,7 +40,7 @@ signal input <%- prefix_ %>finalPol[<%- 1 << parseInt(starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits) %>][3]; // Set of evaluations and Merkle proofs for each of the <%- starkInfo.starkStruct.nQueries %> queries - // performed during the FRI query phase, covering all involved polynomials. + // performed during the FRI query phase, covering all involved polynomials signal input <%- prefix_ %>s0_valsC[<%- starkInfo.starkStruct.nQueries %>][<%- starkInfo.nConstants %>]; <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> signal input <%- prefix_ %>s0_siblingsC[<%- starkInfo.starkStruct.nQueries %>][<%- Math.floor((parseInt(starkInfo.starkStruct.steps[0].nBits) - 1)/Math.log2(starkInfo.starkStruct.merkleTreeArity))+1 %>][<%- starkInfo.starkStruct.merkleTreeArity %>]; diff --git a/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs index b3226c8..11f67d8 100644 --- a/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs @@ -2,6 +2,7 @@ <% let prefixStark_ = prefixStark ? `${prefixStark}_` : ""; -%> <% let nPublicsInps = 0; -%> + // Assign the VADCOP proof data <%- componentName %>.publics[<%- nPublicsInps++ %>] <== <%- prefix_ %>circuitType; <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> @@ -18,12 +19,10 @@ <% nPublicsInps += 3*vadcopInfo.aggTypes[airgroupId].length ; -%> <% } -%> - <% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; i++) { -%> for(var i = 0; i < 4; i++) { <%- componentName %>.publics[<%- nPublicsInps %> + i] <== <%- prefix_ %>root<%- i+1 %>[i]; } - <% nPublicsInps += 4 -%> <% } -%> @@ -45,12 +44,14 @@ <% nPublicsInps += 4 -%> <% if(vadcopInfo.nPublics > 0) { -%> + // Assign the AIR inputs for(var i = 0; i < <%- vadcopInfo.nPublics %>; i++) { <%- componentName %>.publics[<%- nPublicsInps %> + i] <== publics[i]; } <% nPublicsInps += vadcopInfo.nPublics -%> <% } -%> + // Assign the VADCOP inputs for(var i = 0; i < <%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>; i++) { <%- componentName %>.publics[<%- nPublicsInps %> + 3*i] <== challenges[i][0]; <%- componentName %>.publics[<%- nPublicsInps %> + 3*i+1] <== challenges[i][1]; diff --git a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs index 9c4d9d0..c05ffbb 100644 --- a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs @@ -41,7 +41,6 @@ <% } -%> <% } -%> - // Assign the prover messages as outputs, compressing them if there are more than one at the same stage <% for (let i = 0; i < starkInfo.nStages; ++i) { -%> <% if(i == 0) { -%> @@ -75,4 +74,4 @@ <% } -%> <% } -%> - <%- prefix_ %>finalPolHash <== CalculateFRILastLayerPolHash()(<%- prefixStark_ %>finalPol); \ No newline at end of file + <%- prefix_ %>finalPolHash <== CalculateFinalPolHash()(<%- prefixStark_ %>finalPol); \ No newline at end of file diff --git a/src/vadcop/helpers/templates/calculate_hashes.circom.ejs b/src/vadcop/helpers/templates/calculate_hashes.circom.ejs index de4d27c..55238a9 100644 --- a/src/vadcop/helpers/templates/calculate_hashes.circom.ejs +++ b/src/vadcop/helpers/templates/calculate_hashes.circom.ejs @@ -123,11 +123,15 @@ class Transcript { -%> -%> template CalculateStage1Hash() { - signal input rootFixed[4]; // Merkle tree root of the fixed columns - signal input rootWitness[4]; // Merkle tree root of the witness columns of Stage 1 + // Merkle tree root of the fixed columns + signal input rootFixed[4]; + + // Merkle tree root of the witness columns of Stage 1 + signal input rootWitness[4]; <% if(starkInfo.airValuesMap.filter(a => a.stage == 1).length > 0) { -%> - signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; // AIR values of Stage 1 + // AIR values of Stage 1 + signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> signal output stageHash[4]; @@ -138,8 +142,10 @@ template CalculateStage1Hash() { <% for (let j=0; j <% if(starkInfo.airValuesMap[j].stage == 1) { -%> <% transcriptStage.put(`airValues[${j}]`, 1); -%> + _ <== airValues[<%- j %>][1]; + _ <== airValues[<%- j %>][2]; <% } else { -%> - _ <== airValues[<%- j %>]; + _ <== airValues[<%- j %>]; <% } -%> <% } -%> <% transcriptStage.getState(`stageHash`); -%> @@ -149,9 +155,11 @@ template CalculateStage1Hash() { <% for (let i = 1; i < starkInfo.nStages; ++i) { -%> <% if(starkInfo.airValuesMap.filter(a => a.stage == i + 1).length > 0) { -%> template CalculateStage<%- i+1 %>Hash() { - signal input rootWitness[4]; // Merkle tree root of the witness columns of Stage <%- i+1 %> + // Merkle tree root of the witness columns of Stage <%- i+1 %> + signal input rootWitness[4]; - signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; // AIR values of Stage <%- i+1 %> + // AIR values of Stage <%- i+1 %> + signal input airValues[<%- starkInfo.airValuesMap.length %>][3]; signal output stageHash[4]; @@ -172,7 +180,8 @@ template CalculateStage<%- i+1 %>Hash() { <% } -%> template CalculateEvalsHash() { - signal input evals[<%- starkInfo.evMap.length %>][3]; // Set of evaluations around the out-of-domain sample + // Set of evaluations around the out-of-domain sample + signal input evals[<%- starkInfo.evMap.length %>][3]; signal output evalsHash[4]; -%> @@ -184,15 +193,16 @@ template CalculateEvalsHash() { <%- transcriptEvals.getCode(); %> } -template CalculateFRILastLayerPolHash() { - signal input lastLayerPol[<%- 1 << starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits %>][3]; // Polynomial sent in clear in the last iteration of the FRI commit phase +template CalculateFinalPolHash() { + // Polynomial sent in clear in the last iteration of the FRI commit phase + signal input finalPol[<%- 1 << starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits %>][3]; - signal output lastLayerPolHash[4]; -%> + signal output finalPolHash[4]; -%> -<% const transcriptlastLayerPol = new Transcript(); -%> +<% const transcriptfinalPol = new Transcript(); -%> <% for (let j=0; j< 1< -<%- transcriptlastLayerPol.getCode(); %> + transcriptfinalPol.getState("finalPolHash"); -%> +<%- transcriptfinalPol.getCode(); %> } \ No newline at end of file diff --git a/src/vadcop/templates/recursive1.circom.ejs b/src/vadcop/templates/recursive1.circom.ejs index 61fc735..d3bc425 100644 --- a/src/vadcop/templates/recursive1.circom.ejs +++ b/src/vadcop/templates/recursive1.circom.ejs @@ -13,19 +13,26 @@ include "<%- verifierFilenames[i] %>"; <% let publicsNames = []; -%> template Recursive1() { - -<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false } }); %> - -<%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, airgroupId, prefix: "sv", starkInfo, options: { ...options, publicsNames, isInput: options.hasCompressor ? true : false } }); %> - + // --> Get the public inputs <% if(vadcopInfo.nPublics > 0) { -%> + // AIR inputs signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> + + // VADCOP inputs signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; - - signal input rootCAgg[4]; + + // VADCOP proof data +<%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, airgroupId, prefix: "sv", starkInfo, options: { ...options, publicsNames, isInput: options.hasCompressor ? true : false } }); %> + + // Merkle tree root for the fixed columns of the recursive2 circuit + signal input rootCRecursive2[4]; + // --> Get the AIR STARK proof data +<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false } }); %> + + // --> Verify the STARK proof <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "sV", prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: options.hasCompressor ? false : true } }); %> <% if(!options.hasCompressor) { -%> @@ -36,10 +43,9 @@ template Recursive1() { } <% if(!options.hasCompressor) { -%> - component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps, rootCAgg]} = Recursive1(); + component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps, rootCRecursive2]} = Recursive1(); <% } else { -%> <% if(vadcopInfo.nPublics > 0) publicsNames.push("publics"); -%> -<% publicsNames.push(...["challenges", "challengesFRISteps", "rootCAgg"]); -%> +<% publicsNames.push(...["challenges", "challengesFRISteps", "rootCRecursive2"]); -%> component main {public [<%- publicsNames.join(", ") %>]} = Recursive1(); - <% } -%> \ No newline at end of file From 927fa90af24b6bae60da79bc425d73ed912603c9 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Tue, 14 Jan 2025 17:16:00 +0000 Subject: [PATCH 7/9] minor fixes --- .../assign_stark_inputs.circom.ejs | 43 ++++++++++--------- .../define_stark_inputs.circom.ejs | 20 +++++---- .../vadcop/acc_vadcop_inputs.circom.ejs | 10 +++-- .../vadcop/agg_airgroup_values.circom.ejs | 2 +- .../vadcop/assign_vadcop_inputs.circom.ejs | 10 ++--- .../vadcop/define_vadcop_inputs.circom.ejs | 4 +- .../vadcop/init_vadcop_inputs.circom.ejs | 11 +++-- src/vadcop/templates/compressor.circom.ejs | 18 ++++---- src/vadcop/templates/recursive1.circom.ejs | 17 +++++--- src/vadcop/templates/recursive2.circom.ejs | 31 +++++++------ 10 files changed, 93 insertions(+), 73 deletions(-) diff --git a/src/main_templates/assign_stark_inputs.circom.ejs b/src/main_templates/assign_stark_inputs.circom.ejs index 88cdde2..fcc2dbc 100644 --- a/src/main_templates/assign_stark_inputs.circom.ejs +++ b/src/main_templates/assign_stark_inputs.circom.ejs @@ -2,40 +2,47 @@ <% if(starkInfo.airgroupId !== undefined) { -%> <% airgroupId = starkInfo.airgroupId; -%> <% } -%> - +-%> <% let prefix_ = prefix !== "" ? `${prefix}_` : ""; -%> - +-%> <% if(!options.final && !isNaN(airgroupId)) { -%> component <%- componentName %> = StarkVerifier<%- airgroupId %>(); <% } else { -%> component <%- componentName %> = StarkVerifier(); <% } -%> - // Assign the AIR STARK proof data + // --> Assign the previous STARK proof data <% if(options.addPublics && nPublics > 0) { -%> for (var i=0; i< <%- nPublics %>; i++) { - <%- componentName %>.publics[i] <== <%- prefix_ %>publics[i]; + <%- componentName %>.publics[i] <== <%- prefix_ %>publics[i]; + } <% } -%> - -<% if(starkInfo.airgroupValuesMap.length > 0) { -%> - <%- componentName %>.airgroupValues <== <%- prefix_ %>airgroupValues; -<% } -%> - +-%> <% if(starkInfo.airValuesMap.length > 0) { -%> <%- componentName %>.airvalues <== <%- prefix_ %>airvalues; <% } -%> - +-%> +<% if(starkInfo.airgroupValuesMap.length > 0) { -%> + <%- componentName %>.airgroupValues <== <%- prefix_ %>airgroupValues; +<% } -%> +-%> <% if(starkInfo.proofValuesMap.length > 0) { -%> <%- componentName %>.proofvalues <== <%- prefix_ %>proofvalues; <% } -%> - +-%> <% for (let s=1; s<=starkInfo.nStages + 1; ++s) { -%> <%- componentName %>.root<%- s %> <== <%- prefix_ %>root<%- s %>; <% } -%> <%- componentName %>.evals <== <%- prefix_ %>evals; +<% for (let s=1; s + <%- componentName %>.s<%- s %>_root <== <%- prefix_ %>s<%- s %>_root; +<% } -%> + + <%- componentName %>.finalPol <== <%- prefix_ %>finalPol; + <%- componentName %>.s0_valsC <== <%- prefix_ %>s0_valsC; <%- componentName %>.s0_siblingsC <== <%- prefix_ %>s0_siblingsC; @@ -43,7 +50,7 @@ <%- componentName %>.s0_vals_<%- starkInfo.customCommits[i].name %>_0 <== <%- prefix_ %>s0_vals_<%- starkInfo.customCommits[i].name %>_0; <%- componentName %>.s0_siblings_<%- starkInfo.customCommits[i].name %>_0 <== <%- prefix_ %>s0_siblings_<%- starkInfo.customCommits[i].name %>_0; <% } -%> - +-%> <% for (let s=1; s<=starkInfo.nStages + 1; ++s) { -%> <% if (starkInfo.mapSectionsN[`cm${s}`] > 0) { -%> <%- componentName %>.s0_vals<%- s %> <== <%- prefix_ %>s0_vals<%- s %>; @@ -51,17 +58,13 @@ <% } -%> <% } -%> -<% for (let s=1; s - <%- componentName %>.s<%- s %>_root <== <%- prefix_ %>s<%- s %>_root; -<% } -%> <% for (let s=1; s <%- componentName %>.s<%- s %>_vals <== <%- prefix_ %>s<%- s %>_vals; <%- componentName %>.s<%- s %>_siblings <== <%- prefix_ %>s<%- s %>_siblings; -<% } -%> - - <%- componentName %>.finalPol <== <%- prefix_ %>finalPol; - +<% } -%> +-%> <% if(options.setEnableInput) { -%> <% let enableInput = options.setEnableInput === true ? 1 : options.setEnableInput -%> <%- componentName %>.enable <== <%- enableInput %>; -<% } -%> \ No newline at end of file +<% } -%> +-%> \ No newline at end of file diff --git a/src/main_templates/define_stark_inputs.circom.ejs b/src/main_templates/define_stark_inputs.circom.ejs index 95b18d9..d2e0507 100644 --- a/src/main_templates/define_stark_inputs.circom.ejs +++ b/src/main_templates/define_stark_inputs.circom.ejs @@ -1,8 +1,12 @@ <% let prefix_ = prefix !== "" ? `${prefix}_` : ""; -%> <% if(options.addPublics && nPublics > 0) { -%> signal input <%- prefix_ %>publics[<%- nPublics %>]; -<% } -%> +<% } -%> +-%> +<% if((starkInfo.airValuesMap && starkInfo.airValuesMap.length > 0) || (starkInfo.airgroupValuesMap && starkInfo.airgroupValuesMap.length > 0) || (starkInfo.proofValuesMap && starkInfo.proofValuesMap.length > 0)) { -%> + // One-dimensional elements +<% } -%> <% if(starkInfo.airValuesMap && starkInfo.airValuesMap.length > 0) { -%> signal input <%- prefix_ %>airvalues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> @@ -14,7 +18,7 @@ <% if(starkInfo.proofValuesMap && starkInfo.proofValuesMap.length > 0) { -%> signal input <%- prefix_ %>proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> - +-%> // Merkle tree roots of the witness columns at each stage <% for (let s=1; s<=starkInfo.nStages + 1; ++s) { -%> <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> @@ -27,7 +31,7 @@ // Set of evaluations around the out-of-domain sample signal input <%- prefix_ %>evals[<%- starkInfo.evMap.length %>][3]; - // Merkle tree roots of the FRI polynomials for each layer during the commit phase + // Merkle tree roots of the polynomials for each of the <%- starkInfo.starkStruct.steps.length %> layers of the FRI commit phase, except the last one <% for (let s=1; s <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> signal input <%- prefix_ %>s<%- s %>_root; @@ -36,11 +40,11 @@ <% } -%> <% } -%> - // Polynomial sent in clear in the last iteration of the FRI commit phase + // Polynomial sent in clear at layer <%- starkInfo.starkStruct.steps.length %> of the FRI commit phase signal input <%- prefix_ %>finalPol[<%- 1 << parseInt(starkInfo.starkStruct.steps[starkInfo.starkStruct.steps.length-1].nBits) %>][3]; - // Set of evaluations and Merkle proofs for each of the <%- starkInfo.starkStruct.nQueries %> queries - // performed during the FRI query phase, covering all involved polynomials + // Set of evaluations "vals" and Merkle proofs "siblings" of all involved polynomials, + // for each of the <%- starkInfo.starkStruct.nQueries %> queries performed during the FRI query phase signal input <%- prefix_ %>s0_valsC[<%- starkInfo.starkStruct.nQueries %>][<%- starkInfo.nConstants %>]; <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> signal input <%- prefix_ %>s0_siblingsC[<%- starkInfo.starkStruct.nQueries %>][<%- Math.floor((parseInt(starkInfo.starkStruct.steps[0].nBits) - 1)/Math.log2(starkInfo.starkStruct.merkleTreeArity))+1 %>][<%- starkInfo.starkStruct.merkleTreeArity %>]; @@ -56,7 +60,7 @@ signal input <%- prefix_ %>s0_siblings_<%- starkInfo.customCommits[i].name %>_0[<%- starkInfo.starkStruct.nQueries %>][<%- starkInfo.starkStruct.steps[0].nBits %>][4]; <% } -%> <% } -%> - +-%> <% for (let s=1; s<=starkInfo.nStages + 1; ++s) { -%> <% if (starkInfo.mapSectionsN[`cm${s}`] > 0) { -%> signal input <%- prefix_ %>s0_vals<%- s %>[<%- starkInfo.starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${s}`] %>]; @@ -67,7 +71,7 @@ <% } -%> <% } -%> <% } -%> - +-%> <% for (let s=1; s< starkInfo.starkStruct.steps.length; s++) { -%> signal input <%- prefix_ %>s<%- s %>_vals[<%- starkInfo.starkStruct.nQueries %>][<%- (1 << parseInt(starkInfo.starkStruct.steps[s-1].nBits - starkInfo.starkStruct.steps[s].nBits))*3 %>]; <% if(starkInfo.starkStruct.verificationHashType === "BN128") { -%> diff --git a/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs index 998bc66..3e1883a 100644 --- a/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs @@ -4,18 +4,22 @@ <% } -%> <%- prefix %>_evalsHash <== AccumulateValuesNull()(<%- prefix1 %>_evalsHash, <%- prefix2 %>_evalsHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); + <% for(let i = 1; i < vadcopInfo.stepsFRI.length; i++) { -%> <%- prefix %>_s<%- i %>_root <== AccumulateValuesNull()(<%- prefix1 %>_s<%- i %>_root, <%- prefix2 %>_s<%- i %>_root, <%- prefix1%>_isNull, <%- prefix2%>_isNull); <% } -%> -<%- prefix %>_finalPolHash <== AccumulateValuesNull()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); + + <%- prefix %>_finalPolHash <== AccumulateValuesNull()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash, <%- prefix1%>_isNull, <%- prefix2%>_isNull); <% } else { -%> <% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; ++i) { -%> - <%- prefix %>_root<%- i+1 %> <== AccumulateValues()(<%- prefix1 %>_root<%- i+1 %>, <%- prefix2 %>_root<%- i+1 %>); + <%- prefix %>_root<%- i+1 %> <== AccumulateValues()(<%- prefix1 %>_root<%- i+1 %>, <%- prefix2 %>_root<%- i+1 %>); <% } -%> <%- prefix %>_evalsHash <== AccumulateValues()(<%- prefix1 %>_evalsHash, <%- prefix2 %>_evalsHash); + <% for(let i = 1; i < vadcopInfo.stepsFRI.length; i++) { -%> <%- prefix %>_s<%- i %>_root <== AccumulateValues()(<%- prefix1 %>_s<%- i %>_root, <%- prefix2 %>_s<%- i %>_root); <% } -%> -<%- prefix %>_finalPolHash <== AccumulateValues()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash); + + <%- prefix %>_finalPolHash <== AccumulateValues()(<%- prefix1 %>_finalPolHash, <%- prefix2 %>_finalPolHash); <% } -%> \ No newline at end of file diff --git a/src/main_templates/vadcop/agg_airgroup_values.circom.ejs b/src/main_templates/vadcop/agg_airgroup_values.circom.ejs index 521e011..6291faa 100644 --- a/src/main_templates/vadcop/agg_airgroup_values.circom.ejs +++ b/src/main_templates/vadcop/agg_airgroup_values.circom.ejs @@ -1,4 +1,4 @@ -<%- prefix %>_circuitType <== <%- (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) ? 1 : 0 %>; + <%- prefix %>_circuitType <== <%- (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) ? 1 : 0 %>; <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> <%- prefix %>_aggregationTypes <== aggregationTypes; diff --git a/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs index 11f67d8..934b717 100644 --- a/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs @@ -1,8 +1,8 @@ <% let prefix_ = prefix ? `${prefix}_` : ""; -%> <% let prefixStark_ = prefixStark ? `${prefixStark}_` : ""; -%> <% let nPublicsInps = 0; -%> - - // Assign the VADCOP proof data +-%> + // --> Assign the VADCOP proof data <%- componentName %>.publics[<%- nPublicsInps++ %>] <== <%- prefix_ %>circuitType; <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> @@ -44,14 +44,14 @@ <% nPublicsInps += 4 -%> <% if(vadcopInfo.nPublics > 0) { -%> - // Assign the AIR inputs + // --> Assign the public inputs for(var i = 0; i < <%- vadcopInfo.nPublics %>; i++) { <%- componentName %>.publics[<%- nPublicsInps %> + i] <== publics[i]; } <% nPublicsInps += vadcopInfo.nPublics -%> <% } -%> - // Assign the VADCOP inputs + // --> Assign the VADCOP data for(var i = 0; i < <%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>; i++) { <%- componentName %>.publics[<%- nPublicsInps %> + 3*i] <== challenges[i][0]; <%- componentName %>.publics[<%- nPublicsInps %> + 3*i+1] <== challenges[i][1]; @@ -65,7 +65,7 @@ <%- componentName %>.publics[<%- nPublicsInps %> + 3*i+2] <== challengesFRISteps[i][2]; } <% nPublicsInps += 3*(vadcopInfo.stepsFRI.length); -%> - +-%> <% if(options.setEnableInput) { -%> signal {binary} <%- prefix_ %>isNull <== IsZero()(<%- prefix_ %>circuitType); diff --git a/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs index be859a7..ee14c51 100644 --- a/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/define_vadcop_inputs.circom.ejs @@ -1,6 +1,6 @@ <% let signalType = options.isInput ? "input" : "output" -%> <% let prefix_ = prefix ? `${prefix}_` : ""; -%> - +-%> signal <%- signalType %> <%- prefix_ %>circuitType; <% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}circuitType`) -%> @@ -14,7 +14,6 @@ <% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}airgroupValues`) -%> <% } -%> - <% for (let i = 0; i < vadcopInfo.numChallenges.length + 1; ++i) { -%> signal <%- signalType %> <%- prefix_ %>root<%- i + 1 %>[4]; <% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}root${i + 1}`) -%> @@ -30,3 +29,4 @@ signal <%- signalType %> <%- prefix_ %>finalPolHash[4]; <% if(Array.isArray(options.publicsNames)) options.publicsNames.push(`${prefix_}finalPolHash`) -%> +-%> \ No newline at end of file diff --git a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs index c05ffbb..3fad427 100644 --- a/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs +++ b/src/main_templates/vadcop/init_vadcop_inputs.circom.ejs @@ -1,9 +1,8 @@ <% let prefixStark_ = prefixStark ? `${prefixStark}_` : ""; -%> <% let prefix_ = prefix ? `${prefix}_` : ""; -%> - - +-%> <% let c = 0; -%> - // Assign the VADCOP data + // --> Assign the VADCOP data <% for(let i = 0; i < vadcopInfo.numChallenges.length; ++i) { -%> <% for(let j = 0; j < vadcopInfo.numChallenges[i]; ++j) { -%> <% if(i < starkInfo.nStages && j < starkInfo.challengesMap.filter(c => c.stage == i + 1).length) { -%> @@ -19,13 +18,13 @@ <%- componentName %>.challengesFRI[0] <== challenges[<%- c++ %>]; <%- componentName %>.challengesFRI[1] <== challenges[<%- c++ %>]; -<% c = 0; %> +<% c = 0; -%> <% for(let i = 0; i < vadcopInfo.stepsFRI.length; ++i) { -%> <% if(c < starkInfo.starkStruct.steps.length && starkInfo.starkStruct.steps[c].nBits === vadcopInfo.stepsFRI[i].nBits) { -%> <%- componentName %>.challengesFRISteps[<%- c++ %>] <== challengesFRISteps[<%- i %>]; <% } -%> <% } -%> -<%- componentName %>.challengesFRISteps[<%- starkInfo.starkStruct.steps.length %>] <== challengesFRISteps[<%- vadcopInfo.stepsFRI.length %>]; + <%- componentName %>.challengesFRISteps[<%- starkInfo.starkStruct.steps.length %>] <== challengesFRISteps[<%- vadcopInfo.stepsFRI.length %>]; // --> Compute the outputs <% let circuitType = (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) ? starkInfo.airId + 2 : starkInfo.airId + 1; -%> @@ -41,7 +40,7 @@ <% } -%> <% } -%> - // Assign the prover messages as outputs, compressing them if there are more than one at the same stage + // --> Accumulate the proof elements: hash them if there are more than one at the same stage <% for (let i = 0; i < starkInfo.nStages; ++i) { -%> <% if(i == 0) { -%> <% if(starkInfo.airValuesMap.filter(a => a.stage == i + 1).length > 0) { -%> diff --git a/src/vadcop/templates/compressor.circom.ejs b/src/vadcop/templates/compressor.circom.ejs index 428a780..1b672d8 100644 --- a/src/vadcop/templates/compressor.circom.ejs +++ b/src/vadcop/templates/compressor.circom.ejs @@ -8,9 +8,10 @@ include "<%- verifierFilenames[i] %>"; <%- include('src/vadcop/helpers/templates/calculate_hashes.circom.ejs', { starkInfo, vadcopInfo }); %> template Compressor() { - // --> Get the public inputs + // --> Circuit public inputs <-- + <% if(vadcopInfo.nPublics > 0) { -%> - // AIR inputs + // AIR public inputs signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> @@ -18,16 +19,18 @@ template Compressor() { signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; - // --> Get the AIR STARK proof data - <%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false} }); %> + // --> Circuit private inputs <-- + + // --> AIR STARK proof data +<%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false} }); %> - // --> Define the outputs + // --> Circuit outputs <-- <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, starkInfo, prefix: "sv", airgroupId: starkInfo.airgroupId, options: {...options, isInput: false} }); %> - // --> Verify the STARK proof + // --> Verify the STARK proof <-- <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "sV", prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false } }); %> - // Assign the public inputs + // --> Assign the public inputs <% if(vadcopInfo.nPublics > 0) { -%> for (var i = 0; i < <%- vadcopInfo.nPublics %>; i++) { sV.publics[i] <== publics[i]; @@ -35,7 +38,6 @@ template Compressor() { <% } -%> <%- include('src/main_templates/vadcop/init_vadcop_inputs.circom.ejs', { componentName: "sV", prefix: "sv", prefixStark: "", airgroupId: starkInfo.airgroupId, starkInfo, vadcopInfo }); %> - } component main {public [<%- vadcopInfo.nPublics > 0 ? "publics, " : "" %>challenges, challengesFRISteps]} = Compressor(); diff --git a/src/vadcop/templates/recursive1.circom.ejs b/src/vadcop/templates/recursive1.circom.ejs index d3bc425..99dfb4f 100644 --- a/src/vadcop/templates/recursive1.circom.ejs +++ b/src/vadcop/templates/recursive1.circom.ejs @@ -13,26 +13,29 @@ include "<%- verifierFilenames[i] %>"; <% let publicsNames = []; -%> template Recursive1() { - // --> Get the public inputs + // --> Circuit public inputs <-- + <% if(vadcopInfo.nPublics > 0) { -%> - // AIR inputs + // AIR public inputs signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> // VADCOP inputs signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1 %>][3]; - - // VADCOP proof data -<%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, airgroupId, prefix: "sv", starkInfo, options: { ...options, publicsNames, isInput: options.hasCompressor ? true : false } }); %> // Merkle tree root for the fixed columns of the recursive2 circuit signal input rootCRecursive2[4]; - // --> Get the AIR STARK proof data + // Accumulated STARK proof data +<%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { vadcopInfo, airgroupId, prefix: "sv", starkInfo, options: { ...options, publicsNames, isInput: options.hasCompressor ? true : false } }); %> + + // --> Circuit private inputs <-- + + // --> Previous STARK proof data <%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: false } }); %> - // --> Verify the STARK proof + // --> Verify the STARK proof <-- <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "sV", prefix: "", starkInfo, nPublics: vadcopInfo.nPublics, options: { addPublics: options.hasCompressor ? false : true } }); %> <% if(!options.hasCompressor) { -%> diff --git a/src/vadcop/templates/recursive2.circom.ejs b/src/vadcop/templates/recursive2.circom.ejs index 7db8442..29df521 100644 --- a/src/vadcop/templates/recursive2.circom.ejs +++ b/src/vadcop/templates/recursive2.circom.ejs @@ -11,47 +11,52 @@ include "<%- verifierFilenames[i] %>"; template Recursive2() { - // Merkle tree roots for the fixed columns of each AIR within AIR group <%- airgroupId %> + // Merkle tree roots for the fixed columns of each proof to be aggregated var rootFixedAIRs[<%- vadcopInfo.airs[airgroupId].length %>][4]; -%> <% for(let i = 0; i < vadcopInfo.airs[airgroupId].length; ++i) { -%> rootFixedAIRs[<%- i %>] = [<%- basicVK[i].join(",") %>]; <% } -%> + // --> Circuit public inputs <-- + // Merkle tree root for the fixed columns of the aggregation signal input rootFixedAgg[4]; // Note: `rootFixedAIRs` is used for proof verification in the base layer of the aggregation tree, // while `rootFixedAgg` is used for proof verification in the higher layers - // Get the global VADCOP data <% if(vadcopInfo.nPublics > 0) { -%> + // AIR public inputs signal input publics[<%- vadcopInfo.nPublics %>]; <% } -%> + // VADCOP inputs signal input challenges[<%- vadcopInfo.numChallenges.reduce((nc, acc) => nc + acc, 0) + 4 %>][3]; signal input challengesFRISteps[<%- vadcopInfo.stepsFRI.length + 1%>][3]; + // --> Circuit private inputs <-- + <% if(vadcopInfo.aggTypes[airgroupId].length > 0) { -%> signal input aggregationTypes[<%- vadcopInfo.aggTypes[airgroupId].length %>]; <% } -%> - // Get the first STARK proof data (prefix "a") + // --> First STARK proof data (prefix "a") <%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "a", starkInfo, nPublics: vadcopInfo.nPublics, addPublics: false }); %> - // Get the second STARK proof data (prefix "b") + // --> Second STARK proof data (prefix "b") <%- include('src/main_templates/define_stark_inputs.circom.ejs', { prefix: "b", starkInfo, nPublics: vadcopInfo.nPublics, addPublics: false }); %> - // Get the VADCOP data for the first STARK proof (prefix "a_sv") + // --> Accumulated first STARK proof data (prefix "a_sv") <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "a_sv", vadcopInfo, airgroupId, starkInfo, options: {...options, addPublics: false, isInput: true, isAggregation: true} }); %> - // Get the VADCOP data for the second STARK proof (prefix "b_sv") + // --> Accumulated second STARK proof data (prefix "b_sv") <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "b_sv", vadcopInfo, airgroupId, starkInfo, options: {...options, addPublics: false, isInput: true, isAggregation: true} }); %> - // Define the outputs + // --> Circuit outputs <-- <%- include('src/main_templates/vadcop/define_vadcop_inputs.circom.ejs', { prefix: "sv", vadcopInfo, airgroupId, starkInfo, options: {...options, isInput: false} }); %> - // Verify the first STARK proof + // --> Verify the first STARK proof <-- <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "vA", prefix: "a", starkInfo, nPublics: vadcopInfo.nPublics }); %> <%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vA", vadcopInfo, prefix: "a_sv", prefixStark: "a", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> @@ -65,7 +70,7 @@ template Recursive2() { vA.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(a_sv_circuitType, rootFixedAIRs, rootFixedAgg); <% } -%> - // Verify the second STARK proof + // --> Verify the second STARK proof <-- <%- include('src/main_templates/assign_stark_inputs.circom.ejs', { componentName: "vB", prefix: "b", starkInfo, nPublics: vadcopInfo.nPublics }); %> <%- include('src/main_templates/vadcop/assign_vadcop_inputs.circom.ejs', { componentName: "vB", vadcopInfo, prefix: "b_sv", prefixStark: "b", airgroupId, options: { setEnableInput: (vadcopInfo.air_groups.length > 1 || vadcopInfo.airs[0].length > 1) } }); %> @@ -79,11 +84,11 @@ template Recursive2() { vB.rootC <== SelectVerificationKeyNull(<%- vadcopInfo.airs[airgroupId].length %>)(b_sv_circuitType, rootFixedAIRs, rootFixedAgg); <% } -%> - // Aggregate the AIR group values - <%- include('src/main_templates/vadcop/agg_airgroup_values.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> + // --> Aggregate the AIR group values <-- +<%- include('src/main_templates/vadcop/agg_airgroup_values.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> - // Accumulate the proof elements - <%- include('src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> + // --> Accumulate the proof elements <-- +<%- include('src/main_templates/vadcop/acc_vadcop_inputs.circom.ejs', { vadcopInfo, prefix1: "a_sv", prefix2: "b_sv", prefix: "sv", airgroupId }); %> // TODO! VERIFY SINGLE FRI } From 93ddff885ad9890421b4cfeac4fd202a2ba821d2 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Wed, 15 Jan 2025 13:31:41 +0000 Subject: [PATCH 8/9] Stark verifier simplified --- .../circuits.gl/stark_verifier.circom.ejs | 248 ++++++++++-------- 1 file changed, 144 insertions(+), 104 deletions(-) diff --git a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs index 9817d57..b8bfc9d 100644 --- a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs @@ -110,7 +110,7 @@ pragma custom_templates; <% } -%> <% return ref(code[code.length-1].dest); -%> <% } -%> - +-%> <% const NFields = Math.floor(((starkInfo.starkStruct.nQueries * starkInfo.starkStruct.steps[0].nBits) - 1)/63)+1; -%> <% class Transcript { @@ -138,7 +138,7 @@ class Transcript { } updateState() { - let signalName = "transcriptHash"; + let signalName = "partialHash"; if(this.name) signalName += "_" + this.name; if(this.hCnt > 0) { const firstUnused = Math.max(this.hiCnt, 4); @@ -190,37 +190,37 @@ class Transcript { } getPermutations(v, n, nBits) { - let signalName = "transcriptHash"; + let signalName = "partialHash"; if(this.name) signalName += "_" + this.name; const totalBits = n*nBits; const n2b = []; for (let i=0; i - +-%> include "cmul.circom"; include "cinv.circom"; include "poseidon.circom"; @@ -253,7 +253,7 @@ include "merklehash.circom"; <% if(starkInfo.airgroupId !== undefined) { -%> <% airgroupId = starkInfo.airgroupId; -%> <% } -%> - +-%> <% let qStage = starkInfo.nStages + 1; -%> <% let evalsStage = starkInfo.nStages + 2; -%> <% let friStage = starkInfo.nStages + 3; -%> @@ -266,13 +266,12 @@ include "merklehash.circom"; <% calculateFriQueriesName += airgroupId; -%> <% } -%> template <%- calculateFriQueriesName %>() { - signal input challengeFRIQueries[3]; signal output {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>]; - +-%> <% const transcriptQueries = new Transcript("friQueries"); -%> <% transcriptQueries.put("challengeFRIQueries", 3); -%> - +-%> <% transcriptQueries.getPermutations("queriesFRI", starkStruct.nQueries, starkStruct.steps[0].nBits); -%> <%- transcriptQueries.getCode(); %> } @@ -287,7 +286,7 @@ template <%- calculateFriQueriesName %>() { Calculate the transcript */ template <%- transcriptName %>() { - +-%> <% if(starkInfo.nPublics > 0) { -%> signal input publics[<%- starkInfo.nPublics %>]; <% } -%> @@ -295,9 +294,11 @@ template <%- transcriptName %>() { <% for(let i=0; i < starkInfo.nStages; i++) { -%> <% const stage = i + 1; -%> signal input root<%- stage %>[4]; -<% } -%> +<% } -%> signal input root<%- qStage %>[4]; - signal input evals[<%- starkInfo.evMap.length %>][3]; + + signal input evals[<%- starkInfo.evMap.length %>][3]; + <% for (let s=1; s signal input s<%- s %>_root[4]; <% } -%> @@ -315,13 +316,14 @@ template <%- transcriptName %>() { signal output {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>]; <% if(starkInfo.starkStruct.hashCommits) { -%> + // Intermediate hashes <% if(starkInfo.nPublics > 0) { -%> signal publicsHash[4]; <% } -%> signal evalsHash[4]; signal lastPolFRIHash[4]; <% } -%> - +-%> <% const transcript = new Transcript(); -%> <% transcript.put("rootC", 4 ); -%> <% if(starkInfo.nPublics > 0) { -%> @@ -336,7 +338,7 @@ template <%- transcriptName %>() { <% transcript.put("publicsHash", 4); -%> <% } -%> <% } -%> - +-%> <% for(let i=0; i < starkInfo.nStages; i++) { const stage = i + 1; for(let j = 0; j < starkInfo.challengesMap.filter(c => c.stage === stage).length; ++j) { @@ -393,13 +395,12 @@ template <%- transcriptName %>() { queriesFRI <== <%- calculateFriQueriesName %>()(challengesFRISteps[<%- starkStruct.steps.length %>]); } - <% } -%> /* Verify that all committed polynomials are calculated correctly */ - +-%> <% let verifyEvaluationsName = "VerifyEvaluations"; -%> <% if(airgroupId !== undefined) { -%> <% verifyEvaluationsName += airgroupId; -%> @@ -411,40 +412,40 @@ template <%- verifyEvaluationsName %>() { signal input challengesStage<%- stage %>[<%- starkInfo.challengesMap.filter(c => c.stage === stage).length -%>][3]; <% } -%> signal input challengeQ[3]; - signal input challengeXi[3]; + signal input challengeZ[3]; signal input evals[<%- starkInfo.evMap.length %>][3]; - <% if(starkInfo.nPublics > 0) { -%> +<% if(starkInfo.nPublics > 0) { -%> signal input publics[<%- starkInfo.nPublics %>]; - <% } -%> -<% if(starkInfo.airgroupValuesMap.length > 0) { -%> - signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; <% } -%> <% if(starkInfo.airValuesMap.length > 0) { -%> signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> +<% if(starkInfo.airgroupValuesMap.length > 0) { -%> + signal input airgroupValues[<%- starkInfo.airgroupValuesMap.length %>][3]; +<% } -%> <% if(starkInfo.proofValuesMap.length > 0) { -%> signal input proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> signal input {binary} enable; - // zMul stores all the powers of z (which is stored in challengeXi) up to nBits, i.e, [z, z^2, ..., z^nBits] + // Compute all powers of z (stored in challengeXi) up to nBits, i.e, [z, z^2, ..., z^nBits] signal zMul[<%- starkStruct.nBits %>][3]; - for (var i=0; i< <%- starkStruct.nBits %> ; i++) { - if(i==0){ - zMul[i] <== CMul()(challengeXi, challengeXi); + for (var i = 0; i < <%- starkStruct.nBits %> ; i++) { + if (i == 0){ + zMul[i] <== CMul()(challengeZ, challengeZ); } else { zMul[i] <== CMul()(zMul[i-1], zMul[i-1]); } } - // Store the vanishing polynomial Zh(x) = x^nBits - 1 evaluated at z + // Compute the evaluation of the vanishing polynomial Zh(X) = X^nBits - 1 at z signal Z[3] <== [zMul[<%- starkStruct.nBits - 1%>][0] - 1, zMul[<%- starkStruct.nBits - 1%>][1], zMul[<%- starkStruct.nBits - 1%>][2]]; signal Zh[3] <== CInv()(Z); - +-%> <% if(starkInfo.boundaries.map(b => b.name).includes("firstRow")) { -%> signal Zfirst[3] <== CInv()([challengeXi[0] - 1, challengeXi[1], challengeXi[2]]); <% } -%> - +-%> <% if(starkInfo.boundaries.map(b => b.name).includes("lastRow")) { -%> <% let root = F.one; -%> <% for(let i = 0; i < (1 << starkStruct.nBits) - 1; ++i) { -%> @@ -452,7 +453,7 @@ template <%- verifyEvaluationsName %>() { <% } -%> signal Zlast[3] <== CInv()([challengeXi[0] - <%- root %>, challengeXi[1], challengeXi[2]]); <% } -%> - +-%> <% if(starkInfo.boundaries.map(b => b.name).includes("everyFrame")) { -%> <% const constraintFrames = starkInfo.boundaries.filter(b => b.name === "everyFrame"); -%> <% for(let i = 0; i < constraintFrames.length; ++i) { -%> @@ -484,20 +485,22 @@ template <%- verifyEvaluationsName %>() { <% } -%> <% } -%> - // Using the evaluations committed and the challenges, - // calculate the sum of q_i, i.e, q_0(X) + challenge * q_1(X) + challenge^2 * q_2(X) + ... + challenge^(l-1) * q_l-1(X) evaluated at z + // Given the public inputs, the challenges, the evaluations and the one-dimensional elements, + // compute the evaluation of the RLC: + // q_0(X) + challenge * q_1(X) + challenge^2 * q_2(X) + ... + challenge^(l-1) * q_l-1(X) + // at z. This is the RHS of equation (30) in https://eprint.iacr.org/2023/474.pdf. <% const evalP = unrollCode(verifierInfo.qVerifier.code) -%> - signal xAcc[<%- starkInfo.qDeg %>][3]; //Stores, at each step, x^i evaluated at z + // Next, we compute the evaluation of the expression: + // Q1(X) + X^n*Q2(X) + X^(2·n)*Q3(X) + ... X^((qDeg-1)·n)*Q(X) + // at z, where each Q_i(X) is a polynomial of degree < n. This is the LHS of equation (30) in https://eprint.iacr.org/2023/474.pdf. + signal xAcc[<%- starkInfo.qDeg %>][3]; // Stores X^i evaluated at z signal qStep[<%- starkInfo.qDeg-1 %>][3]; // Stores the evaluations of Q_i signal qAcc[<%- starkInfo.qDeg %>][3]; // Stores the accumulate sum of Q_i - - // Note: Each Qi has degree < n. qDeg determines the number of polynomials of degree < n needed to define Q - // Calculate Q(X) = Q1(X) + X^n*Q2(X) + X^(2n)*Q3(X) + ..... X^((qDeg-1)n)*Q(X) evaluated at z - for (var i=0; i< <%- starkInfo.qDeg %>; i++) { + for (var i = 0; i < <%- starkInfo.qDeg %>; i++) { <% let qIndex = starkInfo.cmPolsMap.findIndex(p => p.stage === qStage && p.stageId === 0); -%> <% const evId = starkInfo.evMap.findIndex(e => e.type === "cm" && e.id === qIndex); -%> - if (i==0) { + if (i == 0) { xAcc[0] <== [1, 0, 0]; qAcc[0] <== evals[<%- evId %>+i]; } else { @@ -509,19 +512,22 @@ template <%- verifyEvaluationsName %>() { } } - // Final Verification. Check that Q(X)*Zh(X) = sum of linear combination of q_i, which is stored at <%- evalP %> + // Finally, check that the LHS is equal to the RHS evaluated at z: + // Q1(z) + z^n*Q2(z) + z^(2·n)*Q3(z) + ... z^((qDeg-1)·n)*Q(z) = q_0(z) + challenge * q_1(z) + challenge^2 * q_2(z) + ... + challenge^(l-1) * q_l-1(z) enable * (<%- evalP %>[0] - qAcc[<%- starkInfo.qDeg-1 %>][0]) === 0; enable * (<%- evalP %>[1] - qAcc[<%- starkInfo.qDeg-1 %>][1]) === 0; enable * (<%- evalP %>[2] - qAcc[<%- starkInfo.qDeg-1 %>][2]) === 0; } -/* Calculate FRI polinomial */ +/* + Calculate FRI polinomial +*/ <% let calculateFRIPolName = "CalculateFRIPolValue"; -%> <% if(airgroupId !== undefined) { -%> <% calculateFRIPolName += airgroupId; -%> <% } -%> template <%- calculateFRIPolName %>() { - signal input {binary} queriesFRI[<%- starkStruct.steps[0].nBits %>]; + signal input {binary} queryFRI[<%- starkStruct.steps[0].nBits %>]; signal input challengeXi[3]; signal input challengesFRI[2][3]; signal input evals[<%- starkInfo.evMap.length %>][3]; @@ -556,24 +562,38 @@ template <%- calculateFRIPolName %>() { <% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> mapValues.vals_<%- starkInfo.customCommits[i].name %>_0 <== custom_<%- starkInfo.customCommits[i].name %>_0; <% } -%> + signal xacc[<%- starkStruct.steps[0].nBits %>]; - xacc[0] <== queriesFRI[0]*(<%- F.shift %> * roots(<%- starkStruct.steps[0].nBits %>)-<%- F.shift %>) + <%- F.shift %>; - for (var i=1; i<<%- starkStruct.steps[0].nBits %>; i++) { - xacc[i] <== xacc[i-1] * ( queriesFRI[i]*(roots(<%- starkStruct.steps[0].nBits %> - i) - 1) +1); + xacc[0] <== queryFRI[0]*(<%- F.shift %>*roots(<%- starkStruct.steps[0].nBits %>) - <%- F.shift %>) + <%- F.shift %>; + for (var i = 1; i < <%- starkStruct.steps[0].nBits %>; i++) { + xacc[i] <== xacc[i-1] * (queryFRI[i]*(roots(<%- starkStruct.steps[0].nBits %>-i) - 1) + 1); } + // Compute the denominators of the opening domains signal xDivXSubXi[<%- starkInfo.openingPoints.length %>][3]; - +-%> <% for(var i=0; i <% const opening = Number(starkInfo.openingPoints[i]); -%> -<% let root = "1"; -%> +<% let root = ""; -%> <% for(let j = 0; j < Math.abs(opening); ++j) { - root += ` * ${opening > 0 ? "roots" : "invroots"}(${starkStruct.nBits})`; + if (j === 0) { + root += `${opening > 0 ? "roots" : "invroots"}(${starkStruct.nBits})`; + } else { + root += ` * ${opening > 0 ? "roots" : "invroots"}(${starkStruct.nBits})`; + } } -%> +<% if (Math.abs(opening) > 0) { -%> + // X / (X - <%- root %>*Xi) signal den<%- i %>inv[3] <== CInv()([xacc[<%- starkStruct.steps[0].nBits-1 %>] - <%- root %> * challengeXi[0], - <%- root %> * challengeXi[1], - <%- root %> * challengeXi[2]]); +<% } else { -%> + // X / (X - Xi) + signal den<%- i %>inv[3] <== CInv()([xacc[<%- starkStruct.steps[0].nBits-1 %>] - challengeXi[0], - challengeXi[1], - challengeXi[2]]); +<% } -%> xDivXSubXi[<%- i %>] <== [xacc[<%- starkStruct.steps[0].nBits-1 %>] * den<%- i %>inv[0], xacc[<%- starkStruct.steps[0].nBits-1 %>] * den<%- i %>inv[1], xacc[<%- starkStruct.steps[0].nBits-1 %>] * den<%- i %>inv[2]]; <% } -%> + // Compute the evaluations of the FRI polynomial at the query: + // sum_i (f_i(X) - f_i(Xi))/(X - Xi) <% const evalQ = unrollCode(verifierInfo.queryVerifier.code) -%> queryVals[0] <== <%- evalQ %>[0]; @@ -591,18 +611,18 @@ template <%- calculateFRIPolName %>() { <% } -%> template <%- verifyQueryName %>(currStepBits, nextStepBits) { var nextStep = currStepBits - nextStepBits; - signal input {binary} queriesFRI[<%- starkStruct.steps[0].nBits %>]; + signal input {binary} queryFRI[<%- starkStruct.steps[0].nBits %>]; signal input queryVals[3]; signal input s1_vals[1 << nextStep][3]; signal input {binary} enable; signal {binary} s0_keys_lowValues[nextStep]; - for(var i = 0; i < nextStep; i++) { - s0_keys_lowValues[i] <== queriesFRI[i + nextStepBits]; + for (var i = 0; i < nextStep; i++) { + s0_keys_lowValues[i] <== queryFRI[i + nextStepBits]; } - for(var i = 0; i < nextStepBits; i++) { - _ <== queriesFRI[i]; + for (var i = 0; i < nextStepBits; i++) { + _ <== queryFRI[i]; } signal lowValues[3] <== TreeSelector(nextStep, 3)(s1_vals, s0_keys_lowValues); @@ -612,11 +632,12 @@ template <%- verifyQueryName %>(currStepBits, nextStepBits) { enable * (lowValues[2] - queryVals[2]) === 0; } -// Polynomials can either have dimension 1 (if they are defined in the base field) or dimension 3 (if they are defined in the -// extended field). In general, all initial polynomials (constants and tr) will have dim 1 and the other ones such as Z (grand product), -// Q (quotient) or h_i (plookup) will have dim 3. -// This function processes the values, which are stored in an array vals[n] and splits them in multiple signals of size 1 (vals_i) -// or 3 (vals_i[3]) depending on its dimension. +/* + Polynomials can either be defined over the base field (such as the initial polynomials constants and tr) or over the extended field + (such as the grand product Z or the quotient Q). + This function processes the values, which are stored in an array vals[n] and splits them in multiple signals of the base + field size or the extended field size. +*/ template <%- mapValuesName %>() { <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% const stage = i + 1; -%> @@ -653,7 +674,7 @@ template <%- mapValuesName %>() { <% } -%> <% } -%> <% } -%> - +-%> <% for (let t = 0; t < starkInfo.customCommits.length; ++t) { -%> <% for(let l = 0; l < starkInfo.customCommits[t].stageWidths.length; ++l) { -%> <% let sectionsStage = starkInfo.customCommitsMap[t].filter(p => p.stage === l); -%> @@ -667,7 +688,7 @@ template <%- mapValuesName %>() { <% } -%> <% } -%> <% } -%> - +-%> <% for (let t = 1; t<=starkInfo.nStages + 1; t++) { -%> <% let sectionsStage = starkInfo.cmPolsMap.filter(p => p.stage === t); -%> <% for (let i=0; i< sectionsStage.length; i++) { -%> @@ -685,21 +706,31 @@ template <%- mapValuesName %>() { <% if(airgroupId !== undefined) { -%> <% verifierName += airgroupId; -%> <% } -%> +/* + STARK verifier +*/ template <%- verifierName %>() { // Signal used to enable or disable the constraints signal {binary} enabled; - <% if (options.enableInput) { -%> +<% if (options.enableInput) { -%> signal input enable; - enable * (enable -1) === 0; + enable * (enable - 1) === 0; enabled <== enable; - <% } else { -%> +<% } else { -%> enabled <== 1; - <% } -%> +<% } -%> + + // --> Proof elements <% if(starkInfo.nPublics > 0) { -%> + // Public inputs signal input publics[<%- starkInfo.nPublics %>]; -<% } -%> +<% } -%> +-%> +<% if((starkInfo.airValuesMap && starkInfo.airValuesMap.length > 0) || (starkInfo.airgroupValuesMap && starkInfo.airgroupValuesMap.length > 0) || (starkInfo.proofValuesMap && starkInfo.proofValuesMap.length > 0)) { -%> + // One-dimensional elements +<% } -%> <% if(starkInfo.airValuesMap.length > 0) { -%> signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> @@ -710,25 +741,27 @@ template <%- verifierName %>() { signal input proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> - // Merkle tree roots of the witness columns at each stage -<% for(let i=0; i < starkInfo.nStages; i++) { -%> -<% const stage = i + 1; -%> - signal input root<%- stage %>[4]; -<% } -%> - signal input root<%- qStage %>[4]; - - // Merkle tree roots of the fixed columns -<% if (options.verkeyInput) { -%> <% /* Depending on the STARK being verified, the rootC will be hardcoded or passed as an input */%> +<% if (options.verkeyInput) { -%> + // Merkle tree roots of the fixed columns signal input rootC[4]; <% } else { -%> <% if (options.inputChallenges) { -%> + // Merkle tree root of the fixed columns. + // Notice that it is set as an output so that it can be used outside this circuit signal output rootC[4] <== [<%- constRoot.join(',') %> ]; <% } else { -%> signal rootC[4] <== [<%- constRoot.join(',') %> ]; <% } -%> <% } -%> + // Merkle tree roots of the witness columns at each stage +<% for(let i=0; i < starkInfo.nStages; i++) { -%> +<% const stage = i + 1; -%> + signal input root<%- stage %>[4]; +<% } -%> + signal input root<%- qStage %>[4]; + // Set of evaluations around the out-of-domain sample signal input evals[<%- starkInfo.evMap.length %>][3]; @@ -751,7 +784,7 @@ template <%- verifierName %>() { signal input s0_vals_<%- starkInfo.customCommits[i].name %>_0[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>]; signal input s0_siblings_<%- starkInfo.customCommits[i].name %>_0[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>][4]; <% } -%> - +-%> <% for (let i = 1; i < starkInfo.nStages + 1; ++i) { -%> <% if (starkInfo.mapSectionsN[`cm${i}`] > 0) { -%> signal input s0_vals<%- i %>[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${i}`] %>]; @@ -767,6 +800,10 @@ template <%- verifierName %>() { <% } -%> <% if (!options.inputChallenges) { -%> + /////////// + // Main verifier logic + /////////// + <% let challengeNames = []; -%> // Proof challenges <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> @@ -785,17 +822,14 @@ template <%- verifierName %>() { // Challenges from which we derive all the queries signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>]; - - /////////// - // Derive challenges, challengesFRISteps and queriesFRI - /////////// + // --> Derive challenges, challengesFRISteps and queriesFRI <% const stageRoots = []; -%> <% for(let i = 0; i < starkInfo.nStages; i++) { stageRoots.push(`root${i + 1}`) } -%> (<%- challengeNames.join(",") %>,challengesFRISteps,queriesFRI) <== <%- transcriptName %>()(<%- starkInfo.nPublics > 0 ? "publics," : "" %>rootC,<%- stageRoots.join(",") %>,root<%- qStage %>,evals<%- si_roots.length > 0 ? "," + si_roots.join(",") : "" %>,finalPol); <% } else { -%> - // Get the challenges + // --> VADCOP elements <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> signal input challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; @@ -806,19 +840,20 @@ template <%- verifierName %>() { signal input challengesFRI[2][3]; signal input challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; - // Calculate the FRI queries from the hash of the last layer polynomial in the FRI commit phase + // Note: All challenges are set as inputs so the verifier assumes they have been correctly derived + + /////////// + // Main verifier logic + /////////// + + // --> Derive the FRI queries from the last challenge signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>] <== <%- calculateFriQueriesName %>()(challengesFRISteps[<%- starkStruct.steps.length -%>]); <% } -%> <% if (options.multiFRI) { -%> signal output queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; <% } -%> - - /////////// - // Main verifier logic - /////////// - - // --> Perform the consistency check around the out-of-domain sample Xi +-%> <% const verifyEvalsInputs = []; -%> <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% const stage = i + 1; -%> @@ -829,16 +864,19 @@ template <%- verifierName %>() { <% verifyEvalsInputs.push("challengeXi"); -%> <% verifyEvalsInputs.push("evals"); -%> <% if(starkInfo.nPublics > 0) verifyEvalsInputs.push("publics"); -%> -<% if(starkInfo.airgroupValuesMap.length > 0) verifyEvalsInputs.push("airgroupValues"); -%> <% if(starkInfo.airValuesMap.length > 0) verifyEvalsInputs.push("airvalues"); -%> +<% if(starkInfo.airgroupValuesMap.length > 0) verifyEvalsInputs.push("airgroupValues"); -%> <% if(starkInfo.proofValuesMap.length > 0) verifyEvalsInputs.push("proofvalues"); -%> <% verifyEvalsInputs.push("enabled"); -%> - +-%> + // --> Perform the consistency check around the out-of-domain sample Xi, i.e., check that the expressions: + // Q1(X) + X^n*Q2(X) + X^(2·n)*Q3(X) + ... X^((qDeg-1)·n)*Q(X), + // q_0(X) + challenge * q_1(X) + challenge^2 * q_2(X) + ... + challenge^(l-1) * q_l-1(X), + // are equal at Xi. <%- verifyEvaluationsName %>()(<%- verifyEvalsInputs.join(", ") %>); - // --> Preprocess the query answers sent in the query phase of FRI + // --> Preprocess the query answers sent in the query phase of FRI so that we can use anonymous components - // Preprocess the s_i vals given as inputs so that we can use anonymous components. // Two different processings are done: // For s0_vals, the arrays are transposed so that they fit MerkleHash template // For (s_i)_vals, the values are passed all together in a single array of length nVals*3. We convert them to vals[nVals][3] @@ -875,9 +913,9 @@ template <%- verifierName %>() { s0_valsC_p[q][i][0] = s0_valsC[q][i]; } <% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> - for (var i = 0; i < <%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>; i++) { - s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[q][i][0] = s0_vals_<%- starkInfo.customCommits[i].name %>_0[q][i]; - } + for (var i = 0; i < <%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>; i++) { + s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[q][i][0] = s0_vals_<%- starkInfo.customCommits[i].name %>_0[q][i]; + } <% }-%> // Preprocess vals for each folded polynomial @@ -894,7 +932,7 @@ template <%- verifierName %>() { <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% const stage = i + 1; -%> <% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { + for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`cm${stage}`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals<%- stage %>_p[q], s0_siblings<%- stage %>[q], queriesFRI[q], root<%- stage %>, enabled); } <% } -%> @@ -925,7 +963,9 @@ template <%- verifierName %>() { <% } -%> <% } -%> - // --> Verify that, for each of the queries, the FRI polynomial is properly constructed + // --> Perform the consistency checks on the FRI polynomial: + // F(X) = (f_0(X) - f_0(Xi))/(X - Xi) + challenge * (f_1(X) - f_1(root·Xi))/(X - root·Xi) + ... + // around the FRI queries <% if (!options.multiFRI) { -%> signal queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; <% } -%> @@ -943,21 +983,21 @@ template <%- verifierName %>() { queryVals.push(`s0_vals_${starkInfo.customCommits[i].name}_0[q]`); } -%> - // Reconstruct the FRI polinomial from evaluations + // Reconstruct the RHS from Xi, the challenge and the evaluations queryVals[q] <== <%- calculateFRIPolName %>()(queriesFRI[q], challengeXi, challengesFRI, evals, <%- queryVals.join(", ") %>); <% let nextValsPol = 0 < starkStruct.steps.length-1 ? "s1_vals_p[q]" : "finalPol"; let nextStep = 0 < starkStruct.steps.length-1 ? starkStruct.steps[1].nBits : 0; -%> - // Verify that it matches with the FRI polynomial evaluation + // Verify that it matches with the LHS <%- verifyQueryName %>(<%- starkStruct.steps[0].nBits %>, <%- nextStep %>)(queriesFRI[q], queryVals[q], <%- nextValsPol %>, enabled); } <% if(!options.recursive2) { -%> - // --> Verify that, for each of the queries, the FRI commit phase is correct + // --> Verify that, for each query, the polynomials in the FRI commit phase are correctly related layer by layer <% for (let s=1; s signal {binary} s<%- s %>_queriesFRI[<%- starkStruct.nQueries -%>][<%- starkStruct.steps[s].nBits%>]; <% } -%> - +-%> for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { // For each layer we need to check that polynomial is properly constructed // Remember that if the step between polynomials is b = 2^l, the next polynomial p_(i+1) will have degree deg(p_i) / b From ab62db748744be79c20f81a56a3e05914a7ffde6 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Masip?= Date: Thu, 16 Jan 2025 09:53:01 +0000 Subject: [PATCH 9/9] dividing the star verifier between the iop and the ldt test --- .../circuits.gl/stark_iop_verifier.circom.ejs | 69 ++++ .../circuits.gl/stark_ldt_verifier.circom.ejs | 145 ++++++++ .../circuits.gl/stark_verifier.circom.ejs | 328 ++++-------------- src/pil2circom/pil2circom.js | 8 +- 4 files changed, 285 insertions(+), 265 deletions(-) create mode 100644 src/pil2circom/circuits.gl/stark_iop_verifier.circom.ejs create mode 100644 src/pil2circom/circuits.gl/stark_ldt_verifier.circom.ejs diff --git a/src/pil2circom/circuits.gl/stark_iop_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_iop_verifier.circom.ejs new file mode 100644 index 0000000..b5f0332 --- /dev/null +++ b/src/pil2circom/circuits.gl/stark_iop_verifier.circom.ejs @@ -0,0 +1,69 @@ +<% if (!options.inputChallenges) { -%> + +<% let challengeNames = []; -%> + // Proof challenges +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> + signal challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; +<% challengeNames.push("challengesStage" + (i + 1)); -%> +<% }-%> + + signal challengeQ[3]; + signal challengeXi[3]; + signal challengesFRI[2][3]; +<% challengeNames.push(...["challengeQ", "challengeXi", "challengesFRI"]); -%> + + signal challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; + + // Challenges from which we derive all the queries + signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>]; + + // --> Derive challenges, challengesFRISteps and queriesFRI + +<% const stageRoots = []; -%> +<% for(let i = 0; i < starkInfo.nStages; i++) { stageRoots.push(`root${i + 1}`) } -%> + (<%- challengeNames.join(",") %>,challengesFRISteps,queriesFRI) <== <%- calculateChallengesName %>()(<%- starkInfo.nPublics > 0 ? "publics," : "" %>rootC,<%- stageRoots.join(",") %>,root<%- qStage %>,evals<%- si_roots.length > 0 ? "," + si_roots.join(",") : "" %>,finalPol); + +<% } else { -%> + // --> VADCOP elements +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> + signal input challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; +<% }-%> + + signal input challengeQ[3]; + signal input challengeXi[3]; + signal input challengesFRI[2][3]; + signal input challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; + + // Note: All challenges are set as inputs so the verifier assumes they have been correctly derived + + // --> Derive the FRI queries from the last challenge + signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>] <== <%- calculateFriQueriesName %>()(challengesFRISteps[<%- starkStruct.steps.length -%>]); +<% } -%> + +<% if (options.multiFRI) { -%> + signal output queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; +<% } -%> +-%> +<% const verifyEvalsInputs = []; -%> +<% verifyEvalsInputs.push("enabled"); -%> +<% if(starkInfo.nPublics > 0) verifyEvalsInputs.push("publics"); -%> +<% if(starkInfo.airValuesMap.length > 0) verifyEvalsInputs.push("airvalues"); -%> +<% if(starkInfo.airgroupValuesMap.length > 0) verifyEvalsInputs.push("airgroupValues"); -%> +<% if(starkInfo.proofValuesMap.length > 0) verifyEvalsInputs.push("proofvalues"); -%> +-%> +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% const stage = i + 1; -%> +<% if(starkInfo.challengesMap.filter(c => c.stage === stage).length === 0) continue; -%> +<% verifyEvalsInputs.push("challengesStage" + stage); -%> +<% } -%> +<% verifyEvalsInputs.push("challengeQ"); -%> +<% verifyEvalsInputs.push("challengeXi"); -%> +<% verifyEvalsInputs.push("evals"); -%> +-%> + // --> Perform the consistency check around the out-of-domain sample Xi, i.e., check that the expressions: + // Q1(X) + X^n*Q2(X) + X^(2·n)*Q3(X) + ... X^((qDeg-1)·n)*Q(X), + // q_0(X) + challenge * q_1(X) + challenge^2 * q_2(X) + ... + challenge^(l-1) * q_l-1(X), + // are equal at Xi. + <%- verifyEvaluationsName %>()(<%- verifyEvalsInputs.join(", ") %>); diff --git a/src/pil2circom/circuits.gl/stark_ldt_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_ldt_verifier.circom.ejs new file mode 100644 index 0000000..3bfca98 --- /dev/null +++ b/src/pil2circom/circuits.gl/stark_ldt_verifier.circom.ejs @@ -0,0 +1,145 @@ + + // --> Preprocess the query answers sent in the query phase of FRI so that we can use anonymous components + + // Two different processings are done: + // For s0_vals, the arrays are transposed so that they fit MerkleHash template + // For (s_i)_vals, the values are passed all together in a single array of length nVals*3. We convert them to vals[nVals][3] +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% const stage = i + 1; -%> +<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> + var s0_vals<%- stage %>_p[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${stage}`] %>][1]; +<% } -%> +<% } -%> + var s0_vals<%- qStage %>_p[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${qStage}`] %>][1]; + var s0_valsC_p[<%- starkStruct.nQueries %>][<%- starkInfo.nConstants %>][1]; +<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> + var s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>][1]; +<% }-%> +<% for (let s=0; s +<% let exponent = s === 0 ? 1 : (1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits)); -%> + var s<%- s %>_vals_p[<%- starkStruct.nQueries %>][<%- exponent %>][3]; +<% } -%> + + for (var q=0; q<<%- starkStruct.nQueries %>; q++) { + // Preprocess vals for the initial FRI polynomial +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% const stage = i + 1; -%> +<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> + for (var i = 0; i < <%- starkInfo.mapSectionsN[`cm${stage}`] %>; i++) { + s0_vals<%- stage %>_p[q][i][0] = s0_vals<%- stage %>[q][i]; + } +<% } -%> +<% } -%> + for (var i = 0; i < <%- starkInfo.mapSectionsN[`cm${qStage}`] %>; i++) { + s0_vals<%- qStage %>_p[q][i][0] = s0_vals<%- qStage %>[q][i]; + } + for (var i = 0; i < <%- starkInfo.nConstants %>; i++) { + s0_valsC_p[q][i][0] = s0_valsC[q][i]; + } +<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> + for (var i = 0; i < <%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>; i++) { + s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[q][i][0] = s0_vals_<%- starkInfo.customCommits[i].name %>_0[q][i]; + } +<% }-%> + + // Preprocess vals for each folded polynomial + for(var e=0; e < 3; e++) { +<% for (let s=1; s + for(var c=0; c < <%- (1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits))%>; c++) { + s<%- s %>_vals_p[q][c][e] = s<%- s %>_vals[q][c*3+e]; + } +<% } -%> + } + } + + // --> Verify the Merkle roots for each of the <%- starkStruct.nQueries %> queries +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% const stage = i + 1; -%> +<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> + for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { + VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`cm${stage}`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals<%- stage %>_p[q], s0_siblings<%- stage %>[q], queriesFRI[q], root<%- stage %>, enabled); + } +<% } -%> +<% } -%> + + for (var q=0; q<<%- starkStruct.nQueries %>; q++) { + VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`cm${qStage}`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals<%- qStage %>_p[q], s0_siblings<%- qStage %>[q], queriesFRI[q], root<%- qStage %>, enabled); + } + + for (var q=0; q<<%- starkStruct.nQueries %>; q++) { + VerifyMerkleHash(1, <%- starkInfo.nConstants %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_valsC_p[q], s0_siblingsC[q], queriesFRI[q], rootC, enabled); + } + +<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> + signal root_<%- starkInfo.customCommits[i].name %>_0[4] <== [publics[<%- starkInfo.customCommits[i].publicValues[0].idx %>], publics[<%- starkInfo.customCommits[i].publicValues[1].idx %>], publics[<%- starkInfo.customCommits[i].publicValues[2].idx %>], publics[<%- starkInfo.customCommits[i].publicValues[3].idx %>]]; + for (var q=0; q<<%- starkStruct.nQueries %>; q++) { + VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[q], s0_siblings_<%- starkInfo.customCommits[i].name %>_0[q], queriesFRI[q], root_<%- starkInfo.customCommits[i].name %>_0, enabled); + } +<% } -%> + +<% if(!options.recursive2) { -%> +<% for (let s=1; s + signal {binary} s<%- s %>_keys_merkle[<%- starkStruct.nQueries %>][<%- starkStruct.steps[s].nBits %>]; + for (var q=0; q<<%- starkStruct.nQueries %>; q++) { + for(var i = 0; i < <%-starkStruct.steps[s].nBits %>; i++) { s<%- s %>_keys_merkle[q][i] <== queriesFRI[q][i]; } + VerifyMerkleHash(3, <%- 1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits) %>, <%- 1 << starkStruct.steps[s].nBits %>)(s<%- s %>_vals_p[q], s<%- s %>_siblings[q], s<%- s %>_keys_merkle[q], s<%- s %>_root, enabled); + } +<% } -%> +<% } -%> + + // --> Perform the consistency checks on the FRI polynomial: + // F(X) = (f_0(X) - f_0(Xi))/(X - Xi) + challenge * (f_1(X) - f_1(root·Xi))/(X - root·Xi) + ... + // around the FRI queries +<% if (!options.multiFRI) { -%> + signal queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; +<% } -%> + for (var q=0; q<<%- starkStruct.nQueries %>; q++) { +<% let queryVals = []; + queryVals.push("s0_valsC[q]"); + for(let i = 0; i < starkInfo.customCommits.length; ++i) { + queryVals.push(`s0_vals_${starkInfo.customCommits[i].name}_0[q]`); + } + for(let i = 0; i < starkInfo.nStages; ++i) { + const stage = i + 1; + if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { + queryVals.push(`s0_vals${stage}[q]`); + } + } + queryVals.push(`s0_vals${qStage}[q]`); +-%> + // Reconstruct the RHS from Xi, the challenge and the evaluations + queryVals[q] <== <%- calculateFRIPolName %>()(queriesFRI[q], challengeXi, challengesFRI, evals, <%- queryVals.join(", ") %>); +<% let nextValsPol = 0 < starkStruct.steps.length-1 ? "s1_vals_p[q]" : "finalPol"; + let nextStep = 0 < starkStruct.steps.length-1 ? starkStruct.steps[1].nBits : 0; +-%> + // Verify that it matches with the LHS + <%- verifyQueryName %>(<%- starkStruct.steps[0].nBits %>, <%- nextStep %>)(enabled, queriesFRI[q], queryVals[q], <%- nextValsPol %>); + } + +<% if(!options.recursive2) { -%> + // --> Verify that, for each query, the polynomials in the FRI commit phase are correctly related layer by layer +<% for (let s=1; s + signal {binary} s<%- s %>_queriesFRI[<%- starkStruct.nQueries -%>][<%- starkStruct.steps[s].nBits%>]; +<% } -%> +-%> + for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { + // For each layer we need to check that polynomial is properly constructed + // Remember that if the step between polynomials is b = 2^l, the next polynomial p_(i+1) will have degree deg(p_i) / b +<% for (let s=1; s + + // Check S<%- s %> + for(var i = 0; i < <%- starkStruct.steps[s].nBits %>; i++) { s<%- s %>_queriesFRI[q][i] <== queriesFRI[q][i]; } +<% const nextPolFRI = s < starkStruct.steps.length-1 ? `s${s+1}_vals_p[q]` : "finalPol"; -%> +<% const nextStepFRI = s < starkStruct.steps.length-1 ? starkStruct.steps[s+1].nBits : 0; -%> +<% const exponent = s === 0 ? 0 : 1 << (starkStruct.nBitsExt -starkStruct.steps[s-1].nBits); -%> +<% const prevStepBits = s === 0 ? starkStruct.steps[s].nBits : starkStruct.steps[s-1].nBits; -%> +<% const e0 = F.inv(F.exp(F.shift, exponent)) -%> + VerifyFRI(<%- starkStruct.nBitsExt %>, <%- prevStepBits %>, <%- starkStruct.steps[s].nBits %>, <%- nextStepFRI %>, <%- e0 %>)(s<%- s %>_queriesFRI[q], challengesFRISteps[<%- s %>], s<%- s %>_vals_p[q], <%- nextPolFRI %>, enabled); +<% } -%> + } + +<% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> +<% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> + // --> Verify that the final polynomial is of correct degree + VerifyFinalPol(<%- nLastBits %>, <%- maxDegBits %>)(finalPol, enabled); +<% } -%> \ No newline at end of file diff --git a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs index b8bfc9d..b7f71f4 100644 --- a/src/pil2circom/circuits.gl/stark_verifier.circom.ejs +++ b/src/pil2circom/circuits.gl/stark_verifier.circom.ejs @@ -138,13 +138,13 @@ class Transcript { } updateState() { - let signalName = "partialHash"; + let signalName = "hash"; if(this.name) signalName += "_" + this.name; if(this.hCnt > 0) { const firstUnused = Math.max(this.hiCnt, 4); if(firstUnused < 12) { this.code.push(`for(var i = ${firstUnused}; i < 12; i++){ - _ <== ${signalName}_${this.hCnt -1}[i]; // Unused transcript values + _ <== ${signalName}_${this.hCnt -1}[i]; // Unused hash values }`) } } @@ -190,13 +190,13 @@ class Transcript { } getPermutations(v, n, nBits) { - let signalName = "partialHash"; + let signalName = "hash"; if(this.name) signalName += "_" + this.name; const totalBits = n*nBits; const n2b = []; for (let i=0; i /* - Calculate FRI Queries + Calculate FRI queries from a field element */ <% let calculateFriQueriesName = "calculateFRIQueries"; -%> <% if(airgroupId !== undefined) { -%> <% calculateFriQueriesName += airgroupId; -%> <% } -%> template <%- calculateFriQueriesName %>() { - signal input challengeFRIQueries[3]; + signal input fieldElement[3]; + signal output {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>]; -%> <% const transcriptQueries = new Transcript("friQueries"); -%> -<% transcriptQueries.put("challengeFRIQueries", 3); -%> +<% transcriptQueries.put("fieldElement", 3); -%> -%> <% transcriptQueries.getPermutations("queriesFRI", starkStruct.nQueries, starkStruct.steps[0].nBits); -%> <%- transcriptQueries.getCode(); %> } -<% let transcriptName = "Transcript"; -%> +/* + Calculate the proof challenges from the proof elements +*/ +<% let calculateChallengesName = "calculateChallenges"; -%> <% if(airgroupId !== undefined) { -%> -<% transcriptName += airgroupId; -%> +<% calculateChallengesName += airgroupId; -%> <% } -%> <% if (!options.inputChallenges) { -%> - -/* - Calculate the transcript -*/ -template <%- transcriptName %>() { +template <%- calculateChallengesName %>() { -%> <% if(starkInfo.nPublics > 0) { -%> signal input publics[<%- starkInfo.nPublics %>]; <% } -%> + signal input rootC[4]; + <% for(let i=0; i < starkInfo.nStages; i++) { -%> <% const stage = i + 1; -%> signal input root<%- stage %>[4]; @@ -308,7 +310,6 @@ template <%- transcriptName %>() { <% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> signal output challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; <% } -%> - signal output challengeQ[3]; signal output challengeXi[3]; signal output challengesFRI[2][3]; @@ -398,7 +399,7 @@ template <%- transcriptName %>() { <% } -%> /* - Verify that all committed polynomials are calculated correctly + Run the consistency check around the out-of-domain sample */ -%> <% let verifyEvaluationsName = "VerifyEvaluations"; -%> @@ -406,17 +407,13 @@ template <%- transcriptName %>() { <% verifyEvaluationsName += airgroupId; -%> <% } -%> template <%- verifyEvaluationsName %>() { -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.challengesMap.filter(c => c.stage === stage).length === 0) continue; -%> - signal input challengesStage<%- stage %>[<%- starkInfo.challengesMap.filter(c => c.stage === stage).length -%>][3]; -<% } -%> - signal input challengeQ[3]; - signal input challengeZ[3]; - signal input evals[<%- starkInfo.evMap.length %>][3]; + // Signal used to enable or disable the constraints + signal input {binary} enable; + <% if(starkInfo.nPublics > 0) { -%> signal input publics[<%- starkInfo.nPublics %>]; <% } -%> +-%> <% if(starkInfo.airValuesMap.length > 0) { -%> signal input airvalues[<%- starkInfo.airValuesMap.length %>][3]; <% } -%> @@ -426,13 +423,22 @@ template <%- verifyEvaluationsName %>() { <% if(starkInfo.proofValuesMap.length > 0) { -%> signal input proofvalues[<%- starkInfo.proofValuesMap.length %>][3]; <% } -%> - signal input {binary} enable; + +<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> +<% const stage = i + 1; -%> +<% if(starkInfo.challengesMap.filter(c => c.stage === stage).length === 0) continue; -%> + signal input challengesStage<%- stage %>[<%- starkInfo.challengesMap.filter(c => c.stage === stage).length -%>][3]; +<% } -%> + signal input challengeQ[3]; + signal input challengeXi[3]; + + signal input evals[<%- starkInfo.evMap.length %>][3]; // Compute all powers of z (stored in challengeXi) up to nBits, i.e, [z, z^2, ..., z^nBits] signal zMul[<%- starkStruct.nBits %>][3]; for (var i = 0; i < <%- starkStruct.nBits %> ; i++) { if (i == 0){ - zMul[i] <== CMul()(challengeZ, challengeZ); + zMul[i] <== CMul()(challengeXi, challengeXi); } else { zMul[i] <== CMul()(zMul[i-1], zMul[i-1]); } @@ -443,6 +449,7 @@ template <%- verifyEvaluationsName %>() { signal Zh[3] <== CInv()(Z); -%> <% if(starkInfo.boundaries.map(b => b.name).includes("firstRow")) { -%> + // Compute the evaluation of the polynomial Zfirst(X) = X - 1 at z signal Zfirst[3] <== CInv()([challengeXi[0] - 1, challengeXi[1], challengeXi[2]]); <% } -%> -%> @@ -451,6 +458,7 @@ template <%- verifyEvaluationsName %>() { <% for(let i = 0; i < (1 << starkStruct.nBits) - 1; ++i) { -%> <% root = F.mul(root, F.w[starkStruct.nBits]); -%> <% } -%> + // Compute the evaluation of the polynomial Zlast(X) = X - root^(nBits-1) at z signal Zlast[3] <== CInv()([challengeXi[0] - <%- root %>, challengeXi[1], challengeXi[2]]); <% } -%> -%> @@ -520,7 +528,7 @@ template <%- verifyEvaluationsName %>() { } /* - Calculate FRI polinomial + Calculate the value of the FRI polynomial at the query point */ <% let calculateFRIPolName = "CalculateFRIPolValue"; -%> <% if(airgroupId !== undefined) { -%> @@ -528,9 +536,22 @@ template <%- verifyEvaluationsName %>() { <% } -%> template <%- calculateFRIPolName %>() { signal input {binary} queryFRI[<%- starkStruct.steps[0].nBits %>]; + signal input challengeXi[3]; signal input challengesFRI[2][3]; + + // Evaluations around the out-of-domain sample signal input evals[<%- starkInfo.evMap.length %>][3]; + + // Evaluations of the constant polynomials at the query point + signal input consts[<%- starkInfo.nConstants %>]; + +<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> + // Evaluations of the custom <%- starkInfo.customCommits[i].name %> polynomials at the query point + signal input custom_<%- starkInfo.customCommits[i].name %>_0[<%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>]; +<% } -%> + + // Evaluations of the committed polynomials at the query point <% for(let i = 0; i < starkInfo.nStages; ++i) { -%> <% const stage = i + 1; -%> <% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> @@ -538,10 +559,6 @@ template <%- calculateFRIPolName %>() { <% } -%> <% } -%> signal input cm<%- qStage %>[<%- starkInfo.mapSectionsN[`cm${qStage}`] %>]; - signal input consts[<%- starkInfo.nConstants %>]; -<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> - signal input custom_<%- starkInfo.customCommits[i].name %>_0[<%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>]; -<% } -%> signal output queryVals[3]; @@ -602,19 +619,26 @@ template <%- calculateFRIPolName %>() { } /* - Verify that the initial FRI polynomial, which is the lineal combination of the committed polynomials - during the STARK phases, is built properly + Performs the consistency check of the FRI polynomial around a domain sample: + Given the evaluation of the FRI polynomial at the query point, verifies that another + claimed value is the same */ <% let verifyQueryName = "VerifyQuery"; -%> <% if(airgroupId !== undefined) { -%> <% verifyQueryName += airgroupId; -%> <% } -%> template <%- verifyQueryName %>(currStepBits, nextStepBits) { - var nextStep = currStepBits - nextStepBits; + // Signal used to enable or disable the constraints + signal input {binary} enable; + signal input {binary} queryFRI[<%- starkStruct.steps[0].nBits %>]; + + // Computed value of the FRI polynomial at the query point signal input queryVals[3]; - signal input s1_vals[1 << nextStep][3]; - signal input {binary} enable; + + var nextStep = currStepBits - nextStepBits; + // Claimed value + signal input claimedValue[1 << nextStep][3]; signal {binary} s0_keys_lowValues[nextStep]; for (var i = 0; i < nextStep; i++) { @@ -622,10 +646,10 @@ template <%- verifyQueryName %>(currStepBits, nextStepBits) { } for (var i = 0; i < nextStepBits; i++) { - _ <== queryFRI[i]; + _ <== queryFRI[i]; // Unused bits } - signal lowValues[3] <== TreeSelector(nextStep, 3)(s1_vals, s0_keys_lowValues); + signal lowValues[3] <== TreeSelector(nextStep, 3)(claimedValue, s0_keys_lowValues); enable * (lowValues[0] - queryVals[0]) === 0; enable * (lowValues[1] - queryVals[1]) === 0; @@ -742,12 +766,11 @@ template <%- verifierName %>() { <% } -%> <% /* Depending on the STARK being verified, the rootC will be hardcoded or passed as an input */%> -<% if (options.verkeyInput) { -%> // Merkle tree roots of the fixed columns +<% if (options.verkeyInput) { -%> signal input rootC[4]; <% } else { -%> <% if (options.inputChallenges) { -%> - // Merkle tree root of the fixed columns. // Notice that it is set as an output so that it can be used outside this circuit signal output rootC[4] <== [<%- constRoot.join(',') %> ]; <% } else { -%> @@ -799,228 +822,13 @@ template <%- verifierName %>() { signal input s<%- s %>_siblings[<%- starkStruct.nQueries %>][<%- starkStruct.steps[s].nBits %>][4]; <% } -%> -<% if (!options.inputChallenges) { -%> - /////////// - // Main verifier logic - /////////// - -<% let challengeNames = []; -%> - // Proof challenges -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> - signal challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; -<% challengeNames.push("challengesStage" + (i + 1)); -%> -<% }-%> - - signal challengeQ[3]; - signal challengeXi[3]; - signal challengesFRI[2][3]; -<% challengeNames.push(...["challengeQ", "challengeXi", "challengesFRI"]); -%> - - signal challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; - - // Challenges from which we derive all the queries - signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>]; - - // --> Derive challenges, challengesFRISteps and queriesFRI - -<% const stageRoots = []; -%> -<% for(let i = 0; i < starkInfo.nStages; i++) { stageRoots.push(`root${i + 1}`) } -%> - (<%- challengeNames.join(",") %>,challengesFRISteps,queriesFRI) <== <%- transcriptName %>()(<%- starkInfo.nPublics > 0 ? "publics," : "" %>rootC,<%- stageRoots.join(",") %>,root<%- qStage %>,evals<%- si_roots.length > 0 ? "," + si_roots.join(",") : "" %>,finalPol); - -<% } else { -%> - // --> VADCOP elements -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% if(starkInfo.challengesMap.filter(c => c.stage === i + 1).length === 0) continue; -%> - signal input challengesStage<%- i + 1 %>[<%- starkInfo.challengesMap.filter(c => c.stage === i + 1).length %>][3]; -<% }-%> - - signal input challengeQ[3]; - signal input challengeXi[3]; - signal input challengesFRI[2][3]; - signal input challengesFRISteps[<%- starkStruct.steps.length + 1 -%>][3]; - - // Note: All challenges are set as inputs so the verifier assumes they have been correctly derived + // --> Run the IOP verifier <-- +<%- include("circuits.gl/stark_iop_verifier.circom.ejs", { calculateChallengesName, qStage, si_roots, verifyEvaluationsName, calculateFriQueriesName }) -%> - /////////// - // Main verifier logic - /////////// - - // --> Derive the FRI queries from the last challenge - signal {binary} queriesFRI[<%- starkStruct.nQueries %>][<%- starkStruct.steps[0].nBits %>] <== <%- calculateFriQueriesName %>()(challengesFRISteps[<%- starkStruct.steps.length -%>]); -<% } -%> - -<% if (options.multiFRI) { -%> - signal output queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; -<% } -%> --%> -<% const verifyEvalsInputs = []; -%> -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.challengesMap.filter(c => c.stage === stage).length === 0) continue; -%> -<% verifyEvalsInputs.push("challengesStage" + stage); -%> -<% } -%> -<% verifyEvalsInputs.push("challengeQ"); -%> -<% verifyEvalsInputs.push("challengeXi"); -%> -<% verifyEvalsInputs.push("evals"); -%> -<% if(starkInfo.nPublics > 0) verifyEvalsInputs.push("publics"); -%> -<% if(starkInfo.airValuesMap.length > 0) verifyEvalsInputs.push("airvalues"); -%> -<% if(starkInfo.airgroupValuesMap.length > 0) verifyEvalsInputs.push("airgroupValues"); -%> -<% if(starkInfo.proofValuesMap.length > 0) verifyEvalsInputs.push("proofvalues"); -%> -<% verifyEvalsInputs.push("enabled"); -%> --%> - // --> Perform the consistency check around the out-of-domain sample Xi, i.e., check that the expressions: - // Q1(X) + X^n*Q2(X) + X^(2·n)*Q3(X) + ... X^((qDeg-1)·n)*Q(X), - // q_0(X) + challenge * q_1(X) + challenge^2 * q_2(X) + ... + challenge^(l-1) * q_l-1(X), - // are equal at Xi. - <%- verifyEvaluationsName %>()(<%- verifyEvalsInputs.join(", ") %>); - - // --> Preprocess the query answers sent in the query phase of FRI so that we can use anonymous components - - // Two different processings are done: - // For s0_vals, the arrays are transposed so that they fit MerkleHash template - // For (s_i)_vals, the values are passed all together in a single array of length nVals*3. We convert them to vals[nVals][3] -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> - var s0_vals<%- stage %>_p[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${stage}`] %>][1]; -<% } -%> -<% } -%> - var s0_vals<%- qStage %>_p[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`cm${qStage}`] %>][1]; - var s0_valsC_p[<%- starkStruct.nQueries %>][<%- starkInfo.nConstants %>][1]; -<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> - var s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[<%- starkStruct.nQueries %>][<%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>][1]; -<% }-%> -<% for (let s=0; s -<% let exponent = s === 0 ? 1 : (1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits)); -%> - var s<%- s %>_vals_p[<%- starkStruct.nQueries %>][<%- exponent %>][3]; -<% } -%> - - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - // Preprocess vals for the initial FRI polynomial -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> - for (var i = 0; i < <%- starkInfo.mapSectionsN[`cm${stage}`] %>; i++) { - s0_vals<%- stage %>_p[q][i][0] = s0_vals<%- stage %>[q][i]; - } -<% } -%> -<% } -%> - for (var i = 0; i < <%- starkInfo.mapSectionsN[`cm${qStage}`] %>; i++) { - s0_vals<%- qStage %>_p[q][i][0] = s0_vals<%- qStage %>[q][i]; - } - for (var i = 0; i < <%- starkInfo.nConstants %>; i++) { - s0_valsC_p[q][i][0] = s0_valsC[q][i]; - } -<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> - for (var i = 0; i < <%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>; i++) { - s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[q][i][0] = s0_vals_<%- starkInfo.customCommits[i].name %>_0[q][i]; - } -<% }-%> - - // Preprocess vals for each folded polynomial - for(var e=0; e < 3; e++) { -<% for (let s=1; s - for(var c=0; c < <%- (1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits))%>; c++) { - s<%- s %>_vals_p[q][c][e] = s<%- s %>_vals[q][c*3+e]; - } -<% } -%> - } - } - - // --> Verify the Merkle roots for each of the <%- starkStruct.nQueries %> queries -<% for(let i = 0; i < starkInfo.nStages; ++i) { -%> -<% const stage = i + 1; -%> -<% if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { -%> - for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { - VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`cm${stage}`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals<%- stage %>_p[q], s0_siblings<%- stage %>[q], queriesFRI[q], root<%- stage %>, enabled); - } -<% } -%> -<% } -%> - - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`cm${qStage}`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals<%- qStage %>_p[q], s0_siblings<%- qStage %>[q], queriesFRI[q], root<%- qStage %>, enabled); - } - - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - VerifyMerkleHash(1, <%- starkInfo.nConstants %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_valsC_p[q], s0_siblingsC[q], queriesFRI[q], rootC, enabled); - } - -<% for(let i = 0; i < starkInfo.customCommits.length; ++i) { -%> - signal root_<%- starkInfo.customCommits[i].name %>_0[4] <== [publics[<%- starkInfo.customCommits[i].publicValues[0].idx %>], publics[<%- starkInfo.customCommits[i].publicValues[1].idx %>], publics[<%- starkInfo.customCommits[i].publicValues[2].idx %>], publics[<%- starkInfo.customCommits[i].publicValues[3].idx %>]]; - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - VerifyMerkleHash(1, <%- starkInfo.mapSectionsN[`${starkInfo.customCommits[i].name}0`] %>, <%- 1 << starkStruct.steps[0].nBits %>)(s0_vals_<%- starkInfo.customCommits[i].name %>_0_p[q], s0_siblings_<%- starkInfo.customCommits[i].name %>_0[q], queriesFRI[q], root_<%- starkInfo.customCommits[i].name %>_0, enabled); - } -<% } -%> - -<% if(!options.recursive2) { -%> -<% for (let s=1; s - signal {binary} s<%- s %>_keys_merkle[<%- starkStruct.nQueries %>][<%- starkStruct.steps[s].nBits %>]; - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { - for(var i = 0; i < <%-starkStruct.steps[s].nBits %>; i++) { s<%- s %>_keys_merkle[q][i] <== queriesFRI[q][i]; } - VerifyMerkleHash(3, <%- 1 << (starkStruct.steps[s-1].nBits - starkStruct.steps[s].nBits) %>, <%- 1 << starkStruct.steps[s].nBits %>)(s<%- s %>_vals_p[q], s<%- s %>_siblings[q], s<%- s %>_keys_merkle[q], s<%- s %>_root, enabled); - } -<% } -%> -<% } -%> - - // --> Perform the consistency checks on the FRI polynomial: - // F(X) = (f_0(X) - f_0(Xi))/(X - Xi) + challenge * (f_1(X) - f_1(root·Xi))/(X - root·Xi) + ... - // around the FRI queries -<% if (!options.multiFRI) { -%> - signal queryVals[<%- starkInfo.starkStruct.nQueries %>][3]; -<% } -%> - for (var q=0; q<<%- starkStruct.nQueries %>; q++) { -<% let queryVals = []; - for(let i = 0; i < starkInfo.nStages; ++i) { - const stage = i + 1; - if(starkInfo.mapSectionsN[`cm${stage}`] > 0) { - queryVals.push(`s0_vals${stage}[q]`); - } - } - queryVals.push(`s0_vals${qStage}[q]`); - queryVals.push("s0_valsC[q]"); - for(let i = 0; i < starkInfo.customCommits.length; ++i) { - queryVals.push(`s0_vals_${starkInfo.customCommits[i].name}_0[q]`); - } --%> - // Reconstruct the RHS from Xi, the challenge and the evaluations - queryVals[q] <== <%- calculateFRIPolName %>()(queriesFRI[q], challengeXi, challengesFRI, evals, <%- queryVals.join(", ") %>); -<% let nextValsPol = 0 < starkStruct.steps.length-1 ? "s1_vals_p[q]" : "finalPol"; - let nextStep = 0 < starkStruct.steps.length-1 ? starkStruct.steps[1].nBits : 0; --%> - // Verify that it matches with the LHS - <%- verifyQueryName %>(<%- starkStruct.steps[0].nBits %>, <%- nextStep %>)(queriesFRI[q], queryVals[q], <%- nextValsPol %>, enabled); - } - -<% if(!options.recursive2) { -%> - // --> Verify that, for each query, the polynomials in the FRI commit phase are correctly related layer by layer -<% for (let s=1; s - signal {binary} s<%- s %>_queriesFRI[<%- starkStruct.nQueries -%>][<%- starkStruct.steps[s].nBits%>]; -<% } -%> --%> - for (var q = 0; q < <%- starkStruct.nQueries %>; q++) { - // For each layer we need to check that polynomial is properly constructed - // Remember that if the step between polynomials is b = 2^l, the next polynomial p_(i+1) will have degree deg(p_i) / b -<% for (let s=1; s - - // Check S<%- s %> - for(var i = 0; i < <%- starkStruct.steps[s].nBits %>; i++) { s<%- s %>_queriesFRI[q][i] <== queriesFRI[q][i]; } -<% const nextPolFRI = s < starkStruct.steps.length-1 ? `s${s+1}_vals_p[q]` : "finalPol"; -%> -<% const nextStepFRI = s < starkStruct.steps.length-1 ? starkStruct.steps[s+1].nBits : 0; -%> -<% const exponent = s === 0 ? 0 : 1 << (starkStruct.nBitsExt -starkStruct.steps[s-1].nBits); -%> -<% const prevStepBits = s === 0 ? starkStruct.steps[s].nBits : starkStruct.steps[s-1].nBits; -%> -<% const e0 = F.inv(F.exp(F.shift, exponent)) -%> - VerifyFRI(<%- starkStruct.nBitsExt %>, <%- prevStepBits %>, <%- starkStruct.steps[s].nBits %>, <%- nextStepFRI %>, <%- e0 %>)(s<%- s %>_queriesFRI[q], challengesFRISteps[<%- s %>], s<%- s %>_vals_p[q], <%- nextPolFRI %>, enabled); -<% } -%> - } - -<% const nLastBits = starkStruct.steps[ starkStruct.steps.length-1].nBits; -%> -<% const maxDegBits = Math.max(nLastBits - (starkStruct.nBitsExt - starkStruct.nBits), 0); -%> - // --> Verify that the final polynomial is of correct degree - VerifyFinalPol(<%- nLastBits %>, <%- maxDegBits %>)(finalPol, enabled); -<% } -%> + // --> Run the LDT verifier <-- +<%- include("circuits.gl/stark_ldt_verifier.circom.ejs", { qStage, calculateFRIPolName, verifyQueryName }) -%> } <% if (!options.skipMain) { -%> component main <%- starkInfo.nPublics > 0 ? "{public [publics]}" : ""%>= <%- verifierName %>(); -<% } -%> +<% } -%> \ No newline at end of file diff --git a/src/pil2circom/pil2circom.js b/src/pil2circom/pil2circom.js index 60b4048..b9e3430 100644 --- a/src/pil2circom/pil2circom.js +++ b/src/pil2circom/pil2circom.js @@ -18,13 +18,13 @@ module.exports = async function pil2circom(constRoot, starkInfo, verifierInfo, o } else if (starkStruct.verificationHashType == "BN128") { template = await fs.promises.readFile(path.join(__dirname, "circuits.bn128", "stark_verifier.circom.ejs"), "utf8"); } else { - throw new Error("Invalid Hash Type: "+ starkStruct.verificationHashType); + throw new Error("Invalid Hash Type: " + starkStruct.verificationHashType); } const arity = starkStruct.merkleTreeArity || 16; const custom = starkStruct.merkleTreeCustom || false; const transcriptArity = custom ? starkStruct.merkleTreeArity : 16; - + const obj = { F, starkInfo, @@ -38,7 +38,5 @@ module.exports = async function pil2circom(constRoot, starkInfo, verifierInfo, o custom, }; - - return ejs.render(template, obj); - + return ejs.render(template, obj, { views: [__dirname] }); }