diff --git a/.github/workflows/benchmark.yml b/.github/workflows/benchmark.yml deleted file mode 100644 index 5d0762b2..00000000 --- a/.github/workflows/benchmark.yml +++ /dev/null @@ -1,47 +0,0 @@ -name: Benchmark - -on: - workflow_dispatch: - inputs: - run_benchmark: - description: "Please confirm running the benchmarks by typing 'yes' in the input box." - required: true - default: "no" - -jobs: - wakeup: - runs-on: ubuntu-latest - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_benchmark == 'yes' }} - permissions: - id-token: write - contents: read - steps: - - uses: actions/checkout@v3 - - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::490752553772:role/summa-solvency-ec2-slc - role-duration-seconds: 900 - aws-region: us-west-2 - - - name: Wakeup runner - run: .github/scripts/wakeup.sh - - benchmark: - runs-on: [summa-solvency-runner] - needs: [wakeup] - if: ${{ github.event_name == 'workflow_dispatch' && github.event.inputs.run_benchmark == 'yes' }} - steps: - - uses: actions/checkout@v3 - - - name: Run Benchmark Tests - run: | - cd prover - cargo bench - - - name: Upload Benchmark Results - uses: actions/upload-artifact@v2 - with: - name: benchmark-results - path: prover/target/criterion diff --git a/.github/workflows/contracts.yml b/.github/workflows/contracts.yml deleted file mode 100644 index f05c06f8..00000000 --- a/.github/workflows/contracts.yml +++ /dev/null @@ -1,23 +0,0 @@ -name: Contracts - -on: - push: - branches: ["*"] - pull_request: - branches: ["*"] - -jobs: - tests: - runs-on: ubuntu-latest - - steps: - - uses: actions/checkout@v3 - - name: Install packages - uses: actions/setup-node@v3 - - run: | - cd contracts - npm ci - - name: Run Tests - run: | - cd contracts - npx hardhat test diff --git a/.github/workflows/rust.yml b/.github/workflows/rust.yml index 1ba15d57..90ba614c 100644 --- a/.github/workflows/rust.yml +++ b/.github/workflows/rust.yml @@ -14,53 +14,27 @@ env: CARGO_TERM_COLOR: always jobs: - wakeup: + test-zk-prover: runs-on: ubuntu-latest - permissions: - id-token: write - contents: read - steps: - uses: actions/checkout@v3 + - name: Test Zk Prover + run: | + cd prover + cargo test --release --features dev-graph -- --nocapture - - name: Configure AWS Credentials - uses: aws-actions/configure-aws-credentials@v4 - with: - role-to-assume: arn:aws:iam::490752553772:role/summa-solvency-ec2-slc - role-duration-seconds: 900 - aws-region: us-west-2 - - - name: Wakeup runner - run: .github/scripts/wakeup.sh - - build: - runs-on: [summa-solvency-runner] - needs: [wakeup] - + test-backend: + runs-on: ubuntu-latest steps: - - uses: actions/checkout@v3 - - - name: Set Environment - run: echo "PATH=/home/ubuntu/.cargo/bin:/usr/local/sbin:/usr/local/bin:/usr/sbin:/usr/bin:/sbin:/bin" >> "$GITHUB_ENV" - - - name: Install solc - run: (hash svm 2>/dev/null || cargo install --version 0.2.23 svm-rs) && svm install 0.8.20 && solc --version - - - name: Test Prover + - name: Test backend run: | - cd prover + cd backend cargo test --release -- --nocapture - - name: Install Foundry - uses: foundry-rs/foundry-toolchain@v1 - - # TODO restore workflow - # - name: Test backend - # run: | - # cd backend - # cargo test --release -- --nocapture - - # - name: Test example - # run: | - # cd backend - # cargo run --release --example summa_solvency_flow + test-backend-examples: + runs-on: ubuntu-latest + steps: + - name: Test backend example + run: | + cd backend + cargo run --release --example summa_solvency_flow diff --git a/README.md b/README.md index a1b4a1d5..635dbbd6 100644 --- a/README.md +++ b/README.md @@ -5,7 +5,6 @@ A monorepo for Summa, zk proof of solvency protocol ### Subdirectories - `prover`: Halo2 based zk prover and KZG polynomial interpolation for Summa -- `contracts`: Solidity smart contracts for Summa - `backend` : Rust API to interact with Summa ## License diff --git a/backend/.gitignore b/backend/.gitignore index 5e48149c..9253bccd 100644 --- a/backend/.gitignore +++ b/backend/.gitignore @@ -2,4 +2,4 @@ # will have compiled files and executables /target .env -*_proof.json +*.json diff --git a/backend/Cargo.lock b/backend/Cargo.lock index 318a51e5..fd0d4202 100644 --- a/backend/Cargo.lock +++ b/backend/Cargo.lock @@ -2,68 +2,6 @@ # It is not intended for manual editing. version = 3 -[[package]] -name = "Inflector" -version = "0.11.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe438c63458706e03479442743baae6c88256498e6431708f6dfc520a26515d3" -dependencies = [ - "lazy_static", - "regex", -] - -[[package]] -name = "addr2line" -version = "0.20.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4fa78e18c64fce05e902adecd7a5eed15a5e0a3439f7b0e169f0252214865e3" -dependencies = [ - "gimli", -] - -[[package]] -name = "adler" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f26201604c87b1e01bd3d98f8d5d9a8fcbb815e8cedb41ffccbeb4bf593a35fe" - -[[package]] -name = "aes" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac1f845298e95f983ff1944b728ae08b8cebab80d684f0a832ed0fc74dfa27e2" -dependencies = [ - "cfg-if", - "cipher", - "cpufeatures", -] - -[[package]] -name = "ahash" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c99f64d1e06488f620f932677e24bc6e2897582980441ae90a671415bd7ec2f" -dependencies = [ - "cfg-if", - "once_cell", - "version_check", -] - -[[package]] -name = "aho-corasick" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43f6cb1bf222025340178f382c426f13757b2960e89779dfcb319c32542a5a41" -dependencies = [ - "memchr", -] - -[[package]] -name = "android-tzdata" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e999941b234f3131b00bc13c22d06e8c5ff726d1b6318ac7eb276997bbb4fef0" - [[package]] name = "ark-std" version = "0.4.0" @@ -86,150 +24,18 @@ version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "96d30a06541fbafbc7f82ed10c06164cfbd2c401138f6addd8404629c4b16711" -[[package]] -name = "ascii-canvas" -version = "3.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8824ecca2e851cec16968d54a01dd372ef8f95b244fb84b84e70128be347c3c6" -dependencies = [ - "term", -] - -[[package]] -name = "askama" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b79091df18a97caea757e28cd2d5fda49c6cd4bd01ddffd7ff01ace0c0ad2c28" -dependencies = [ - "askama_derive", - "askama_escape", -] - -[[package]] -name = "askama_derive" -version = "0.12.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19fe8d6cb13c4714962c072ea496f3392015f0989b1a2847bb4b2d9effd71d83" -dependencies = [ - "askama_parser", - "basic-toml", - "mime", - "mime_guess", - "proc-macro2", - "quote", - "serde", - "syn 2.0.25", -] - -[[package]] -name = "askama_escape" -version = "0.10.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "619743e34b5ba4e9703bba34deac3427c72507c7159f5fd030aea8cac0cfe341" - -[[package]] -name = "askama_parser" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "acb1161c6b64d1c3d83108213c2a2533a342ac225aabd0bda218278c2ddb00c0" -dependencies = [ - "nom", -] - -[[package]] -name = "async-trait" -version = "0.1.71" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a564d521dd56509c4c47480d00b80ee55f7e385ae48db5744c67ad50c92d2ebf" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "async_io_stream" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6d7b9decdf35d8908a7e3ef02f64c5e9b1695e230154c0e8de3969142d9b94c" -dependencies = [ - "futures", - "pharos", - "rustc_version", -] - -[[package]] -name = "auto_impl" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fee3da8ef1276b0bee5dd1c7258010d8fffd31801447323115a25560e1327b89" -dependencies = [ - "proc-macro-error", - "proc-macro2", - "quote", - "syn 1.0.109", -] - [[package]] name = "autocfg" version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d468802bab17cbc0cc575e9b053f41e72aa36bfa6b7f55e3529ffa43161b97fa" -[[package]] -name = "backtrace" -version = "0.3.68" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4319208da049c43661739c5fade2ba182f09d1dc2299b32298d3a31692b17e12" -dependencies = [ - "addr2line", - "cc", - "cfg-if", - "libc", - "miniz_oxide", - "object", - "rustc-demangle", -] - -[[package]] -name = "base16ct" -version = "0.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" - [[package]] name = "base64" version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9e1b586273c5702936fe7b7d6896644d8be71e6314cfe09d3167c95f712589e8" -[[package]] -name = "base64" -version = "0.21.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604178f6c5c21f02dc555784810edfb88d34ac2c73b2eae109655649ee73ce3d" - -[[package]] -name = "base64ct" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" - -[[package]] -name = "basic-toml" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bfc506e7a2370ec239e1d072507b2a80c833083699d3c6fa176fbb4de8448c6" -dependencies = [ - "serde", -] - -[[package]] -name = "bech32" -version = "0.7.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dabbe35f96fb9507f7330793dc490461b2962659ac5d427181e451a623751d1" - [[package]] name = "bincode" version = "1.3.3" @@ -239,43 +45,6 @@ dependencies = [ "serde", ] -[[package]] -name = "bit-set" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" -dependencies = [ - "bit-vec", -] - -[[package]] -name = "bit-vec" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" - -[[package]] -name = "bitflags" -version = "1.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" - -[[package]] -name = "bitflags" -version = "2.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4682ae6287fcf752ecaabbfcc7b6f9b72aa33933dc23a554d853aea8eea8635" - -[[package]] -name = "bitvec" -version = "0.17.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41262f11d771fd4a61aa3ce019fca363b4b6c282fca9da2a31186d3965a47a5c" -dependencies = [ - "either", - "radium 0.3.0", -] - [[package]] name = "bitvec" version = "1.0.1" @@ -283,7 +52,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1bc2832c24239b0141d5674bb9174f9d68a8b5b3f2753311927c172ca46f7e9c" dependencies = [ "funty", - "radium 0.7.0", + "radium", "tap", "wyz", ] @@ -324,196 +93,18 @@ version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8d696c370c750c948ada61c69a0ee2cbbb9c50b1019ddb86d9317157a99c2cae" -[[package]] -name = "bs58" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "771fe0050b883fcc3ea2359b1a96bcfbc090b7116eae7c3c512c7a083fdf23d3" -dependencies = [ - "sha2 0.9.9", -] - -[[package]] -name = "bumpalo" -version = "3.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a3e2c3daef883ecc1b5d58c15adae93470a91d425f3532ba1695849656af3fc1" - -[[package]] -name = "byte-slice-cast" -version = "1.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" - -[[package]] -name = "byteorder" -version = "1.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "14c189c53d098945499cdfa7ecc63567cf3886b3332b312a5b4585d8d3a6a610" - -[[package]] -name = "bytes" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89b2fd2a0dcf38d7971e2194b6b6eebab45ae01067456a7fd93d5547a61b70be" -dependencies = [ - "serde", -] - -[[package]] -name = "camino" -version = "1.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c530edf18f37068ac2d977409ed5cd50d53d73bc653c7647b48eb78976ac9ae2" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo-platform" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbdb825da8a5df079a43676dbe042702f1707b1109f713a01420fbb4cc71fa27" -dependencies = [ - "serde", -] - -[[package]] -name = "cargo_metadata" -version = "0.15.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eee4243f1f26fc7a42710e7439c149e2b10b05472f88090acce52632f231a73a" -dependencies = [ - "camino", - "cargo-platform", - "semver", - "serde", - "serde_json", - "thiserror", -] - -[[package]] -name = "cc" -version = "1.0.79" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50d30906286121d95be3d479533b458f87493b30a4b5f79a607db8f5d11aa91f" - [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" -[[package]] -name = "chrono" -version = "0.4.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec837a71355b28f6556dbd569b37b3f363091c0bd4b2e735674521b4c5fd9bc5" -dependencies = [ - "android-tzdata", - "num-traits", -] - -[[package]] -name = "cipher" -version = "0.4.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "773f3b9af64447d2ce9850330c473515014aa235e6a783b02db81ff39e4a3dad" -dependencies = [ - "crypto-common", - "inout", -] - -[[package]] -name = "coins-bip32" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b30a84aab436fcb256a2ab3c80663d8aec686e6bae12827bb05fef3e1e439c9f" -dependencies = [ - "bincode", - "bs58", - "coins-core", - "digest 0.10.7", - "getrandom", - "hmac", - "k256", - "lazy_static", - "serde", - "sha2 0.10.7", - "thiserror", -] - -[[package]] -name = "coins-bip39" -version = "0.8.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84f4d04ee18e58356accd644896aeb2094ddeafb6a713e056cef0c0a8e468c15" -dependencies = [ - "bitvec 0.17.4", - "coins-bip32", - "getrandom", - "hmac", - "once_cell", - "pbkdf2 0.12.2", - "rand", - "sha2 0.10.7", - "thiserror", -] - -[[package]] -name = "coins-core" -version = "0.8.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b949a1c63fb7eb591eb7ba438746326aedf0ae843e51ec92ba6bec5bb382c4f" -dependencies = [ - "base64 0.21.2", - "bech32", - "bs58", - "digest 0.10.7", - "generic-array", - "hex", - "ripemd", - "serde", - "serde_derive", - "sha2 0.10.7", - "sha3 0.10.8", - "thiserror", -] - -[[package]] -name = "const-oid" -version = "0.9.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "795bc6e66a8e340f075fcf6227e417a2dc976b92b91f3cdc778bb858778b6747" - [[package]] name = "constant_time_eq" version = "0.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "21a53c0a4d288377e7415b53dcfc3c04da5cdc2cc95c8d5ac178b58f0b861ad6" -[[package]] -name = "convert_case" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6245d59a3e82a7fc217c5828a6692dbc6dfb63a0c8c90495621f7b9d79704a0e" - -[[package]] -name = "core-foundation" -version = "0.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "194a7a9e6de53fa55116934067c844d9d749312f75c6f6d0980e8c252f8c2146" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "core-foundation-sys" -version = "0.8.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e496a50fda8aacccc86d7529e2c1e0892dbd0f898a6b5645b5561b89c3210efa" - [[package]] name = "cpufeatures" version = "0.2.9" @@ -556,24 +147,6 @@ dependencies = [ "cfg-if", ] -[[package]] -name = "crunchy" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" - -[[package]] -name = "crypto-bigint" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf4c2f4e1afd912bc40bfd6fed5d9dc1f288e0ba01bfcc835cc5bc3eb13efe15" -dependencies = [ - "generic-array", - "rand_core", - "subtle", - "zeroize", -] - [[package]] name = "crypto-common" version = "0.1.6" @@ -605,44 +178,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "ctr" -version = "0.9.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0369ee1ad671834580515889b80f2ea915f23b8be8d0daa4bbaf2ac5c7590835" -dependencies = [ - "cipher", -] - -[[package]] -name = "der" -version = "0.7.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7ed52955ce76b1554f509074bb357d3fb8ac9b51288a65a3fd480d1dfba946" -dependencies = [ - "const-oid", - "zeroize", -] - -[[package]] -name = "derive_more" -version = "0.99.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fb810d30a7c1953f91334de7244731fc3f3c10d7fe163338a35b9f640960321" -dependencies = [ - "convert_case", - "proc-macro2", - "quote", - "rustc_version", - "syn 1.0.109", -] - -[[package]] -name = "diff" -version = "0.1.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56254986775e3233ffa9c4d7d3faaf6d36a2c09d30b20687e9f88bc8bafc16c8" - [[package]] name = "digest" version = "0.9.0" @@ -659,3211 +194,652 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9ed9a281f7bc9b7576e61468ba615a66a5c8cfdff42420a70aa82701a3b1e292" dependencies = [ "block-buffer 0.10.4", - "const-oid", "crypto-common", - "subtle", ] [[package]] -name = "dirs-next" -version = "2.0.0" +name = "either" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b98cf8ebf19c3d1b223e151f99a4f9f0690dca41414773390fc824184ac833e1" -dependencies = [ - "cfg-if", - "dirs-sys-next", -] +checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" [[package]] -name = "dirs-sys-next" -version = "0.1.2" +name = "ff" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ebda144c4fe02d1f7ea1a7d9641b6fc6b580adcfa024ae48797ecdeb6825b4d" +checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" dependencies = [ - "libc", - "redox_users", - "winapi", + "bitvec", + "rand_core", + "subtle", ] [[package]] -name = "dunce" -version = "1.0.4" +name = "funty" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56ce8c6da7551ec6c462cbaf3bfbc75131ebbfa1c944aeaa9dab51ca1c5f0c3b" +checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" [[package]] -name = "ecdsa" -version = "0.16.7" +name = "futures" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0997c976637b606099b9985693efa3581e84e41f5c11ba5255f88711058ad428" +checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" dependencies = [ - "der", - "digest 0.10.7", - "elliptic-curve", - "rfc6979", - "signature", - "spki", + "futures-channel", + "futures-core", + "futures-executor", + "futures-io", + "futures-sink", + "futures-task", + "futures-util", ] [[package]] -name = "either" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7fcaabb2fef8c910e7f4c7ce9f67a1283a1715879a7c230ca9d6d1ae31f16d91" - -[[package]] -name = "elliptic-curve" -version = "0.13.5" +name = "futures-channel" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "968405c8fdc9b3bf4df0a6638858cc0b52462836ab6b1c87377785dd09cf1c0b" +checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" dependencies = [ - "base16ct", - "crypto-bigint", - "digest 0.10.7", - "ff", - "generic-array", - "group", - "pkcs8", - "rand_core", - "sec1", - "subtle", - "zeroize", + "futures-core", + "futures-sink", ] [[package]] -name = "ena" -version = "0.14.2" +name = "futures-core" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c533630cf40e9caa44bd91aadc88a75d75a4c3a12b4cfde353cbed41daa1e1f1" -dependencies = [ - "log", -] +checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" [[package]] -name = "encoding_rs" -version = "0.8.32" +name = "futures-executor" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "071a31f4ee85403370b58aca746f01041ede6f0da2730960ad001edc2b71b394" +checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" dependencies = [ - "cfg-if", + "futures-core", + "futures-task", + "futures-util", ] [[package]] -name = "enr" -version = "0.8.1" +name = "futures-io" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cf56acd72bb22d2824e66ae8e9e5ada4d0de17a69c7fd35569dde2ada8ec9116" -dependencies = [ - "base64 0.13.1", - "bytes", - "hex", - "k256", - "log", - "rand", - "rlp", - "serde", - "sha3 0.10.8", - "zeroize", -] +checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" [[package]] -name = "enumn" -version = "0.1.10" +name = "futures-macro" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c9838a970f5de399d3070ae1739e131986b2f5dcc223c7423ca0927e3a878522" +checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", + "syn", ] [[package]] -name = "equivalent" -version = "1.0.1" +name = "futures-sink" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" [[package]] -name = "errno" -version = "0.3.1" +name = "futures-task" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bcfec3a70f97c962c307b2d2c56e358cf1d00b558d74262b5f929ee8cc7e73a" -dependencies = [ - "errno-dragonfly", - "libc", - "windows-sys", -] +checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" [[package]] -name = "errno-dragonfly" -version = "0.1.2" +name = "futures-util" +version = "0.3.28" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa68f1b12764fab894d2755d2518754e71b4fd80ecfb822714a1206c2aab39bf" +checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" dependencies = [ - "cc", - "libc", + "futures-channel", + "futures-core", + "futures-io", + "futures-macro", + "futures-sink", + "futures-task", + "memchr", + "pin-project-lite", + "pin-utils", + "slab", ] [[package]] -name = "eth-keystore" -version = "0.5.0" +name = "generic-array" +version = "0.14.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fda3bf123be441da5260717e0661c25a2fd9cb2b2c1d20bf2e05580047158ab" +checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" dependencies = [ - "aes", - "ctr", - "digest 0.10.7", - "hex", - "hmac", - "pbkdf2 0.11.0", - "rand", - "scrypt", "serde", - "serde_json", - "sha2 0.10.7", - "sha3 0.10.8", - "thiserror", - "uuid", + "typenum", + "version_check", ] [[package]] -name = "ethabi" -version = "18.0.0" +name = "getrandom" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7413c5f74cc903ea37386a8965a936cbeb334bd270862fdece542c1b2dcbc898" +checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" dependencies = [ - "ethereum-types", - "hex", - "once_cell", - "regex", - "serde", - "serde_json", - "sha3 0.10.8", - "thiserror", - "uint", + "cfg-if", + "libc", + "wasi", ] [[package]] -name = "ethbloom" +name = "group" version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c22d4b5885b6aa2fe5e8b9329fb8d232bf739e434e6b87347c63bdd00c120f60" +checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "crunchy", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "tiny-keccak", + "ff", + "rand_core", + "subtle", ] [[package]] -name = "ethereum-types" -version = "0.14.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02d215cbf040552efcbe99a38372fe80ab9d00268e20012b79fcd0f073edd8ee" +name = "halo2_proofs" +version = "0.2.0" +source = "git+https://github.com/han0110/halo2.git?branch=feature/for-benchmark#4981b8d5bdaab04af9b56a5d2c482b6eec9f7fa4" dependencies = [ - "ethbloom", - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "primitive-types", - "scale-info", - "uint", + "ark-std", + "blake2b_simd", + "ff", + "group", + "halo2curves 0.3.3", + "rand_chacha", + "rand_core", + "rayon", + "sha3 0.9.1", + "tracing", ] [[package]] -name = "ethers" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a58ce802c65cf3d0756dee5a61094a92cde53c1583b246e9ee5b37226c7fc15" +name = "halo2curves" +version = "0.3.2" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves.git?tag=0.3.2#9f5c50810bbefe779ee5cf1d852b2fe85dc35d5e" dependencies = [ - "ethers-addressbook", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-middleware", - "ethers-providers", - "ethers-signers", - "ethers-solc", + "ff", + "group", + "lazy_static", + "num-bigint", + "num-traits", + "pasta_curves", + "paste", + "rand", + "rand_core", + "static_assertions", + "subtle", ] [[package]] -name = "ethers-addressbook" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7b856b7b8ff5c961093cb8efe151fbcce724b451941ce20781de11a531ccd578" +name = "halo2curves" +version = "0.3.3" +source = "git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.3#8e4cb9f0c66c864e8ca25da07f50ae95f664a5b7" dependencies = [ - "ethers-core", - "once_cell", + "ff", + "group", + "lazy_static", + "num-bigint", + "num-traits", + "pasta_curves", + "paste", + "rand", + "rand_core", "serde", - "serde_json", + "static_assertions", + "subtle", ] [[package]] -name = "ethers-contract" -version = "2.0.7" +name = "hex" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e066a0d9cfc70c454672bf16bb433b0243427420076dc5b2f49c448fb5a10628" +checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" dependencies = [ - "ethers-contract-abigen", - "ethers-contract-derive", - "ethers-core", - "ethers-providers", - "futures-util", - "hex", - "once_cell", - "pin-project", "serde", - "serde_json", - "thiserror", ] [[package]] -name = "ethers-contract-abigen" -version = "2.0.7" +name = "itertools" +version = "0.10.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c113e3e86b6bc16d98484b2c3bb2d01d6fed9f489fe2e592e5cc87c3024d616b" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" dependencies = [ - "Inflector", - "dunce", - "ethers-core", - "eyre", - "hex", - "prettyplease", - "proc-macro2", - "quote", - "regex", - "serde", - "serde_json", - "syn 2.0.25", - "toml", - "walkdir", + "either", ] [[package]] -name = "ethers-contract-derive" -version = "2.0.7" +name = "itoa" +version = "1.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3fb5adee25701c79ec58fcf2c63594cd8829bc9ad6037ff862d5a111101ed2" -dependencies = [ - "Inflector", - "ethers-contract-abigen", - "ethers-core", - "hex", - "proc-macro2", - "quote", - "serde_json", - "syn 2.0.25", -] +checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" [[package]] -name = "ethers-core" -version = "2.0.7" +name = "keccak" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6da5fa198af0d3be20c19192df2bd9590b92ce09a8421e793bec8851270f1b05" +checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" dependencies = [ - "arrayvec", - "bytes", - "cargo_metadata", - "chrono", - "elliptic-curve", - "ethabi", - "generic-array", - "hex", - "k256", - "num_enum", - "once_cell", - "open-fastrlp", - "rand", - "rlp", - "serde", - "serde_json", - "strum", - "syn 2.0.25", - "tempfile", - "thiserror", - "tiny-keccak", - "unicode-xid", + "cpufeatures", ] [[package]] -name = "ethers-etherscan" -version = "2.0.7" +name = "lazy_static" +version = "1.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "84ebb401ba97c6f5af278c2c9936c4546cad75dec464b439ae6df249906f4caa" +checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" dependencies = [ - "ethers-core", - "ethers-solc", - "reqwest", - "semver", - "serde", - "serde_json", - "thiserror", - "tracing", + "spin", ] [[package]] -name = "ethers-middleware" -version = "2.0.7" +name = "libc" +version = "0.2.147" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "740f4a773c19dd6d6a68c8c2e0996c096488d38997d524e21dc612c55da3bd24" -dependencies = [ - "async-trait", - "auto_impl", - "ethers-contract", - "ethers-core", - "ethers-etherscan", - "ethers-providers", - "ethers-signers", - "futures-channel", - "futures-locks", - "futures-util", - "instant", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", -] +checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" [[package]] -name = "ethers-providers" -version = "2.0.7" +name = "memchr" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "56b498fd2a6c019d023e43e83488cd1fb0721f299055975aa6bac8dbf1e95f2c" -dependencies = [ - "async-trait", - "auto_impl", - "base64 0.21.2", - "bytes", - "enr", - "ethers-core", - "futures-core", - "futures-timer", - "futures-util", - "hashers", - "hex", - "http", - "instant", - "once_cell", - "pin-project", - "reqwest", - "serde", - "serde_json", - "thiserror", - "tokio", - "tracing", - "tracing-futures", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "ws_stream_wasm", -] +checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" [[package]] -name = "ethers-signers" -version = "2.0.7" +name = "memoffset" +version = "0.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02c4b7e15f212fa7cc2e1251868320221d4ff77a3d48068e69f47ce1c491df2d" -dependencies = [ - "async-trait", - "coins-bip32", - "coins-bip39", - "elliptic-curve", - "eth-keystore", - "ethers-core", - "hex", - "rand", - "sha2 0.10.7", - "thiserror", - "tracing", -] - -[[package]] -name = "ethers-solc" -version = "2.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a81c89f121595cf8959e746045bb8b25a6a38d72588561e1a3b7992fc213f674" -dependencies = [ - "cfg-if", - "dunce", - "ethers-core", - "glob", - "hex", - "home", - "md-5", - "num_cpus", - "once_cell", - "path-slash", - "rayon", - "regex", - "semver", - "serde", - "serde_json", - "solang-parser", - "thiserror", - "tiny-keccak", - "tokio", - "tracing", - "walkdir", - "yansi", -] - -[[package]] -name = "eyre" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c2b6b5a29c02cdc822728b7d7b8ae1bab3e3b05d44522770ddd49722eeac7eb" -dependencies = [ - "indenter", - "once_cell", -] - -[[package]] -name = "fastrand" -version = "1.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e51093e27b0797c359783294ca4f0a911c270184cb10f85783b118614a1501be" -dependencies = [ - "instant", -] - -[[package]] -name = "ff" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" -dependencies = [ - "bitvec 1.0.1", - "rand_core", - "subtle", -] - -[[package]] -name = "fixed-hash" -version = "0.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" -dependencies = [ - "byteorder", - "rand", - "rustc-hex", - "static_assertions", -] - -[[package]] -name = "fixedbitset" -version = "0.4.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0ce7134b9999ecaf8bcd65542e436736ef32ddca1b3e06094cb6ec5755203b80" - -[[package]] -name = "fnv" -version = "1.0.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" - -[[package]] -name = "foreign-types" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" -dependencies = [ - "foreign-types-shared", -] - -[[package]] -name = "foreign-types-shared" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" - -[[package]] -name = "form_urlencoded" -version = "1.2.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a62bc1cf6f830c2ec14a513a9fb124d0a213a629668a4186f329db21fe045652" -dependencies = [ - "percent-encoding", -] - -[[package]] -name = "funty" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6d5a32815ae3f33302d95fdcb2ce17862f8c65363dcfd29360480ba1001fc9c" - -[[package]] -name = "futures" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "23342abe12aba583913b2e62f22225ff9c950774065e4bfb61a19cd9770fec40" -dependencies = [ - "futures-channel", - "futures-core", - "futures-executor", - "futures-io", - "futures-sink", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-channel" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "955518d47e09b25bbebc7a18df10b81f0c766eaf4c4f1cccef2fca5f2a4fb5f2" -dependencies = [ - "futures-core", - "futures-sink", -] - -[[package]] -name = "futures-core" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4bca583b7e26f571124fe5b7561d49cb2868d79116cfa0eefce955557c6fee8c" - -[[package]] -name = "futures-executor" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ccecee823288125bd88b4d7f565c9e58e41858e47ab72e8ea2d64e93624386e0" -dependencies = [ - "futures-core", - "futures-task", - "futures-util", -] - -[[package]] -name = "futures-io" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fff74096e71ed47f8e023204cfd0aa1289cd54ae5430a9523be060cdb849964" - -[[package]] -name = "futures-locks" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45ec6fe3675af967e67c5536c0b9d44e34e6c52f86bedc4ea49c5317b8e94d06" -dependencies = [ - "futures-channel", - "futures-task", -] - -[[package]] -name = "futures-macro" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "89ca545a94061b6365f2c7355b4b32bd20df3ff95f02da9329b34ccc3bd6ee72" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "futures-sink" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43be4fe21a13b9781a69afa4985b0f6ee0e1afab2c6f454a8cf30e2b2237b6e" - -[[package]] -name = "futures-task" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76d3d132be6c0e6aa1534069c705a74a5997a356c0dc2f86a47765e5617c5b65" - -[[package]] -name = "futures-timer" -version = "3.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e64b03909df88034c26dc1547e8970b91f98bdb65165d6a4e9110d94263dbb2c" -dependencies = [ - "gloo-timers", - "send_wrapper 0.4.0", -] - -[[package]] -name = "futures-util" -version = "0.3.28" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26b01e40b772d54cf6c6d721c1d1abd0647a0106a12ecaa1c186273392a69533" -dependencies = [ - "futures-channel", - "futures-core", - "futures-io", - "futures-macro", - "futures-sink", - "futures-task", - "memchr", - "pin-project-lite", - "pin-utils", - "slab", -] - -[[package]] -name = "fxhash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c31b6d751ae2c7f11320402d34e41349dd1016f8d5d45e48c4312bc8625af50c" -dependencies = [ - "byteorder", -] - -[[package]] -name = "generic-array" -version = "0.14.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85649ca51fd72272d7821adaf274ad91c288277713d9c18820d8499a7ff69e9a" -dependencies = [ - "serde", - "typenum", - "version_check", - "zeroize", -] - -[[package]] -name = "getrandom" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4136b2a15dd319360be1c07d9933517ccf0be8f16bf62a3bee4f0d618df427" -dependencies = [ - "cfg-if", - "js-sys", - "libc", - "wasi", - "wasm-bindgen", -] - -[[package]] -name = "gimli" -version = "0.27.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6c80984affa11d98d1b88b66ac8853f143217b399d3c74116778ff8fdb4ed2e" - -[[package]] -name = "glob" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" - -[[package]] -name = "gloo-timers" -version = "0.2.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b995a66bb87bebce9a0f4a95aed01daca4872c050bfcb21653361c03bc35e5c" -dependencies = [ - "futures-channel", - "futures-core", - "js-sys", - "wasm-bindgen", -] - -[[package]] -name = "group" -version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" -dependencies = [ - "ff", - "rand_core", - "subtle", -] - -[[package]] -name = "h2" -version = "0.3.20" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97ec8491ebaf99c8eaa73058b045fe58073cd6be7f596ac993ced0b0a0c01049" -dependencies = [ - "bytes", - "fnv", - "futures-core", - "futures-sink", - "futures-util", - "http", - "indexmap 1.9.3", - "slab", - "tokio", - "tokio-util", - "tracing", -] - -[[package]] -name = "halo2_proofs" -version = "0.2.0" -source = "git+https://github.com/han0110/halo2.git?branch=feature/for-benchmark#4981b8d5bdaab04af9b56a5d2c482b6eec9f7fa4" -dependencies = [ - "ark-std", - "blake2b_simd", - "ff", - "group", - "halo2curves 0.3.3", - "rand_chacha", - "rand_core", - "rayon", - "sha3 0.9.1", - "tracing", -] - -[[package]] -name = "halo2_proofs" -version = "0.2.0" -source = "git+https://github.com/summa-dev/halo2#8386d6e64fc33baccf626869123185890b8284dc" -dependencies = [ - "blake2b_simd", - "ff", - "group", - "halo2curves 0.1.0", - "maybe-rayon", - "rand_chacha", - "rand_core", - "sha3 0.9.1", - "tracing", -] - -[[package]] -name = "halo2_solidity_verifier" -version = "0.1.0" -source = "git+https://github.com/summa-dev/halo2-solidity-verifier#d33972567f83f3218257b286b541ad97ba32928c" -dependencies = [ - "askama", - "blake2b_simd", - "halo2_proofs 0.2.0 (git+https://github.com/summa-dev/halo2)", - "hex", - "itertools 0.11.0", - "revm", - "ruint", - "sha3 0.10.8", -] - -[[package]] -name = "halo2curves" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6b1142bd1059aacde1b477e0c80c142910f1ceae67fc619311d6a17428007ab" -dependencies = [ - "blake2b_simd", - "ff", - "group", - "lazy_static", - "num-bigint", - "num-traits", - "pasta_curves", - "paste", - "rand", - "rand_core", - "static_assertions", - "subtle", -] - -[[package]] -name = "halo2curves" -version = "0.3.2" -source = "git+https://github.com/privacy-scaling-explorations/halo2curves.git?tag=0.3.2#9f5c50810bbefe779ee5cf1d852b2fe85dc35d5e" -dependencies = [ - "ff", - "group", - "lazy_static", - "num-bigint", - "num-traits", - "pasta_curves", - "paste", - "rand", - "rand_core", - "static_assertions", - "subtle", -] - -[[package]] -name = "halo2curves" -version = "0.3.3" -source = "git+https://github.com/privacy-scaling-explorations/halo2curves?tag=0.3.3#8e4cb9f0c66c864e8ca25da07f50ae95f664a5b7" -dependencies = [ - "ff", - "group", - "lazy_static", - "num-bigint", - "num-traits", - "pasta_curves", - "paste", - "rand", - "rand_core", - "serde", - "static_assertions", - "subtle", -] - -[[package]] -name = "hashbrown" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" - -[[package]] -name = "hashbrown" -version = "0.13.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" -dependencies = [ - "ahash", -] - -[[package]] -name = "hashbrown" -version = "0.14.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c6201b9ff9fd90a5a3bac2e56a830d0caa509576f0e503818ee82c181b3437a" - -[[package]] -name = "hashers" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2bca93b15ea5a746f220e56587f71e73c6165eab783df9e26590069953e3c30" -dependencies = [ - "fxhash", -] - -[[package]] -name = "heck" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "95505c38b4572b2d910cecb0281560f54b440a19336cbbcb27bf6ce6adc6f5a8" - -[[package]] -name = "hermit-abi" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "443144c8cdadd93ebf52ddb4056d257f5b52c04d3c804e657d19eb73fc33668b" - -[[package]] -name = "hex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f24254aa9a54b5c858eaee2f5bccdb46aaf0e486a595ed5fd8f86ba55232a70" -dependencies = [ - "serde", -] - -[[package]] -name = "hex-literal" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6fe2267d4ed49bc07b63801559be28c718ea06c4738b7a03c94df7386d2cde46" - -[[package]] -name = "hmac" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6c49c37c09c17a53d937dfbb742eb3a961d65a994e6bcdcf37e7399d0cc8ab5e" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "home" -version = "0.5.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5444c27eef6923071f7ebcc33e3444508466a76f7a2b93da00ed6e19f30c1ddb" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "http" -version = "0.2.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd6effc99afb63425aff9b05836f029929e345a6148a14b7ecd5ab67af944482" -dependencies = [ - "bytes", - "fnv", - "itoa", -] - -[[package]] -name = "http-body" -version = "0.4.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5f38f16d184e36f2408a55281cd658ecbd3ca05cce6d6510a176eca393e26d1" -dependencies = [ - "bytes", - "http", - "pin-project-lite", -] - -[[package]] -name = "httparse" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d897f394bad6a705d5f4104762e116a75639e470d80901eed05a860a95cb1904" - -[[package]] -name = "httpdate" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4a1e36c821dbe04574f602848a19f742f4fb3c98d40449f11bcad18d6b17421" - -[[package]] -name = "hyper" -version = "0.14.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ffb1cfd654a8219eaef89881fdb3bb3b1cdc5fa75ded05d6933b2b382e395468" -dependencies = [ - "bytes", - "futures-channel", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "httparse", - "httpdate", - "itoa", - "pin-project-lite", - "socket2", - "tokio", - "tower-service", - "tracing", - "want", -] - -[[package]] -name = "hyper-tls" -version = "0.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" -dependencies = [ - "bytes", - "hyper", - "native-tls", - "tokio", - "tokio-native-tls", -] - -[[package]] -name = "idna" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d20d6b07bfbc108882d88ed8e37d39636dcc260e15e30c45e6ba089610b917c" -dependencies = [ - "unicode-bidi", - "unicode-normalization", -] - -[[package]] -name = "impl-codec" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba6a270039626615617f3f36d15fc827041df3b78c439da2cadfa47455a77f2f" -dependencies = [ - "parity-scale-codec", -] - -[[package]] -name = "impl-rlp" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f28220f89297a075ddc7245cd538076ee98b01f2a9c23a53a4f1105d5a322808" -dependencies = [ - "rlp", -] - -[[package]] -name = "impl-serde" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ebc88fc67028ae3db0c853baa36269d398d5f45b6982f95549ff5def78c935cd" -dependencies = [ - "serde", -] - -[[package]] -name = "impl-trait-for-tuples" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "11d7a9f6330b71fea57921c9b61c47ee6e84f72d394754eff6163ae67e7395eb" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "indenter" -version = "0.3.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ce23b50ad8242c51a442f3ff322d56b02f08852c77e4c0b4d3fd684abc89c683" - -[[package]] -name = "indexmap" -version = "1.9.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" -dependencies = [ - "autocfg", - "hashbrown 0.12.3", -] - -[[package]] -name = "indexmap" -version = "2.0.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d5477fe2230a79769d8dc68e0eabf5437907c0457a5614a9e8dddb67f65eb65d" -dependencies = [ - "equivalent", - "hashbrown 0.14.0", -] - -[[package]] -name = "inout" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a0c10553d664a4d0bcff9f4215d0aac67a639cc68ef660840afe309b807bc9f5" -dependencies = [ - "generic-array", -] - -[[package]] -name = "instant" -version = "0.1.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a5bbe824c507c5da5956355e86a746d82e0e1464f65d862cc5e71da70e94b2c" -dependencies = [ - "cfg-if", -] - -[[package]] -name = "io-lifetimes" -version = "1.0.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "eae7b9aee968036d54dce06cebaefd919e4472e753296daccd6d344e3e2df0c2" -dependencies = [ - "hermit-abi", - "libc", - "windows-sys", -] - -[[package]] -name = "ipnet" -version = "2.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28b29a3cd74f0f4598934efe3aeba42bae0eb4680554128851ebbecb02af14e6" - -[[package]] -name = "is-terminal" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb0889898416213fab133e1d33a0e5858a48177452750691bde3666d0fdbaf8b" -dependencies = [ - "hermit-abi", - "rustix 0.38.11", - "windows-sys", -] - -[[package]] -name = "itertools" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" -dependencies = [ - "either", -] - -[[package]] -name = "itertools" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" -dependencies = [ - "either", -] - -[[package]] -name = "itoa" -version = "1.0.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62b02a5381cc465bd3041d84623d0fa3b66738b52b8e2fc3bab8ad63ab032f4a" - -[[package]] -name = "js-sys" -version = "0.3.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c5f195fe497f702db0f318b07fdd68edb16955aed830df8363d837542f8f935a" -dependencies = [ - "wasm-bindgen", -] - -[[package]] -name = "k256" -version = "0.13.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cadb76004ed8e97623117f3df85b17aaa6626ab0b0831e6573f104df16cd1bcc" -dependencies = [ - "cfg-if", - "ecdsa", - "elliptic-curve", - "once_cell", - "sha2 0.10.7", - "signature", -] - -[[package]] -name = "keccak" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8f6d5ed8676d904364de097082f4e7d240b571b67989ced0240f08b7f966f940" -dependencies = [ - "cpufeatures", -] - -[[package]] -name = "lalrpop" -version = "0.19.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0a1cbf952127589f2851ab2046af368fd20645491bb4b376f04b7f94d7a9837b" -dependencies = [ - "ascii-canvas", - "bit-set", - "diff", - "ena", - "is-terminal", - "itertools 0.10.5", - "lalrpop-util", - "petgraph", - "regex", - "regex-syntax 0.6.29", - "string_cache", - "term", - "tiny-keccak", - "unicode-xid", -] - -[[package]] -name = "lalrpop-util" -version = "0.19.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3c48237b9604c5a4702de6b824e02006c3214327564636aef27c1028a8fa0ed" - -[[package]] -name = "lazy_static" -version = "1.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2abad23fbc42b3700f2f279844dc832adb2b2eb069b2df918f455c4e18cc646" -dependencies = [ - "spin", -] - -[[package]] -name = "libc" -version = "0.2.147" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4668fb0ea861c1df094127ac5f1da3409a82116a4ba74fca2e58ef927159bb3" - -[[package]] -name = "linux-raw-sys" -version = "0.3.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef53942eb7bf7ff43a617b3e2c1c4a5ecf5944a7c1bc12d7ee39bbb15e5c1519" - -[[package]] -name = "linux-raw-sys" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09fc20d2ca12cb9f044c93e3bd6d32d523e6e2ec3db4f7b2939cd99026ecd3f0" - -[[package]] -name = "lock_api" -version = "0.4.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c1cc9717a20b1bb222f333e6a92fd32f7d8a18ddc5a3191a11af45dcbf4dcd16" -dependencies = [ - "autocfg", - "scopeguard", -] - -[[package]] -name = "log" -version = "0.4.19" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b06a4cde4c0f271a446782e3eff8de789548ce57dbc8eca9292c27f4a42004b4" - -[[package]] -name = "maybe-rayon" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ea1f30cedd69f0a2954655f7188c6a834246d2bcf1e315e2ac40c4b24dc9519" -dependencies = [ - "cfg-if", - "rayon", -] - -[[package]] -name = "md-5" -version = "0.10.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6365506850d44bff6e2fbcb5176cf63650e48bd45ef2fe2665ae1570e0f4b9ca" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "memchr" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2dffe52ecf27772e601905b7522cb4ef790d2cc203488bbd0e2fe85fcb74566d" - -[[package]] -name = "memoffset" -version = "0.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" -dependencies = [ - "autocfg", -] - -[[package]] -name = "mime" -version = "0.3.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" - -[[package]] -name = "mime_guess" -version = "2.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4192263c238a5f0d0c6bfd21f336a313a4ce1c450542449ca191bb657b4642ef" -dependencies = [ - "mime", - "unicase", -] - -[[package]] -name = "minimal-lexical" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" - -[[package]] -name = "miniz_oxide" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e7810e0be55b428ada41041c41f32c9f1a42817901b4ccf45fa3d4b6561e74c7" -dependencies = [ - "adler", -] - -[[package]] -name = "mio" -version = "0.8.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "927a765cd3fc26206e66b296465fa9d3e5ab003e651c1b3c060e7956d96b19d2" -dependencies = [ - "libc", - "wasi", - "windows-sys", -] - -[[package]] -name = "native-tls" -version = "0.2.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "07226173c32f2926027b63cce4bcd8076c3552846cbe7925f3aaffeac0a3b92e" -dependencies = [ - "lazy_static", - "libc", - "log", - "openssl", - "openssl-probe", - "openssl-sys", - "schannel", - "security-framework", - "security-framework-sys", - "tempfile", -] - -[[package]] -name = "new_debug_unreachable" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e4a24736216ec316047a1fc4252e27dabb04218aa4a3f37c6e7ddbf1f9782b54" - -[[package]] -name = "nom" -version = "7.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" -dependencies = [ - "memchr", - "minimal-lexical", -] - -[[package]] -name = "num" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "43db66d1170d347f9a065114077f7dccb00c1b9478c89384490a3425279a4606" -dependencies = [ - "num-bigint", - "num-complex", - "num-integer", - "num-iter", - "num-rational", - "num-traits", -] - -[[package]] -name = "num-bigint" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-complex" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "02e0d21255c828d6f128a1e41534206671e8c3ea0c62f32291e808dc82cff17d" -dependencies = [ - "num-traits", -] - -[[package]] -name = "num-integer" -version = "0.1.45" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" -dependencies = [ - "autocfg", - "num-traits", -] - -[[package]] -name = "num-iter" -version = "0.1.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d03e6c028c5dc5cac6e2dec0efda81fc887605bb3d884578bb6d6bf7514e252" -dependencies = [ - "autocfg", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-rational" -version = "0.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0638a1c9d0a3c0914158145bc76cff373a75a627e6ecbfb71cbe6f453a5a19b0" -dependencies = [ - "autocfg", - "num-bigint", - "num-integer", - "num-traits", -] - -[[package]] -name = "num-traits" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" -dependencies = [ - "autocfg", -] - -[[package]] -name = "num_cpus" -version = "1.16.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4161fcb6d602d4d2081af7c3a45852d875a03dd337a6bfdd6e06407b61342a43" -dependencies = [ - "hermit-abi", - "libc", -] - -[[package]] -name = "num_enum" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a015b430d3c108a207fd776d2e2196aaf8b1cf8cf93253e3a097ff3085076a1" -dependencies = [ - "num_enum_derive", -] - -[[package]] -name = "num_enum_derive" -version = "0.6.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96667db765a921f7b295ffee8b60472b686a51d4f21c2ee4ffdb94c7013b65a6" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "object" -version = "0.31.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8bda667d9f2b5051b8833f59f3bf748b28ef54f850f4fcb389a252aa383866d1" -dependencies = [ - "memchr", -] - -[[package]] -name = "once_cell" -version = "1.18.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" - -[[package]] -name = "opaque-debug" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" - -[[package]] -name = "open-fastrlp" -version = "0.1.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "786393f80485445794f6043fd3138854dd109cc6c4bd1a6383db304c9ce9b9ce" -dependencies = [ - "arrayvec", - "auto_impl", - "bytes", - "ethereum-types", - "open-fastrlp-derive", -] - -[[package]] -name = "open-fastrlp-derive" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "003b2be5c6c53c1cfeb0a238b8a1c3915cd410feb684457a36c10038f764bb1c" -dependencies = [ - "bytes", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "openssl" -version = "0.10.55" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "345df152bc43501c5eb9e4654ff05f794effb78d4efe3d53abc158baddc0703d" -dependencies = [ - "bitflags 1.3.2", - "cfg-if", - "foreign-types", - "libc", - "once_cell", - "openssl-macros", - "openssl-sys", -] - -[[package]] -name = "openssl-macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "openssl-probe" -version = "0.1.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" - -[[package]] -name = "openssl-sys" -version = "0.9.90" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "374533b0e45f3a7ced10fcaeccca020e66656bc03dac384f852e4e5a7a8104a6" -dependencies = [ - "cc", - "libc", - "pkg-config", - "vcpkg", -] - -[[package]] -name = "parity-scale-codec" -version = "3.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "756d439303e94fae44f288ba881ad29670c65b0c4b0e05674ca81061bb65f2c5" -dependencies = [ - "arrayvec", - "bitvec 1.0.1", - "byte-slice-cast", - "impl-trait-for-tuples", - "parity-scale-codec-derive", - "serde", -] - -[[package]] -name = "parity-scale-codec-derive" -version = "3.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d884d78fcf214d70b1e239fcd1c6e5e95aa3be1881918da2e488cc946c7a476" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "parking_lot" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3742b2c103b9f06bc9fff0a37ff4912935851bee6d36f3c02bcc755bcfec228f" -dependencies = [ - "lock_api", - "parking_lot_core", -] - -[[package]] -name = "parking_lot_core" -version = "0.9.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93f00c865fe7cabf650081affecd3871070f26767e7b2070a3ffae14c654b447" -dependencies = [ - "cfg-if", - "libc", - "redox_syscall 0.3.5", - "smallvec", - "windows-targets", -] - -[[package]] -name = "pasta_curves" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" -dependencies = [ - "blake2b_simd", - "ff", - "group", - "hex", - "lazy_static", - "rand", - "serde", - "static_assertions", - "subtle", -] - -[[package]] -name = "paste" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" - -[[package]] -name = "path-slash" -version = "0.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e91099d4268b0e11973f036e885d652fb0b21fedcf69738c627f94db6a44f42" - -[[package]] -name = "pbkdf2" -version = "0.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83a0692ec44e4cf1ef28ca317f14f8f07da2d95ec3fa01f86e4467b725e60917" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "pbkdf2" -version = "0.12.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8ed6a7761f76e3b9f92dfb0a60a6a6477c61024b775147ff0973a02653abaf2" -dependencies = [ - "digest 0.10.7", - "hmac", -] - -[[package]] -name = "percent-encoding" -version = "2.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b2a4787296e9989611394c33f193f676704af1686e70b8f8033ab5ba9a35a94" - -[[package]] -name = "petgraph" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4dd7d28ee937e54fe3080c91faa1c3a46c06de6252988a7f4592ba2310ef22a4" -dependencies = [ - "fixedbitset", - "indexmap 1.9.3", -] - -[[package]] -name = "pharos" -version = "0.5.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e9567389417feee6ce15dd6527a8a1ecac205ef62c2932bcf3d9f6fc5b78b414" -dependencies = [ - "futures", - "rustc_version", -] - -[[package]] -name = "phf" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ade2d8b8f33c7333b51bcf0428d37e217e9f32192ae4772156f65063b8ce03dc" -dependencies = [ - "phf_macros", - "phf_shared 0.11.2", -] - -[[package]] -name = "phf_generator" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "48e4cc64c2ad9ebe670cb8fd69dd50ae301650392e81c05f9bfcb2d5bdbc24b0" -dependencies = [ - "phf_shared 0.11.2", - "rand", -] - -[[package]] -name = "phf_macros" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3444646e286606587e49f3bcf1679b8cef1dc2c5ecc29ddacaffc305180d464b" -dependencies = [ - "phf_generator", - "phf_shared 0.11.2", - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "phf_shared" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6796ad771acdc0123d2a88dc428b5e38ef24456743ddb1744ed628f9815c096" -dependencies = [ - "siphasher", -] - -[[package]] -name = "phf_shared" -version = "0.11.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "90fcb95eef784c2ac79119d1dd819e162b5da872ce6f3c3abe1e8ca1c082f72b" -dependencies = [ - "siphasher", -] - -[[package]] -name = "pin-project" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "030ad2bc4db10a8944cb0d837f158bdfec4d4a4873ab701a95046770d11f8842" -dependencies = [ - "pin-project-internal", -] - -[[package]] -name = "pin-project-internal" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec2e072ecce94ec471b13398d5402c188e76ac03cf74dd1a975161b23a3f6d9c" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "pin-project-lite" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" - -[[package]] -name = "pin-utils" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" - -[[package]] -name = "pkcs8" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" -dependencies = [ - "der", - "spki", -] - -[[package]] -name = "pkg-config" -version = "0.3.27" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "26072860ba924cbfa98ea39c8c19b4dd6a4a25423dbdf219c1eca91aa0cf6964" - -[[package]] -name = "plonkish_backend" -version = "0.1.0" -source = "git+https://github.com/summa-dev/plonkish?branch=summa#fa852d0a4cd79621e5ee31ffcedd9ba348d17d5c" -dependencies = [ - "bincode", - "bitvec 1.0.1", - "generic-array", - "halo2_proofs 0.2.0 (git+https://github.com/han0110/halo2.git?branch=feature/for-benchmark)", - "halo2curves 0.3.3", - "itertools 0.10.5", - "num-bigint", - "num-integer", - "pasta_curves", - "poseidon", - "rand", - "rayon", - "serde", - "sha3 0.10.8", -] - -[[package]] -name = "poseidon" -version = "0.2.0" -source = "git+https://github.com/han0110/poseidon?branch=feature/with-spec#fa4c2544ed38666f1f72d1c4fd0956756a7112b3" -dependencies = [ - "halo2curves 0.3.2", - "subtle", -] - -[[package]] -name = "ppv-lite86" -version = "0.2.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" - -[[package]] -name = "precomputed-hash" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "925383efa346730478fb4838dbe9137d2a47675ad789c546d150a6e1dd4ab31c" - -[[package]] -name = "prettyplease" -version = "0.2.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92139198957b410250d43fad93e630d956499a625c527eda65175c8680f83387" -dependencies = [ - "proc-macro2", - "syn 2.0.25", -] - -[[package]] -name = "primitive-types" -version = "0.12.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f3486ccba82358b11a77516035647c34ba167dfa53312630de83b12bd4f3d66" -dependencies = [ - "fixed-hash", - "impl-codec", - "impl-rlp", - "impl-serde", - "scale-info", - "uint", -] - -[[package]] -name = "proc-macro-crate" -version = "1.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7f4c021e1093a56626774e81216a4ce732a735e5bad4868a03f3ed65ca0c3919" -dependencies = [ - "once_cell", - "toml_edit", -] - -[[package]] -name = "proc-macro-error" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da25490ff9892aab3fcf7c36f08cfb902dd3e71ca0f9f9517bea02a73a5ce38c" -dependencies = [ - "proc-macro-error-attr", - "proc-macro2", - "quote", - "syn 1.0.109", - "version_check", -] - -[[package]] -name = "proc-macro-error-attr" -version = "1.0.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1be40180e52ecc98ad80b184934baf3d0d29f979574e439af5a55274b35f869" -dependencies = [ - "proc-macro2", - "quote", - "version_check", -] - -[[package]] -name = "proc-macro2" -version = "1.0.64" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78803b62cbf1f46fde80d7c0e803111524b9877184cfe7c3033659490ac7a7da" -dependencies = [ - "unicode-ident", -] - -[[package]] -name = "quote" -version = "1.0.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "573015e8ab27661678357f27dc26460738fd2b6c86e46f386fde94cb5d913105" -dependencies = [ - "proc-macro2", -] - -[[package]] -name = "radium" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "def50a86306165861203e7f84ecffbbdfdea79f0e51039b33de1e952358c47ac" - -[[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" -dependencies = [ - "libc", - "rand_chacha", - "rand_core", -] - -[[package]] -name = "rand_chacha" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" -dependencies = [ - "ppv-lite86", - "rand_core", -] - -[[package]] -name = "rand_core" -version = "0.6.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] - -[[package]] -name = "rayon" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" -dependencies = [ - "either", - "rayon-core", -] - -[[package]] -name = "rayon-core" -version = "1.12.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" -dependencies = [ - "crossbeam-deque", - "crossbeam-utils", -] - -[[package]] -name = "redox_syscall" -version = "0.2.16" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb5a58c1855b4b6819d59012155603f0b22ad30cad752600aadfcb695265519a" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_syscall" -version = "0.3.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "567664f262709473930a4bf9e51bf2ebf3348f2e748ccc50dea20646858f8f29" -dependencies = [ - "bitflags 1.3.2", -] - -[[package]] -name = "redox_users" -version = "0.4.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b033d837a7cf162d7993aded9304e30a83213c648b6e389db233191f891e5c2b" -dependencies = [ - "getrandom", - "redox_syscall 0.2.16", - "thiserror", -] - -[[package]] -name = "regex" -version = "1.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2eae68fc220f7cf2532e4494aded17545fce192d59cd996e0fe7887f4ceb575" -dependencies = [ - "aho-corasick", - "memchr", - "regex-automata", - "regex-syntax 0.7.4", -] - -[[package]] -name = "regex-automata" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "83d3daa6976cffb758ec878f108ba0e062a45b2d6ca3a2cca965338855476caf" -dependencies = [ - "aho-corasick", - "memchr", - "regex-syntax 0.7.4", -] - -[[package]] -name = "regex-syntax" -version = "0.6.29" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f162c6dd7b008981e4d40210aca20b4bd0f9b60ca9271061b07f78537722f2e1" - -[[package]] -name = "regex-syntax" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5ea92a5b6195c6ef2a0295ea818b312502c6fc94dde986c5553242e18fd4ce2" - -[[package]] -name = "reqwest" -version = "0.11.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cde824a14b7c14f85caff81225f411faacc04a2013f41670f41443742b1c1c55" -dependencies = [ - "base64 0.21.2", - "bytes", - "encoding_rs", - "futures-core", - "futures-util", - "h2", - "http", - "http-body", - "hyper", - "hyper-tls", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "serde", - "serde_json", - "serde_urlencoded", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", -] - -[[package]] -name = "revm" -version = "3.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f293f351c4c203d321744e54ed7eed3d2b6eef4c140228910dde3ac9a5ea8031" -dependencies = [ - "auto_impl", - "revm-interpreter", - "revm-precompile", -] - -[[package]] -name = "revm-interpreter" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a53980a26f9b5a66d13511c35074d4b53631e157850a1d7cf1af4efc2c2b72c9" -dependencies = [ - "derive_more", - "enumn", - "revm-primitives", - "sha3 0.10.8", -] - -[[package]] -name = "revm-precompile" -version = "2.0.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "41320af3bd6a65153d38eb1d3638ba89104cc9513c7feedb2d8510e8307dab29" -dependencies = [ - "k256", - "num", - "once_cell", - "revm-primitives", - "ripemd", - "secp256k1", - "sha2 0.10.7", - "sha3 0.10.8", - "substrate-bn", -] - -[[package]] -name = "revm-primitives" -version = "1.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "304d998f466ffef72d76c7f20b05bf08a96801736a6fb1fdef47d49a292618df" -dependencies = [ - "auto_impl", - "bitvec 1.0.1", - "bytes", - "derive_more", - "enumn", - "fixed-hash", - "hashbrown 0.13.2", - "hex", - "hex-literal", - "primitive-types", - "rlp", - "ruint", - "sha3 0.10.8", -] - -[[package]] -name = "rfc6979" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" -dependencies = [ - "hmac", - "subtle", -] - -[[package]] -name = "ripemd" -version = "0.1.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bd124222d17ad93a644ed9d011a40f4fb64aa54275c08cc216524a9ea82fb09f" -dependencies = [ - "digest 0.10.7", -] - -[[package]] -name = "rlp" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bb919243f34364b6bd2fc10ef797edbfa75f33c252e7998527479c6d6b47e1ec" -dependencies = [ - "bytes", - "rlp-derive", - "rustc-hex", -] - -[[package]] -name = "rlp-derive" -version = "0.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e33d7b2abe0c340d8797fe2907d3f20d3b5ea5908683618bfe80df7f621f672a" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "ruint" -version = "1.8.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d470e29e933dac4101180fd6574971892315c414cf2961a192729089687cc9b" -dependencies = [ - "derive_more", - "primitive-types", - "rlp", - "ruint-macro", - "rustc_version", - "thiserror", -] - -[[package]] -name = "ruint-macro" -version = "1.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62cc5760263ea229d367e7dff3c0cbf09e4797a125bd87059a6c095804f3b2d1" - -[[package]] -name = "rustc-demangle" -version = "0.1.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d626bb9dae77e28219937af045c257c28bfd3f69333c512553507f5f9798cb76" - -[[package]] -name = "rustc-hex" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e75f6a532d0fd9f7f13144f392b6ad56a32696bfcd9c78f797f16bbb6f072d6" - -[[package]] -name = "rustc_version" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa0f585226d2e68097d4f95d113b15b83a82e819ab25717ec0590d9584ef366" -dependencies = [ - "semver", -] - -[[package]] -name = "rustix" -version = "0.37.23" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d69718bf81c6127a49dc64e44a742e8bb9213c0ff8869a22c308f84c1d4ab06" -dependencies = [ - "bitflags 1.3.2", - "errno", - "io-lifetimes", - "libc", - "linux-raw-sys 0.3.8", - "windows-sys", -] - -[[package]] -name = "rustix" -version = "0.38.11" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c0c3dde1fc030af041adc40e79c0e7fbcf431dd24870053d187d7c66e4b87453" -dependencies = [ - "bitflags 2.4.0", - "errno", - "libc", - "linux-raw-sys 0.4.3", - "windows-sys", -] - -[[package]] -name = "rustversion" -version = "1.0.13" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc31bd9b61a32c31f9650d18add92aa83a49ba979c143eefd27fe7177b05bd5f" - -[[package]] -name = "ryu" -version = "1.0.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" - -[[package]] -name = "salsa20" -version = "0.10.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97a22f5af31f73a954c10289c93e8a50cc23d971e80ee446f1f6f7137a088213" -dependencies = [ - "cipher", -] - -[[package]] -name = "same-file" -version = "1.0.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93fc1dc3aaa9bfed95e02e6eadabb4baf7e3078b0bd1b4d7b6b0b68378900502" -dependencies = [ - "winapi-util", -] - -[[package]] -name = "scale-info" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "35c0a159d0c45c12b20c5a844feb1fe4bea86e28f17b92a5f0c42193634d3782" -dependencies = [ - "cfg-if", - "derive_more", - "parity-scale-codec", - "scale-info-derive", -] - -[[package]] -name = "scale-info-derive" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "912e55f6d20e0e80d63733872b40e1227c0bce1e1ab81ba67d696339bfd7fd29" -dependencies = [ - "proc-macro-crate", - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "schannel" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c3733bf4cf7ea0880754e19cb5a462007c4a8c1914bff372ccc95b464f1df88" -dependencies = [ - "windows-sys", -] - -[[package]] -name = "scopeguard" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" - -[[package]] -name = "scrypt" -version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f9e24d2b632954ded8ab2ef9fea0a0c769ea56ea98bddbafbad22caeeadf45d" -dependencies = [ - "hmac", - "pbkdf2 0.11.0", - "salsa20", - "sha2 0.10.7", -] - -[[package]] -name = "sec1" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f0aec48e813d6b90b15f0b8948af3c63483992dee44c03e9930b3eebdabe046e" -dependencies = [ - "base16ct", - "der", - "generic-array", - "pkcs8", - "subtle", - "zeroize", -] - -[[package]] -name = "secp256k1" -version = "0.27.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "25996b82292a7a57ed3508f052cfff8640d38d32018784acd714758b43da9c8f" -dependencies = [ - "secp256k1-sys", -] - -[[package]] -name = "secp256k1-sys" -version = "0.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70a129b9e9efbfb223753b9163c4ab3b13cff7fd9c7f010fbac25ab4099fa07e" -dependencies = [ - "cc", -] - -[[package]] -name = "security-framework" -version = "2.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1fc758eb7bffce5b308734e9b0c1468893cae9ff70ebf13e7090be8dcbcc83a8" -dependencies = [ - "bitflags 1.3.2", - "core-foundation", - "core-foundation-sys", - "libc", - "security-framework-sys", -] - -[[package]] -name = "security-framework-sys" -version = "2.9.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f51d0c0d83bec45f16480d0ce0058397a69e48fcdc52d1dc8855fb68acbd31a7" -dependencies = [ - "core-foundation-sys", - "libc", -] - -[[package]] -name = "semver" -version = "1.0.17" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bebd363326d05ec3e2f532ab7660680f3b02130d780c299bca73469d521bc0ed" -dependencies = [ - "serde", -] - -[[package]] -name = "send_wrapper" -version = "0.4.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f638d531eccd6e23b980caf34876660d38e265409d8e99b397ab71eb3612fad0" - -[[package]] -name = "send_wrapper" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" - -[[package]] -name = "serde" -version = "1.0.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30e27d1e4fd7659406c492fd6cfaf2066ba8773de45ca75e855590f856dc34a9" -dependencies = [ - "serde_derive", -] - -[[package]] -name = "serde_derive" -version = "1.0.171" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "389894603bd18c46fa56231694f8d827779c0951a667087194cf9de94ed24682" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "serde_json" -version = "1.0.102" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5062a995d481b2308b6064e9af76011f2921c35f97b0468811ed9f6cd91dfed" -dependencies = [ - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "serde_spanned" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "96426c9936fd7a0124915f9185ea1d20aa9445cc9821142f0a73bc9207a2e186" -dependencies = [ - "serde", -] - -[[package]] -name = "serde_urlencoded" -version = "0.7.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d3491c14715ca2294c4d6a88f15e84739788c1d030eed8c110436aafdaa2f3fd" -dependencies = [ - "form_urlencoded", - "itoa", - "ryu", - "serde", -] - -[[package]] -name = "sha2" -version = "0.9.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4d58a1e1bf39749807d89cf2d98ac2dfa0ff1cb3faa38fbb64dd88ac8013d800" -dependencies = [ - "block-buffer 0.9.0", - "cfg-if", - "cpufeatures", - "digest 0.9.0", - "opaque-debug", -] - -[[package]] -name = "sha2" -version = "0.10.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "479fb9d862239e610720565ca91403019f2f00410f1864c5aa7479b950a76ed8" -dependencies = [ - "cfg-if", - "cpufeatures", - "digest 0.10.7", -] - -[[package]] -name = "sha3" -version = "0.9.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" -dependencies = [ - "block-buffer 0.9.0", - "digest 0.9.0", - "keccak", - "opaque-debug", -] - -[[package]] -name = "sha3" -version = "0.10.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" -dependencies = [ - "digest 0.10.7", - "keccak", -] - -[[package]] -name = "signal-hook-registry" -version = "1.4.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d8229b473baa5980ac72ef434c4415e70c4b5e71b423043adb4ba059f89c99a1" -dependencies = [ - "libc", -] - -[[package]] -name = "signature" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5e1788eed21689f9cf370582dfc467ef36ed9c707f073528ddafa8d83e3b8500" -dependencies = [ - "digest 0.10.7", - "rand_core", -] - -[[package]] -name = "siphasher" -version = "0.3.10" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7bd3e3206899af3f8b12af284fafc038cc1dc2b41d1b89dd17297221c5d225de" - -[[package]] -name = "slab" -version = "0.4.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" -dependencies = [ - "autocfg", -] - -[[package]] -name = "smallvec" -version = "1.11.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62bb4feee49fdd9f707ef802e22365a35de4b7b299de4763d44bfea899442ff9" - -[[package]] -name = "socket2" -version = "0.4.9" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64a4a911eed85daf18834cfaa86a79b7d266ff93ff5ba14005426219480ed662" -dependencies = [ - "libc", - "winapi", -] - -[[package]] -name = "solang-parser" -version = "0.3.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a94494913728908efa7a25a2dd2e4f037e714897985c24273c40596638ed909" -dependencies = [ - "itertools 0.10.5", - "lalrpop", - "lalrpop-util", - "phf", - "thiserror", - "unicode-xid", -] - -[[package]] -name = "spin" -version = "0.5.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" - -[[package]] -name = "spki" -version = "0.7.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9d1e996ef02c474957d681f1b05213dfb0abab947b446a62d37770b23500184a" -dependencies = [ - "base64ct", - "der", -] - -[[package]] -name = "static_assertions" -version = "1.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" - -[[package]] -name = "string_cache" -version = "0.8.7" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f91138e76242f575eb1d3b38b4f1362f10d3a43f47d182a5b359af488a02293b" -dependencies = [ - "new_debug_unreachable", - "once_cell", - "parking_lot", - "phf_shared 0.10.0", - "precomputed-hash", -] - -[[package]] -name = "strum" -version = "0.24.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "063e6045c0e62079840579a7e47a355ae92f60eb74daaf156fb1e84ba164e63f" -dependencies = [ - "strum_macros", -] - -[[package]] -name = "strum_macros" -version = "0.24.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e385be0d24f186b4ce2f9982191e7101bb737312ad61c1f2f984f34bcf85d59" -dependencies = [ - "heck", - "proc-macro2", - "quote", - "rustversion", - "syn 1.0.109", -] - -[[package]] -name = "substrate-bn" -version = "0.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b5bbfa79abbae15dd642ea8176a21a635ff3c00059961d1ea27ad04e5b441c" -dependencies = [ - "byteorder", - "crunchy", - "lazy_static", - "rand", - "rustc-hex", -] - -[[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "summa-backend" -version = "0.1.0" -dependencies = [ - "base64 0.13.1", - "bincode", - "csv", - "ethers", - "futures", - "halo2_proofs 0.2.0 (git+https://github.com/han0110/halo2.git?branch=feature/for-benchmark)", - "halo2_solidity_verifier", - "num-bigint", - "num-traits", - "rand", - "reqwest", - "serde", - "serde_json", - "summa-hyperplonk", - "tokio", -] - -[[package]] -name = "summa-hyperplonk" -version = "0.3.0" -dependencies = [ - "csv", - "halo2_proofs 0.2.0 (git+https://github.com/han0110/halo2.git?branch=feature/for-benchmark)", - "num-bigint", - "plonkish_backend", - "rand", - "rayon", -] - -[[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "syn" -version = "2.0.25" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "15e3fc8c0c74267e2df136e5e5fb656a464158aa57624053375eb9c8c6e25ae2" -dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", -] - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "tempfile" -version = "3.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "31c0432476357e58790aaa47a8efb0c5138f137343f3b5f23bd36a27e3b0a6d6" +checksum = "5a634b1c61a95585bd15607c6ab0c4e5b226e695ff2800ba0cdccddf208c406c" dependencies = [ "autocfg", - "cfg-if", - "fastrand", - "redox_syscall 0.3.5", - "rustix 0.37.23", - "windows-sys", -] - -[[package]] -name = "term" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c59df8ac95d96ff9bede18eb7300b0fda5e5d8d90960e76f8e14ae765eedbf1f" -dependencies = [ - "dirs-next", - "rustversion", - "winapi", -] - -[[package]] -name = "thiserror" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a35fc5b8971143ca348fa6df4f024d4d55264f3468c71ad1c2f365b0a4d58c42" -dependencies = [ - "thiserror-impl", ] [[package]] -name = "thiserror-impl" -version = "1.0.43" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "463fe12d7993d3b327787537ce8dd4dfa058de32fc2b195ef3cde03dc4771e8f" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" -dependencies = [ - "crunchy", -] - -[[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" -dependencies = [ - "tinyvec_macros", -] - -[[package]] -name = "tinyvec_macros" -version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" - -[[package]] -name = "tokio" -version = "1.29.1" +name = "num-bigint" +version = "0.4.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "532826ff75199d5833b9d2c5fe410f29235e25704ee5f0ef599fb51c21f4a4da" +checksum = "f93ab6289c7b344a8a9f60f88d80aa20032336fe78da341afc91c8a2341fc75f" dependencies = [ "autocfg", - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys", -] - -[[package]] -name = "tokio-macros" -version = "2.1.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "630bdcf245f78637c13ec01ffae6187cca34625e8c63150d424b59e55af2675e" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", -] - -[[package]] -name = "tokio-native-tls" -version = "0.3.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] - -[[package]] -name = "tokio-util" -version = "0.7.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "806fe8c2c87eccc8b3267cbae29ed3ab2d0bd37fca70ab622e46aaa9375ddb7d" -dependencies = [ - "bytes", - "futures-core", - "futures-sink", - "pin-project-lite", - "tokio", - "tracing", -] - -[[package]] -name = "toml" -version = "0.7.6" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17e963a819c331dcacd7ab957d80bc2b9a9c1e71c804826d2f283dd65306542" -dependencies = [ - "serde", - "serde_spanned", - "toml_datetime", - "toml_edit", -] - -[[package]] -name = "toml_datetime" -version = "0.6.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7cda73e2f1397b1262d6dfdcef8aafae14d1de7748d66822d3bfeeb6d03e5e4b" -dependencies = [ - "serde", -] - -[[package]] -name = "toml_edit" -version = "0.19.12" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c500344a19072298cd05a7224b3c0c629348b78692bf48466c5238656e315a78" -dependencies = [ - "indexmap 2.0.0", - "serde", - "serde_spanned", - "toml_datetime", - "winnow", -] - -[[package]] -name = "tower-service" -version = "0.3.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b6bc1c9ce2b5135ac7f93c72918fc37feb872bdc6a5533a8b85eb4b86bfdae52" - -[[package]] -name = "tracing" -version = "0.1.37" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" -dependencies = [ - "cfg-if", - "pin-project-lite", - "tracing-attributes", - "tracing-core", -] - -[[package]] -name = "tracing-attributes" -version = "0.1.26" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.25", + "num-integer", + "num-traits", ] [[package]] -name = "tracing-core" -version = "0.1.31" +name = "num-integer" +version = "0.1.45" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +checksum = "225d3389fb3509a24c93f5c29eb6bde2586b98d9f016636dff58d7c6f7569cd9" dependencies = [ - "once_cell", + "autocfg", + "num-traits", ] [[package]] -name = "tracing-futures" -version = "0.2.5" +name = "num-traits" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97d095ae15e245a057c8e8451bab9b3ee1e1f68e9ba2b4fbc18d0ac5237835f2" +checksum = "f30b0abd723be7e2ffca1272140fac1a2f084c77ec3e123c192b66af1ee9e6c2" dependencies = [ - "pin-project", - "tracing", + "autocfg", ] [[package]] -name = "try-lock" -version = "0.2.4" +name = "once_cell" +version = "1.18.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3528ecfd12c466c6f163363caf2d02a71161dd5e1cc6ae7b34207ea2d42d81ed" +checksum = "dd8b5dd2ae5ed71462c540258bedcb51965123ad7e7ccf4b9a8cafaa4a63576d" [[package]] -name = "typenum" -version = "1.16.0" +name = "opaque-debug" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" +checksum = "624a8340c38c1b80fd549087862da4ba43e08858af025b236e509b6649fc13d5" [[package]] -name = "uint" -version = "0.9.5" +name = "pasta_curves" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +checksum = "d3e57598f73cc7e1b2ac63c79c517b31a0877cd7c402cdcaa311b5208de7a095" dependencies = [ - "byteorder", - "crunchy", + "blake2b_simd", + "ff", + "group", "hex", + "lazy_static", + "rand", + "serde", "static_assertions", + "subtle", ] [[package]] -name = "unicase" -version = "2.7.0" +name = "paste" +version = "1.0.13" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f7d2d4dafb69621809a81864c9c1b864479e1235c0dd4e199924b9742439ed89" -dependencies = [ - "version_check", -] +checksum = "b4b27ab7be369122c218afc2079489cdcb4b517c0a3fc386ff11e1fedfcc2b35" [[package]] -name = "unicode-bidi" -version = "0.3.13" +name = "pin-project-lite" +version = "0.2.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92888ba5573ff080736b3648696b70cafad7d250551175acbaa4e0385b3e1460" +checksum = "4c40d25201921e5ff0c862a505c6557ea88568a4e3ace775ab55e93f2f4f9d57" [[package]] -name = "unicode-ident" -version = "1.0.10" +name = "pin-utils" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" +checksum = "8b870d8c151b6f2fb93e84a13146138f05d02ed11c7e7c54f8826aaaf7c9f184" [[package]] -name = "unicode-normalization" -version = "0.1.22" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c5713f0fc4b5db668a2ac63cdb7bb4469d8c9fed047b1d0292cc7b0ce2ba921" +name = "plonkish_backend" +version = "0.1.0" +source = "git+https://github.com/summa-dev/plonkish?branch=feat-read-params#64274584d00c1744bae042d3007f1f9df2bb2d30" dependencies = [ - "tinyvec", + "bincode", + "bitvec", + "generic-array", + "halo2_proofs", + "halo2curves 0.3.3", + "itertools", + "num-bigint", + "num-integer", + "pasta_curves", + "poseidon", + "rand", + "rayon", + "serde", + "sha3 0.10.8", ] [[package]] -name = "unicode-xid" -version = "0.2.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f962df74c8c05a667b5ee8bcf162993134c104e96440b663c8daa176dc772d8c" +name = "poseidon" +version = "0.2.0" +source = "git+https://github.com/han0110/poseidon?branch=feature/with-spec#fa4c2544ed38666f1f72d1c4fd0956756a7112b3" +dependencies = [ + "halo2curves 0.3.2", + "subtle", +] [[package]] -name = "url" -version = "2.4.0" +name = "ppv-lite86" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "50bff7831e19200a85b17131d085c25d7811bc4e186efdaf54bbd132994a88cb" -dependencies = [ - "form_urlencoded", - "idna", - "percent-encoding", -] +checksum = "5b40af805b3121feab8a3c29f04d8ad262fa8e0561883e7653e024ae4479e6de" [[package]] -name = "uuid" -version = "0.8.2" +name = "proc-macro2" +version = "1.0.86" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bc5cf98d8186244414c848017f0e2676b3fcb46807f6668a97dfe67359a3c4b7" +checksum = "5e719e8df665df0d1c8fbfd238015744736151d4445ec0836b8e628aae103b77" dependencies = [ - "getrandom", - "serde", + "unicode-ident", ] [[package]] -name = "vcpkg" -version = "0.2.15" +name = "quote" +version = "1.0.36" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "accd4ea62f7bb7a82fe23066fb0957d48ef677f6eeb8215f372f52e48bb32426" +checksum = "0fa76aaf39101c457836aec0ce2316dbdc3ab723cdda1c6bd4e6ad4208acaca7" +dependencies = [ + "proc-macro2", +] [[package]] -name = "version_check" -version = "0.9.4" +name = "radium" +version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" [[package]] -name = "walkdir" -version = "2.3.3" +name = "rand" +version = "0.8.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36df944cda56c7d8d8b7496af378e6b16de9284591917d307c9b4d313c44e698" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" dependencies = [ - "same-file", - "winapi-util", + "libc", + "rand_chacha", + "rand_core", ] [[package]] -name = "want" +name = "rand_chacha" version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bfa7760aed19e106de2c7c0b581b509f2f25d3dacaf737cb82ac61bc6d760b0e" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" dependencies = [ - "try-lock", + "ppv-lite86", + "rand_core", ] [[package]] -name = "wasi" -version = "0.11.0+wasi-snapshot-preview1" +name = "rand_core" +version = "0.6.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom", +] [[package]] -name = "wasm-bindgen" -version = "0.2.87" +name = "rayon" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7706a72ab36d8cb1f80ffbf0e071533974a60d0a308d01a5d0375bf60499a342" +checksum = "9c27db03db7734835b3f53954b534c91069375ce6ccaa2e065441e07d9b6cdb1" dependencies = [ - "cfg-if", - "wasm-bindgen-macro", + "either", + "rayon-core", ] [[package]] -name = "wasm-bindgen-backend" -version = "0.2.87" +name = "rayon-core" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5ef2b6d3c510e9625e5fe6f509ab07d66a760f0885d858736483c32ed7809abd" +checksum = "5ce3fb6ad83f861aac485e76e1985cd109d9a3713802152be56c3b1f0e0658ed" dependencies = [ - "bumpalo", - "log", - "once_cell", - "proc-macro2", - "quote", - "syn 2.0.25", - "wasm-bindgen-shared", + "crossbeam-deque", + "crossbeam-utils", ] [[package]] -name = "wasm-bindgen-futures" -version = "0.4.37" +name = "ryu" +version = "1.0.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c02dbc21516f9f1f04f187958890d7e6026df8d16540b7ad9492bc34a67cea03" -dependencies = [ - "cfg-if", - "js-sys", - "wasm-bindgen", - "web-sys", -] +checksum = "fe232bdf6be8c8de797b22184ee71118d63780ea42ac85b61d1baa6d3b782ae9" + +[[package]] +name = "scopeguard" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d29ab0c6d3fc0ee92fe66e2d99f700eab17a8d57d1c1d3b748380fb20baa78cd" [[package]] -name = "wasm-bindgen-macro" -version = "0.2.87" +name = "serde" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dee495e55982a3bd48105a7b947fd2a9b4a8ae3010041b9e0faab3f9cd028f1d" +checksum = "bc76f558e0cbb2a839d37354c575f1dc3fdc6546b5be373ba43d95f231bf7c12" dependencies = [ - "quote", - "wasm-bindgen-macro-support", + "serde_derive", ] [[package]] -name = "wasm-bindgen-macro-support" -version = "0.2.87" +name = "serde_derive" +version = "1.0.204" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "54681b18a46765f095758388f2d0cf16eb8d4169b639ab575a8f5693af210c7b" +checksum = "e0cd7e117be63d3c3678776753929474f3b04a43a080c744d6b0ae2a8c28e222" dependencies = [ "proc-macro2", "quote", - "syn 2.0.25", - "wasm-bindgen-backend", - "wasm-bindgen-shared", + "syn", ] [[package]] -name = "wasm-bindgen-shared" -version = "0.2.87" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca6ad05a4870b2bf5fe995117d3728437bd27d7cd5f06f13c17443ef369775a1" - -[[package]] -name = "web-sys" -version = "0.3.64" +name = "serde_json" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b85cbef8c220a6abc02aefd892dfc0fc23afb1c6a426316ec33253a3877249b" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ - "js-sys", - "wasm-bindgen", + "itoa", + "ryu", + "serde", ] [[package]] -name = "winapi" -version = "0.3.9" +name = "sha3" +version = "0.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c839a674fcd7a98952e593242ea400abe93992746761e38641405d28b00f419" +checksum = "f81199417d4e5de3f04b1e871023acea7389672c4135918f05aa9cbf2f2fa809" dependencies = [ - "winapi-i686-pc-windows-gnu", - "winapi-x86_64-pc-windows-gnu", + "block-buffer 0.9.0", + "digest 0.9.0", + "keccak", + "opaque-debug", ] [[package]] -name = "winapi-i686-pc-windows-gnu" -version = "0.4.0" +name = "sha3" +version = "0.10.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ac3b87c63620426dd9b991e5ce0329eff545bccbbb34f3be09ff6fb6ab51b7b6" +checksum = "75872d278a8f37ef87fa0ddbda7802605cb18344497949862c0d4dcb291eba60" +dependencies = [ + "digest 0.10.7", + "keccak", +] [[package]] -name = "winapi-util" -version = "0.1.5" +name = "slab" +version = "0.4.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "70ec6ce85bb158151cae5e5c87f95a8e97d2c0c4b001223f33a334e3ce5de178" +checksum = "6528351c9bc8ab22353f9d776db39a20288e8d6c37ef8cfe3317cf875eecfc2d" dependencies = [ - "winapi", + "autocfg", ] [[package]] -name = "winapi-x86_64-pc-windows-gnu" -version = "0.4.0" +name = "spin" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "windows-sys" -version = "0.48.0" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "677d2418bec65e3338edb076e806bc1ec15693c5d0104683f2efe857f61056a9" -dependencies = [ - "windows-targets", -] +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" [[package]] -name = "windows-targets" -version = "0.48.1" +name = "subtle" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "05d4b17490f70499f20b9e791dcf6a299785ce8af4d709018206dc5b4953e95f" +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" + +[[package]] +name = "summa-backend" +version = "0.1.0" dependencies = [ - "windows_aarch64_gnullvm", - "windows_aarch64_msvc", - "windows_i686_gnu", - "windows_i686_msvc", - "windows_x86_64_gnu", - "windows_x86_64_gnullvm", - "windows_x86_64_msvc", + "base64", + "bincode", + "csv", + "futures", + "halo2_proofs", + "num-bigint", + "num-traits", + "plonkish_backend", + "rand", + "serde", + "serde_json", + "summa-hyperplonk", ] [[package]] -name = "windows_aarch64_gnullvm" -version = "0.48.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "91ae572e1b79dba883e0d315474df7305d12f569b400fcf90581b06062f7e1bc" +name = "summa-hyperplonk" +version = "0.3.0" +dependencies = [ + "csv", + "halo2_proofs", + "num-bigint", + "plonkish_backend", + "rand", + "rayon", +] [[package]] -name = "windows_aarch64_msvc" -version = "0.48.0" +name = "syn" +version = "2.0.70" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b2ef27e0d7bdfcfc7b868b317c1d32c641a6fe4629c171b8928c7b08d98d7cf3" +checksum = "2f0209b68b3613b093e0ec905354eccaedcfe83b8cb37cbdeae64026c3064c16" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] [[package]] -name = "windows_i686_gnu" -version = "0.48.0" +name = "tap" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "622a1962a7db830d6fd0a69683c80a18fda201879f0f447f065a3b7467daa241" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] -name = "windows_i686_msvc" -version = "0.48.0" +name = "tracing" +version = "0.1.37" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4542c6e364ce21bf45d69fdd2a8e455fa38d316158cfd43b3ac1c5b1b19f8e00" +checksum = "8ce8c33a8d48bd45d624a6e523445fd21ec13d3653cd51f681abf67418f54eb8" +dependencies = [ + "cfg-if", + "pin-project-lite", + "tracing-attributes", + "tracing-core", +] [[package]] -name = "windows_x86_64_gnu" -version = "0.48.0" +name = "tracing-attributes" +version = "0.1.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ca2b8a661f7628cbd23440e50b05d705db3686f894fc9580820623656af974b1" +checksum = "5f4f31f56159e98206da9efd823404b79b6ef3143b4a7ab76e67b1751b25a4ab" +dependencies = [ + "proc-macro2", + "quote", + "syn", +] [[package]] -name = "windows_x86_64_gnullvm" -version = "0.48.0" +name = "tracing-core" +version = "0.1.31" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7896dbc1f41e08872e9d5e8f8baa8fdd2677f29468c4e156210174edc7f7b953" +checksum = "0955b8137a1df6f1a2e9a37d8a6656291ff0297c1a97c24e0d8425fe2312f79a" +dependencies = [ + "once_cell", +] [[package]] -name = "windows_x86_64_msvc" -version = "0.48.0" +name = "typenum" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1a515f5799fe4961cb532f983ce2b23082366b898e52ffbce459c86f67c8378a" +checksum = "497961ef93d974e23eb6f433eb5fe1b7930b659f06d12dec6fc44a8f554c0bba" [[package]] -name = "winnow" -version = "0.4.9" +name = "unicode-ident" +version = "1.0.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81a2094c43cc94775293eaa0e499fbc30048a6d824ac82c0351a8c0bf9112529" -dependencies = [ - "memchr", -] +checksum = "22049a19f4a68748a168c0fc439f9516686aa045927ff767eca0a85101fb6e73" [[package]] -name = "winreg" -version = "0.10.1" +name = "version_check" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "80d0f4e272c85def139476380b12f9ac60926689dd2e01d4923222f40580869d" -dependencies = [ - "winapi", -] +checksum = "49874b5167b65d7193b8aba1567f5c7d93d001cafc34600cee003eda787e483f" [[package]] -name = "ws_stream_wasm" -version = "0.7.4" +name = "wasi" +version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7999f5f4217fe3818726b66257a4475f71e74ffd190776ad053fa159e50737f5" -dependencies = [ - "async_io_stream", - "futures", - "js-sys", - "log", - "pharos", - "rustc_version", - "send_wrapper 0.6.0", - "thiserror", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", -] +checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" [[package]] name = "wyz" @@ -3873,15 +849,3 @@ checksum = "05f360fc0b24296329c78fda852a1e9ae82de9cf7b27dae4b7f62f118f77b9ed" dependencies = [ "tap", ] - -[[package]] -name = "yansi" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09041cd90cf85f7f8b2df60c646f853b7f535ce68f85244eb6731cf89fa498ec" - -[[package]] -name = "zeroize" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2a0956f1ba7c7909bfb66c2e9e4124ab6f6482560f6628b5aaeba39207c9aad9" diff --git a/backend/Cargo.toml b/backend/Cargo.toml index 41afc304..3f9367b9 100644 --- a/backend/Cargo.toml +++ b/backend/Cargo.toml @@ -12,15 +12,9 @@ csv = "1.2.2" futures = "0.3.28" num-bigint = "0.4.3" serde = { version = "1.0.166", features = ["derive"] } -halo2_solidity_verifier = { git = "https://github.com/summa-dev/halo2-solidity-verifier", version = "0.1.0", features = ["evm"] } -ethers = { version = "2.0.7", default-features = false, features = ["ethers-solc", "legacy"] } -reqwest = { version = "0.11", features = ["json"] } serde_json = "1.0.64" -tokio = { version = "1.7.1", features = ["full"] } base64 = "0.13" bincode = "1.3.3" num-traits = "0.2.14" rand = "0.8.5" - -[build-dependencies] -ethers = { version = "2.0.7", default-features = false, features = ["ethers-solc", "legacy"] } +plonkish_backend = { git = "https://github.com/summa-dev/plonkish", branch="feat-read-params", package = "plonkish_backend", features= ["frontend-halo2", "benchmark"] } diff --git a/backend/README.md b/backend/README.md index 59905f15..774a4d11 100644 --- a/backend/README.md +++ b/backend/README.md @@ -7,67 +7,39 @@ This directory contains the backend implementation for the Summa Proof of Solven ### Round The `Round` component represents a specific period or cycle in the Summa Proof of Solvency protocol. It encapsulates the state of the system at a given time, including the snapshot of assets and liabilities, as well as the associated proofs. -The `Round` struct integrates with the `Snapshot` and `SummaSigner` to facilitate the generation and submission of proofs to the contract. +The `Round` struct integrates with the `Snapshot` to facilitate the generation of proofs. Key Features: - Initialization of a new round with specific parameters. - Building a snapshot of the current state. -- Submitting commitment to the contract. +- Generating commitment and verifier parameters used in the verification process. - Retrieving proofs of inclusion for specific users. -### AddressOwnership - -The `AddressOwnership` component is responsible for managing and verifying the ownership of addresses. It ensures that addresses used in the protocol owned by the respective participants. This component interacts with the `SummaSigner` to submit proofs of address ownership to on-chain. - -Key Features: - -- Initialization with specific signer details. -- Dispatching proofs of address ownership to the contract. - ## Prerequisites -Before testing or running the Summa backend, the ptau file, containing the Powers of Tau trusted setup parameters essential for building the ZK circuits, must be downloaded. Specifically, the `hermez-raw-17` file is required for the [Summa flow](./examples/summa_solvency_flow.rs) example and its associated test case. +Before testing or running the Summa backend, you must download the ptau file, which contains the Powers of Tau trusted setup parameters essential for building the ZK circuits. Specifically, the `hermez-raw-hyperplonk-17` file is required for the [Summa flow](./examples/summa_solvency_flow.rs) example and its associated test case. -You can find this and other necessary files at https://github.com/han0110/halo2-kzg-srs. To download `hermez-raw-17`, use the command: +You can find this and other necessary files at https://github.com/sifnoc/halo2-kzg-srs. To download `hermez-raw-hyperplonk-17`, use the following command: ``` -wget https://trusted-setup-halo2kzg.s3.eu-central-1.amazonaws.com/hermez-raw-17 +wget https://trusted-setup-halo2kzg.s3.eu-central-1.amazonaws.com/hermez-raw-plonkish-17 ``` Ensure this file is downloaded before proceeding with the example or test case. ## Running Test -To build the binary executable and test it +To build the binary executable and test it, use the following commands: ``` cargo build cargo test --release -- --nocapture ``` -## Important Notices - -### Generating and updating verifier contract for Backend - -The verifier contract in the backend were generated using a predefined set of parameters: `N_CURRENCIES = 2`, `N_USERS = 16` and `K = 17` as indicated [here](../prover/bin/gen_verifier.rs#L26-L28) -If you intend to work with different parameters, you'll need to adjust these hard-coded values and then generate new verifier contract. - -The process described below assists in both generating the verifier and updating the Summa contract, which integrates the new verifier as constructors. - -#### Using the Bash Script - -We have provided a bash script to automate the process of updating the verifier contract and the Summa contract. To use the script: - -Ensure you have the necessary permissions to execute the script. - -``` -backend $ scripts/update_verifier_contract.sh -``` - ## Summa solvency flow example -This example illustrates how Summa interacts with the Summa contract and the user side. +This example illustrates how Summa can generate commitment proofs and verifier parameters, and then verify inclusion proofs on the user side. To execute this example, use the command: @@ -75,73 +47,53 @@ To execute this example, use the command: cargo run --release --example summa_solvency_flow ``` -### 1. Submitting Address Ownership to the Summa Contract - -First, we submit proof of address ownership to the Summa contract. This is a critical step to register these proofs on-chain, facilitating the validation of asset ownership within Summa. - -Key points: - -- An instance of `AddressOwnership`, named `address_ownership_client`, is initialized with the `signatures.csv` file, which contains the signature data. - -- The `dispatch_proof_of_address_ownership` function sends a transaction to the Summa contract to register CEX-owned addresses. - -Note: This demonstration takes place in a test environment. In real-world production, always ensure that the Summa contract is correctly deployed on the target chain. - -If executed successfully, you'll see: - -``` -1. Ownership proofs are submitted successfully! -``` - -### 2. Submit Commitment +### 1. Generate Commitment -The CEX must submit a commitment to the Summa contract for each round. This commitment consists of a timestamp, a SNARK proof, a grand sum proof and total balances. +The CEX must publicly share a commitment for each round. This commitment consists of a timestamp, a grand sum proof, and total balances. -Without CEX publishing the commitment, users cannot verify their inclusion proof on the Summa contract. This is because the inclusion verifier function internally requires the SNARK proof, but users only know the timestamp associated with the round and the verifier functions does not requre the SNARK proof directly. +Without the CEX publishing the commitment, users cannot verify their inclusion proofs. This is because the inclusion verifier function internally requires the commitment, which is a SNARK proof along with Verifier Parameters. -In here, we'll introduce you through the process of submitting a commitment using the `Round` to the Summa contract. -The Round serves as the core of the backend in Summa, and we have briefly described it in the Components section. +In this step, we'll guide you through the process of generating a commitment using the `Round` component. +The `Round` serves as the core of the backend in Summa, and we have briefly described it in the Components section. -To initialize the `Round` instance, you'll need paths to the liabilities CSV file (`entry_16.csv`) and the `ptau/hermez-raw-17` file. The files serve the following purpose: +To initialize the `Round` instance, you'll need the paths to the liabilities CSV file (`entry_16.csv`) and the `ptau/hermez-raw-plonkish-17` file. These files serve the following purposes: -- `entry_16.csv`: contains the username and liabilities entries for each CEX user (necessary to build the commitment). Liabilities column names have the following format: `balance__`, where and are the names of the cryptocurrencies and their corresponding blockchains. values are the same as in the Address Ownership Proof step; -- `ptau/hermez-raw-17`: contains parameters for constructing the zk circuits. +- `entry_16.csv`: contains the username and liabilities entries for each CEX user (necessary to build the commitment). Liabilities column names have the following format: `balance__`, where and are the names of the cryptocurrencies and their corresponding blockchains. +- `ptau/hermez-raw-plonkish-17`: contains parameters for constructing the zk circuits. -Using the `Round` instance, the solvency proof is dispatched to the Summa contract with the `dispatch_solvency_proof` method. - -If this step successfully ran, you can see this message: +If this step runs successfully, you will see the following message: ``` -2. Solvency proof is submitted successfully! +1. Commitment and Verifier Parameters successfully Exported! ``` -### 3. Generating and Exporting Inclusion Proofs +### 2. Generating and Exporting Inclusion Proofs -Assuming you're a CEX, after committing the commitment and ownership proofs to the Summa contract, you should generate inclusion proofs for every user. This proof verifies the presence of specific elements in the polynomials encoding the username, balances. +Assuming you're a CEX, after committing the commitment publicly, you should generate inclusion proofs for every user. This proof verifies the presence of specific elements in the polynomials encoding the username and balances. -After generating the inclusion proof, it's transformed into a JSON format for easy sharing. +After generating the inclusion proof, it is transformed into a JSON format for easy sharing. Upon successful execution, you'll find a file named `user_0_proof.json` and see the following message: ``` -3. Exported proof to user #0, as `user_0_proof.json` +2. Exported proof to user #0, as `user_0_proof.json`, with verifier params `verifier_params.json` ``` -### 4. Verify Proof of Inclusion +Note that the `verifier_params.json` file can be used in any other round unless the same circuit configurations, such as `N_CURRENCIES` and `K`. + +### 3. Verify Proof of Inclusion This is the final step in the Summa process and the only part that occurs on the user side. -Users receive the proof for a specific round and use methods available on the deployed Summa contract. Importantly, the Summa contract verifier function is a view function, meaning it doesn't consume gas or change the blockchain's state. +Users receive the proof and commitment for a specific round along with the verifier parameters. Unlike the commitment and proof, the verifier parameters are independent of the round. In this step, the user has to: -- Ensure the user values in the proof file aligns with `username` and `balances` provided by the CEX. -- Submit the proof to the `verify_inclusion_proof` method on the Summa contract. +- Ensure that the user values in the proof file align with the `username` and `balances` provided by the CEX. +- Perform the verifier locally with commitment and verifier parameters files. -The result will display as: +The result will be displayed as: ``` -4. Verifying the proof on contract verifier for User #0: true +3. Verified the proof with veirifer parameters for User #0: true ``` - -**Note:** In a production environment, users can independently verify their proof using public interfaces, such as Etherscan. diff --git a/backend/build.rs b/backend/build.rs deleted file mode 100644 index 213e4e66..00000000 --- a/backend/build.rs +++ /dev/null @@ -1,91 +0,0 @@ -use ethers::prelude::Abigen; -use std::{fs::OpenOptions, io::Write, path::PathBuf}; - -fn main() { - let contracts = [ - ( - "src/contracts/generated/summa_contract.rs", - "Summa", - "Summa", - ), - ( - "src/contracts/generated/verifying_key.rs", - "Halo2VerifyingKey", - "VerifyingKey", - ), - ( - "src/contracts/generated/snark_verifier.rs", - "Verifier", - "SnarkVerifier", - ), - ( - "src/contracts/generated/grandsum_verifier.rs", - "GrandSumVerifier", - "GrandSumVerifier", - ), - ( - "src/contracts/generated/inclusion_verifier.rs", - "InclusionVerifier", - "InclusionVerifier", - ), - ]; - - let mut submodule_names = Vec::new(); - for (out_path, contract_name, abi_source) in contracts.iter() { - if let Some(submodule_name) = - generate_rust_contract_interface(out_path, contract_name, abi_source) - { - submodule_names.push(submodule_name); - } - } - - let mod_out_file: PathBuf = std::env::current_dir() - .unwrap() - .join("src/contracts/generated/mod.rs"); - if mod_out_file.exists() { - std::fs::remove_file(&mod_out_file).unwrap(); - } - - let mut mod_file = OpenOptions::new() - .write(true) - .create(true) - .open(mod_out_file) - .unwrap(); - - let final_content = submodule_names - .iter() - .map(|name| format!("pub mod {};", name)) - .collect::>() - .join("\n"); - - mod_file.write_all(final_content.as_bytes()).unwrap(); -} - -fn generate_rust_contract_interface<'a>( - out_path: &'a str, - contract_name: &str, - abi_source: &str, -) -> Option<&'a str> { - let contract_out_file = std::env::current_dir().unwrap().join(out_path); - if contract_out_file.exists() { - std::fs::remove_file(&contract_out_file).unwrap(); - } - - Abigen::new( - contract_name, - format!("./src/contracts/abi/{}.json", abi_source), - ) - .unwrap() - .format(true) - .generate() - .unwrap() - .write_to_file(contract_out_file) - .unwrap(); - - let submodule_name = out_path - .rsplit('/') // Split the string from the right at each / - .next() // Take the substring right after the last / - .and_then(|s| s.split('.').next()); // Take the substring before the first . (from the right) - - submodule_name -} diff --git a/backend/examples/summa_solvency_flow.rs b/backend/examples/summa_solvency_flow.rs index 953a040d..9280f79c 100644 --- a/backend/examples/summa_solvency_flow.rs +++ b/backend/examples/summa_solvency_flow.rs @@ -1,26 +1,29 @@ #![feature(generic_const_exprs)] -use std::{error::Error, fs::File, io::BufReader, io::Write}; +use std::{fs::File, io::Write}; -use ethers::types::U256; -use halo2_proofs::halo2curves::bn256::Fr as Fp; -use serde_json::{from_reader, to_string_pretty}; +use serde_json::to_string_pretty; -use summa_backend::{ - apis::{ - address_ownership::AddressOwnership, - round::{KZGProof, Round}, +use plonkish_backend::{ + backend::{ + hyperplonk::{HyperPlonk, HyperPlonkVerifierParam}, + PlonkishBackend, PlonkishCircuit, }, - contracts::signer::{AddressInput, SummaSigner}, - tests::initialize_test_env, -}; -use summa_solvency::{ - circuits::{ - univariate_grand_sum::{UnivariateGrandSum, UnivariateGrandSumConfig}, - utils::{full_prover, generate_setup_artifacts}, + frontend::halo2::Halo2Circuit, + halo2_curves::bn256::{Bn256, Fr as Fp}, + pcs::{multilinear::MultilinearKzg, Evaluation, PolynomialCommitmentScheme}, + util::{ + test::seeded_std_rng, + transcript::{FieldTranscriptRead, InMemoryTranscript, Keccak256Transcript}, }, - cryptocurrency::Cryptocurrency, - entry::Entry, - utils::parse_csv_to_entries, +}; + +use summa_backend::{ + apis::round::{KZGProof, Round}, + load_from_file, save_to_file, +}; +use summa_hyperplonk::{ + circuits::summa_circuit::summa_hyperplonk::SummaHyperplonk, cryptocurrency::Cryptocurrency, + entry::Entry, utils::parse_csv_to_entries, }; const K: u32 = 17; @@ -28,144 +31,133 @@ const N_CURRENCIES: usize = 2; const N_USERS: usize = 16; const USER_INDEX: usize = 0; -#[tokio::main] -async fn main() -> Result<(), Box> { - // Initialize test environment without `address_ownership` instance from `initialize_test_env` function. - let (anvil, _, _, _, summa_contract) = initialize_test_env(None).await; - - // 1. Submit ownership proof - // - // The signer instance would be shared with `address_ownership` and `round` instances - // - // Using `AddressInput::Address`` to directly provide the summa_contract's address. - // - // If the address of a deployed contract is stored in a configuration file, - // you can use `AddressInput::Path` to provide the path to that file. - // - // For example, if the contract address is in "backend/src/contracts/deployments.json" located - // you would use `AddressInput::Path` as follows:`AddressInput::Path("backend/src/contracts/deployments.json".to_string())`. - // - let signer = SummaSigner::new( - "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - anvil.endpoint().as_str(), - AddressInput::Address(summa_contract.address()), - ) - .await?; - - // Each CEX prepares its own `signature` CSV file. - let signature_csv_path = "../csv/signatures.csv"; - let mut address_ownership_client = AddressOwnership::new(&signer, signature_csv_path).unwrap(); - - // Dispatch the proof of address ownership. - // the `dispatch_proof_of_address_ownership` function sends a transaction to the Summa contract. - address_ownership_client - .dispatch_proof_of_address_ownership() - .await?; - - println!("1. Ownership proofs are submitted successfully!"); +fn main() { + type ProvingBackend = HyperPlonk>; - // 2. Submit Commitment + // 1. Generate Commitment // - // Initialize the `Round` instance to submit the liability commitment. + // Initialize the `Round` instance to generate the commitment and verifier parameters. let entry_csv = "../csv/entry_16.csv"; let mut entries: Vec> = vec![Entry::init_empty(); N_USERS]; let mut cryptos = vec![Cryptocurrency::init_empty(); N_CURRENCIES]; parse_csv_to_entries::<&str, N_CURRENCIES>(entry_csv, &mut entries, &mut cryptos).unwrap(); - let univariate_grand_sum_circuit = UnivariateGrandSum::< - N_USERS, - N_CURRENCIES, - UnivariateGrandSumConfig, - >::init(entries.to_vec()); - - // This ptau file is also utilized in the generation of the verifier contract. - // It corresponds to the same file used in the `gen_verifier.rs` script. - let params_path = "../backend/ptau/hermez-raw-17"; - let (params, pk, vk) = - generate_setup_artifacts(K, Some(params_path), &univariate_grand_sum_circuit).unwrap(); - - // Create a proof - let instances = vec![Fp::zero(); 1]; // This instance is necessary to verify proof on solidity verifier. - let (zk_snark_proof, advice_polys, _) = full_prover( - ¶ms, - &pk, - univariate_grand_sum_circuit.clone(), - &[instances.clone()], - ); + let circuit = SummaHyperplonk::::init(entries.to_vec()); + let num_vars = K; + + let circuit_fn = |num_vars| { + let circuit = Halo2Circuit::>::new::< + ProvingBackend, + >(num_vars, circuit.clone()); + (circuit.circuit_info().unwrap(), circuit) + }; + + let (circuit_info, circuit) = circuit_fn(num_vars as usize); + let instances = circuit.instances(); + + let param = ProvingBackend::setup_custom("../backend/ptau/hermez-raw-plonkish-17").unwrap(); + let (pp, vp) = ProvingBackend::preprocess(¶m, &circuit_info).unwrap(); + + let (advice_polys, proof_transcript) = { + let mut proof_transcript = Keccak256Transcript::new(()); + + let advice_polys = + ProvingBackend::prove(&pp, &circuit, &mut proof_transcript, seeded_std_rng()).unwrap(); + (advice_polys, proof_transcript) + }; + + let zk_snark_proof = proof_transcript.into_proof(); + + // Simple check of the proof before initializing the `Round` instance. + let mut transcript; + let result: Result<(), plonkish_backend::Error> = { + transcript = Keccak256Transcript::from_proof((), zk_snark_proof.as_slice()); + ProvingBackend::verify(&vp, instances, &mut transcript, seeded_std_rng()) + }; + assert_eq!(result, Ok(())); - // Using the `round` instance, the commitment is dispatched to the Summa contract with the `dispatch_commitment` method. - let timestamp = 1u64; + // Using the `round` instance, the custodian can get commitment proof and verifier params. + let snapshot_time = 1u64; let mut round = Round::::new( - &signer, - zk_snark_proof, + zk_snark_proof.clone(), advice_polys, - params, - vk, - timestamp, + pp, + vp.clone(), + snapshot_time, ); - // Sends the commitment, which should ideally complete without errors. - round.dispatch_commitment().await?; + // The commitment and verifier parameters should be publicly available to all users. + let (zk_proof, vp) = round.gen_commitment_and_vp().unwrap(); - println!("2. Commitment is submitted successfully!"); + let vp_filename = "verifier_params.json"; + let _ = save_to_file::<_, HyperPlonkVerifierParam>>(vp_filename, &vp); - // 3. Generate Inclusion Proof + let commitment_proof_filename = "commitment_proof.json"; + let _ = save_to_file::<_, KZGProof>(commitment_proof_filename, &zk_proof); + + println!("1. Commitment and Verifier Parameters successfully Exported!"); + + // 2. Generate Inclusion Proof // - // Generate and export the inclusion proof for the specified user to a JSON file. + // Generate then export the inclusion proof for the specified user to a JSON file. let inclusion_proof = round.get_proof_of_inclusion(USER_INDEX).unwrap(); - let filename = format!("user_{}_proof.json", USER_INDEX); - let mut file = File::create(filename.clone()).expect("Unable to create file"); + let proof_filename = format!("user_{}_proof.json", USER_INDEX); + let mut file = File::create(proof_filename.clone()).expect("Unable to create inclusion file"); let output = to_string_pretty(&inclusion_proof).unwrap(); file.write_all(output.as_bytes()) - .expect("Failed to write JSON to file"); + .expect("Failed to write inclusion proof to a JSON file"); + + let _ = save_to_file("user_proof.json", &inclusion_proof); println!( - "3. Exported proof to user #{}, as `{}`", - USER_INDEX, filename + "2. Exported proof to user #{}, as `{}`, with verifier params `{}`", + USER_INDEX, proof_filename, vp_filename ); - // 4. Verify Inclusion Proof + // 3. Verify Inclusion Proof // - // The `snapshot_time` denotes the specific moment when entries were created for polynomal interpolation. - // This timestamp is established during the initialization of the Round instance. - let snapshot_time = U256::from(timestamp); + // Load the commitment and verifier parameters from the files + let commitment: KZGProof = load_from_file(commitment_proof_filename).unwrap(); + let verifier_params: HyperPlonkVerifierParam> = + load_from_file(vp_filename).unwrap(); // When verifying the inclusion proof from the user's perspective, the user have to fetch `proof`. - // Assume that the `proof` file has been downloaded from the CEX. - let proof_file = File::open(format!("user_{}_proof.json", USER_INDEX))?; - let reader = BufReader::new(proof_file); - - let downloaded_inclusion_proof: KZGProof = from_reader(reader)?; - - // Fetch commitment data from the contract with timestamp, `snapshot_time`. - let commitment = summa_contract.commitments(snapshot_time).call().await?; - - // Ensure the length of the commitment matches the expected size for the number of points. - assert_eq!(commitment.to_vec().len(), 0x40 * (N_CURRENCIES + 1)); - - // Validate the inclusion proof using the contract verifier. - let mut verification_result = false; - - if let Some(challenges) = downloaded_inclusion_proof.get_challenge().as_ref() { - verification_result = summa_contract - .verify_inclusion_proof( - snapshot_time, - inclusion_proof.get_proof().clone(), - challenges.clone(), - inclusion_proof.get_input_values().clone(), - ) - .await?; - } else { - eprintln!("No challenges found in the proof, This may not a inclusion proof"); + // Assume that the `proof` file has been downloaded from the CEX along with commitment and verifier parameters. + let proof: KZGProof = load_from_file(format!("user_{}_proof.json", USER_INDEX)) + .expect("Failed to load proof from JSON file"); + + // Load commitment from the commitment file + let mut transcript = Keccak256Transcript::from_proof((), commitment.get_proof().as_slice()); + let user_entry_commitments = MultilinearKzg::::read_commitments( + &verifier_params.pcs, + N_CURRENCIES + 1, + &mut transcript, + ) + .unwrap(); + + let mut kzg_transcript = Keccak256Transcript::from_proof((), proof.get_proof().as_slice()); + let mut multivariate_challenge: Vec = Vec::new(); + for _ in 0..num_vars { + multivariate_challenge.push(kzg_transcript.read_field_element().unwrap()); } + let input_values = proof.get_input_values(); + let evals: Vec> = (0..N_CURRENCIES + 1) + .map(|i| Evaluation::new(i, 0, input_values[i])) + .collect(); + + MultilinearKzg::::batch_verify( + &verifier_params.pcs, + &user_entry_commitments, + &[multivariate_challenge.clone()], + &evals, + &mut kzg_transcript, + ) + .unwrap(); + println!( - "4. Verifying the proof on contract veirifer for User #{}: {}", - USER_INDEX, verification_result + "3. Verified the proof with veirifer parameters for User #{}", + USER_INDEX ); - - // Wrapping up - drop(anvil); - Ok(()) } diff --git a/backend/ptau/hermez-raw-11 b/backend/ptau/hermez-raw-11 deleted file mode 100644 index 2205b729..00000000 Binary files a/backend/ptau/hermez-raw-11 and /dev/null differ diff --git a/backend/ptau/hermez-raw-17 b/backend/ptau/hermez-raw-plonkish-17 similarity index 65% rename from backend/ptau/hermez-raw-17 rename to backend/ptau/hermez-raw-plonkish-17 index 8dc765eb..10f25272 100644 Binary files a/backend/ptau/hermez-raw-17 and b/backend/ptau/hermez-raw-plonkish-17 differ diff --git a/backend/scripts/update_verifier_contract.sh b/backend/scripts/update_verifier_contract.sh deleted file mode 100755 index 91a70a93..00000000 --- a/backend/scripts/update_verifier_contract.sh +++ /dev/null @@ -1,23 +0,0 @@ -#!/bin/bash -set -e - -# Build the verifier contract -echo "1. Building verifier contracts" -cd ../prover -cargo run --release --bin generate_verifier - -# Generate Commitment and Proofs for Encoded Polynomials -echo "2. Generate Commitment and Proofs for Encoded Polynomials" -cd ../prover -cargo run --release --bin generate_commitment_and_proofs - -# Deploy contracts to local environment -echo "3. Deploying contracts to local environment" -cd ../contracts -npm install -npx hardhat run scripts/deploy.ts - -# Generate interface files for Backend -echo "4. Generating interface files for Backend" -cd ../backend -cargo build diff --git a/backend/src/apis/address_ownership.rs b/backend/src/apis/address_ownership.rs deleted file mode 100644 index 42a405d1..00000000 --- a/backend/src/apis/address_ownership.rs +++ /dev/null @@ -1,38 +0,0 @@ -use crate::contracts::{generated::summa_contract::AddressOwnershipProof, signer::SummaSigner}; -use std::{error::Error, result::Result}; - -use super::csv_parser::parse_signature_csv; - -pub struct AddressOwnership<'a> { - address_ownership_proofs: Vec, - signer: &'a SummaSigner, -} - -impl AddressOwnership<'_> { - pub fn new<'a>( - signer: &'a SummaSigner, - signature_csv_path: &str, - ) -> Result, Box> { - let address_ownership_proofs = parse_signature_csv(signature_csv_path)?; - - Ok(AddressOwnership { - address_ownership_proofs, - signer, - }) - } - - pub fn get_ownership_proofs(&self) -> &Vec { - &self.address_ownership_proofs - } - - // This function dispatches the proof of address ownership. Before calling this function, - // ensure externally that the provided `addresses` in `address_ownership_proof` are not already registered - // on the Summa contract. - pub async fn dispatch_proof_of_address_ownership(&mut self) -> Result<(), Box> { - self.signer - .submit_proof_of_address_ownership(self.address_ownership_proofs.clone()) - .await?; - - Ok(()) - } -} diff --git a/backend/src/apis/csv_parser.rs b/backend/src/apis/csv_parser.rs deleted file mode 100644 index 672fd14d..00000000 --- a/backend/src/apis/csv_parser.rs +++ /dev/null @@ -1,68 +0,0 @@ -use std::{error::Error, fs::File, path::Path}; - -use ethers::{abi::AbiEncode, types::Bytes}; -use serde::{Deserialize, Serialize}; - -use crate::contracts::generated::summa_contract::AddressOwnershipProof; - -#[derive(Debug, Deserialize, Serialize)] -pub struct SignatureRecord { - chain: String, - address: String, - signature: String, - message: String, -} - -impl SignatureRecord { - pub fn new(chain: String, address: String, signature: String, message: String) -> Self { - Self { - chain, - address, - signature, - message, - } - } -} - -pub fn parse_signature_csv>( - path: P, -) -> Result, Box> { - let file = File::open(path)?; - let mut rdr = csv::ReaderBuilder::new().delimiter(b';').from_reader(file); - - let mut address_ownership_proofs = Vec::::new(); - - for result in rdr.deserialize() { - let record: SignatureRecord = result?; - - address_ownership_proofs.push(AddressOwnershipProof { - cex_address: record.address.to_string(), - chain: record.chain.to_string(), - signature: record.signature.parse()?, - message: Bytes::from(record.message.encode()), - }); - } - - Ok(address_ownership_proofs) -} - -#[cfg(test)] -mod tests { - use super::*; - - #[test] - fn test_parse_csv_to_signature() { - let path = "../csv/signatures.csv"; - let address_ownership = parse_signature_csv(path).unwrap(); - - let first_address_ownership = AddressOwnershipProof { - chain: "ETH".to_string(), - cex_address: "0x70997970C51812dc3A010C7d01b50e0d17dc79C8".to_string(), - signature: - ("0x089b32327d332c295dc3b8873c205b72153211de6dc1c51235782b091cefb9d06d6df2661b86a7d441cd322f125b84901486b150e684221a7b7636eb8182af551b").parse().unwrap(), - message: "Summa proof of solvency for CryptoExchange".encode().into(), - }; - - assert_eq!(address_ownership[0], first_address_ownership); - } -} diff --git a/backend/src/apis/mod.rs b/backend/src/apis/mod.rs index 82fca001..1449dc2f 100644 --- a/backend/src/apis/mod.rs +++ b/backend/src/apis/mod.rs @@ -1,3 +1 @@ -pub mod address_ownership; -pub mod csv_parser; pub mod round; diff --git a/backend/src/apis/round.rs b/backend/src/apis/round.rs index da1b0d34..4afcb04f 100644 --- a/backend/src/apis/round.rs +++ b/backend/src/apis/round.rs @@ -1,42 +1,36 @@ -use ethers::types::{Bytes, U256}; -use halo2_proofs::{ - arithmetic::{best_fft, Field}, - halo2curves::{ - bn256::{Bn256, Fr as Fp, G1Affine, G2Affine}, - group::{cofactor::CofactorCurveAffine, Curve}, +use plonkish_backend::{ + backend::hyperplonk::{HyperPlonkProverParam, HyperPlonkVerifierParam}, + halo2_curves::bn256::{Bn256, Fr as Fp}, + pcs::{multilinear::MultilinearKzg, Evaluation, PolynomialCommitmentScheme}, + poly::multilinear::MultilinearPolynomial, + util::{ + transcript::{FieldTranscriptWrite, InMemoryTranscript, Keccak256Transcript}, + Itertools, }, - plonk::{AdviceSingle, VerifyingKey}, - poly::{ - kzg::commitment::{KZGCommitmentScheme, ParamsKZG}, - Coeff, - }, - transcript::TranscriptRead, }; -use halo2_solidity_verifier::Keccak256Transcript; + use serde::{Deserialize, Serialize}; use std::error::Error; +use summa_hyperplonk::utils::uni_to_multivar_binary_index; -use crate::contracts::signer::SummaSigner; -use summa_solvency::utils::amortized_kzg::{create_naive_kzg_proof, verify_kzg_proof}; - -#[derive(Debug, Clone, Serialize, Deserialize)] +#[derive(Debug, PartialEq, Eq, Clone, Serialize, Deserialize)] pub struct KZGProof { - proof_calldata: Bytes, - input_values: Vec, - challenge_s_g2: Option>, + proof: Vec, + input_values: Vec, + challenge: Option>, } impl KZGProof { - pub fn get_input_values(&self) -> &Vec { + pub fn get_input_values(&self) -> &Vec { &self.input_values } - pub fn get_proof(&self) -> &Bytes { - &self.proof_calldata + pub fn get_proof(&self) -> &Vec { + &self.proof } - pub fn get_challenge(&self) -> &Option> { - &self.challenge_s_g2 + pub fn get_challenge(&self) -> &Option> { + &self.challenge } } @@ -54,35 +48,31 @@ impl KZGProof { /// * `timestamp`: A Unix timestamp marking the initiation of this round. It serves as a temporal reference point /// for the operations carried out in this phase of the protocol. /// * `snapshot`: A `Snapshot` struct capturing the round's state, including user identities and balances. -/// * `signer`: A reference to a `SummaSigner`, the entity responsible for signing transactions with the Summa contract in this round. /// -pub struct Round<'a, const N_CURRENCIES: usize, const N_USERS: usize> { +pub struct Round { timestamp: u64, snapshot: Snapshot, - signer: &'a SummaSigner, } -impl Round<'_, N_CURRENCIES, N_USERS> +impl Round where [usize; N_CURRENCIES + 1]: Sized, { pub fn new( - signer: &SummaSigner, zk_snark_proof: Vec, - advice_polys: AdviceSingle, - params: ParamsKZG, - verifying_key: VerifyingKey, + advice_polys: Vec>, + prover_params: HyperPlonkProverParam>, + verifier_params: HyperPlonkVerifierParam>, timestamp: u64, - ) -> Round<'_, N_CURRENCIES, N_USERS> { + ) -> Round { Round { timestamp, snapshot: Snapshot::::new( zk_snark_proof, advice_polys, - params, - verifying_key, + prover_params, + verifier_params, ), - signer, } } @@ -90,16 +80,15 @@ where self.timestamp } - pub async fn dispatch_commitment(&mut self) -> Result<(), Box> { + /// This method returns the commitment proof and verification parameters for verifying proofs. + /// Both the commitment and verification parameters should be posted publicly. + #[allow(clippy::complexity)] + pub fn gen_commitment_and_vp( + &mut self, + ) -> Result<(KZGProof, HyperPlonkVerifierParam>), Box> + { let grand_sum_proof = self.snapshot.generate_grand_sum_proof().unwrap(); - let submit_tx = self.signer.submit_commitment( - Bytes::from(self.snapshot.zk_snark_proof.clone()), - grand_sum_proof.proof_calldata, - grand_sum_proof.input_values, - self.timestamp.into(), - ); - - submit_tx.await + Ok((grand_sum_proof, self.snapshot.verifier_params.clone())) } pub fn get_proof_of_inclusion(&self, user_index: usize) -> Result { @@ -111,16 +100,16 @@ where /// /// # Fields /// -/// * `zk_snark_proof`: The zk-SNARK proof for the round, which is used to verify the validity of the round's commitments. +/// * `zk_snark_proof`: The zk-SNARK proof for the round, which is used to verify the validity of the round's commitment. /// * `advice_polys`: Composed of the unblinded advice polynomial, `advice_poly`, and the polynomials of blind factors, `advice_blind`. -/// * `params`: The parameters for the KZG commitment scheme. -/// * `verifying_key`: The verifying key for getting domains, which is used for generating inclusion proofs. +/// * `prover_params`: The parameters for generating KZG proofs, which are commitment and inclusions. +/// * `verifier_params`: The verifying params for verifying inclusion proofs. /// pub struct Snapshot { zk_snark_proof: Vec, - advice_polys: AdviceSingle, - params: ParamsKZG, - verifying_key: VerifyingKey, + advice_polys: Vec>, + prover_params: HyperPlonkProverParam>, + verifier_params: HyperPlonkVerifierParam>, } impl Snapshot @@ -129,121 +118,85 @@ where { pub fn new( zk_snark_proof: Vec, - advice_polys: AdviceSingle, - params: ParamsKZG, - verifying_key: VerifyingKey, + advice_polys: Vec>, + prover_params: HyperPlonkProverParam>, + verifier_params: HyperPlonkVerifierParam>, ) -> Self { Snapshot { zk_snark_proof, advice_polys, - params, - verifying_key, + prover_params, + verifier_params, } } pub fn generate_grand_sum_proof(&self) -> Result { - let challenge = Fp::zero(); - let (proof_calldata, input_values) = self.generate_kzg_proof(None, challenge).unwrap(); + let mut input_values = vec![Fp::zero(); N_CURRENCIES + 1]; + + // First input values as instance would be zero like Summa V2 + for i in 1..N_CURRENCIES + 1 { + let poly = self.advice_polys.get(i).unwrap(); + input_values[i] = poly.evals().iter().fold(Fp::zero(), |acc, x| acc + x); + } Ok(KZGProof { - proof_calldata, + proof: self.zk_snark_proof.clone(), input_values, - challenge_s_g2: None, + challenge: None, }) } pub fn generate_proof_of_inclusion(&self, user_index: usize) -> Result { - let omega = self.verifying_key.get_domain().get_omega(); - let challenge = omega.pow_vartime([user_index as u64]); - let (proof_calldata, input_values) = self - .generate_kzg_proof(Some(user_index), challenge) - .unwrap(); - - // Prepare S_G2 points with the challenge for proof verification on the KZG Solidity verifier. - let s_g2 = -self.params.s_g2() + (G2Affine::generator() * challenge); - let s_g2_affine = s_g2.to_affine(); - - let s_g2_point = vec![ - U256::from_little_endian(s_g2_affine.x.c1.to_bytes().as_slice()), - U256::from_little_endian(s_g2_affine.x.c0.to_bytes().as_slice()), - U256::from_little_endian(s_g2_affine.y.c1.to_bytes().as_slice()), - U256::from_little_endian(s_g2_affine.y.c0.to_bytes().as_slice()), - ]; + let num_vars = self.prover_params.pcs.num_vars(); + let multivariate_challenge: Vec = uni_to_multivar_binary_index(&user_index, num_vars); - Ok(KZGProof { - proof_calldata, - input_values, - challenge_s_g2: Some(s_g2_point), - }) - } + let mut kzg_transcript = Keccak256Transcript::new(()); - fn generate_kzg_proof( - &self, - user_index: Option, - challenge: Fp, - ) -> Result<(Bytes, Vec), &'static str> { - let domain = self.verifying_key.get_domain(); - let omega = domain.get_omega(); - - let mut opening_proofs = Vec::new(); - let mut input_values = Vec::new(); - - // Evaluate the commitments from the SNARK proof - let mut kzg_commitments = Vec::with_capacity(N_CURRENCIES); - let mut transcript = Keccak256Transcript::new(self.zk_snark_proof.as_slice()); - for _ in 0..(N_CURRENCIES + 1) { - let point: G1Affine = transcript.read_point().unwrap(); - kzg_commitments.push(point); - } + let mut transcript = Keccak256Transcript::from_proof((), self.zk_snark_proof.as_slice()); + + let num_points = N_CURRENCIES + 1; + let user_entry_commitments = MultilinearKzg::::read_commitments( + &self.verifier_params.pcs, + num_points, + &mut transcript, + ) + .unwrap(); + + let user_entry_polynomials = self + .advice_polys + .iter() + .take(num_points) + .collect::>(); - // If the user index is None, assign 1 or else 0, for skipping the usename polynomial. - let start_index = user_index.map_or(1, |_| 0); - - for column_index in start_index..N_CURRENCIES + 1 { - let f_poly = self.advice_polys.advice_polys.get(column_index).unwrap(); - - // Perform iDFT to obtain the actual value that is encoded in the polynomial. - let mut vec_f_poly = f_poly.to_vec(); - best_fft(&mut vec_f_poly, omega, f_poly.len().trailing_zeros()); - - let z = if let Some(user_index) = user_index { - let _z = vec_f_poly[user_index]; - input_values.push(U256::from_little_endian(&_z.to_bytes())); - _z - } else { - let total_balance: Fp = vec_f_poly.iter().sum(); - input_values.push(U256::from_little_endian(&total_balance.to_bytes())); - total_balance * Fp::from(f_poly.len() as u64).invert().unwrap() - }; - - let kzg_proof = create_naive_kzg_proof::>( - &self.params, - domain, - f_poly, - challenge, - z, - ); - - if !verify_kzg_proof( - &self.params, - kzg_commitments[column_index].to_curve(), - kzg_proof, - &challenge, - &z, - ) { - return Err("KZG proof verification failed"); - } - - // Convert the KZG proof to an affine point and serialize it to bytes. - let kzg_proof_affine = kzg_proof.to_affine(); - let mut kzg_proof_affine_x = kzg_proof_affine.x.to_bytes(); - let mut kzg_proof_affine_y = kzg_proof_affine.y.to_bytes(); - kzg_proof_affine_x.reverse(); - kzg_proof_affine_y.reverse(); - - opening_proofs.push([kzg_proof_affine_x, kzg_proof_affine_y].concat()); + for binary_var in multivariate_challenge.iter() { + kzg_transcript.write_field_element(binary_var).unwrap(); } - Ok((Bytes::from(opening_proofs.concat()), input_values)) + let evals = user_entry_polynomials + .iter() + .enumerate() + .map(|(poly_idx, poly)| { + Evaluation::new(poly_idx, 0, poly.evaluate(&multivariate_challenge)) + }) + .collect_vec(); + + MultilinearKzg::::batch_open( + &self.prover_params.pcs, + user_entry_polynomials, + &user_entry_commitments, + &[multivariate_challenge.clone()], + &evals, + &mut kzg_transcript, + ) + .unwrap(); + + let proof = kzg_transcript.into_proof(); + let input_values = evals.iter().map(|eval| *eval.value()).collect::>(); + + Ok(KZGProof { + proof, + input_values, + challenge: Some(multivariate_challenge), + }) } } diff --git a/backend/src/lib.rs b/backend/src/lib.rs index 6c363179..44735d8d 100644 --- a/backend/src/lib.rs +++ b/backend/src/lib.rs @@ -1,4 +1,28 @@ #![feature(generic_const_exprs)] pub mod apis; -pub mod contracts; pub mod tests; + +use serde::{Deserialize, Serialize}; +use std::{ + error::Error, + fs::File, + io::{Read, Write}, + path::Path, +}; + +pub fn save_to_file, T: Serialize>(path: P, data: &T) -> Result<(), Box> { + let serialized_data = serde_json::to_string(data)?; + let mut file = std::fs::File::create(path)?; + file.write_all(serialized_data.as_bytes())?; + Ok(()) +} + +pub fn load_from_file, T: for<'de> Deserialize<'de>>( + path: P, +) -> Result> { + let mut file = File::open(path)?; + let mut data = String::new(); + file.read_to_string(&mut data)?; + let deserialized_data = serde_json::from_str(&data)?; + Ok(deserialized_data) +} diff --git a/backend/src/tests.rs b/backend/src/tests.rs index 7e61fe64..bdc62f75 100644 --- a/backend/src/tests.rs +++ b/backend/src/tests.rs @@ -1,367 +1,96 @@ -use std::{sync::Arc, time::Duration}; - -use ethers::{ - abi::Token, - prelude::SignerMiddleware, - providers::{Http, Middleware, Provider}, - signers::{LocalWallet, Signer}, - types::{H160, U256}, - utils::{Anvil, AnvilInstance}, -}; -use tokio::time; - -use crate::contracts::generated::{ - grandsum_verifier::GrandSumVerifier, inclusion_verifier::InclusionVerifier, - snark_verifier::Verifier as SnarkVerifier, summa_contract::Summa, - verifying_key::Halo2VerifyingKey as VerifyingKey, -}; - -// Setup test environment on the Anvil instance. -pub async fn initialize_test_env( - block_time: Option, -) -> ( - AnvilInstance, - H160, - H160, - Arc, LocalWallet>>, - Summa, LocalWallet>>, -) { - // Initiate Anvil by assigning a block time or enabling instant mining. - let anvil = match block_time { - Some(interval) => Anvil::new() - .mnemonic("test test test test test test test test test test test junk") - .block_time(interval) - .spawn(), - None => Anvil::new() - .mnemonic("test test test test test test test test test test test junk") - .spawn(), - }; - - // Extracting two exchange addresses from the Anvil instance. - let cex_addr_1 = anvil.addresses()[1]; - let cex_addr_2 = anvil.addresses()[2]; - - // Setup wallet using the first key in the Anvil and an HTTP provider with a 10 ms interval from the Anvil endpoint. - let wallet: LocalWallet = anvil.keys()[0].clone().into(); - let provider = Provider::::try_from(anvil.endpoint()) - .unwrap() - .interval(Duration::from_millis(10u64)); - - // Create a client by wrapping the provider with a signing middleware and the Anvil chain ID. - let client = Arc::new(SignerMiddleware::new( - provider, - wallet.with_chain_id(anvil.chain_id()), - )); - - // Send RPC requests using the `anvil_setBalance`` method via the provider to set the ETH balance for `cex_addr_1`` and `cex_addr_2`. - for addr in [cex_addr_1, cex_addr_2].iter().copied() { - let _res = client - .provider() - .request::<(H160, U256), ()>("anvil_setBalance", (addr, U256::from(278432))) - .await; - } - - // Deploy a Verifying Key and Verifier contracts. - if block_time.is_some() { - time::sleep(Duration::from_secs(block_time.unwrap())).await; - }; - - let verifying_key_contract = VerifyingKey::deploy(Arc::clone(&client), ()) - .unwrap() - .send() - .await - .unwrap(); - - let snark_verifier_contract = SnarkVerifier::deploy(Arc::clone(&client), ()) - .unwrap() - .send() - .await - .unwrap(); - - let grand_sum_verifier = GrandSumVerifier::deploy(Arc::clone(&client), ()) - .unwrap() - .send() - .await - .unwrap(); - - let inclusion_verifier_contract = InclusionVerifier::deploy(Arc::clone(&client), ()) - .unwrap() - .send() - .await - .unwrap(); - - // The number of bytes used to represent the balance of a cryptocurrency in polynomials. - let balance_byte_range = 8; - - let args: &[Token] = &[ - Token::Address(verifying_key_contract.address()), - Token::Address(snark_verifier_contract.address()), - Token::Address(grand_sum_verifier.address()), - Token::Address(inclusion_verifier_contract.address()), - // TOCO: check cryptocurrency names - Token::Array([Token::String("ETH".into()), Token::String("USDT".into())].to_vec()), - Token::Array([Token::String("ETH".into()), Token::String("ETH".into())].to_vec()), - Token::Uint(balance_byte_range.into()), - ]; - - // Deploy Summa contract. - let summa_contract = Summa::deploy(Arc::clone(&client), args) - .unwrap() - .send() - .await - .unwrap(); - - time::sleep(Duration::from_secs(3)).await; - - (anvil, cex_addr_1, cex_addr_2, client, summa_contract) -} - #[cfg(test)] mod test { - use ethers::{ - abi::AbiEncode, - providers::{Http, Middleware, Provider}, - types::{U256, U64}, - utils::to_checksum, - }; - use halo2_proofs::halo2curves::bn256::Fr as Fp; use rand::{rngs::OsRng, Rng}; - use std::{convert::TryFrom, error::Error}; - use tokio::{ - join, - time::{sleep, Duration}, - }; - use crate::apis::{address_ownership::AddressOwnership, round::Round}; - use crate::contracts::{ - generated::summa_contract::{AddressOwnershipProof, AddressOwnershipProofSubmittedFilter}, - signer::{AddressInput, SummaSigner}, - }; - use crate::tests::initialize_test_env; - use summa_solvency::{ - circuits::{ - univariate_grand_sum::{UnivariateGrandSum, UnivariateGrandSumConfig}, - utils::{full_prover, full_verifier, generate_setup_artifacts}, + use plonkish_backend::{ + backend::{hyperplonk::HyperPlonk, PlonkishBackend, PlonkishCircuit}, + frontend::halo2::Halo2Circuit, + halo2_curves::bn256::{Bn256, Fr as Fp}, + pcs::{multilinear::MultilinearKzg, Evaluation, PolynomialCommitmentScheme}, + util::{ + test::seeded_std_rng, + transcript::{FieldTranscriptRead, InMemoryTranscript, Keccak256Transcript}, }, - cryptocurrency::Cryptocurrency, - entry::Entry, - utils::parse_csv_to_entries, + }; + + use crate::apis::round::Round; + use summa_hyperplonk::{ + circuits::summa_circuit::summa_hyperplonk::SummaHyperplonk, + utils::{big_uint_to_fp, generate_dummy_entries}, }; const K: u32 = 17; const N_CURRENCIES: usize = 2; const N_USERS: usize = 16; - const PARAMS_PATH: &str = "../backend/ptau/hermez-raw-17"; - - #[tokio::test] - async fn test_deployed_address() -> Result<(), Box> { - let (anvil, _, _, _, summa_contract) = initialize_test_env(None).await; - - // Hardhat development environment, usually updates the address of a deployed contract in the `artifacts` directory. - // However, in our custom deployment script, `contracts/scripts/deploy.ts`, the address is updated in `backend/src/contracts/deployments.json`. - let contract_address = summa_contract.address(); - - let signer = SummaSigner::new( - "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - anvil.endpoint().as_str(), - AddressInput::Path("./src/contracts/deployments.json".into()), // This file contains the address of the deployed contract. - ) - .await?; - - assert_eq!(contract_address, signer.get_summa_address()); - - Ok(()) - } - - #[tokio::test] - async fn test_concurrent_sumbit_commitments() -> Result<(), Box> { - let (anvil, _, _, _, summa_contract) = initialize_test_env(Some(1)).await; - - // This test ensures that dispatching two commitments concurrently does not result in nonce collisions. - // It checks that both commitments are processed and mined, indicating there is no interference when they are submitted simultaneously. - let signer = SummaSigner::new( - "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - anvil.endpoint().as_str(), - AddressInput::Address(summa_contract.address()), - ) - .await?; - - let entry_csv = "../csv/entry_16.csv"; - let mut entries: Vec> = vec![Entry::init_empty(); N_USERS]; - let mut cryptos = vec![Cryptocurrency::init_empty(); N_CURRENCIES]; - parse_csv_to_entries::<&str, N_CURRENCIES>(entry_csv, &mut entries, &mut cryptos).unwrap(); + const PARAMS_PATH: &str = "../backend/ptau/hermez-raw-plonkish-17"; - let univariate_grand_sum_circuit = UnivariateGrandSum::< - N_USERS, - N_CURRENCIES, - UnivariateGrandSumConfig, - >::init(entries.to_vec()); - - let (params, pk, vk) = - generate_setup_artifacts(K, Some(PARAMS_PATH), &univariate_grand_sum_circuit).unwrap(); - - // Create a proof - let instances = vec![Fp::zero(); 1]; // This instance is necessary to verify proof on solidity verifier. - let (zk_snark_proof, advice_polys, _omega) = full_prover( - ¶ms, - &pk, - univariate_grand_sum_circuit.clone(), - &[instances.clone()], - ); - - let mut round_one = Round::::new( - &signer, - zk_snark_proof.clone(), - advice_polys.clone(), - params.clone(), - vk.clone(), - 1, - ); - let mut round_two = Round::::new( - &signer, - zk_snark_proof, - advice_polys, - params, - vk, - 2, - ); - - // Check the block number before sending the transaction for liability commitment. - let outer_provider: Provider = Provider::try_from(anvil.endpoint().as_str())?; - let start_block_number = outer_provider.get_block_number().await?; - - // Send two commitments simultaneously. - let (round_one_result, round_two_result) = join!( - round_one.dispatch_commitment(), - round_two.dispatch_commitment() - ); - - // Check that two blocks have been mined. - for _ in 0..5 { - sleep(Duration::from_millis(500)).await; - let updated_block_number = outer_provider.get_block_number().await?; - if (updated_block_number - start_block_number) > U64::from(2) { - break; - } - } - - // Check that the results of both commitments are correctly submitted. - assert!(round_one_result.is_ok()); - assert!(round_two_result.is_ok()); - - Ok(()) - } - - #[tokio::test] - async fn test_round_features() -> Result<(), Box> { - let (anvil, cex_addr_1, cex_addr_2, _, summa_contract) = initialize_test_env(None).await; - - let signer = SummaSigner::new( - "0xac0974bec39a17e36ba4a6b4d238ff944bacb478cbed5efcae784d7bf4f2ff80", - anvil.endpoint().as_str(), - AddressInput::Address(summa_contract.address()), - ) - .await?; - - let mut address_ownership_client = - AddressOwnership::new(&signer, "../csv/signatures.csv").unwrap(); - - // Dispatch proof of address ownership. - address_ownership_client - .dispatch_proof_of_address_ownership() - .await?; - - let ownership_proof_logs = summa_contract - .address_ownership_proof_submitted_filter() - .query() - .await?; - - assert_eq!(ownership_proof_logs.len(), 1); - assert_eq!( - ownership_proof_logs[0], - AddressOwnershipProofSubmittedFilter { - address_ownership_proofs: vec![AddressOwnershipProof { - chain: "ETH".to_string(), - cex_address: to_checksum(&cex_addr_1, None), - signature: - ("0x089b32327d332c295dc3b8873c205b72153211de6dc1c51235782b091cefb9d06d6df2661b86a7d441cd322f125b84901486b150e684221a7b7636eb8182af551b").parse().unwrap(), - message: "Summa proof of solvency for CryptoExchange".encode().into(), - },AddressOwnershipProof { - chain: "ETH".to_string(), - cex_address:to_checksum(&cex_addr_2, None), - signature: - ("0xb17a9e25265d3b88de7bfad81e7accad6e3d5612308ff83cc0fef76a34152b0444309e8fc3dea5139e49b6fc83a8553071a7af3d0cfd3fb8c1aea2a4c171729c1c").parse().unwrap(), - message: "Summa proof of solvency for CryptoExchange".encode().into(), - }, - ], - } - ); + #[test] + fn test_round_features() { + type ProvingBackend = HyperPlonk>; // Initialize Round. - let entry_csv = "../csv/entry_16.csv"; - let mut entries: Vec> = vec![Entry::init_empty(); N_USERS]; - let mut cryptos = vec![Cryptocurrency::init_empty(); N_CURRENCIES]; - parse_csv_to_entries::<&str, N_CURRENCIES>(entry_csv, &mut entries, &mut cryptos).unwrap(); + let entries = generate_dummy_entries::().unwrap(); + let circuit = SummaHyperplonk::::init(entries.to_vec()); + let num_vars = K; - let univariate_grand_sum_circuit = UnivariateGrandSum::< - N_USERS, - N_CURRENCIES, - UnivariateGrandSumConfig, - >::init(entries.to_vec()); + let circuit_fn = |num_vars| { + let circuit = Halo2Circuit::>::new::< + ProvingBackend, + >(num_vars, circuit.clone()); + (circuit.circuit_info().unwrap(), circuit) + }; - let (params, pk, vk) = - generate_setup_artifacts(K, Some(PARAMS_PATH), &univariate_grand_sum_circuit).unwrap(); + let (circuit_info, circuit) = circuit_fn(num_vars as usize); + let instances = circuit.instances(); // Create a SNARK proof - let instances = vec![Fp::zero(); 1]; // This instance is necessary to verify proof on solidity verifier. - let (zk_snark_proof, advice_polys, _omega) = full_prover( - ¶ms, - &pk, - univariate_grand_sum_circuit.clone(), - &[instances.clone()], - ); + let param = ProvingBackend::setup_custom(PARAMS_PATH).unwrap(); + + let (prover_params, verifier_params) = + ProvingBackend::preprocess(¶m, &circuit_info).unwrap(); - // Verify the SNARK proof to ensure its validity. - assert!(full_verifier( - ¶ms, - pk.get_vk(), - &zk_snark_proof, - &[instances] - )); + let (advice_polys, proof_transcript) = { + let mut proof_transcript = Keccak256Transcript::new(()); + + let advice_polys = ProvingBackend::prove( + &prover_params, + &circuit, + &mut proof_transcript, + seeded_std_rng(), + ) + .unwrap(); + (advice_polys, proof_transcript) + }; + + let zk_snark_proof = proof_transcript.into_proof(); + + let mut transcript; + let result: Result<(), plonkish_backend::Error> = { + transcript = Keccak256Transcript::from_proof((), zk_snark_proof.as_slice()); + ProvingBackend::verify( + &verifier_params, + instances, + &mut transcript, + seeded_std_rng(), + ) + }; + assert_eq!(result, Ok(())); let snapshot_time = 1u64; let mut round = Round::::new( - &signer, - zk_snark_proof, + zk_snark_proof.clone(), advice_polys, - params, - vk, + prover_params, + verifier_params.clone(), snapshot_time, ); - let mut liability_commitment_logs = summa_contract - .liabilities_commitment_submitted_filter() - .query() - .await?; - assert_eq!(liability_commitment_logs.len(), 0); - - // Dispatch the liability commitment transaction to Summa contract. - round.dispatch_commitment().await?; - - // Check for updated logs to confirm the liability commitment transaction. - liability_commitment_logs = summa_contract - .liabilities_commitment_submitted_filter() - .query() - .await?; - - assert_eq!(liability_commitment_logs.len(), 1); - assert_eq!(liability_commitment_logs[0].timestamp, U256::from(1)); - assert_eq!( - liability_commitment_logs[0].total_balances, - vec![U256::from(556862), U256::from(556862)] - ); - assert_eq!(liability_commitment_logs[0].grand_sum_proof.len(), 128); - assert_eq!(liability_commitment_logs[0].snark_proof.len(), 192); + let (commitment_proof, vp) = round.gen_commitment_and_vp().unwrap(); + // Checks return proof and verifier params are the same + assert_eq!(commitment_proof.get_proof(), &zk_snark_proof); + for i in 0..num_vars as usize { + assert_eq!(vp.pcs.ss(i), verifier_params.pcs.ss(i)); + } // Generate and verify an inclusion proof for a random user. let user_range: std::ops::Range = 0..N_USERS; @@ -370,23 +99,52 @@ mod test { // Check inclusion proof is not none assert!(inclusion_proof.get_proof().len() > 0); + assert_eq!(inclusion_proof.get_input_values().len(), N_CURRENCIES + 1); + + // Verifier side + let mut kzg_transcript = + Keccak256Transcript::from_proof((), inclusion_proof.get_proof().as_slice()); + + // The verifier knows the ZK-SNARK proof, can extract the polynomial commitments + let mut transcript = Keccak256Transcript::from_proof((), zk_snark_proof.as_slice()); + let user_entry_commitments = MultilinearKzg::::read_commitments( + &verifier_params.pcs, + N_CURRENCIES + 1, + &mut transcript, + ) + .unwrap(); - // Verify the inclusion proof with onchain function - let verified = summa_contract - .verify_inclusion_proof( - U256::from(snapshot_time), - inclusion_proof.get_proof().clone(), - inclusion_proof - .get_challenge() - .clone() - .expect("no challenge"), - inclusion_proof.get_input_values().clone(), - ) - .await?; - - assert!(verified); + let mut multivariate_challenge: Vec = Vec::new(); + for _ in 0..num_vars { + multivariate_challenge.push(kzg_transcript.read_field_element().unwrap()); + } - drop(anvil); - Ok(()) + // Assumed that the user already knows their evaluation, which is balances, at the challenge point + let evals: Vec> = (0..N_CURRENCIES + 1) + .map(|i| { + if i == 0 { + Evaluation::new( + i, + 0, + big_uint_to_fp::(entries[random_user_index].username_as_big_uint()), + ) + } else { + Evaluation::new( + i, + 0, + big_uint_to_fp::(&entries[random_user_index].balances()[i - 1]), + ) + } + }) + .collect(); + + MultilinearKzg::::batch_verify( + &verifier_params.pcs, + &user_entry_commitments, + &[multivariate_challenge.clone()], + &evals, + &mut kzg_transcript, + ) + .unwrap(); } } diff --git a/prover/Cargo.lock b/prover/Cargo.lock index 933aed32..e7d362d7 100644 --- a/prover/Cargo.lock +++ b/prover/Cargo.lock @@ -989,7 +989,7 @@ checksum = "d231b230927b5e4ad203db57bbcbee2802f6bce620b1e4a9024a07d94e2907ec" [[package]] name = "plonkish_backend" version = "0.1.0" -source = "git+https://github.com/summa-dev/plonkish?branch=summa#fa852d0a4cd79621e5ee31ffcedd9ba348d17d5c" +source = "git+https://github.com/summa-dev/plonkish?branch=feat-read-params#64274584d00c1744bae042d3007f1f9df2bb2d30" dependencies = [ "bincode", "bitvec", @@ -1257,9 +1257,9 @@ dependencies = [ [[package]] name = "serde_json" -version = "1.0.116" +version = "1.0.120" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3e17db7126d17feb94eb3fad46bf1a96b034e8aacbc2e775fe81505f8b0b2813" +checksum = "4e0d21c9a8cae1235ad58a00c11cb40d4b1e5c784f1ef2c537876ed6ffd8b7c5" dependencies = [ "itoa", "ryu", diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 5035ee31..b73cf0c9 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -13,7 +13,7 @@ parallel = ["dep:rayon"] frontend-halo2 = ["dep:halo2_proofs"] [dependencies] -plonkish_backend = { git = "https://github.com/summa-dev/plonkish", branch="summa", package = "plonkish_backend", features= ["frontend-halo2", "benchmark"] } +plonkish_backend = { git = "https://github.com/summa-dev/plonkish", branch="feat-read-params", package = "plonkish_backend", features= ["frontend-halo2", "benchmark"] } plotters = { version = "0.3.4", optional = true } rand = "0.8" csv = "1.1" diff --git a/prover/bin/commitment_solidity_calldata.json b/prover/bin/commitment_solidity_calldata.json deleted file mode 100644 index 1ae19c41..00000000 --- a/prover/bin/commitment_solidity_calldata.json +++ /dev/null @@ -1,8 +0,0 @@ -{ - "range_check_snark_proof": "0x1b200581ce1ccff3f92e35dddd962cbda546c1c03834ca56296e567de16461a4075d4eb1bcbb18879d8c84f3804c11e920660ae1c62e0acb20e476c903ae0a3a261b66db77d711fd90671890321022121affeaf8353d696bf4597a6d9fba617c1560b42a43ed84a13785aa23e8d95a604d7aed90b8a4dd41c15284ac81189b812d536e6e7be13957f2eb82d0ced26c44b76e3dee0b896af61f57575935a346871fb31cc9f50e9d5084bb0d2856c98aa13718b511415ecad0e00bbf66c8f6d90009b068aa48cacfb89f98f17d513735930d7a9ca7c72f5c47ca044d5f145a16721a3cd8678d4ff1328601f5246e8fdfa240975ca59d6553add481f1647dcef2a71f250fb136e25a6ac0884fc15417d2cc436a3b9fc7c57f1f4bd0353ea1249f411f7c76d365074a7c695d59edd2a7c5b9e1d9d2f1f851a3495ebbbcdf88a7e74d2cc291aad02f0ce6e69aac34cb88d35bb2f35f56f873060f47b840745d64ef950cde7ea63d577bbc926c6ebb9b10f3ba1082e6d0c17977c3dda4a9f4212f8a22000f603776df9e725b18eac4a405bd18a56cfe291e84c9b3ef90d7192d1d8b78027de76238369cc7e8759784685b5c0fb08a0a52058dcec38e4d67b64072636414b5494d7838057eb66259bb5c984e864a8b604d96d35790a7e079cc152679241cf6d45a7166853135d1ca333727e8b2353eb7e90ae8391783731d392a79063e28d451e54b553700b3a5d8f6b4fb2c069440b4e26d748d6a425b770433a47c6b03181db50c65bfcb472b070c9353228023f3766f536bc953b8c0b2ed54a879242874e7d166e7573897e65ffb943ee855df1a131f86c18da6126f551dc7e1ae192a693fae10d79f0d9d119b145871e6a6fc1143cd5b53f90a48f849727b79fab93048e2f14f00c297ade3227b32a5f2d19145d0c5c9f7ace1bef44481525a227e1f041a4fb26e18d77036ace80d4d29959a5654893185d6c6e9c1a66dcb0b874b007eeef5091b519b8e16e5877b0746d4bff497fa3022d30675d981ce513bed8628e0f67d71b6eea2c0047b1ef4b85a3ac0bf0462abc518a82ecc900f3f32ce6a21f30533df9e36688b94d1ff7c51f5530a36962556c9ec526fda390a6dec8f0502819520ddcc9722ef50731fdd0698e91d53764a0929bed7d7aab2246d287b612baf952b31fae1fd4270034332ed893d7d0ab181f7d9a68205570b60f99cfd19147ba2d8a835fae9f72a43c9db4c9a5dd3e0060fc69af8a1ec14da5c170eb12316c4f940985d6d3133f36b14e6da6ea88bacf4f26641cddf3a0a540bfe4198e2275b31cb08b7e45baadde23fb64b9bbc95e713fc1b55396a150e75b0038837c40d69af90e6144f5e7c0f2b12349f8a0acf52e21a8219aafe765d9d2f7724425a28e8c9e850b2b52a59a87ede18618b6aa8a10eac03a536e1b996767e0583839b11608307bfc8a7048e7069fe123e06ee9f72c2dcdb3c94d135f8a8f95bca6efb29a5ea36536bf72bb3039e04baddac9f49b8b46cabf9902f828b5a70416a4017005f6933903f821274efad4634fcc2ed4da97e43e6ca1eb07197920066f7d7bb115909765a3e1ea151a31f01c63e7930647424be324d3dc45458237194c38e1e1ffb93985978172ee13e425b627f9800c3eeb1a230540a67ad8d699d02227636029c959c26b504774a84ec7d2e64d7ad3f892f94c4fae8abb26935f2f2006b832af8d3a66febdcc3e5659fd28ff59ada6c7ae44f565e10e6f0a074d86402c6b4176c4853110edae31ee186904261ca3fb3794ac42f8a229422b0099486dc6e5f04314e7ec83fd1e051b33299b14c75ac2b2f5996b4ab0467c40d7978ea2c718d005dfc20f5a84b7b669ae47a3f8dc359417c62745a598ea53308377552579dea12f44b1f03372e42eb71af3e464148d4446b1c6768fc1eea18a20a7ac48d41b12cd41e17891dccaf592009218490a38c9a7b3596aa6ab9ecf4bfffce31eb125e2f339daf6e57f4093b6494784831c8846e0fe84536802805e273cbe14d8531dc12ef4ab51059fc94d959899a25ae31bcd868fca678ab710be698014ff31eee271a23055aa10c35cee8c5b9f6dc3e6277dc8742ab9db7049827e1dfa16be2d0f410e037716dd68a33493c79211c18755892db6d6a279405af7198af9e645d618724d3a287384bcd7bda940d5bfa11abde37d1e0adde6ab114aed31a05d9f2ef3924003f4918f100ddf49def61a1fc3362ddc863ef0c47edfa88444eb7e9912d9c01651316d0b3a50ae36c01955898e0533f18da2bca239959cf058a230c5ec8ad215a0df35d515b250ce2dcc58e738698d8f4ed6b4119fa04b5f224b581b2caa008a111bc65c68ad917ee74c11c57bd93414133c4f856d38d0196f26a686052b92bc59d15f547cab99b15904b5333d5d36a34bce08c8f1d0c88624d294a77d2b707e27dff709dcaa80aa6355b832e6fe4ea8492ca325551707b10f9e5bc5aab64092cd1c0fef6f4165a26c20f5c5d014432b3163fce63b2edfa62a260a40172182a928b6b21e05186bc2191cfb9862ebd6f1352ad66f1074c8f7daf06a4e3d777236e6efe6a555655996d7c1126607f9745d2c0d5466a2a5c83b7cee5ab324b0923e67df7d3799436d4435112ddd5c0abaf53d9fc2fc47734e0fd47b77e1f94ca29a14c3cc78915b9e0628c61b7d677faf49be039084d6db04afb75d5eea151cd2d21d59bc86e914bd9b3c98aff084c09fcac9b1290c5cca92f9771ca41ebbed40709fc41153455c8d86753e9752e34c29060148f8704607a6c3bd3dfddf6ceb72435f3ef8ca862b6eaae98b2fe29b51475cca9179ee06f542a044aa1e3e9d1ed1ff1f31fd1450f557ef56cb8dfe6620fe0aa7b9562e9faf479964d17c877834604ad3fe40204e4fe18ff27388a35200e07faaa9487b50d2b0afe02ffcf0ed6522f9d1d256ce6c89af49420fb379fd793c5e87a01c6541412ed0f348681c03c630b90a0e829e5c873ce97b70fe4f33aab122796c833a9e8aa15f81cc0f9d524e11ff88113a2e0325ab73455dd950276848d9f85aba0006a362c2f963cb473ba401af97c4e4d1bf6c9f70a194b41f27a145c8b69fc045953ae04296ec52bcd3b6e260d3a53f50d1f20c07f1200e2637fa545d1390ebd812771b9bebd6bb189e3990257ccaf91e84f211af01b415fb8d7d493a304cfb03824ff680b22f8ae609d621164ef9d70d88f64c9c48ef3265fdc81cd72940aa59a63c06fa63e79c74e5f2d00ce48d62a3536299dde64df718796e7425826cc487fdb1f179c61edeaf040280aa100f302519c2042d64cca4138eec8b33729f5dfc0a03e795d7cf570a8045e1eff836baf5f06c6c61cca266e976ea0eb122b5e6bd29f3c240645c5c2404e2513eb2b331f3802856bc83bbdc40a64ba6065d4a82663ac87dc08a6bc93e39e2f2767f750e2eab6e88032e0199cb35733e6ac0d17534cd413bab641f8a75534cf049faf9192f6b83cb439f5c5572aea5ce5d581371d4116f1c43ad60a1e3f163f2e15f81ab9597985951f0f063f86976b1077bbcefdf1e4d7fa477fdcc1e7d1390e260f969e8e2c7376b72fa5401ef62d30c409a2d7d579a8eb39c763c2fd84d121771983521ae3de3ad954507938271080cbf83231efb45e28c82d0cb47f1e88162e663c0d8a75e673f4b0e9d9aea6d2f82aa8c6204a695c7bf1b0f7a5bf46772faa8fb8a6e36ed22763eebf1427dd5a8c1da1bdd8fd14eca9d9e65601454ba4082a17f58d273c30f931af7885a25e8e4f2baa9f85dcc970f3cc97c946df591f09b78b7da9db60a8c54e6e1f6a030f1be20bef6e22d747c25e0d268ed3d9f93715b2a618cce6b02161dc00858ce2233068f3c83053eddb805596bd4c58466e96209f7299fdffeca7ff573e2fa41d5b8655626421145f467f05451ac19334b4260a0f443cd9704c549d8d4d96b2a1219ea4e66daec875bfd74f4bb0712e6ac5b22f6ff8564c9bb0907283b79e1dc87b48641d166c40c4e5448d4e8a84c20f120e1da1487aa706d72e4e205c36815c47675754b52b41e51fb237ae36274d12de2121ed49ec2a3cbc8ac40166687bf18acdf75e062b826b25050ebc62f402cbb21820b774f663dea6af4868efa2181eed9dc9321365a104dbe16d01ae67bcb80fe10428abe1a98b038c25a0e9fc54fec9c120a1eff63de904e6306bbfa99b6ee9ba18881a5354469eeb4feef89fa682dcdee62a33757a61d8efdde248a005442cc6247f38fe393a44f0812814b7be1f7d5ee0975060aa82a9e78602419eb5a8f6610723b52608263605d5dff29dbc80d514a99f3d0a9d4dacb07817995102047f1d29347b1317934162c2fd55c39831119eb40fa67e6f7e326fa1fa61122ceeca05144db4355935cb1d1762842b1f1e40423813cfd82113914c83966ad8486ddfcd1fe2390b2d01794e522a4c95d6483661bc24af467c5915ab1a5bf315cc7a2abb08627f170ee896b9015162a8a9d741847ed80e2848af9d632682dee79b61de361c0ba9d2513c8aa794495b3123989c10343db49ad6786f1716dde66d811974890806eea7d70f5154dba13a45816639d2c2dc2b17b6c0b3710c7deeded162de6e0c2f4b9f600209591d33208fd26e8d8c525b6f03931fc714c451b8c40d38f69d04694df2f4a14cbd76f97351c41d940c12dbc04ed654d8cf62f44afdf43dca752191c47a3cf7d2f3932c94a294538bbd2262dd65e25720de90e8f0db604192d1100da03880dbb08234529a77695c7fa3ca1b7cbbd1c347dbb0558dae5ef439ba1917cfa948c1c509f9a7e2ef3ba9d78503975d769c1934b78c741c74fc36c7a106c6942af654bbae1ddfeee473492411ea6d23f7094d280c83869a00ecda054c1992416c6808c8941b3407c22fceb6800eb8b1da9e78b4af5ed9b80af86e2351049341e779893782438dd60920e6ea219aa20cb9189855f6e410548ff582511c1a7e25ef38919457e8e23d8e90f594c68816968ffd8d4fb39aa99467fb149ed529bbe7879d39b284bf9f009b71720f426a566c81848f7bbcbcbf37061e06357c2ee53ecdab1453c7cce77e2c06972e04825d2e4336b95a5609cb08fb693638910269a4f72095076b7d46dc24743fe951485d751282d0418cabeb16ac50444d861a27552c4d6b349fe034be3fc2e35087013ef76f871845ede39ba92386b08a6a0bf6b447d95e05ad65ba15a0b1a636b1a41d6b94fddede61528842ada317b4711bcc372e891ed3cc68634ee0ddad9bbd5c2fcf0ff74cbea665414f482faaeeae09383bfb526a0c9c18a80e93f2a9440a0c398ca9548d39f1ed352d464f0809ca0dba2e2521de785c977c7979c43269fd71ec56b9afae58cf35cc465fc88e168b15e2460234bf5b91183032f4dd8c3aa15d582fa1d17bb55e446292e68565a10a024a7bb44dc8ab203969ff6f5d2b1e2a7e208de5106350fa21ec5246ac5d20e40df1f8439af5f86a6002199b9082f878e7286c1071c6588341de511fac571f5513f7c058dfc614b4f570de2a62614351ea3e664e8971a7e5d63004c9026dd400052a97f9b59d3de75552b7185b5912be32f9a49cbb5cb8f3b716c4137911bdb006bc52868e283baca4692ba389032bfe9d0a700e2f47c14a104a4ea731cabc9e23a3dff6c06ceac32421283e96970dae4f22dc3848d3834f675bbda5ba3a436618b97e5277db6e1cf10d7eb5a49f0540dcf50fc9e469957df24d69a9e790eed20f18d2e8f8d535a388019d6ea8197fe373f663819fb47255677e5585892fc4d20859f6834baf37ac4d9989960790fdf08e0989859b76196fffcff9ab80e3df3905fabb664473c9476f71bd5ef2621ed47f76d076a3ff0fe27777073243b68eeb2a14ab9c57dd4fcf758b03a35f49da50238a7c0a464dd73823abe97ea44a97bc2bbec4ca8ae8bed8200bb2da0e2fca94839b3a7cd06c3f8a7fe341e2b1194ddf23b92500bc858bcf7365a1b4ea53bec3beef3ee71f41c148cd4c382b5e48cd9c16fac06e418ec1af458c8f5b658cc117893d685826985759c1500b28137461c00fc713188ce3264701d7376f588240430bc2a3a441cd811d77218385336781e01958b3b3e68c741d9a15e5ec4d4f591d0341f6270b7ebc262e0e4507c33a73442f8279c5d8f1a3fa68b892e74931532df4d030c30e728d32e9d3e364f578c89710d858432377e59e820ccd54fcef1fe1558a09d96c6758d425b20d61020dbcdf12fb55d12da9804179e37b5eb23de9077b73f10a4de909183782a36b65ec92442930f98bd428540c05622b2a545465c000bbd9b4e70f6f9faaf5af85730e7dd203ab945c07893c6096a8b2f457d092153b54369f007997883cc4430775a70d1718241c395063816dce07ea10d4baba9884b568382b7c0efd47d95d21f8d815441a978863e211e1611841e43049ff989aa3595e64052b448f633be2b2f5c1614227d9a49cf7c6f1b53c0aad1ac041d5c734fc3f2ca2830bd6886250ccb3031747251504c8850d9b3845a76b7b77e0cedd57694098b25b30aa62d26be5f435c7ae2404c804e3805870acea4b76fc9e08a2805549b478b9e9cc3379225fb40e755d10acb7167d639d02fc954d7dfb940d8f23320026967a5eaee125318b5d53046b27d81d57642b283e33b631c8d3f8d36ba43daa3ed16a793d3f5d78afefa136d02d76c7efef3836f37ef3318b0ef2b03a6e76151ba5bf4ceef026d6fae19b369a0cb3cc3debd9e28c13999fb73d6e6913064ce706f066b3735eb9b33c7ff59752164f50f5a2274c3f2abf4e499ec60a0c365c8d00d28909b9b032deeae5fb4b0904cdd16690c9631a25828559ab5d2ff25de31fc6cd68c5f474dcf1f99a8c6c770b20baf5752cc4937046638161fafe364b8d3e2ff83024540a0c1794346e27221b4d0fb61d725325f48465ddc9250922e8784b6740fe9e3e594ff29d84a6e18b0f5c9f0895d79912e990bfbf032e29717962423ef29e5d301e7f6df98b302ef811fe513641dc7844134461fe40bd7122588ee3b5ed9bfe78ea04e4ea585eef2d248d9a64528b632f0a5e570c242dc3188c8b3cc536c7e6248fbf74e28be9baf810f6fec952208765498c1fad4de6bb42a2a60d4eb5f84c76357fb527777f320805a00fe719cad11599aa48c6ea066a8818cfe25ca6041ce3de19e319b48ef7bc30395f7ca65c24d6c6a898742cd1ed8858bf4a3f1e8d0ff948351b860768f8b52440e6f08ce61f0c72d813d09eafb2e702ee1b5a70acbd1c5dd6d06ea2d125af13e9c56d652434e16633d851b80969521d4e32e209a0caedc6b8422cf4f0c57f1a809e252787f9f6d88f9f60273268286b3d5e4ddfb534fae863dd381ef919152b9a220f12b3890b1e1a312919e9776a292c3b4bac2ff35b180d5d83232321b60d9dc75397d11aaa6d151a96028edd8060d23c3b3bd15d179e113a10b14eff8a1f27bfae91aa88a9fa6d7243244e1c1c77bbe9b28bdfd0ebcf0f0eb79b99771b0c02446010ee5bdff5d215283109f54fab077adf59a5961d48105b5c95402f3129d7b10968df0858e798858e96acacc3ba49e02dd8afaafbc45ebd0a89363365", - "grand_sums_batch_proof": "0x17e2032176f6575e95aa4d9d97293edf675fd8aad89e76d99883b4a830564e7d2ca14616b46c35c4573a4e5806a7fde693b0da39ca285023e93c2e3ee781b78b18c815403ccb3ac8188e4a1b761df4504068402c880e4a687311455818ed4ca32367d0768c54895acb9875b2b2f60d85102d455cc28f0d9d2af67ecaa4ac662f", - "total_balances": [ - "0x87f3e", - "0x87f3e" - ] -} \ No newline at end of file diff --git a/prover/bin/inclusion_proof_solidity_calldata.json b/prover/bin/inclusion_proof_solidity_calldata.json deleted file mode 100644 index 92130cc1..00000000 --- a/prover/bin/inclusion_proof_solidity_calldata.json +++ /dev/null @@ -1,15 +0,0 @@ -{ - "proof": "0x0faaa8aa92bf36e2601bdd9d5be92bb5c7aa6f982661cff0611d0bd8ccccb9bd171586516226f99958cdb181eecdfb1ce9bd48e5ae3c19aea353c163c7acf1db0938c672375247acf7a110224e1f3d0e118b289a02c8b4a0acd33a8d209dbebc01895e90be59da66f1de8e8a144047936e7393e312fbbcfe11960be9de661277150f79ec188c492fc71556342c001c2cdf89aca2df24b2f68514e1742185c2021f0479d9e8e1a3e1c14e2bac6af1c5ebd3d6c5b35c230c0cc92c554cc245a9d5", - "challenges": [ - "0xf79a0045992596e3278606b5317aaf4f6bb65071219b1c89d542509fe6dddd3", - "0x2299faaf0e21893e99005dc9165fba869b5aa88bcac5af4395071fd569686fde", - "0x2480ccf8a3834d03badc6b0c35773d758908019658fe9ea3bf85dc202257cfda", - "0x2bd763bd08804bb437e62575eff584497632e3d3034a20f2a868b1136e4adb6e" - ], - "user_id": "MBlfbBGI", - "user_values": [ - "0x4d426c6662424749", - "0x108ef", - "0x48db" - ] -} \ No newline at end of file diff --git a/prover/prints/range-check-layout.png b/prover/prints/range-check-layout.png index 579656ef..4bdffdb0 100644 Binary files a/prover/prints/range-check-layout.png and b/prover/prints/range-check-layout.png differ diff --git a/prover/prints/summa-hyperplonk-layout.png b/prover/prints/summa-hyperplonk-layout.png index 497b11f3..f16be9fe 100644 Binary files a/prover/prints/summa-hyperplonk-layout.png and b/prover/prints/summa-hyperplonk-layout.png differ diff --git a/prover/rust-toolchain b/prover/rust-toolchain new file mode 100644 index 00000000..4524b7cb --- /dev/null +++ b/prover/rust-toolchain @@ -0,0 +1 @@ +nightly-2023-07-11 \ No newline at end of file diff --git a/prover/src/circuits/summa_circuit.rs b/prover/src/circuits/summa_circuit.rs index ea6e8bdb..dbe0e0bd 100644 --- a/prover/src/circuits/summa_circuit.rs +++ b/prover/src/circuits/summa_circuit.rs @@ -112,6 +112,13 @@ pub mod summa_hyperplonk { grand_total, } } + + pub fn init_empty() -> Self { + Self { + entries: vec![Entry::init_empty(); N_USERS], + grand_total: vec![BigUint::from(0u64); N_CURRENCIES], + } + } } impl Circuit diff --git a/prover/src/circuits/tests.rs b/prover/src/circuits/tests.rs index 58c518e5..3279bda4 100644 --- a/prover/src/circuits/tests.rs +++ b/prover/src/circuits/tests.rs @@ -50,7 +50,7 @@ fn test_summa_hyperplonk() { let (circuit_info, circuit) = circuit_fn(num_vars as usize); let instances = circuit.instances(); - let param = ProvingBackend::setup(&circuit_info, seeded_std_rng()).unwrap(); + let param = ProvingBackend::setup_custom("../backend/ptau/hermez-raw-plonkish-17").unwrap(); let (prover_parameters, verifier_parameters) = ProvingBackend::preprocess(¶m, &circuit_info).unwrap(); @@ -102,7 +102,7 @@ fn test_summa_hyperplonk() { &verifier_parameters, &[invalid_grand_total_instances], &mut transcript, - seeded_std_rng(), + seeded_std_rng(), // This is not being used in the HyperPlonk implementation ) }; assert_eq!( @@ -169,7 +169,7 @@ fn test_summa_hyperplonk() { .unwrap(); let user_entry_polynomials = witness_polys.iter().take(num_points).collect::>(); - //Store the user index multi-variable in the transcript for the verifier + // Store the user index multi-variable in the transcript for the verifier for binary_var in multivariate_challenge.iter() { kzg_transcript.write_field_element(binary_var).unwrap(); } diff --git a/prover/src/utils/csv_parser.rs b/prover/src/utils/csv_parser.rs new file mode 100644 index 00000000..43b34895 --- /dev/null +++ b/prover/src/utils/csv_parser.rs @@ -0,0 +1,74 @@ +use num_bigint::BigUint; +use std::collections::HashMap; +use std::error::Error; +use std::fs::File; +use std::path::Path; + +use crate::cryptocurrency::Cryptocurrency; +use crate::entry::Entry; + +pub fn parse_csv_to_entries, const N_CURRENCIES: usize>( + path: P, + entries: &mut [Entry], + cryptocurrencies: &mut [Cryptocurrency], +) -> Result<(), Box> { + let file = File::open(path)?; + let mut rdr = csv::ReaderBuilder::new().from_reader(file); + + let headers = rdr.headers()?.clone(); + + // Extracting cryptocurrency names from column names + for (i, header) in headers.iter().skip(1).enumerate() { + if i >= cryptocurrencies.len() { + println!( + "Too many columns in the CSV file, expected {}, skipping the rest", + cryptocurrencies.len() + ); + break; + } + // Skipping 'username' column + let parts: Vec<&str> = header.split('_').collect(); + if parts.len() == 3 && parts[0] == "balance" { + cryptocurrencies[i] = Cryptocurrency { + name: parts[1].to_owned(), + chain: parts[2].to_owned(), + }; + } else { + // Throw an error if the header is malformed + return Err(format!("Invalid header: {}", header).into()); + } + } + + let mut balances_acc: Vec = vec![BigUint::from(0_usize); N_CURRENCIES]; + + for (i, result) in rdr.deserialize().enumerate() { + let record: HashMap = result?; + let username = record.get("username").ok_or("Username not found")?.clone(); + + let mut balances_big_int = Vec::new(); + for cryptocurrency in &mut *cryptocurrencies { + let balance_str = record + .get(format!("balance_{}_{}", cryptocurrency.name, cryptocurrency.chain).as_str()) + .ok_or(format!( + "Balance for {} on {} not found", + cryptocurrency.name, cryptocurrency.chain + ))?; + let balance = BigUint::parse_bytes(balance_str.as_bytes(), 10).ok_or(format!( + "Invalid balance for {} on {}", + cryptocurrency.name, cryptocurrency.chain + ))?; + balances_big_int.push(balance); + } + + balances_acc = balances_acc + .iter() + .zip(balances_big_int.iter()) + .map(|(x, y)| x + y) + .collect(); + + let entry = Entry::new(username, balances_big_int.try_into().unwrap())?; + entries[i] = entry; + } + + Ok(()) +} diff --git a/prover/src/utils/mod.rs b/prover/src/utils/mod.rs index 06099b77..9564b220 100644 --- a/prover/src/utils/mod.rs +++ b/prover/src/utils/mod.rs @@ -1,5 +1,7 @@ +mod csv_parser; mod dummy_entries; mod operation_helpers; +pub use csv_parser::parse_csv_to_entries; pub use dummy_entries::generate_dummy_entries; pub use operation_helpers::*; diff --git a/remappings.txt b/remappings.txt deleted file mode 100644 index 4047cd3c..00000000 --- a/remappings.txt +++ /dev/null @@ -1,2 +0,0 @@ -@openzeppelin/=contracts/node_modules/@openzeppelin -hardhat/=contracts/node_modules/hardhat \ No newline at end of file