From 98ed012e037bd7dae1edf54ea10c2d10d903a0f6 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Thu, 9 Mar 2023 23:04:06 +0100 Subject: [PATCH 1/3] Add Github Actions CI jobs --- .github/workflows/lint.yml | 40 ++++++++++++++++ .github/workflows/programs-test.yml | 58 +++++++++++++++++++++++ build-sdk.sh | 26 ++++++++-- build.sh | 24 ++++++---- light-system-programs/runTest.sh | 30 +++++++++--- mock-app-verifier/runTest.sh | 36 +++++++++----- mock-app-verifier/scripts/buildCircuit.sh | 0 test.sh | 33 +++++++++++-- 8 files changed, 212 insertions(+), 35 deletions(-) create mode 100644 .github/workflows/lint.yml create mode 100644 .github/workflows/programs-test.yml mode change 100644 => 100755 build-sdk.sh mode change 100644 => 100755 light-system-programs/runTest.sh mode change 100644 => 100755 mock-app-verifier/runTest.sh mode change 100644 => 100755 mock-app-verifier/scripts/buildCircuit.sh diff --git a/.github/workflows/lint.yml b/.github/workflows/lint.yml new file mode 100644 index 0000000000..ac1a87c54f --- /dev/null +++ b/.github/workflows/lint.yml @@ -0,0 +1,40 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + +name: lint + +jobs: + lint: + name: lint + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + with: + submodules: true + token: ${{ secrets.PAT_TOKEN }} + + - name: Install stable Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Run cargo fmt + working-directory: ./light-system-programs + run: | + cargo fmt --all -- --check + + # TODO(vadorovsky): Enable clippy once we fix the issue in Solana: + # https://github.com/solana-labs/solana/issues/29971 + # - name: Run cargo clippy + # working-directory: ./light-system-programs + # run: | + # cargo clippy -- -D warnings diff --git a/.github/workflows/programs-test.yml b/.github/workflows/programs-test.yml new file mode 100644 index 0000000000..9d1306d3b6 --- /dev/null +++ b/.github/workflows/programs-test.yml @@ -0,0 +1,58 @@ +on: + push: + branches: + - main + pull_request: + branches: + - main + +name: programs-test + +jobs: + test: + name: test + runs-on: ubuntu-latest + steps: + - name: Checkout sources + uses: actions/checkout@v2 + with: + path: light-protocol-onchain + submodules: true + token: ${{ secrets.PAT_TOKEN }} + + # - name: Checkout Solana sources + # uses: actions/checkout@v2 + # with: + # path: solana + # repository: solana-labs/solana + + - name: Install stable Rust toolchain + uses: actions-rs/toolchain@v1 + with: + profile: minimal + toolchain: stable + override: true + components: rustfmt, clippy + + - name: Install Node.js + uses: actions/setup-node@v2 + with: + node-version: "16" + + - name: Install Typescript + run: | + npm i -g typescript + + - name: Install Solana and Anchor + run: | + docker run -d --name solana-install --entrypoint=/bin/sleep vadorovsky/solana:audit inf + docker cp solana-install:/usr/local/bin/. /usr/local/bin + docker cp solana-install:/usr/local/cargo/bin/anchor /usr/local/bin + docker rm -f solana-install + solana-keygen new --no-bip39-passphrase + + - name: Run tests + working-directory: light-protocol-onchain + run: | + ./build.sh + ./test.sh diff --git a/build-sdk.sh b/build-sdk.sh old mode 100644 new mode 100755 index 700e5e5a95..8b9d19c226 --- a/build-sdk.sh +++ b/build-sdk.sh @@ -1,4 +1,22 @@ -cd light-sdk-ts && yarn && yarn run build & sleep 5 && kill $! && cd ..; -cd light-circuits && rm -rf ./node_modules && yarn && cd -; -cd light-system-programs && rm -rf ./node_modules && yarn && cd -; -cd mock-app-verifier && rm -rf ./node_modules && yarn && cd -; +#!/usr/bin/env bash + +set -e + +pushd light-sdk-ts +yarn run build +popd + +pushd light-circuits +rm -rf node_modules +yarn +popd + +pushd light-system-programs +rm -rf node_modules +yarn +popd + +pushd mock-app-verifier +rm -rf node_modules +yarn +popd diff --git a/build.sh b/build.sh index 01ff9e873d..484ae480d2 100755 --- a/build.sh +++ b/build.sh @@ -1,9 +1,17 @@ -cd ..; -if [ ! -f ./solana ]; then - git clone git@github.com:ananas-block/solana.git; - cd solana && git fetch -a && git checkout audit && cd validator/ && cargo build && cd ../..; -fi -cd light-protocol-onchain/light-sdk-ts && yarn i && yarn run build; \ -cd ../light-system-programs && yarn install && anchor build; \ -cd ../light-circuits && yarn i && cd ..; +#!/usr/bin/env bash +set -e + +pushd light-sdk-ts +yarn install +yarn run build +popd + +pushd light-system-programs +yarn install +anchor build +popd + +pushd light-circuits +yarn install +popd diff --git a/light-system-programs/runTest.sh b/light-system-programs/runTest.sh old mode 100644 new mode 100755 index 3ff9051f13..1200b13197 --- a/light-system-programs/runTest.sh +++ b/light-system-programs/runTest.sh @@ -1,6 +1,24 @@ -#!/bin/bash -e -../../solana/validator/solana-test-validator --reset --limit-ledger-size 500000000 --bpf-program J1RRetZ4ujphU75LP8RadjXMf3sA12yC2R44CF7PmU7i ./target/deploy/verifier_program_zero.so --bpf-program JA5cjkRJ1euVi9xLWsCJVzsRzEkT8vcC4rqw9sVAo5d6 ./target/deploy/merkle_tree_program.so --bpf-program 3KS2k14CmtnuVv2fvYcvdrNgC94Y11WETBpMUGgXyWZL ./target/deploy/verifier_program_one.so --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../../solana/web3.js/test/fixtures/noop-program/solana_sbf_rust_noop.so --bpf-program DJpbogMSrK94E1zvvJydtkqoE4sknuzmMRoutd6B7TKj ./target/deploy/verifier_program_storage.so --quiet & -sleep 7 -PID=$! -$1; -kill $PID; \ No newline at end of file +#!/bin/bash + +set -eux + +docker rm -f solana-validator || true +docker run -d \ + --name solana-validator \ + --net=host \ + -v $HOME/.config/solana/id.json:/root/.config/solana/id.json \ + -v $(pwd)/target/deploy:/usr/local/lib/light-protocol-onchain \ + vadorovsky/solana:audit \ + --reset \ + --limit-ledger-size 500000000 \ + --bpf-program J1RRetZ4ujphU75LP8RadjXMf3sA12yC2R44CF7PmU7i /usr/local/lib/light-protocol-onchain/verifier_program_zero.so \ + --bpf-program JA5cjkRJ1euVi9xLWsCJVzsRzEkT8vcC4rqw9sVAo5d6 /usr/local/lib/light-protocol-onchain/merkle_tree_program.so \ + --bpf-program 3KS2k14CmtnuVv2fvYcvdrNgC94Y11WETBpMUGgXyWZL /usr/local/lib/light-protocol-onchain/verifier_program_one.so \ + --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV /usr/local/lib/solana-program-library/spl_noop.so \ + --bpf-program DJpbogMSrK94E1zvvJydtkqoE4sknuzmMRoutd6B7TKj /usr/local/lib/light-protocol-onchain/verifier_program_storage.so \ + --quiet + +sleep 15 +$1 + +docker rm -f solana-validator diff --git a/mock-app-verifier/runTest.sh b/mock-app-verifier/runTest.sh old mode 100644 new mode 100755 index adcd95a3f0..3e50a95a12 --- a/mock-app-verifier/runTest.sh +++ b/mock-app-verifier/runTest.sh @@ -1,14 +1,26 @@ -#!/bin/bash -e -../../solana/validator/solana-test-validator \ +#!/bin/bash + +set -eux + +docker rm -f solana-validator || true +docker run -d \ + --name solana-validator \ + --net=host \ + -v $HOME/.config/solana/id.json:/root/.config/solana/id.json \ + -v $(git rev-parse --show-toplevel)/light-system-programs/target/deploy:/usr/local/lib/light-protocol-onchain \ + -v $(pwd)/target/deploy:/usr/local/lib/mock-app-verifier \ + vadorovsky/solana:audit \ --reset \ --limit-ledger-size 500000000 \ - --bpf-program J1RRetZ4ujphU75LP8RadjXMf3sA12yC2R44CF7PmU7i ../light-system-programs/target/deploy/verifier_program_zero.so \ - --bpf-program JA5cjkRJ1euVi9xLWsCJVzsRzEkT8vcC4rqw9sVAo5d6 ../light-system-programs/target/deploy/merkle_tree_program.so \ - --bpf-program 3KS2k14CmtnuVv2fvYcvdrNgC94Y11WETBpMUGgXyWZL ../light-system-programs/target/deploy/verifier_program_one.so \ - --bpf-program GFDwN8PXuKZG2d2JLxRhbggXYe9eQHoGYoYK5K3G5tV8 ../light-system-programs/target/deploy/verifier_program_two.so \ - --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV ../../solana/web3.js/test/fixtures/noop-program/solana_sbf_rust_noop.so \ - --bpf-program Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS ./target/deploy/mock_verifier.so --quiet & \ -sleep 5 -PID=$! -$1; -kill $PID; + --bpf-program J1RRetZ4ujphU75LP8RadjXMf3sA12yC2R44CF7PmU7i /usr/local/lib/light-protocol-onchain/verifier_program_zero.so \ + --bpf-program JA5cjkRJ1euVi9xLWsCJVzsRzEkT8vcC4rqw9sVAo5d6 /usr/local/lib/light-protocol-onchain/merkle_tree_program.so \ + --bpf-program 3KS2k14CmtnuVv2fvYcvdrNgC94Y11WETBpMUGgXyWZL /usr/local/lib/light-protocol-onchain/verifier_program_one.so \ + --bpf-program GFDwN8PXuKZG2d2JLxRhbggXYe9eQHoGYoYK5K3G5tV8 /usr/local/lib/light-protocol-onchain/verifier_program_two.so \ + --bpf-program noopb9bkMVfRPU8AsbpTUg8AQkHtKwMYZiFUjNRtMmV /usr/local/lib/solana-program-library/spl_noop.so \ + --bpf-program Fg6PaFpoGXkYsidMpWTK6W2BeZ7FEfcYkg476zPFsLnS /usr/local/lib/mock-app-verifier/mock_verifier.so \ + --quiet + +sleep 15 +$1 + +docker rm -f solana-validator diff --git a/mock-app-verifier/scripts/buildCircuit.sh b/mock-app-verifier/scripts/buildCircuit.sh old mode 100644 new mode 100755 diff --git a/test.sh b/test.sh index a744435ed4..4af78dc296 100755 --- a/test.sh +++ b/test.sh @@ -1,6 +1,29 @@ -sh build-sdk.sh; -cd light-system-programs && anchor build && yarn test && yarn run test-user && yarn run test-merkle-tree && yarn run test-verifiers && cd ..; -cd light-sdk-ts && yarn test && sleep 1 && cd ..; -cd mock-app-verifier && anchor build && yarn test && yarn run test-verifiers && cd ..; -cd light-circuits && yarn run test && cd ..; +#!/usr/bin/env bash + +set -e + +./build-sdk.sh + +pushd light-system-programs +anchor build +yarn test +yarn run test-merkle-tree +yarn run test-verifiers +popd + +pushd light-sdk-ts +yarn test +sleep 1 +popd + +pushd mock-app-verifier +anchor build +yarn test +yarn run test-verifiers +popd + +pushd light-circuits +yarn run test +popd + # && cd programs/merkle_tree_program && cargo test From 16b667b24a1274e02d1fe6ccd9f0f73648d10efe Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Wed, 8 Mar 2023 20:51:55 +0100 Subject: [PATCH 2/3] Fix cargo fmt issues --- .../verifier_program_one/src/verifying_key.rs | 245 +++++++++++------- .../verifier_program_two/src/verifying_key.rs | 225 +++++++++------- .../src/verifying_key.rs | 165 +++++++----- 3 files changed, 378 insertions(+), 257 deletions(-) diff --git a/light-system-programs/programs/verifier_program_one/src/verifying_key.rs b/light-system-programs/programs/verifier_program_one/src/verifying_key.rs index a35f7f6aae..252d2afae8 100644 --- a/light-system-programs/programs/verifier_program_one/src/verifying_key.rs +++ b/light-system-programs/programs/verifier_program_one/src/verifying_key.rs @@ -1,106 +1,153 @@ use groth16_solana::groth16::Groth16Verifyingkey; -pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { - nr_pubinputs: 18, +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 18, - vk_alpha_g1: [ - 45,77,154,167,227,2,217,223,65,116,157,85,7,148,157,5,219,234,51,251,177,108,100,59,34,245,153,162,190,109,242,226, - 20,190,221,80,60,55,206,176,97,216,236,96,32,159,227,69,206,137,131,10,25,35,3,1,240,118,202,255,0,77,25,38, - ], + vk_alpha_g1: [ + 45, 77, 154, 167, 227, 2, 217, 223, 65, 116, 157, 85, 7, 148, 157, 5, 219, 234, 51, 251, + 177, 108, 100, 59, 34, 245, 153, 162, 190, 109, 242, 226, 20, 190, 221, 80, 60, 55, 206, + 176, 97, 216, 236, 96, 32, 159, 227, 69, 206, 137, 131, 10, 25, 35, 3, 1, 240, 118, 202, + 255, 0, 77, 25, 38, + ], - vk_beta_g2: [ - 9,103,3,47,203,247,118,209,175,201,133,248,136,119,241,130,211,132,128,166,83,242,222,202,169,121,76,188,59,243,6,12, - 14,24,120,71,173,76,121,131,116,208,214,115,43,245,1,132,125,214,139,192,224,113,36,30,2,19,188,127,193,61,183,171, - 48,76,251,209,224,138,112,74,153,245,232,71,217,63,140,60,170,253,222,196,107,122,13,55,157,166,154,77,17,35,70,167, - 23,57,193,177,164,87,168,199,49,49,35,210,77,47,145,146,248,150,183,198,62,234,5,169,213,127,6,84,122,208,206,200, - ], + vk_beta_g2: [ + 9, 103, 3, 47, 203, 247, 118, 209, 175, 201, 133, 248, 136, 119, 241, 130, 211, 132, 128, + 166, 83, 242, 222, 202, 169, 121, 76, 188, 59, 243, 6, 12, 14, 24, 120, 71, 173, 76, 121, + 131, 116, 208, 214, 115, 43, 245, 1, 132, 125, 214, 139, 192, 224, 113, 36, 30, 2, 19, 188, + 127, 193, 61, 183, 171, 48, 76, 251, 209, 224, 138, 112, 74, 153, 245, 232, 71, 217, 63, + 140, 60, 170, 253, 222, 196, 107, 122, 13, 55, 157, 166, 154, 77, 17, 35, 70, 167, 23, 57, + 193, 177, 164, 87, 168, 199, 49, 49, 35, 210, 77, 47, 145, 146, 248, 150, 183, 198, 62, + 234, 5, 169, 213, 127, 6, 84, 122, 208, 206, 200, + ], - vk_gamme_g2: [ - 25,142,147,147,146,13,72,58,114,96,191,183,49,251,93,37,241,170,73,51,53,169,231,18,151,228,133,183,174,243,18,194, - 24,0,222,239,18,31,30,118,66,106,0,102,94,92,68,121,103,67,34,212,247,94,218,221,70,222,189,92,217,146,246,237, - 9,6,137,208,88,95,240,117,236,158,153,173,105,12,51,149,188,75,49,51,112,179,142,243,85,172,218,220,209,34,151,91, - 18,200,94,165,219,140,109,235,74,171,113,128,141,203,64,143,227,209,231,105,12,67,211,123,76,230,204,1,102,250,125,170, - ], + vk_gamme_g2: [ + 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, + 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, + 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, + 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, + 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, + 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, + 123, 76, 230, 204, 1, 102, 250, 125, 170, + ], - vk_delta_g2: [ - 11,5,71,43,239,53,105,112,81,0,193,34,112,127,97,179,215,121,196,247,170,170,5,139,64,152,51,63,73,221,207,28, - 32,39,120,232,3,106,111,67,227,49,76,187,120,34,10,126,86,1,41,139,80,205,84,32,188,123,139,7,230,119,155,188, - 32,84,160,249,132,77,57,157,139,96,118,10,205,131,14,122,204,109,31,69,40,114,52,209,49,198,89,48,90,142,85,10, - 8,244,30,152,245,86,206,125,34,209,229,192,239,200,206,212,190,140,10,84,103,159,125,214,94,82,109,51,79,98,94,69, - ], + vk_delta_g2: [ + 11, 5, 71, 43, 239, 53, 105, 112, 81, 0, 193, 34, 112, 127, 97, 179, 215, 121, 196, 247, + 170, 170, 5, 139, 64, 152, 51, 63, 73, 221, 207, 28, 32, 39, 120, 232, 3, 106, 111, 67, + 227, 49, 76, 187, 120, 34, 10, 126, 86, 1, 41, 139, 80, 205, 84, 32, 188, 123, 139, 7, 230, + 119, 155, 188, 32, 84, 160, 249, 132, 77, 57, 157, 139, 96, 118, 10, 205, 131, 14, 122, + 204, 109, 31, 69, 40, 114, 52, 209, 49, 198, 89, 48, 90, 142, 85, 10, 8, 244, 30, 152, 245, + 86, 206, 125, 34, 209, 229, 192, 239, 200, 206, 212, 190, 140, 10, 84, 103, 159, 125, 214, + 94, 82, 109, 51, 79, 98, 94, 69, + ], - vk_ic: &[ - [ - 23,198,68,197,114,25,97,8,212,78,90,202,89,227,165,178,46,207,107,214,145,168,55,47,97,71,74,74,175,108,165,164, - 0,162,25,202,186,102,182,103,132,15,99,192,232,28,193,66,205,19,158,195,249,102,14,204,0,26,243,70,202,165,48,133, - ], - [ - 2,55,119,82,210,145,178,209,104,146,133,137,154,115,8,9,21,60,89,59,113,116,214,196,37,46,120,112,170,176,201,206, - 29,69,71,125,159,14,236,180,219,169,119,112,29,124,168,81,244,127,202,120,160,50,243,172,38,255,40,192,29,64,155,81, - ], - [ - 40,212,131,150,203,1,141,214,2,11,150,226,129,109,84,64,188,190,71,44,215,115,35,198,154,90,166,217,220,61,191,168, - 47,34,87,145,241,108,95,33,45,247,184,63,88,173,247,43,169,3,128,43,5,96,104,72,130,66,4,16,79,242,155,226, - ], - [ - 42,43,71,123,159,195,121,111,72,116,217,105,15,133,107,41,218,9,40,52,181,26,127,78,197,218,252,156,168,216,105,38, - 0,253,136,101,78,255,188,4,109,175,194,39,75,121,81,165,34,247,2,134,178,229,118,150,182,209,111,92,219,161,115,221, - ], - [ - 6,179,96,45,68,58,148,21,122,16,51,116,14,50,113,136,1,209,37,190,57,43,242,105,230,157,16,21,25,253,15,119, - 31,171,187,155,226,172,162,220,251,238,128,58,177,43,13,97,206,101,211,49,190,8,176,146,229,132,135,57,30,164,26,26, - ], - [ - 17,97,121,129,213,2,128,33,251,42,112,25,119,166,224,144,62,21,201,95,79,23,187,253,156,130,211,124,126,253,32,99, - 32,141,238,255,191,2,33,41,154,187,136,9,14,13,217,33,27,248,1,196,231,10,198,133,224,142,72,98,233,94,51,184, - ], - [ - 31,79,148,72,220,77,197,108,111,232,225,183,7,213,239,160,181,201,197,81,69,154,2,166,177,38,0,214,126,54,237,42, - 8,155,183,23,22,50,176,229,198,22,47,248,103,98,22,129,155,241,50,198,40,13,188,126,223,223,41,140,236,132,208,99, - ], - [ - 7,221,160,181,134,158,112,3,94,158,135,208,194,144,86,255,231,159,69,179,106,81,207,145,141,167,170,250,251,140,157,162, - 31,99,218,24,186,73,19,226,42,84,150,71,213,108,24,128,120,107,175,216,181,28,125,153,27,13,187,201,56,84,32,84, - ], - [ - 19,74,116,7,201,150,203,109,132,169,86,109,36,157,30,15,68,245,234,174,0,230,96,27,249,111,6,63,59,215,190,162, - 19,181,165,180,16,63,72,192,182,79,208,253,6,253,48,228,170,225,207,133,1,60,49,134,34,132,36,11,67,236,184,59, - ], - [ - 35,83,151,56,102,55,5,134,120,177,37,197,123,238,138,56,78,70,65,210,211,238,231,172,254,161,113,249,190,52,234,44, - 13,59,43,190,123,13,215,158,184,62,123,149,87,69,155,21,182,43,148,27,136,210,86,40,7,186,251,49,176,154,88,249, - ], - [ - 44,241,33,104,13,253,214,121,90,201,173,8,19,189,227,244,129,184,138,225,97,3,250,2,174,233,45,142,62,167,239,74, - 40,55,79,177,118,107,103,52,161,231,7,72,140,9,232,41,117,17,50,136,27,136,109,137,132,71,234,121,37,125,107,77, - ], - [ - 2,10,1,149,159,184,125,213,107,159,26,28,48,222,24,101,0,106,190,110,250,9,239,203,32,101,89,129,202,54,40,196, - 44,74,241,32,64,153,108,31,219,155,141,161,149,162,43,25,83,243,130,135,242,33,158,42,36,131,219,37,165,251,91,244, - ], - [ - 47,42,116,16,7,196,171,201,120,37,231,119,159,242,172,12,222,27,43,50,241,191,165,58,59,129,191,54,173,85,83,172, - 32,156,159,77,9,173,167,145,40,205,157,159,107,52,207,105,209,201,47,25,251,197,16,183,40,197,235,126,104,35,20,243, - ], - [ - 9,216,251,225,58,155,101,121,13,15,200,249,156,249,192,28,250,243,126,182,77,158,41,32,169,154,239,229,124,97,73,94, - 20,21,80,126,28,176,64,2,204,156,121,122,40,51,22,104,3,147,229,124,115,117,247,4,212,140,13,72,11,103,81,67, - ], - [ - 26,169,224,113,64,24,37,168,59,206,146,215,54,87,0,125,16,212,18,84,216,61,219,168,48,252,200,173,101,144,172,194, - 26,197,236,14,237,94,146,130,53,88,68,199,191,220,51,234,180,84,235,105,246,131,153,130,100,217,240,191,56,142,99,248, - ], - [ - 37,70,11,136,172,237,37,35,41,166,81,6,198,247,98,213,174,4,27,203,208,74,117,21,132,71,38,123,245,83,64,187, - 30,213,143,214,192,42,180,223,124,182,69,142,79,164,32,99,34,125,221,170,46,109,84,252,31,182,135,20,45,219,84,89, - ], - [ - 38,186,215,52,49,74,148,254,99,68,17,176,63,32,220,118,21,246,203,177,128,10,167,149,90,151,212,236,164,107,161,103, - 5,17,243,191,211,133,48,81,174,255,126,31,135,178,71,135,57,16,124,10,185,63,6,31,103,151,43,200,197,196,150,10, - ], - [ - 27,220,189,162,21,108,211,186,230,231,149,194,225,138,198,206,112,178,56,40,73,91,50,144,155,45,49,182,120,202,178,133, - 32,49,138,73,166,128,42,153,36,36,213,155,128,77,129,110,177,86,51,76,140,250,179,16,54,50,201,108,176,80,117,78, - ], - ] -}; \ No newline at end of file + vk_ic: &[ + [ + 23, 198, 68, 197, 114, 25, 97, 8, 212, 78, 90, 202, 89, 227, 165, 178, 46, 207, 107, + 214, 145, 168, 55, 47, 97, 71, 74, 74, 175, 108, 165, 164, 0, 162, 25, 202, 186, 102, + 182, 103, 132, 15, 99, 192, 232, 28, 193, 66, 205, 19, 158, 195, 249, 102, 14, 204, 0, + 26, 243, 70, 202, 165, 48, 133, + ], + [ + 2, 55, 119, 82, 210, 145, 178, 209, 104, 146, 133, 137, 154, 115, 8, 9, 21, 60, 89, 59, + 113, 116, 214, 196, 37, 46, 120, 112, 170, 176, 201, 206, 29, 69, 71, 125, 159, 14, + 236, 180, 219, 169, 119, 112, 29, 124, 168, 81, 244, 127, 202, 120, 160, 50, 243, 172, + 38, 255, 40, 192, 29, 64, 155, 81, + ], + [ + 40, 212, 131, 150, 203, 1, 141, 214, 2, 11, 150, 226, 129, 109, 84, 64, 188, 190, 71, + 44, 215, 115, 35, 198, 154, 90, 166, 217, 220, 61, 191, 168, 47, 34, 87, 145, 241, 108, + 95, 33, 45, 247, 184, 63, 88, 173, 247, 43, 169, 3, 128, 43, 5, 96, 104, 72, 130, 66, + 4, 16, 79, 242, 155, 226, + ], + [ + 42, 43, 71, 123, 159, 195, 121, 111, 72, 116, 217, 105, 15, 133, 107, 41, 218, 9, 40, + 52, 181, 26, 127, 78, 197, 218, 252, 156, 168, 216, 105, 38, 0, 253, 136, 101, 78, 255, + 188, 4, 109, 175, 194, 39, 75, 121, 81, 165, 34, 247, 2, 134, 178, 229, 118, 150, 182, + 209, 111, 92, 219, 161, 115, 221, + ], + [ + 6, 179, 96, 45, 68, 58, 148, 21, 122, 16, 51, 116, 14, 50, 113, 136, 1, 209, 37, 190, + 57, 43, 242, 105, 230, 157, 16, 21, 25, 253, 15, 119, 31, 171, 187, 155, 226, 172, 162, + 220, 251, 238, 128, 58, 177, 43, 13, 97, 206, 101, 211, 49, 190, 8, 176, 146, 229, 132, + 135, 57, 30, 164, 26, 26, + ], + [ + 17, 97, 121, 129, 213, 2, 128, 33, 251, 42, 112, 25, 119, 166, 224, 144, 62, 21, 201, + 95, 79, 23, 187, 253, 156, 130, 211, 124, 126, 253, 32, 99, 32, 141, 238, 255, 191, 2, + 33, 41, 154, 187, 136, 9, 14, 13, 217, 33, 27, 248, 1, 196, 231, 10, 198, 133, 224, + 142, 72, 98, 233, 94, 51, 184, + ], + [ + 31, 79, 148, 72, 220, 77, 197, 108, 111, 232, 225, 183, 7, 213, 239, 160, 181, 201, + 197, 81, 69, 154, 2, 166, 177, 38, 0, 214, 126, 54, 237, 42, 8, 155, 183, 23, 22, 50, + 176, 229, 198, 22, 47, 248, 103, 98, 22, 129, 155, 241, 50, 198, 40, 13, 188, 126, 223, + 223, 41, 140, 236, 132, 208, 99, + ], + [ + 7, 221, 160, 181, 134, 158, 112, 3, 94, 158, 135, 208, 194, 144, 86, 255, 231, 159, 69, + 179, 106, 81, 207, 145, 141, 167, 170, 250, 251, 140, 157, 162, 31, 99, 218, 24, 186, + 73, 19, 226, 42, 84, 150, 71, 213, 108, 24, 128, 120, 107, 175, 216, 181, 28, 125, 153, + 27, 13, 187, 201, 56, 84, 32, 84, + ], + [ + 19, 74, 116, 7, 201, 150, 203, 109, 132, 169, 86, 109, 36, 157, 30, 15, 68, 245, 234, + 174, 0, 230, 96, 27, 249, 111, 6, 63, 59, 215, 190, 162, 19, 181, 165, 180, 16, 63, 72, + 192, 182, 79, 208, 253, 6, 253, 48, 228, 170, 225, 207, 133, 1, 60, 49, 134, 34, 132, + 36, 11, 67, 236, 184, 59, + ], + [ + 35, 83, 151, 56, 102, 55, 5, 134, 120, 177, 37, 197, 123, 238, 138, 56, 78, 70, 65, + 210, 211, 238, 231, 172, 254, 161, 113, 249, 190, 52, 234, 44, 13, 59, 43, 190, 123, + 13, 215, 158, 184, 62, 123, 149, 87, 69, 155, 21, 182, 43, 148, 27, 136, 210, 86, 40, + 7, 186, 251, 49, 176, 154, 88, 249, + ], + [ + 44, 241, 33, 104, 13, 253, 214, 121, 90, 201, 173, 8, 19, 189, 227, 244, 129, 184, 138, + 225, 97, 3, 250, 2, 174, 233, 45, 142, 62, 167, 239, 74, 40, 55, 79, 177, 118, 107, + 103, 52, 161, 231, 7, 72, 140, 9, 232, 41, 117, 17, 50, 136, 27, 136, 109, 137, 132, + 71, 234, 121, 37, 125, 107, 77, + ], + [ + 2, 10, 1, 149, 159, 184, 125, 213, 107, 159, 26, 28, 48, 222, 24, 101, 0, 106, 190, + 110, 250, 9, 239, 203, 32, 101, 89, 129, 202, 54, 40, 196, 44, 74, 241, 32, 64, 153, + 108, 31, 219, 155, 141, 161, 149, 162, 43, 25, 83, 243, 130, 135, 242, 33, 158, 42, 36, + 131, 219, 37, 165, 251, 91, 244, + ], + [ + 47, 42, 116, 16, 7, 196, 171, 201, 120, 37, 231, 119, 159, 242, 172, 12, 222, 27, 43, + 50, 241, 191, 165, 58, 59, 129, 191, 54, 173, 85, 83, 172, 32, 156, 159, 77, 9, 173, + 167, 145, 40, 205, 157, 159, 107, 52, 207, 105, 209, 201, 47, 25, 251, 197, 16, 183, + 40, 197, 235, 126, 104, 35, 20, 243, + ], + [ + 9, 216, 251, 225, 58, 155, 101, 121, 13, 15, 200, 249, 156, 249, 192, 28, 250, 243, + 126, 182, 77, 158, 41, 32, 169, 154, 239, 229, 124, 97, 73, 94, 20, 21, 80, 126, 28, + 176, 64, 2, 204, 156, 121, 122, 40, 51, 22, 104, 3, 147, 229, 124, 115, 117, 247, 4, + 212, 140, 13, 72, 11, 103, 81, 67, + ], + [ + 26, 169, 224, 113, 64, 24, 37, 168, 59, 206, 146, 215, 54, 87, 0, 125, 16, 212, 18, 84, + 216, 61, 219, 168, 48, 252, 200, 173, 101, 144, 172, 194, 26, 197, 236, 14, 237, 94, + 146, 130, 53, 88, 68, 199, 191, 220, 51, 234, 180, 84, 235, 105, 246, 131, 153, 130, + 100, 217, 240, 191, 56, 142, 99, 248, + ], + [ + 37, 70, 11, 136, 172, 237, 37, 35, 41, 166, 81, 6, 198, 247, 98, 213, 174, 4, 27, 203, + 208, 74, 117, 21, 132, 71, 38, 123, 245, 83, 64, 187, 30, 213, 143, 214, 192, 42, 180, + 223, 124, 182, 69, 142, 79, 164, 32, 99, 34, 125, 221, 170, 46, 109, 84, 252, 31, 182, + 135, 20, 45, 219, 84, 89, + ], + [ + 38, 186, 215, 52, 49, 74, 148, 254, 99, 68, 17, 176, 63, 32, 220, 118, 21, 246, 203, + 177, 128, 10, 167, 149, 90, 151, 212, 236, 164, 107, 161, 103, 5, 17, 243, 191, 211, + 133, 48, 81, 174, 255, 126, 31, 135, 178, 71, 135, 57, 16, 124, 10, 185, 63, 6, 31, + 103, 151, 43, 200, 197, 196, 150, 10, + ], + [ + 27, 220, 189, 162, 21, 108, 211, 186, 230, 231, 149, 194, 225, 138, 198, 206, 112, 178, + 56, 40, 73, 91, 50, 144, 155, 45, 49, 182, 120, 202, 178, 133, 32, 49, 138, 73, 166, + 128, 42, 153, 36, 36, 213, 155, 128, 77, 129, 110, 177, 86, 51, 76, 140, 250, 179, 16, + 54, 50, 201, 108, 176, 80, 117, 78, + ], + ], +}; diff --git a/light-system-programs/programs/verifier_program_two/src/verifying_key.rs b/light-system-programs/programs/verifier_program_two/src/verifying_key.rs index faffab4040..68b407cd4c 100644 --- a/light-system-programs/programs/verifier_program_two/src/verifying_key.rs +++ b/light-system-programs/programs/verifier_program_two/src/verifying_key.rs @@ -1,98 +1,141 @@ use groth16_solana::groth16::Groth16Verifyingkey; -pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { - nr_pubinputs: 16, +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 16, - vk_alpha_g1: [ - 45,77,154,167,227,2,217,223,65,116,157,85,7,148,157,5,219,234,51,251,177,108,100,59,34,245,153,162,190,109,242,226, - 20,190,221,80,60,55,206,176,97,216,236,96,32,159,227,69,206,137,131,10,25,35,3,1,240,118,202,255,0,77,25,38, - ], + vk_alpha_g1: [ + 45, 77, 154, 167, 227, 2, 217, 223, 65, 116, 157, 85, 7, 148, 157, 5, 219, 234, 51, 251, + 177, 108, 100, 59, 34, 245, 153, 162, 190, 109, 242, 226, 20, 190, 221, 80, 60, 55, 206, + 176, 97, 216, 236, 96, 32, 159, 227, 69, 206, 137, 131, 10, 25, 35, 3, 1, 240, 118, 202, + 255, 0, 77, 25, 38, + ], - vk_beta_g2: [ - 9,103,3,47,203,247,118,209,175,201,133,248,136,119,241,130,211,132,128,166,83,242,222,202,169,121,76,188,59,243,6,12, - 14,24,120,71,173,76,121,131,116,208,214,115,43,245,1,132,125,214,139,192,224,113,36,30,2,19,188,127,193,61,183,171, - 48,76,251,209,224,138,112,74,153,245,232,71,217,63,140,60,170,253,222,196,107,122,13,55,157,166,154,77,17,35,70,167, - 23,57,193,177,164,87,168,199,49,49,35,210,77,47,145,146,248,150,183,198,62,234,5,169,213,127,6,84,122,208,206,200, - ], + vk_beta_g2: [ + 9, 103, 3, 47, 203, 247, 118, 209, 175, 201, 133, 248, 136, 119, 241, 130, 211, 132, 128, + 166, 83, 242, 222, 202, 169, 121, 76, 188, 59, 243, 6, 12, 14, 24, 120, 71, 173, 76, 121, + 131, 116, 208, 214, 115, 43, 245, 1, 132, 125, 214, 139, 192, 224, 113, 36, 30, 2, 19, 188, + 127, 193, 61, 183, 171, 48, 76, 251, 209, 224, 138, 112, 74, 153, 245, 232, 71, 217, 63, + 140, 60, 170, 253, 222, 196, 107, 122, 13, 55, 157, 166, 154, 77, 17, 35, 70, 167, 23, 57, + 193, 177, 164, 87, 168, 199, 49, 49, 35, 210, 77, 47, 145, 146, 248, 150, 183, 198, 62, + 234, 5, 169, 213, 127, 6, 84, 122, 208, 206, 200, + ], - vk_gamme_g2: [ - 25,142,147,147,146,13,72,58,114,96,191,183,49,251,93,37,241,170,73,51,53,169,231,18,151,228,133,183,174,243,18,194, - 24,0,222,239,18,31,30,118,66,106,0,102,94,92,68,121,103,67,34,212,247,94,218,221,70,222,189,92,217,146,246,237, - 9,6,137,208,88,95,240,117,236,158,153,173,105,12,51,149,188,75,49,51,112,179,142,243,85,172,218,220,209,34,151,91, - 18,200,94,165,219,140,109,235,74,171,113,128,141,203,64,143,227,209,231,105,12,67,211,123,76,230,204,1,102,250,125,170, - ], + vk_gamme_g2: [ + 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, + 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, + 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, + 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, + 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, + 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, + 123, 76, 230, 204, 1, 102, 250, 125, 170, + ], - vk_delta_g2: [ - 28,0,41,116,12,150,19,85,139,132,151,57,133,47,13,142,76,24,91,13,176,221,224,168,177,31,186,176,41,166,223,21, - 7,245,117,4,238,116,230,169,34,252,106,102,154,20,135,73,98,183,25,125,127,78,32,194,144,229,48,151,141,120,187,191, - 39,230,138,117,90,94,114,3,104,60,9,12,90,240,41,131,140,55,104,186,75,93,179,202,39,93,248,133,89,190,89,83, - 10,186,126,99,169,247,179,103,234,8,119,198,37,205,142,219,147,99,67,238,109,81,7,133,22,19,134,176,229,240,190,36, - ], + vk_delta_g2: [ + 28, 0, 41, 116, 12, 150, 19, 85, 139, 132, 151, 57, 133, 47, 13, 142, 76, 24, 91, 13, 176, + 221, 224, 168, 177, 31, 186, 176, 41, 166, 223, 21, 7, 245, 117, 4, 238, 116, 230, 169, 34, + 252, 106, 102, 154, 20, 135, 73, 98, 183, 25, 125, 127, 78, 32, 194, 144, 229, 48, 151, + 141, 120, 187, 191, 39, 230, 138, 117, 90, 94, 114, 3, 104, 60, 9, 12, 90, 240, 41, 131, + 140, 55, 104, 186, 75, 93, 179, 202, 39, 93, 248, 133, 89, 190, 89, 83, 10, 186, 126, 99, + 169, 247, 179, 103, 234, 8, 119, 198, 37, 205, 142, 219, 147, 99, 67, 238, 109, 81, 7, 133, + 22, 19, 134, 176, 229, 240, 190, 36, + ], - vk_ic: &[ - [ - 33,135,140,77,71,193,22,100,58,80,18,75,34,14,109,43,70,188,26,16,249,167,143,0,112,18,76,209,245,204,52,218, - 21,226,104,137,7,47,43,192,84,90,99,12,61,38,244,50,137,203,20,97,207,45,90,26,241,135,12,8,29,11,206,118, - ], - [ - 3,169,41,57,37,51,55,38,230,165,8,20,230,112,176,38,13,162,58,8,172,218,18,104,199,51,5,123,162,72,2,113, - 44,167,242,210,199,57,243,172,149,166,199,88,99,94,219,110,108,29,151,146,106,10,200,33,105,134,69,165,99,188,17,141, - ], - [ - 40,79,94,54,36,31,126,53,70,141,150,92,34,145,203,143,251,33,36,234,39,176,221,215,162,100,150,48,131,57,57,139, - 20,207,82,248,246,49,4,51,81,253,208,225,213,131,193,77,60,207,112,237,41,227,106,81,252,83,253,92,105,186,223,134, - ], - [ - 18,64,62,175,217,9,199,160,116,90,234,251,3,208,208,239,239,51,7,57,191,27,47,138,61,139,107,57,79,173,13,67, - 37,229,155,59,92,29,157,218,36,177,162,124,9,69,229,200,135,47,67,179,30,177,77,86,6,114,100,237,65,144,54,203, - ], - [ - 41,223,254,150,8,62,230,51,183,199,227,168,165,165,97,255,134,56,201,210,78,51,156,143,94,183,128,91,122,208,112,241, - 21,38,249,187,210,216,53,9,188,194,84,218,155,119,54,149,221,31,214,41,68,28,13,65,140,120,111,210,139,224,201,170, - ], - [ - 13,108,85,38,217,253,67,42,27,223,192,57,62,130,186,62,49,242,175,212,182,249,70,194,4,237,47,248,200,199,68,186, - 34,89,193,230,242,162,139,54,26,214,42,155,183,206,134,168,250,239,14,42,134,155,149,76,6,68,132,179,249,81,163,163, - ], - [ - 36,253,114,22,182,244,9,208,219,205,90,212,148,85,91,214,36,253,109,49,15,115,86,27,178,197,64,10,47,249,201,223, - 22,81,59,112,223,73,57,194,90,183,60,92,10,135,129,184,132,209,38,95,31,1,236,237,36,122,118,46,175,24,98,198, - ], - [ - 8,51,12,49,230,11,31,25,82,170,184,15,92,76,103,190,35,0,58,77,118,100,246,35,52,11,19,32,223,236,220,226, - 28,147,125,166,140,151,109,121,99,213,132,4,54,170,236,157,33,188,96,150,15,211,36,89,102,235,78,17,78,125,143,195, - ], - [ - 40,18,0,72,15,50,242,145,165,205,38,231,219,216,62,123,254,84,57,87,178,139,157,167,118,116,145,197,14,240,22,155, - 22,100,151,56,116,216,106,25,38,33,15,170,242,43,201,17,7,176,181,6,204,34,111,244,70,195,138,161,54,97,51,147, - ], - [ - 42,78,243,222,232,198,74,236,34,26,123,244,15,247,239,96,7,103,46,38,157,199,183,166,219,64,94,55,140,179,183,182, - 36,39,169,227,77,82,120,178,200,173,139,26,94,229,0,127,193,249,30,60,70,11,74,6,119,92,147,160,194,230,17,17, - ], - [ - 4,59,101,59,240,233,121,223,45,83,222,23,181,67,178,29,222,49,237,239,214,109,212,27,209,226,32,105,214,127,50,207, - 28,196,233,244,72,235,136,124,86,11,67,125,211,228,96,254,62,181,246,12,58,49,35,31,246,8,74,39,78,229,70,182, - ], - [ - 35,152,24,67,136,73,125,103,236,133,179,98,191,159,236,82,150,20,119,179,62,28,146,241,134,190,139,155,84,85,91,153, - 33,217,218,146,79,143,197,233,71,47,147,50,83,48,126,44,59,99,73,248,110,230,114,43,142,92,152,182,101,118,167,83, - ], - [ - 36,43,150,232,129,180,141,233,185,183,45,218,100,228,77,12,173,141,92,204,105,155,216,206,143,98,220,68,112,180,135,234, - 46,156,5,244,47,79,106,140,164,209,208,218,62,34,11,141,86,14,242,28,54,212,116,113,215,40,7,252,133,252,55,99, - ], - [ - 17,217,118,37,253,42,57,23,132,16,27,163,128,196,241,46,46,200,58,46,242,61,201,66,18,215,202,191,214,128,174,174, - 24,99,249,9,245,232,242,252,247,98,244,246,195,81,88,185,233,223,168,246,72,218,37,66,40,182,172,213,86,198,5,32, - ], - [ - 18,246,145,85,197,111,120,231,233,74,223,189,42,119,228,96,20,48,151,142,88,210,174,93,238,167,220,106,61,103,179,47, - 41,151,10,122,133,98,68,228,209,141,245,138,218,120,180,58,97,140,35,40,150,197,202,43,6,173,85,10,144,29,102,196, - ], - [ - 3,113,156,68,39,132,161,206,208,96,102,103,222,194,100,118,96,162,239,157,41,154,158,205,182,142,59,86,216,188,246,107, - 47,59,91,143,43,55,97,83,207,104,39,171,36,221,154,124,54,198,69,36,23,83,221,104,231,133,55,179,164,211,243,84, - ], - ] -}; \ No newline at end of file + vk_ic: &[ + [ + 33, 135, 140, 77, 71, 193, 22, 100, 58, 80, 18, 75, 34, 14, 109, 43, 70, 188, 26, 16, + 249, 167, 143, 0, 112, 18, 76, 209, 245, 204, 52, 218, 21, 226, 104, 137, 7, 47, 43, + 192, 84, 90, 99, 12, 61, 38, 244, 50, 137, 203, 20, 97, 207, 45, 90, 26, 241, 135, 12, + 8, 29, 11, 206, 118, + ], + [ + 3, 169, 41, 57, 37, 51, 55, 38, 230, 165, 8, 20, 230, 112, 176, 38, 13, 162, 58, 8, + 172, 218, 18, 104, 199, 51, 5, 123, 162, 72, 2, 113, 44, 167, 242, 210, 199, 57, 243, + 172, 149, 166, 199, 88, 99, 94, 219, 110, 108, 29, 151, 146, 106, 10, 200, 33, 105, + 134, 69, 165, 99, 188, 17, 141, + ], + [ + 40, 79, 94, 54, 36, 31, 126, 53, 70, 141, 150, 92, 34, 145, 203, 143, 251, 33, 36, 234, + 39, 176, 221, 215, 162, 100, 150, 48, 131, 57, 57, 139, 20, 207, 82, 248, 246, 49, 4, + 51, 81, 253, 208, 225, 213, 131, 193, 77, 60, 207, 112, 237, 41, 227, 106, 81, 252, 83, + 253, 92, 105, 186, 223, 134, + ], + [ + 18, 64, 62, 175, 217, 9, 199, 160, 116, 90, 234, 251, 3, 208, 208, 239, 239, 51, 7, 57, + 191, 27, 47, 138, 61, 139, 107, 57, 79, 173, 13, 67, 37, 229, 155, 59, 92, 29, 157, + 218, 36, 177, 162, 124, 9, 69, 229, 200, 135, 47, 67, 179, 30, 177, 77, 86, 6, 114, + 100, 237, 65, 144, 54, 203, + ], + [ + 41, 223, 254, 150, 8, 62, 230, 51, 183, 199, 227, 168, 165, 165, 97, 255, 134, 56, 201, + 210, 78, 51, 156, 143, 94, 183, 128, 91, 122, 208, 112, 241, 21, 38, 249, 187, 210, + 216, 53, 9, 188, 194, 84, 218, 155, 119, 54, 149, 221, 31, 214, 41, 68, 28, 13, 65, + 140, 120, 111, 210, 139, 224, 201, 170, + ], + [ + 13, 108, 85, 38, 217, 253, 67, 42, 27, 223, 192, 57, 62, 130, 186, 62, 49, 242, 175, + 212, 182, 249, 70, 194, 4, 237, 47, 248, 200, 199, 68, 186, 34, 89, 193, 230, 242, 162, + 139, 54, 26, 214, 42, 155, 183, 206, 134, 168, 250, 239, 14, 42, 134, 155, 149, 76, 6, + 68, 132, 179, 249, 81, 163, 163, + ], + [ + 36, 253, 114, 22, 182, 244, 9, 208, 219, 205, 90, 212, 148, 85, 91, 214, 36, 253, 109, + 49, 15, 115, 86, 27, 178, 197, 64, 10, 47, 249, 201, 223, 22, 81, 59, 112, 223, 73, 57, + 194, 90, 183, 60, 92, 10, 135, 129, 184, 132, 209, 38, 95, 31, 1, 236, 237, 36, 122, + 118, 46, 175, 24, 98, 198, + ], + [ + 8, 51, 12, 49, 230, 11, 31, 25, 82, 170, 184, 15, 92, 76, 103, 190, 35, 0, 58, 77, 118, + 100, 246, 35, 52, 11, 19, 32, 223, 236, 220, 226, 28, 147, 125, 166, 140, 151, 109, + 121, 99, 213, 132, 4, 54, 170, 236, 157, 33, 188, 96, 150, 15, 211, 36, 89, 102, 235, + 78, 17, 78, 125, 143, 195, + ], + [ + 40, 18, 0, 72, 15, 50, 242, 145, 165, 205, 38, 231, 219, 216, 62, 123, 254, 84, 57, 87, + 178, 139, 157, 167, 118, 116, 145, 197, 14, 240, 22, 155, 22, 100, 151, 56, 116, 216, + 106, 25, 38, 33, 15, 170, 242, 43, 201, 17, 7, 176, 181, 6, 204, 34, 111, 244, 70, 195, + 138, 161, 54, 97, 51, 147, + ], + [ + 42, 78, 243, 222, 232, 198, 74, 236, 34, 26, 123, 244, 15, 247, 239, 96, 7, 103, 46, + 38, 157, 199, 183, 166, 219, 64, 94, 55, 140, 179, 183, 182, 36, 39, 169, 227, 77, 82, + 120, 178, 200, 173, 139, 26, 94, 229, 0, 127, 193, 249, 30, 60, 70, 11, 74, 6, 119, 92, + 147, 160, 194, 230, 17, 17, + ], + [ + 4, 59, 101, 59, 240, 233, 121, 223, 45, 83, 222, 23, 181, 67, 178, 29, 222, 49, 237, + 239, 214, 109, 212, 27, 209, 226, 32, 105, 214, 127, 50, 207, 28, 196, 233, 244, 72, + 235, 136, 124, 86, 11, 67, 125, 211, 228, 96, 254, 62, 181, 246, 12, 58, 49, 35, 31, + 246, 8, 74, 39, 78, 229, 70, 182, + ], + [ + 35, 152, 24, 67, 136, 73, 125, 103, 236, 133, 179, 98, 191, 159, 236, 82, 150, 20, 119, + 179, 62, 28, 146, 241, 134, 190, 139, 155, 84, 85, 91, 153, 33, 217, 218, 146, 79, 143, + 197, 233, 71, 47, 147, 50, 83, 48, 126, 44, 59, 99, 73, 248, 110, 230, 114, 43, 142, + 92, 152, 182, 101, 118, 167, 83, + ], + [ + 36, 43, 150, 232, 129, 180, 141, 233, 185, 183, 45, 218, 100, 228, 77, 12, 173, 141, + 92, 204, 105, 155, 216, 206, 143, 98, 220, 68, 112, 180, 135, 234, 46, 156, 5, 244, 47, + 79, 106, 140, 164, 209, 208, 218, 62, 34, 11, 141, 86, 14, 242, 28, 54, 212, 116, 113, + 215, 40, 7, 252, 133, 252, 55, 99, + ], + [ + 17, 217, 118, 37, 253, 42, 57, 23, 132, 16, 27, 163, 128, 196, 241, 46, 46, 200, 58, + 46, 242, 61, 201, 66, 18, 215, 202, 191, 214, 128, 174, 174, 24, 99, 249, 9, 245, 232, + 242, 252, 247, 98, 244, 246, 195, 81, 88, 185, 233, 223, 168, 246, 72, 218, 37, 66, 40, + 182, 172, 213, 86, 198, 5, 32, + ], + [ + 18, 246, 145, 85, 197, 111, 120, 231, 233, 74, 223, 189, 42, 119, 228, 96, 20, 48, 151, + 142, 88, 210, 174, 93, 238, 167, 220, 106, 61, 103, 179, 47, 41, 151, 10, 122, 133, 98, + 68, 228, 209, 141, 245, 138, 218, 120, 180, 58, 97, 140, 35, 40, 150, 197, 202, 43, 6, + 173, 85, 10, 144, 29, 102, 196, + ], + [ + 3, 113, 156, 68, 39, 132, 161, 206, 208, 96, 102, 103, 222, 194, 100, 118, 96, 162, + 239, 157, 41, 154, 158, 205, 182, 142, 59, 86, 216, 188, 246, 107, 47, 59, 91, 143, 43, + 55, 97, 83, 207, 104, 39, 171, 36, 221, 154, 124, 54, 198, 69, 36, 23, 83, 221, 104, + 231, 133, 55, 179, 164, 211, 243, 84, + ], + ], +}; diff --git a/light-system-programs/programs/verifier_program_zero/src/verifying_key.rs b/light-system-programs/programs/verifier_program_zero/src/verifying_key.rs index 3ded31fa41..2261e6f014 100644 --- a/light-system-programs/programs/verifier_program_zero/src/verifying_key.rs +++ b/light-system-programs/programs/verifier_program_zero/src/verifying_key.rs @@ -1,74 +1,105 @@ use groth16_solana::groth16::Groth16Verifyingkey; -pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { - nr_pubinputs: 10, +pub const VERIFYINGKEY: Groth16Verifyingkey = Groth16Verifyingkey { + nr_pubinputs: 10, - vk_alpha_g1: [ - 45,77,154,167,227,2,217,223,65,116,157,85,7,148,157,5,219,234,51,251,177,108,100,59,34,245,153,162,190,109,242,226, - 20,190,221,80,60,55,206,176,97,216,236,96,32,159,227,69,206,137,131,10,25,35,3,1,240,118,202,255,0,77,25,38, - ], + vk_alpha_g1: [ + 45, 77, 154, 167, 227, 2, 217, 223, 65, 116, 157, 85, 7, 148, 157, 5, 219, 234, 51, 251, + 177, 108, 100, 59, 34, 245, 153, 162, 190, 109, 242, 226, 20, 190, 221, 80, 60, 55, 206, + 176, 97, 216, 236, 96, 32, 159, 227, 69, 206, 137, 131, 10, 25, 35, 3, 1, 240, 118, 202, + 255, 0, 77, 25, 38, + ], - vk_beta_g2: [ - 9,103,3,47,203,247,118,209,175,201,133,248,136,119,241,130,211,132,128,166,83,242,222,202,169,121,76,188,59,243,6,12, - 14,24,120,71,173,76,121,131,116,208,214,115,43,245,1,132,125,214,139,192,224,113,36,30,2,19,188,127,193,61,183,171, - 48,76,251,209,224,138,112,74,153,245,232,71,217,63,140,60,170,253,222,196,107,122,13,55,157,166,154,77,17,35,70,167, - 23,57,193,177,164,87,168,199,49,49,35,210,77,47,145,146,248,150,183,198,62,234,5,169,213,127,6,84,122,208,206,200, - ], + vk_beta_g2: [ + 9, 103, 3, 47, 203, 247, 118, 209, 175, 201, 133, 248, 136, 119, 241, 130, 211, 132, 128, + 166, 83, 242, 222, 202, 169, 121, 76, 188, 59, 243, 6, 12, 14, 24, 120, 71, 173, 76, 121, + 131, 116, 208, 214, 115, 43, 245, 1, 132, 125, 214, 139, 192, 224, 113, 36, 30, 2, 19, 188, + 127, 193, 61, 183, 171, 48, 76, 251, 209, 224, 138, 112, 74, 153, 245, 232, 71, 217, 63, + 140, 60, 170, 253, 222, 196, 107, 122, 13, 55, 157, 166, 154, 77, 17, 35, 70, 167, 23, 57, + 193, 177, 164, 87, 168, 199, 49, 49, 35, 210, 77, 47, 145, 146, 248, 150, 183, 198, 62, + 234, 5, 169, 213, 127, 6, 84, 122, 208, 206, 200, + ], - vk_gamme_g2: [ - 25,142,147,147,146,13,72,58,114,96,191,183,49,251,93,37,241,170,73,51,53,169,231,18,151,228,133,183,174,243,18,194, - 24,0,222,239,18,31,30,118,66,106,0,102,94,92,68,121,103,67,34,212,247,94,218,221,70,222,189,92,217,146,246,237, - 9,6,137,208,88,95,240,117,236,158,153,173,105,12,51,149,188,75,49,51,112,179,142,243,85,172,218,220,209,34,151,91, - 18,200,94,165,219,140,109,235,74,171,113,128,141,203,64,143,227,209,231,105,12,67,211,123,76,230,204,1,102,250,125,170, - ], + vk_gamme_g2: [ + 25, 142, 147, 147, 146, 13, 72, 58, 114, 96, 191, 183, 49, 251, 93, 37, 241, 170, 73, 51, + 53, 169, 231, 18, 151, 228, 133, 183, 174, 243, 18, 194, 24, 0, 222, 239, 18, 31, 30, 118, + 66, 106, 0, 102, 94, 92, 68, 121, 103, 67, 34, 212, 247, 94, 218, 221, 70, 222, 189, 92, + 217, 146, 246, 237, 9, 6, 137, 208, 88, 95, 240, 117, 236, 158, 153, 173, 105, 12, 51, 149, + 188, 75, 49, 51, 112, 179, 142, 243, 85, 172, 218, 220, 209, 34, 151, 91, 18, 200, 94, 165, + 219, 140, 109, 235, 74, 171, 113, 128, 141, 203, 64, 143, 227, 209, 231, 105, 12, 67, 211, + 123, 76, 230, 204, 1, 102, 250, 125, 170, + ], - vk_delta_g2: [ - 44,239,81,225,138,199,56,80,203,170,159,134,232,35,84,251,247,175,247,42,2,40,111,160,77,68,10,199,184,70,186,91, - 13,14,114,132,197,206,18,189,41,208,202,223,117,111,102,35,109,178,140,117,151,8,209,210,142,25,131,200,211,113,236,15, - 16,58,93,160,240,42,116,39,106,84,76,176,91,254,97,16,105,220,107,128,229,159,91,117,245,230,210,250,23,83,14,103, - 40,59,89,231,123,142,152,42,254,7,190,123,96,131,68,221,178,181,207,126,223,148,218,3,210,35,134,51,43,21,200,227, - ], + vk_delta_g2: [ + 44, 239, 81, 225, 138, 199, 56, 80, 203, 170, 159, 134, 232, 35, 84, 251, 247, 175, 247, + 42, 2, 40, 111, 160, 77, 68, 10, 199, 184, 70, 186, 91, 13, 14, 114, 132, 197, 206, 18, + 189, 41, 208, 202, 223, 117, 111, 102, 35, 109, 178, 140, 117, 151, 8, 209, 210, 142, 25, + 131, 200, 211, 113, 236, 15, 16, 58, 93, 160, 240, 42, 116, 39, 106, 84, 76, 176, 91, 254, + 97, 16, 105, 220, 107, 128, 229, 159, 91, 117, 245, 230, 210, 250, 23, 83, 14, 103, 40, 59, + 89, 231, 123, 142, 152, 42, 254, 7, 190, 123, 96, 131, 68, 221, 178, 181, 207, 126, 223, + 148, 218, 3, 210, 35, 134, 51, 43, 21, 200, 227, + ], - vk_ic: &[ - [ - 41,245,109,73,147,163,68,160,253,20,147,95,178,37,104,229,249,125,2,34,192,250,6,80,96,87,61,36,47,10,151,17, - 5,67,44,252,97,116,33,0,242,58,70,58,12,252,198,242,116,94,16,143,63,109,127,166,192,230,150,4,19,73,58,89, - ], - [ - 14,194,148,5,192,240,196,184,183,169,108,203,1,178,70,115,209,173,154,178,163,180,103,116,28,87,46,1,80,216,98,48, - 45,62,80,187,14,15,8,200,156,9,85,172,31,203,10,198,102,253,126,221,246,95,6,72,128,39,66,135,25,80,247,110, - ], - [ - 3,27,36,104,25,162,2,204,173,221,186,217,130,89,110,83,150,32,187,161,24,201,227,51,57,254,179,231,255,16,95,53, - 26,219,219,185,43,123,8,125,65,24,27,125,176,125,244,171,96,112,17,116,231,213,57,90,243,64,160,171,17,85,253,36, - ], - [ - 5,205,199,85,37,74,207,65,114,171,218,123,130,7,205,88,247,173,76,226,116,132,84,137,134,24,17,39,134,147,241,196, - 32,6,208,233,121,252,13,249,106,232,86,8,208,166,73,49,174,128,186,123,148,233,30,82,38,163,197,0,37,248,32,9, - ], - [ - 22,198,102,214,56,237,28,72,217,139,49,109,11,151,189,99,180,69,210,66,10,92,209,217,209,41,213,170,183,190,115,148, - 17,203,177,245,33,121,85,175,21,9,223,25,83,72,69,78,148,9,55,223,136,199,144,76,35,225,229,62,19,220,5,106, - ], - [ - 30,186,140,157,222,181,73,231,187,104,47,185,157,70,44,144,97,34,15,57,242,127,129,60,66,236,244,91,157,47,113,118, - 1,16,75,217,84,38,24,236,234,154,219,77,47,63,222,61,116,178,175,229,206,98,239,127,3,134,209,147,24,165,70,135, - ], - [ - 35,75,138,181,148,165,157,78,72,110,79,246,97,53,159,146,67,49,169,86,22,100,102,233,88,255,187,192,166,24,166,224, - 29,165,138,55,69,169,17,101,7,101,113,212,245,114,86,206,30,85,152,38,173,59,144,98,59,180,130,21,215,54,51,172, - ], - [ - 16,152,60,218,87,90,32,55,197,75,35,75,49,5,106,119,65,181,38,184,254,64,90,226,30,13,12,121,243,152,148,215, - 18,116,243,164,33,94,171,59,207,240,233,200,175,20,168,0,182,116,90,196,197,144,71,151,27,210,2,86,206,44,64,25, - ], - [ - 22,211,126,224,228,185,164,106,92,62,142,202,186,147,44,130,153,120,98,69,22,164,244,180,206,99,102,228,237,1,26,249, - 16,197,207,28,244,119,100,2,52,141,133,118,85,251,224,10,61,210,59,174,150,62,3,199,141,180,200,158,132,191,137,3, - ], - [ - 47,176,172,39,158,126,194,195,237,158,210,27,50,173,243,148,89,55,150,250,236,234,35,161,182,122,209,106,44,232,244,28, - 14,126,245,10,194,216,200,169,12,174,1,39,119,83,117,216,105,106,234,76,80,63,145,209,72,28,99,59,100,110,75,245, - ], - ] -}; \ No newline at end of file + vk_ic: &[ + [ + 41, 245, 109, 73, 147, 163, 68, 160, 253, 20, 147, 95, 178, 37, 104, 229, 249, 125, 2, + 34, 192, 250, 6, 80, 96, 87, 61, 36, 47, 10, 151, 17, 5, 67, 44, 252, 97, 116, 33, 0, + 242, 58, 70, 58, 12, 252, 198, 242, 116, 94, 16, 143, 63, 109, 127, 166, 192, 230, 150, + 4, 19, 73, 58, 89, + ], + [ + 14, 194, 148, 5, 192, 240, 196, 184, 183, 169, 108, 203, 1, 178, 70, 115, 209, 173, + 154, 178, 163, 180, 103, 116, 28, 87, 46, 1, 80, 216, 98, 48, 45, 62, 80, 187, 14, 15, + 8, 200, 156, 9, 85, 172, 31, 203, 10, 198, 102, 253, 126, 221, 246, 95, 6, 72, 128, 39, + 66, 135, 25, 80, 247, 110, + ], + [ + 3, 27, 36, 104, 25, 162, 2, 204, 173, 221, 186, 217, 130, 89, 110, 83, 150, 32, 187, + 161, 24, 201, 227, 51, 57, 254, 179, 231, 255, 16, 95, 53, 26, 219, 219, 185, 43, 123, + 8, 125, 65, 24, 27, 125, 176, 125, 244, 171, 96, 112, 17, 116, 231, 213, 57, 90, 243, + 64, 160, 171, 17, 85, 253, 36, + ], + [ + 5, 205, 199, 85, 37, 74, 207, 65, 114, 171, 218, 123, 130, 7, 205, 88, 247, 173, 76, + 226, 116, 132, 84, 137, 134, 24, 17, 39, 134, 147, 241, 196, 32, 6, 208, 233, 121, 252, + 13, 249, 106, 232, 86, 8, 208, 166, 73, 49, 174, 128, 186, 123, 148, 233, 30, 82, 38, + 163, 197, 0, 37, 248, 32, 9, + ], + [ + 22, 198, 102, 214, 56, 237, 28, 72, 217, 139, 49, 109, 11, 151, 189, 99, 180, 69, 210, + 66, 10, 92, 209, 217, 209, 41, 213, 170, 183, 190, 115, 148, 17, 203, 177, 245, 33, + 121, 85, 175, 21, 9, 223, 25, 83, 72, 69, 78, 148, 9, 55, 223, 136, 199, 144, 76, 35, + 225, 229, 62, 19, 220, 5, 106, + ], + [ + 30, 186, 140, 157, 222, 181, 73, 231, 187, 104, 47, 185, 157, 70, 44, 144, 97, 34, 15, + 57, 242, 127, 129, 60, 66, 236, 244, 91, 157, 47, 113, 118, 1, 16, 75, 217, 84, 38, 24, + 236, 234, 154, 219, 77, 47, 63, 222, 61, 116, 178, 175, 229, 206, 98, 239, 127, 3, 134, + 209, 147, 24, 165, 70, 135, + ], + [ + 35, 75, 138, 181, 148, 165, 157, 78, 72, 110, 79, 246, 97, 53, 159, 146, 67, 49, 169, + 86, 22, 100, 102, 233, 88, 255, 187, 192, 166, 24, 166, 224, 29, 165, 138, 55, 69, 169, + 17, 101, 7, 101, 113, 212, 245, 114, 86, 206, 30, 85, 152, 38, 173, 59, 144, 98, 59, + 180, 130, 21, 215, 54, 51, 172, + ], + [ + 16, 152, 60, 218, 87, 90, 32, 55, 197, 75, 35, 75, 49, 5, 106, 119, 65, 181, 38, 184, + 254, 64, 90, 226, 30, 13, 12, 121, 243, 152, 148, 215, 18, 116, 243, 164, 33, 94, 171, + 59, 207, 240, 233, 200, 175, 20, 168, 0, 182, 116, 90, 196, 197, 144, 71, 151, 27, 210, + 2, 86, 206, 44, 64, 25, + ], + [ + 22, 211, 126, 224, 228, 185, 164, 106, 92, 62, 142, 202, 186, 147, 44, 130, 153, 120, + 98, 69, 22, 164, 244, 180, 206, 99, 102, 228, 237, 1, 26, 249, 16, 197, 207, 28, 244, + 119, 100, 2, 52, 141, 133, 118, 85, 251, 224, 10, 61, 210, 59, 174, 150, 62, 3, 199, + 141, 180, 200, 158, 132, 191, 137, 3, + ], + [ + 47, 176, 172, 39, 158, 126, 194, 195, 237, 158, 210, 27, 50, 173, 243, 148, 89, 55, + 150, 250, 236, 234, 35, 161, 182, 122, 209, 106, 44, 232, 244, 28, 14, 126, 245, 10, + 194, 216, 200, 169, 12, 174, 1, 39, 119, 83, 117, 216, 105, 106, 234, 76, 80, 63, 145, + 209, 72, 28, 99, 59, 100, 110, 75, 245, + ], + ], +}; From fb1c8c54628a2b63e26824e1de4f3f58a7fc8245 Mon Sep 17 00:00:00 2001 From: Michal Rostecki Date: Thu, 9 Mar 2023 23:03:10 +0100 Subject: [PATCH 3/3] tests: Provide output UTXOs as transaction parameters --- .../tests/functional_tests.ts | 18 ++++++++++-------- 1 file changed, 10 insertions(+), 8 deletions(-) diff --git a/light-system-programs/tests/functional_tests.ts b/light-system-programs/tests/functional_tests.ts index 918c77f3f3..f285954ddd 100644 --- a/light-system-programs/tests/functional_tests.ts +++ b/light-system-programs/tests/functional_tests.ts @@ -493,14 +493,16 @@ describe("verifier_program", () => { let txParams = new TransactionParameters({ inputUtxos, - // outputUtxos: [new Utxo({poseidon: POSEIDON})], - // outputUtxos: [ - // new Utxo({ - // poseidon: POSEIDON, - // assets: inputUtxos[0].assets, - // amounts: inputUtxos[0].amounts, - // }), - // ], + outputUtxos: [ + new Utxo({ + poseidon: POSEIDON, + assets: inputUtxos[0].assets, + amounts: [ + new BN(0), + inputUtxos[0].amounts[1] + ] + }) + ], // outputUtxos: [new Utxo({poseidon: POSEIDON, assets: inputUtxos[0].assets, amounts: [inputUtxos[0].amounts[0], new BN(0)]})], merkleTreePubkey: MERKLE_TREE_KEY,