diff --git a/.config/nextest.toml b/.config/nextest.toml index ec3eba08b..6ab73993a 100644 --- a/.config/nextest.toml +++ b/.config/nextest.toml @@ -16,7 +16,7 @@ limited = { max-threads = 4 } very-limited = { max-threads = 1 } [[profile.ci.overrides]] -filter = '(test(syscall::precompiles) | test(stark::machine) | package(wp1-recursion-program) | package(wp1-recursion-circuit))' +filter = '(test(syscall::precompiles) | test(stark::machine) | package(sphinx-recursion-program) | package(sphinx-recursion-circuit))' test-group = 'limited' [[profile.ci.overrides]] diff --git a/.github/workflows/book.yml b/.github/workflows/book.yml deleted file mode 100644 index 82449ca96..000000000 --- a/.github/workflows/book.yml +++ /dev/null @@ -1,138 +0,0 @@ -# Documentation and mdbook related jobs. -# Reference: https://github.com/paradigmxyz/reth/blob/main/.github/workflows/book.yml - -name: book - -on: - push: - branches: [main] - pull_request: - branches: [main] - paths: - - "book/**" - merge_group: - -jobs: - # test: - # runs-on: ubuntu-latest - # name: test - # timeout-minutes: 60 - - # steps: - # - uses: actions/checkout@v4 - - # - name: Install mdbook - # run: | - # mkdir mdbook - # curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook - # echo $(pwd)/mdbook >> $GITHUB_PATH - - # - name: Install mdbook-template - # run: | - # mkdir mdbook-template - # curl -sSL https://github.com/sgoudham/mdbook-template/releases/latest/download/mdbook-template-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook-template - # echo $(pwd)/mdbook-template >> $GITHUB_PATH - - # - name: Run tests - # run: mdbook test - - lint: - runs-on: ubuntu-latest - name: lint - timeout-minutes: 60 - - steps: - - uses: actions/checkout@v4 - - - name: Install mdbook-linkcheck - run: | - mkdir mdbook-linkcheck - curl -sSL -o mdbook-linkcheck.zip https://github.com/Michael-F-Bryan/mdbook-linkcheck/releases/latest/download/mdbook-linkcheck.x86_64-unknown-linux-gnu.zip - unzip mdbook-linkcheck.zip -d ./mdbook-linkcheck - chmod +x $(pwd)/mdbook-linkcheck/mdbook-linkcheck - echo $(pwd)/mdbook-linkcheck >> $GITHUB_PATH - - - name: Run linkcheck - run: mdbook-linkcheck --standalone - - build: - runs-on: ubuntu-latest - timeout-minutes: 60 - steps: - - uses: actions/checkout@v4 - - uses: dtolnay/rust-toolchain@nightly - - name: Install mdbook - run: | - mkdir mdbook - curl -sSL https://github.com/rust-lang/mdBook/releases/download/v0.4.14/mdbook-v0.4.14-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook - echo $(pwd)/mdbook >> $GITHUB_PATH - - - name: Install mdbook-template - run: | - mkdir mdbook-template - curl -sSL https://github.com/sgoudham/mdbook-template/releases/latest/download/mdbook-template-x86_64-unknown-linux-gnu.tar.gz | tar -xz --directory=./mdbook-template - echo $(pwd)/mdbook-template >> $GITHUB_PATH - - - uses: Swatinem/rust-cache@v2 - with: - cache-on-failure: true - - - name: Build book - run: mdbook build - - # - name: Build docs - # run: cargo docs - # env: - # # Keep in sync with ./ci.yml:jobs.docs - # RUSTDOCFLAGS: - # --cfg docsrs --show-type-layout --generate-link-to-definition --enable-index-page - # -Zunstable-options - - # - name: Move docs to book folder - # run: | - # mv target/doc target/book/docs - - - name: Archive artifact - shell: sh - run: | - chmod -c -R +rX "target/book" | - while read line; do - echo "::warning title=Invalid file permissions automatically fixed::$line" - done - tar \ - --dereference --hard-dereference \ - --directory "target/book" \ - -cvf "$RUNNER_TEMP/artifact.tar" \ - --exclude=.git \ - --exclude=.github \ - . - - - name: Upload artifact - uses: actions/upload-artifact@v4 - with: - name: github-pages - path: ${{ runner.temp }}/artifact.tar - retention-days: 1 - if-no-files-found: error - - deploy: - # Only deploy if a push to main - if: github.ref_name == 'main' && github.event_name == 'push' - runs-on: ubuntu-latest - needs: [lint, build] - - # Grant GITHUB_TOKEN the permissions required to make a Pages deployment - permissions: - pages: write - id-token: write - - environment: - name: github-pages - url: ${{ steps.deployment.outputs.page_url }} - - timeout-minutes: 60 - - steps: - - name: Deploy to GitHub Pages - id: deployment - uses: actions/deploy-pages@v4 \ No newline at end of file diff --git a/.github/workflows/release.yml b/.github/workflows/release.yml index 08cdd7614..dc113d161 100644 --- a/.github/workflows/release.yml +++ b/.github/workflows/release.yml @@ -136,7 +136,7 @@ jobs: [[ "$target" == *windows* ]] && exe=".exe" - RUSTFLAGS='-C target-feature=+crt-static' cargo build --release -p wp1-cli --target "$target" "${flags[@]}" + RUSTFLAGS='-C target-feature=+crt-static' cargo build --release -p sphinx-cli --target "$target" "${flags[@]}" bins=(cargo-prove) for name in "${bins[@]}"; do diff --git a/.github/workflows/tests.yml b/.github/workflows/tests.yml index c9b1dddaa..134dbe086 100644 --- a/.github/workflows/tests.yml +++ b/.github/workflows/tests.yml @@ -23,16 +23,16 @@ jobs: uses: ./.github/actions/setup with: pull_token: ${{ secrets.REPO_TOKEN }} - - name: Run cargo test on wp1 except the test_e2e_prove_groth16 recursion test + - name: Run cargo test on sphinx except the test_e2e_prove_groth16 recursion test run: | - cargo nextest run --cargo-profile dev-ci --profile ci --workspace --exclude wp1-recursion-circuit -E 'all() - test(test_e2e_prove_groth16)' + cargo nextest run --cargo-profile dev-ci --profile ci --workspace -E 'all() - test(test_e2e_prove_groth16)' - name: Run cargo test with no default features run: | - cargo nextest run -p wp1-core --cargo-profile dev-ci --profile ci --no-default-features --features debug -- cpu::trace::tests::generate_trace + cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features debug -- cpu::trace::tests::generate_trace working-directory: ${{ github.workspace }}/examples - name: Install `cargo prove` CLI run: | - cargo install --locked --path ./cli + cargo install --locked --force --path ./cli cargo prove install-toolchain working-directory: ${{ github.workspace }} @@ -51,7 +51,7 @@ jobs: pull_token: ${{ secrets.PRIVATE_PULL_TOEKN }} - name: Run cargo test on the recursion circuit run: | - cargo nextest run --cargo-profile dev-ci --profile ci -p wp1-recursion-circuit + cargo nextest run --cargo-profile dev-ci --profile ci -p sphinx-recursion-circuit clippy: runs-on: warp-ubuntu-latest-x64-16x @@ -93,7 +93,7 @@ jobs: perf: false - name: Install `cargo prove` CLI run: | - cargo install --locked --path ./cli + cargo install --locked --force --path ./cli cargo prove install-toolchain working-directory: ${{ github.workspace }} - name: Check examples @@ -118,8 +118,8 @@ jobs: cd cargo-prove-test/program cat << EOF | tee -a Cargo.toml - [patch.'ssh://git@github.com/lurk-lab/wp1.git'] - wp1-zkvm = { path = "../../zkvm/entrypoint" } + [patch.'ssh://git@github.com/lurk-lab/sphinx.git'] + sphinx-zkvm = { path = "../../zkvm/entrypoint" } EOF cd ../.. @@ -127,8 +127,8 @@ jobs: cat << EOF | tee -a Cargo.toml [patch.'ssh://git@github.com/lurk-lab/sphinx.git'] - wp1-sdk = { path = "../../sdk" } - wp1-helper = { path = "../../helper" } + sphinx-sdk = { path = "../../sdk" } + sphinx-helper = { path = "../../helper" } EOF cargo run --release @@ -148,15 +148,15 @@ jobs: pull_token: ${{ secrets.REPO_TOKEN }} - name: Install `cargo prove` CLI run: | - cargo install --locked --path ./cli + cargo install --locked --force --path ./cli cargo prove install-toolchain working-directory: ${{ github.workspace }} - - name: Run cargo test on wp1 except the prove_sp1 recursion test + - name: Run cargo test on sphinx except the prove_sp1 recursion test run: | cargo nextest run --cargo-profile dev-ci --profile ci -E 'all() - test(test_e2e_prove_groth16)' - name: Run cargo test with no default features run: | - cargo nextest run -p wp1-core --cargo-profile dev-ci --profile ci --no-default-features --features debug -- cpu::trace::tests::generate_trace + cargo nextest run -p sphinx-core --cargo-profile dev-ci --profile ci --no-default-features --features debug -- cpu::trace::tests::generate_trace - name: check examples compile run: | for i in $(find ./ -maxdepth 1 -mindepth 1 -type d); do diff --git a/Cargo.lock b/Cargo.lock index 3b1269588..bfca17217 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3960,304 +3960,684 @@ dependencies = [ ] [[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.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" -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 = "strsim" -version = "0.11.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" - -[[package]] -name = "strum" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" - -[[package]] -name = "strum_macros" -version = "0.26.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" +name = "sphinx-cli" +version = "0.1.0" dependencies = [ - "heck 0.4.1", - "proc-macro2", - "quote", - "rustversion", - "syn 2.0.66", + "anstyle", + "anyhow", + "cargo_metadata", + "clap", + "futures-util", + "hex", + "home", + "indicatif", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-core", + "sphinx-prover", + "sphinx-sdk", + "target-lexicon", + "tempfile", + "tokio", + "vergen", + "yansi", ] [[package]] -name = "subtle" -version = "2.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" - -[[package]] -name = "subtle-encoding" -version = "0.5.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" +name = "sphinx-core" +version = "0.1.0" dependencies = [ - "zeroize", + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "criterion", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rand", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "sphinx-zkvm", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tiny-keccak", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", ] [[package]] -name = "syn" -version = "1.0.109" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" +name = "sphinx-derive" +version = "0.1.0" dependencies = [ "proc-macro2", "quote", - "unicode-ident", + "syn 1.0.109", ] [[package]] -name = "syn" -version = "2.0.66" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +name = "sphinx-eval" +version = "0.1.0" dependencies = [ - "proc-macro2", - "quote", - "unicode-ident", + "clap", + "csv", + "serde", + "sphinx-core", + "sphinx-prover", ] [[package]] -name = "syn-solidity" -version = "0.7.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b8db114c44cf843a8bacd37a146e37987a0b823a0e8bc4fdc610c9c72ab397a5" +name = "sphinx-helper" +version = "0.1.0" dependencies = [ - "paste", - "proc-macro2", - "quote", - "syn 2.0.66", + "cargo_metadata", + "chrono", ] [[package]] -name = "sync_wrapper" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" - -[[package]] -name = "sync_wrapper" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" - -[[package]] -name = "tap" -version = "1.0.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" - -[[package]] -name = "target-lexicon" -version = "0.12.14" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" - -[[package]] -name = "tempfile" -version = "3.10.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +name = "sphinx-precompiles" +version = "0.1.0" dependencies = [ + "anyhow", + "bincode", + "bls12_381 0.8.0", "cfg-if", - "fastrand", - "rustix", - "windows-sys 0.52.0", + "getrandom", + "hybrid-array", + "k256", + "serde", ] [[package]] -name = "thiserror" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +name = "sphinx-primitives" +version = "0.1.0" dependencies = [ - "thiserror-impl", + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", ] [[package]] -name = "thiserror-impl" -version = "1.0.61" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +name = "sphinx-prover" +version = "0.1.0" dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.66", + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", ] [[package]] -name = "thread_local" -version = "1.1.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +name = "sphinx-recursion-circuit" +version = "0.1.0" dependencies = [ - "cfg-if", - "once_cell", -] - -[[package]] -name = "threadpool" -version = "1.8.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" + "bincode", + "ff 0.13.0", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" dependencies = [ - "num_cpus", + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", ] [[package]] -name = "time" -version = "0.3.36" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +name = "sphinx-recursion-core" +version = "0.1.0" dependencies = [ - "deranged", - "itoa", - "libc", - "num-conv", - "num_threads", - "powerfmt", + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "rand", "serde", - "time-core", - "time-macros", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", ] [[package]] -name = "time-core" -version = "0.1.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] [[package]] -name = "time-macros" -version = "0.2.18" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" dependencies = [ - "num-conv", - "time-core", + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", ] [[package]] -name = "tiny-keccak" -version = "2.0.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +name = "sphinx-recursion-program" +version = "0.1.0" dependencies = [ - "crunchy", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", ] [[package]] -name = "tinytemplate" -version = "1.2.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +name = "sphinx-sdk" +version = "0.1.0" dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", "serde", "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", ] [[package]] -name = "tinyvec" -version = "1.6.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "87cc5ceb3875bb20c2890005a4e226a4651264a5c75edb2421b52861a0a0cb50" +name = "sphinx-zkvm" +version = "0.1.0" dependencies = [ - "tinyvec_macros", + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "p3-baby-bear", + "p3-field", + "rand", + "sha2", + "sphinx-precompiles", + "sphinx-primitives", ] [[package]] -name = "tinyvec_macros" -version = "0.1.1" +name = "spin" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1f3ccbac311fea05f86f61904b462b55fb3df8837a366dfc601a0161d0532f20" +checksum = "6e63cff320ae2c57904679ba7cb63280a3dc4613885beafb148ee7bf9aa9042d" [[package]] -name = "tokio" -version = "1.37.0" +name = "spki" +version = "0.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ - "backtrace", - "bytes", - "libc", - "mio", - "num_cpus", - "parking_lot", - "pin-project-lite", - "signal-hook-registry", - "socket2", - "tokio-macros", - "windows-sys 0.48.0", + "base64ct", + "der", ] [[package]] -name = "tokio-macros" -version = "2.2.0" +name = "static_assertions" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +checksum = "a2eb9349b6444b326872e140eb1cf5e7c522154d69e7a0ffb0fb81c06b37543f" + +[[package]] +name = "strsim" +version = "0.11.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7da8b5736845d9f2fcb837ea5d9e2628564b3b043a70948a3f0b778838c5fb4f" + +[[package]] +name = "strum" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5d8cec3501a5194c432b2b7976db6b7d10ec95c253208b45f83f7136aa985e29" + +[[package]] +name = "strum_macros" +version = "0.26.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6cf59daf282c0a494ba14fd21610a0325f9f90ec9d1231dea26bcb1d696c946" dependencies = [ + "heck 0.4.1", "proc-macro2", "quote", + "rustversion", "syn 2.0.66", ] [[package]] -name = "tokio-native-tls" -version = "0.3.1" +name = "subtle" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bbae76ab933c85776efabc971569dd6119c580d8f5d448769dec1764bf796ef2" -dependencies = [ - "native-tls", - "tokio", -] +checksum = "81cdd64d312baedb58e21336b31bc043b77e01cc99033ce76ef539f78e965ebc" [[package]] -name = "tokio-stream" -version = "0.1.15" +name = "subtle-encoding" +version = "0.5.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +checksum = "7dcb1ed7b8330c5eed5441052651dd7a12c75e2ed88f2ec024ae1fa3a5e59945" dependencies = [ - "futures-core", - "pin-project-lite", - "tokio", - "tokio-util", + "zeroize", ] [[package]] -name = "tokio-util" -version = "0.7.11" +name = "syn" +version = "1.0.109" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +checksum = "72b64191b275b66ffe2469e8af2c1cfe3bafa67b529ead792a6d0160888b4237" dependencies = [ - "bytes", - "futures-core", - "futures-sink", + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn" +version = "2.0.66" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c42f3f41a2de00b01c0aaad383c5a45241efc8b2d1eda5661812fda5f3cdcff5" +dependencies = [ + "proc-macro2", + "quote", + "unicode-ident", +] + +[[package]] +name = "syn-solidity" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8db114c44cf843a8bacd37a146e37987a0b823a0e8bc4fdc610c9c72ab397a5" +dependencies = [ + "paste", + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "sync_wrapper" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2047c6ded9c721764247e62cd3b03c09ffc529b2ba5b10ec482ae507a4a70160" + +[[package]] +name = "sync_wrapper" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a7065abeca94b6a8a577f9bd45aa0867a2238b74e8eb67cf10d492bc39351394" + +[[package]] +name = "tap" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" + +[[package]] +name = "target-lexicon" +version = "0.12.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e1fc403891a21bcfb7c37834ba66a547a8f402146eba7265b5a6d88059c9ff2f" + +[[package]] +name = "tempfile" +version = "3.10.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "85b77fafb263dd9d05cbeac119526425676db3784113aa9295c88498cbf8bff1" +dependencies = [ + "cfg-if", + "fastrand", + "rustix", + "windows-sys 0.52.0", +] + +[[package]] +name = "thiserror" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c546c80d6be4bc6a00c0f01730c08df82eaa7a7a61f11d656526506112cc1709" +dependencies = [ + "thiserror-impl", +] + +[[package]] +name = "thiserror-impl" +version = "1.0.61" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "46c3384250002a6d5af4d114f2845d37b57521033f30d5c3f46c4d70e1197533" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[package]] +name = "thread_local" +version = "1.1.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b9ef9bad013ada3808854ceac7b46812a6465ba368859a37e2100283d2d719c" +dependencies = [ + "cfg-if", + "once_cell", +] + +[[package]] +name = "threadpool" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d050e60b33d41c19108b32cea32164033a9013fe3b46cbd4457559bfbf77afaa" +dependencies = [ + "num_cpus", +] + +[[package]] +name = "time" +version = "0.3.36" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +dependencies = [ + "deranged", + "itoa", + "libc", + "num-conv", + "num_threads", + "powerfmt", + "serde", + "time-core", + "time-macros", +] + +[[package]] +name = "time-core" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" + +[[package]] +name = "time-macros" +version = "0.2.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +dependencies = [ + "num-conv", + "time-core", +] + +[[package]] +name = "tiny-keccak" +version = "2.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c9d3793400a45f954c52e73d068316d76b6f4e36977e3fcebb13a2721e80237" +dependencies = [ + "crunchy", +] + +[[package]] +name = "tinytemplate" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "be4d6b5f19ff7664e8c98d03e2139cb510db9b0a60b55f8e8709b689d939b6bc" +dependencies = [ + "serde", + "serde_json", +] + +[[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.37.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1adbebffeca75fcfd058afa480fb6c0b81e165a0323f9c9d39c9697e37c46787" +dependencies = [ + "backtrace", + "bytes", + "libc", + "mio", + "num_cpus", + "parking_lot", + "pin-project-lite", + "signal-hook-registry", + "socket2", + "tokio-macros", + "windows-sys 0.48.0", +] + +[[package]] +name = "tokio-macros" +version = "2.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b8a1e28f2deaa14e508979454cb3a223b10b938b45af148bc0986de36f1923b" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.66", +] + +[[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-stream" +version = "0.1.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "267ac89e0bec6e691e5813911606935d77c476ff49024f98abcea3e7b15e37af" +dependencies = [ + "futures-core", + "pin-project-lite", + "tokio", + "tokio-util", +] + +[[package]] +name = "tokio-util" +version = "0.7.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9cf6b47b3771c49ac75ad09a6162f53ad4b8088b76ac60e8ec1455b31a189fe1" +dependencies = [ + "bytes", + "futures-core", + "futures-sink", "pin-project-lite", "tokio", ] @@ -4422,8 +4802,8 @@ dependencies = [ "p3-matrix", "p3-maybe-rayon", "p3-uni-stark", - "wp1-core", - "wp1-derive", + "sphinx-core", + "sphinx-derive", ] [[package]] @@ -4905,386 +5285,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-cli" -version = "0.1.0" -dependencies = [ - "anstyle", - "anyhow", - "cargo_metadata", - "clap", - "futures-util", - "hex", - "home", - "indicatif", - "rand", - "reqwest", - "serde", - "serde_json", - "target-lexicon", - "tempfile", - "tokio", - "vergen", - "wp1-core", - "wp1-prover", - "wp1-sdk", - "yansi", -] - -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "criterion", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rand", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tiny-keccak", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", - "wp1-zkvm", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-eval" -version = "0.1.0" -dependencies = [ - "clap", - "csv", - "serde", - "wp1-core", - "wp1-prover", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381 0.8.0", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "ff 0.13.0", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", - "zkhash", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "rand", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "p3-baby-bear", - "p3-field", - "rand", - "sha2", - "wp1-precompiles", - "wp1-primitives", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/Cargo.toml b/Cargo.toml index f9b7c903d..1887e94b1 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -145,4 +145,4 @@ codegen-units = 16 [workspace.package] edition = "2021" license = "MIT OR Apache-2.0" -repository = "https://github.com/wormhole-foundation/wp1" +repository = "https://github.com/lurk-lab/sphinx" diff --git a/book.toml b/book.toml deleted file mode 100644 index 9c14d7b36..000000000 --- a/book.toml +++ /dev/null @@ -1,30 +0,0 @@ -[book] -authors = ["WP1 and SP1 Contributors"] -language = "en" -multilingual = false -src = "book" -title = "WP1 Book" -description = "A book on all things Reth" - -[output.html] -theme = "book/theme" -git-repository-url = "ssh://git@github.com/wormhole-foundation/wp1" -default-theme = "ayu" -no-section-label = true - -[output.html.fold] -enable = true -level = 1 - -[output.html.playground] -runnable = false - -[build] -build-dir = "target/book" - -[preprocessor.template] -before = ["links"] - -[preprocessor.index] - -[preprocessor.links] \ No newline at end of file diff --git a/book/SUMMARY.md b/book/SUMMARY.md deleted file mode 100644 index 36a380f46..000000000 --- a/book/SUMMARY.md +++ /dev/null @@ -1,43 +0,0 @@ -# Summary - -[Introduction](./introduction.md) - -# Getting Started - -- [Install](./getting-started/install.md) - -- [Quickstart](./getting-started/quickstart.md) - -- [Project Template](./getting-started/project-template.md) - -# Writing Programs - -- [Setup](./writing-programs/setup.md) - -- [Basics](./writing-programs/basics.md) - -- [Inputs & Outputs](./writing-programs/inputs-and-outputs.md) - -- [Precompiles](./writing-programs/precompiles.md) - -- [Patched Crates](./writing-programs/patched-crates.md) - -- [Cycle Tracking](./writing-programs/cycle-tracking.md) - -# Generating Proofs - -- [Setup](./generating-proofs/setup.md) - -- [Basics](./generating-proofs/basics.md) - -- [Advanced](./generating-proofs/advanced.md) - -# Verifying Proofs - -- [Solidity & EVM](./verifying-proofs/solidity-and-evm.md) - -# Developers - -- [Recommended Settings](./developers/recommended-settings.md) - -- [Building Groth16 Artifacts](./developers/building-groth16-artifacts.md) \ No newline at end of file diff --git a/book/developers/building-groth16-artifacts.md b/book/developers/building-groth16-artifacts.md deleted file mode 100644 index beeb20946..000000000 --- a/book/developers/building-groth16-artifacts.md +++ /dev/null @@ -1,7 +0,0 @@ -# Building Groth16 Artifacts - -To build the Groth16 artifacts from scratch, you can use the `Makefile` inside the `prover` directory. - -```shell,noplayground -RUST_LOG=info make groth16 -``` \ No newline at end of file diff --git a/book/developers/recommended-settings.md b/book/developers/recommended-settings.md deleted file mode 100644 index 3bbc6c583..000000000 --- a/book/developers/recommended-settings.md +++ /dev/null @@ -1,6 +0,0 @@ -# Recommended Settings - -For developers contributing to the SP1 project, we recommend the following settings: - -- `FRI_QUERIES=1`: Makes the prover use less bits of security to generate proofs more quickly. -- `SP1_DEV=1`: This will rebuild the Groth16 artifacts everytime they are necessary. \ No newline at end of file diff --git a/book/generating-proofs/advanced.md b/book/generating-proofs/advanced.md deleted file mode 100644 index 3b4caa25e..000000000 --- a/book/generating-proofs/advanced.md +++ /dev/null @@ -1,69 +0,0 @@ -# Advanced Usage - -## Execution Only - -We recommend that during development of large programs (> 1 million cycles) that you do not generate proofs each time. -Instead, you should have your script only execute the program with the RISC-V runtime and read `public_values`. Here is an example: - -```rust,noplayground -{{#include ../../examples/fibonacci/script/bin/execute.rs}} -``` - -If execution of your program succeeds, then proof generation should succeed as well! (Unless there is a bug in our zkVM implementation.) - -## Compressed Proofs - -With the `ProverClient`, the default `prove` function generates a proof that is succinct, but can have size that scales with the number of cycles of the program. To generate a compressed proof of constant size, you can use the `prove_compressed` function instead. This will use STARK recursion to generate a proof that is constant size (around 7Kb), but will be slower than just calling `prove`, as it will use recursion to combine the core SP1 proof into a single constant-sized proof. - -```rust,noplayground -{{#include ../../examples/fibonacci/script/bin/compressed.rs}} -``` - -You can run the above script with `RUST_LOG=info cargo run --bin compressed --release` from `examples/fibonacci/script`. - -## Logging and Tracing Information - -You can use `utils::setup_logger()` to enable logging information respectively. You should only use one or the other of these functions. - -**Logging:** - -```rust,noplayground -utils::setup_logger(); -``` - -You must run your command with: - -```bash -RUST_LOG=info cargo run --release -``` - -## CPU Acceleration - -To enable CPU acceleration, you can use the `RUSTFLAGS` environment variable to enable the `target-cpu=native` flag when running your script. This will enable the compiler to generate code that is optimized for your CPU. - -```bash -RUSTFLAGS='-C target-cpu=native' cargo run --release -``` - -Currently there is support for AVX512 and NEON SIMD instructions. For NEON, you must also enable the `sp1-sdk` feature `neon` in your script crate's `Cargo.toml` file. - -```toml -sp1-sdk = { git = "https://github.com/succinctlabs/sp1", features = ["neon"] } -``` - -## Performance - -For maximal performance, you should run proof generation with the following command and vary your `shard_size` depending on your program's number of cycles. - -```rust,noplayground -SHARD_SIZE=4194304 RUST_LOG=info RUSTFLAGS='-C target-cpu=native' cargo run --release -``` - -## Memory Usage - -To reduce memory usage, set the `SHARD_BATCH_SIZE` enviroment variable depending on how much RAM -your machine has. A higher number will use more memory, but will be faster. - -```rust,noplayground -SHARD_BATCH_SIZE=1 SHARD_SIZE=2097152 RUST_LOG=info RUSTFLAGS='-C target-cpu=native' cargo run --release -``` diff --git a/book/generating-proofs/basics.md b/book/generating-proofs/basics.md deleted file mode 100644 index ecaac1766..000000000 --- a/book/generating-proofs/basics.md +++ /dev/null @@ -1,45 +0,0 @@ -# Generating Proofs: Basics - -An end-to-end flow of proving `f(x) = y` with the SP1 zkVM involves the following steps: - -- Define `f` using normal Rust code and compile it to an ELF (covered in the [writing programs](../writing-programs/basics.md) section). -- Setup a proving key (`pk`) and verifying key (`vk`) for the program given the ELF. The proving key contains all the information needed to generate a proof and includes some post-processing on top of the ELF, while the verifying key is a compact representation of the ELF that contains all the information needed to verify a proof and is much smaller than the ELF itself. -- Generate a proof `π` using the SP1 zkVM that `f(x) = y` with `prove(pk, x)`. -- Verify the proof `π` using `verify(vk, x, y, π)`. - -To make this more concrete, let's walk through a simple example of generating a proof for a Fiboancci program inside the zkVM. - -## Fibonacci - -```rust,noplayground -{{#include ../../examples/fibonacci/script/src/main.rs}} -``` - -You can run the above script in the `script` directory with `RUST_LOG=info cargo run --release`. - -## Build Script - -If you want your program crate to be built automatically whenever you build/run your script crate, you can add a `build.rs` file inside of `script/` (at the same level as `Cargo.toml`): - -```rust,noplayground -{{#include ../../examples/fibonacci/script/build.rs}} -``` - -Make sure to also add `wp1-helper` as a build dependency in `script/Cargo.toml`: - -```toml -[build-dependencies] -wp1-helper = { git = "https://github.com/wormhole-foundation/wp1.git" } -``` - -If you run `RUST_LOG=info cargo run --release -vv`, you will see the following output from the build script if the program has changed, indicating that the program was rebuilt: - -```` -[fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/src -[fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/Cargo.toml -[fibonacci-script 0.1.0] cargo:rerun-if-changed=../program/Cargo.lock -[fibonacci-script 0.1.0] cargo:warning=fibonacci-program built at 2024-03-02 22:01:26 -[fibonacci-script 0.1.0] [sp1] Compiling fibonacci-program v0.1.0 (/Users/umaroy/Documents/fibonacci/program) -[fibonacci-script 0.1.0] [sp1] Finished release [optimized] target(s) in 0.15s -warning: fibonacci-script@0.1.0: fibonacci-program built at 2024-03-02 22:01:26``` -```` diff --git a/book/generating-proofs/network.md b/book/generating-proofs/network.md deleted file mode 100644 index 9dfa5726f..000000000 --- a/book/generating-proofs/network.md +++ /dev/null @@ -1,47 +0,0 @@ -# Generating Proofs: Prover Network - -In the case that you do not want to prove locally, you can use the Succinct prover network to generate proofs. - -**Note:** The network is still in development and should be only used for testing purposes. - -## Sending a proof request - -To use the prover network to generate a proof, you can run your program as you would normally but with additional environment variables set: - -```sh -SP1_PROVER=network SP1_PRIVATE_KEY=... cargo run --release -``` - -- `SP1_PROVER` can be set to `network` or `local`, and defaults to local. - -- `SP1_PRIVATE_KEY` is your secp256k1 private key for signing messages on the network. The balance of - the address corresponding to this private key will be used to pay for the proof request. - -Once a request is sent, a prover will claim the request and start generating a proof. After some -time, it will be returned. - -## Network balance - -Before sending requests, you must ensure you have enough balance on the network. You can add to your -balance by sending ETH to the canonical `NetworkFeeVault` contract on Base, which has the address -[0x66ea36fDBdDD09E3aCAB7B9f654220B00e537574](https://basescan.org/address/0x66ea36fdbddd09e3acab7b9f654220b00e537574#code). - -Adding to your balance can be done in [Etherscan](https://basescan.org/address/0x66ea36fdbddd09e3acab7b9f654220b00e537574#writeContract) by -connecting your wallet, or by using the [cast](https://book.getfoundry.sh/cast/) CLI tool. - -This can be done either by calling the `addBalance()` function: - -```sh -# The sender will send 1000 wei and the $OWNER will have their balance increased by 1000 -OWNER=(your address) -AMOUNT=1000 -cast send 0x66ea36fDBdDD09E3aCAB7B9f654220B00e537574 "addBalance(address)" $OWNER --value $AMOUNT --private-key $PRIVATE_KEY --chain-id 8453 --rpc-url https://developer-access-mainnet.base.org -``` - -or by sending ETH directly: - -```sh -# The sender will send 1000 wei and have their balance increased by 1000 -AMOUNT=1000 -cast send 0x66ea36fDBdDD09E3aCAB7B9f654220B00e537574 --value $AMOUNT --private-key $PRIVATE_KEY --chain-id 8453 --rpc-url https://developer-access-mainnet.base.org -``` diff --git a/book/generating-proofs/setup.md b/book/generating-proofs/setup.md deleted file mode 100644 index fc7c68aeb..000000000 --- a/book/generating-proofs/setup.md +++ /dev/null @@ -1,39 +0,0 @@ -# Generating Proofs: Setup - -In this section, we will teach you how to setup a self-contained crate which can generate proofs of programs that have been compiled with the SP1 toolchain inside the SP1 zkVM. - -## CLI (Recommended) - -The recommended way to setup your first program to prove inside the zkVM is using the method described in [Quickstart](../getting-started/quickstart.md) which will create a script folder. - -```bash -cargo prove new -cd script -``` - - -## Manual - -You can also manually setup a project. First create a new cargo project: - -```bash -cargo new script -cd script -``` - -#### Cargo Manifest - -Inside this crate, add the `sp1-sdk` crate as a dependency. Your `Cargo.toml` should look like as follows: - -```rust,noplayground -[workspace] -[package] -version = "0.1.0" -name = "script" -edition = "2021" - -[dependencies] -sp1-sdk = { git = "https://github.com/succinctlabs/sp1.git" } -``` - -The `sp1-sdk` crate includes necessary utilities to generate, save, and verify proofs. diff --git a/book/getting-started/install.md b/book/getting-started/install.md deleted file mode 100644 index f29b6a98c..000000000 --- a/book/getting-started/install.md +++ /dev/null @@ -1,110 +0,0 @@ -# Installation - -SP1 currently runs on Linux and macOS. You can either use prebuilt binaries through sp1up or -build the toolchain and CLI from source. - -## Requirements - -- [Rust (Nightly)](https://www.rust-lang.org/tools/install) -- [Go 1.22](https://go.dev/doc/install) - -## Option 1: Prebuilt Binaries (Recommended) - -Currently our prebuilt binaries are built on Ubuntu 20.04 (22.04 on ARM) and macOS. If your OS uses an older GLIBC version, it's possible these may not work and you will need to [build the toolchain from source](#option-2-building-from-source). - -sp1up is the SP1 toolchain installer. Open your terminal and run the following command and follow the instructions: - -```bash -curl -L https://sp1.succinct.xyz | bash -``` - -This will install sp1up, then simply follow the instructions on-screen, which will make the `sp1up` command available in your CLI. - -After following the instructions, you can run `sp1up` to install the toolchain: - -```bash -sp1up -``` - -This will install support for the `riscv32im-succinct-zkvm-elf` compilation target within your Rust compiler -and a `cargo prove` CLI tool that will let you compile provable programs and then prove their correctness. - -You can verify the installation by running `cargo prove --version`: - -```bash -cargo prove --version -``` - -If this works, go to the [next section](./quickstart.md) to compile and prove a simple zkVM program. - -### Troubleshooting - -If you have installed `cargo-prove` from source, it may conflict with sp1up's `cargo-prove` installation or vice versa. You can remove the `cargo-prove` that was installed from source with the following command: - -```bash -rm ~/.cargo/bin/cargo-prove -``` - -Or, you can remove the `cargo-prove` that was installed through `sp1up`: - -```bash -rm ~/.sp1/bin/cargo-prove -``` - -## Option 2: Building from Source - -Make sure you have installed the [dependencies](https://github.com/rust-lang/rust/blob/master/INSTALL.md#dependencies) needed to build the rust toolchain from source. - -Clone the `sp1` repository and navigate to the root directory. - -```bash -git clone git@github.com:github.com/wormhole-foundation/wp1.git -cd sp1 -cd cli -cargo install --locked --path . -cd ~ -cargo prove build-toolchain -``` - -Building the toolchain can take a while, ranging from 30 mins to an hour depending on your machine. If you're on a machine that we have prebuilt binaries for (ARM Mac or x86 or ARM Linux), you can use the following to download a prebuilt version. - -```bash -cargo prove install-toolchain -``` - -To verify the installation of the tooolchain, run and make sure you see `succinct`: - -```bash -rustup toolchain list -``` - -You can delete your existing installation of the toolchain with: - -```bash -rustup toolchain remove succinct -``` - -## Option 3: Using Docker - -SP1 can also be used entirely within a Docker container. If you don't have it, Docker can be -installed directly from [Docker's website](https://docs.docker.com/get-docker/). - -Then you can use: - -```bash -cargo prove --docker -``` - -to automatically use the latest image of SP1 in a container. - -Alternatively, it is possible to build the docker image locally by running: - -```bash -docker build -t github.com/wormhole-foundation/wp1:latest ./cli/docker -``` - -You can then run the `cargo prove` command by mounting your program directory into the container: - -```bash -docker run -v "$(pwd):/root/program" -it github.com/wormhole-foundation/wp1:latest prove build -``` diff --git a/book/getting-started/project-template.md b/book/getting-started/project-template.md deleted file mode 100644 index d9c04ed48..000000000 --- a/book/getting-started/project-template.md +++ /dev/null @@ -1,3 +0,0 @@ -# Project Template - -Another option for getting started with SP1 is to use the [SP1 Project Template](https://github.com/succinctlabs/sp1-project-template/tree/main). \ No newline at end of file diff --git a/book/getting-started/quickstart.md b/book/getting-started/quickstart.md deleted file mode 100644 index e6c850899..000000000 --- a/book/getting-started/quickstart.md +++ /dev/null @@ -1,79 +0,0 @@ -# Quickstart - -In this section, we will show you how to create a simple Fibonacci program using the SP1 zkVM. - -## Create Project - -The first step is to create a new project using the `cargo prove new ` command. This command will create a new folder in your current directory. - -```bash -cargo prove new fibonacci -cd fibonacci -``` - -This will create a new project with the following structure: - -``` -. -├── program -│   ├── Cargo.toml -│   ├── elf -│   └── src -│   └── main.rs -└── script - ├── Cargo.toml - └── src - └── main.rs - -6 directories, 4 files -``` - -There are 2 directories (each a crate) in the project: -- `program`: the source code that will be proven inside the zkVM. -- `script`: code that contains proof generation and verification code. - -We recommend you install the [rust-analyzer](https://marketplace.visualstudio.com/items?itemName=rust-lang.rust-analyzer) extension. -Note that if you use `cargo prove new` inside a monorepo, you will need to add the manifest file to `rust-analyzer.linkedProjects` to get full IDE support. - -## Build Program - -Before we can run the program inside the zkVM, we must compile it to a RISCV executable using the `succinct` Rust toolchain. The `cargo prove` CLI tool exposes a `build` command which you can run at the root of the `program` directory to do this. - -The program is a very simple program to compute the `n`-th Fibonacci number. - -```bash -cd program -cargo prove build -``` - -The resulting compiled executable is called an [ELF (Executable and Linkable Format)](https://en.wikipedia.org/wiki/Executable_and_Linkable_Format) and contains bytecode that can be executed by the SP1 zkVM. - - -After running the above command, you can verify that the ELF was generated by looking in the `elf` directory and looking for a file called `riscv32im-succinct-zkvm-elf`: -```bash -ls elf # should show riscv32im-succinct-zkvm-elf -``` - -## Generate Proof - -To generate a proof, we take the ELF file that was generated in the previous step and execute it within the SP1 zkVM. The code in the `script` directory is already scaffolded with a script that has logic to generate a proof, save the proof to disk, and verify it. - -```bash -cd ../script -RUST_LOG=info cargo run --release -``` - -The output should show -``` -... - Compiling fibonacci-script v0.1.0 (/Users/umaroy/Documents/fibonacci/script) - Finished release [optimized] target(s) in 26.14s - Running `target/release/fibonacci-script` -a: 205697230343233228174223751303346572685 -b: 332825110087067562321196029789634457848 -successfully generated and verified proof for the program! -``` - -The program by default is quite small, so proof generation will only take a few seconds locally. After it completes, the proof will be saved in the `proof-with-io.json` file and also be verified for correctness. - -You can play around with how many rounds of Fibonacci are executed by playing around with `n` (by default set to `186`) in the file `script/src/main.rs`. Integer overflow will cause larger `n` to result in non-fibonacci output, although the proof will still be generated and verified. \ No newline at end of file diff --git a/book/introduction.md b/book/introduction.md deleted file mode 100644 index e70e264b9..000000000 --- a/book/introduction.md +++ /dev/null @@ -1,22 +0,0 @@ -# SP1 - -*Documentation for SP1 users and developers*. - -[![Telegram Chat][tg-badge]][tg-url] - -![](./sp1.png) - -SP1 is a performant, 100% open-source, contributor-friendly zero-knowledge virtual machine (zkVM) that verifies the execution of arbitrary Rust (or any LLVM-compiled language) programs. - -[tg-badge]: https://img.shields.io/endpoint?color=neon&logo=telegram&label=chat&url=https%3A%2F%2Ftg.sumanjay.workers.dev%2Fsuccinct%5Fsp1 -[tg-url]: https://t.me/succinct_sp1 - -## The future of truth is programmable - -**The future of ZK is writing normal code.** Zero-knowledge proofs (ZKPs) are a powerful primitive that will enable a new generation of more secure, scalable and innovative blockchain architectures that rely on truth not trust. But ZKP adoption has been held back because it is “moon math”, requiring specialized knowledge in obscure ZKP frameworks and hard to maintain one-off deployments. - -Performant, general-purpose zkVMs, like SP1, will obsolete the current paradigm of specialized teams hand rolling their own custom ZK stack and create a future where all blockchain infrastructure, including rollups, bridges, coprocessors, and more, utilize ZKPs via **maintainable software** written in Rust (or other LLVM-compiled languages). - -## Built from day one to be customizable and maintained by a diverse ecosystem of contributors - -SP1 is 100% open-source (MIT / Apache 2.0) with no code obfuscation and built to be contributor friendly, with all development done in the open. Unlike existing zkVMs whose constraint logic is closed-source and impossible to modify, SP1 is modularly architected and designed to be customizable from day one. This customizability (unique to SP1) allows for users to add “precompiles” to the core zkVM logic that yield substantial performance gains, making SP1’s performance not only SOTA vs. existing zkVMs, but also competitive with circuits in a variety of use-cases. diff --git a/book/sp1.png b/book/sp1.png deleted file mode 100644 index 86bf73e4a..000000000 Binary files a/book/sp1.png and /dev/null differ diff --git a/book/theme/head.hbs b/book/theme/head.hbs deleted file mode 100644 index 2e2be7a19..000000000 --- a/book/theme/head.hbs +++ /dev/null @@ -1,6 +0,0 @@ - - - - - \ No newline at end of file diff --git a/book/verifying-proofs/solidity-and-evm.md b/book/verifying-proofs/solidity-and-evm.md deleted file mode 100644 index 0d6375c59..000000000 --- a/book/verifying-proofs/solidity-and-evm.md +++ /dev/null @@ -1,42 +0,0 @@ -# Verifying Proofs: Solidity & EVM - -SP1 recently added support for verifying proofs for onchain usecases. To see an end-to-end example -of using SP1 for on-chain usecases, refer to the [SP1 Project Template](https://github.com/succinctlabs/sp1-project-template/tree/main). - -## Generating a Groth16 Proof - -By default, the proofs generated by SP1 are not verifiable onchain, as they are non-constant size and STARK verification on Ethereum is very expensive. To generate a proof that can be verified onchain, we use performant STARK recursion to combine SP1 shard proofs into a single STARK proof and then wrap that in a SNARK proof. Our `ProverClient` has a function for this called `prove_groth16`. Behind the scenes, this function will first generate a normal SP1 proof, then recursively combine all of them into a single proof using the STARK recursion protocol. Finally, the proof is wrapped in a SNARK proof using Groth16. - -**Due to the fact that Groth16 proofs require a trusted setup, the Groth16 prover is only guaranteed to work on official releases of SP1 (i.e., `v.1.0.0-testnet`).** - - -### Example - -```rust,noplayground -{{#include ../../examples/fibonacci/script/bin/groth16.rs}} -``` - -You can run the above script with `RUST_LOG=info cargo run --bin groth16 --release` in `examples/fibonacci/script`. - -## Exporting the Verifier Contract - -To export the verifier contract, you can use the export function in the `sp1_sdk` crate. - -### Example - -```rust,noplayground -//! Builds the proving artifacts and exports the solidity verifier. -//! -//! You can run this script using the following command: -//! ```shell -//! RUST_LOG=info cargo run --package fibonacci-script --bin artifacts --release -//! ``` - -use std::path::PathBuf; - -fn main() { - let contracts_src_dir = PathBuf::from(env!("CARGO_MANIFEST_DIR")).join("../contracts/src"); - sp1_sdk::artifacts::export_solidity_groth16_verifier(contracts_src_dir) - .expect("failed to export verifier"); -} -``` \ No newline at end of file diff --git a/book/writing-programs/basics.md b/book/writing-programs/basics.md deleted file mode 100644 index 1de279474..000000000 --- a/book/writing-programs/basics.md +++ /dev/null @@ -1,20 +0,0 @@ -# Writing Programs: Basics - -A zero-knowledge proof generally proves that some function `f` when applied to some input `x` produces some output `y` (i.e. `f(x) = y`). -In the context of the SP1 zkVM: - -- `f` is written in normal Rust code. -- `x` are bytes that can be serialized / deserialized into objects -- `y` are bytes that can be serialized / deserialized into objects - -To make this more concrete, let's walk through a simple example of writing a Fibonacci program inside the zkVM. - -## Fibonacci - -This program is from the `examples` [directory](https://github.com/wormhole-foundation/wp1/tree/main/examples) in the SP1 repo which contains several example programs of varying complexity. - -```rust,noplayground -{{#include ../../examples/fibonacci/program/src/main.rs}} -``` - -As you can see, writing programs is as simple as writing normal Rust. To read more about how inputs and outputs work, refer to the section on [Inputs & Outputs](./inputs-and-outputs.md). \ No newline at end of file diff --git a/book/writing-programs/cycle-tracking.md b/book/writing-programs/cycle-tracking.md deleted file mode 100644 index 2163098cb..000000000 --- a/book/writing-programs/cycle-tracking.md +++ /dev/null @@ -1,43 +0,0 @@ -# Cycle Tracking - -When writing a program, it is useful to know how many RISC-V cycles a portion of the program takes to identify potential performance bottlenecks. SP1 provides a way to track the number of cycles spent in a portion of the program. - -## Tracking Cycles - -To track the number of cycles spent in a portion of the program, you can either put `println!("cycle-tracker-start: block name")` + `println!("cycle-tracker-end: block name")` statements (block name must be same between start and end) around the portion of your program you want to profile or use the `#[wp1_derive::cycle_tracker]` macro on a function. An example is shown below: - -```rust,noplayground -{{#include ../../examples/cycle-tracking/program/src/main.rs}} -``` - -Note that to use the macro, you must add the `wp1-derive` crate to your dependencies for your program. - -```toml -[dependencies] -wp1-derive = { git = "https://github.com/wormhole-foundation/wp1.git" } -``` - -In the script for proof generation, setup the logger with `utils::setup_logger()` and run the script with `RUST_LOG=info cargo run --release`. You should see the following output: - -``` -$ RUST_LOG=info cargo run --release - Finished release [optimized] target(s) in 0.21s - Running `target/release/cycle-tracking-script` -2024-03-13T02:03:40.567500Z INFO execute: loading memory image -2024-03-13T02:03:40.567751Z INFO execute: starting execution -2024-03-13T02:03:40.567760Z INFO execute: clk = 0 pc = 0x2013b8 -2024-03-13T02:03:40.567822Z INFO execute: ┌╴setup -2024-03-13T02:03:40.568095Z INFO execute: └╴4,398 cycles -2024-03-13T02:03:40.568122Z INFO execute: ┌╴main-body -2024-03-13T02:03:40.568149Z INFO execute: │ ┌╴expensive_function -2024-03-13T02:03:40.568250Z INFO execute: │ └╴1,368 cycles -stdout: result: 5561 -2024-03-13T02:03:40.568373Z INFO execute: │ ┌╴expensive_function -2024-03-13T02:03:40.568470Z INFO execute: │ └╴1,368 cycles -stdout: result: 2940 -2024-03-13T02:03:40.568556Z INFO execute: └╴5,766 cycles -2024-03-13T02:03:40.568566Z INFO execute: finished execution clk = 11127 pc = 0x0 -2024-03-13T02:03:40.569251Z INFO execute: close time.busy=1.78ms time.idle=21.1µs -``` - -Note that we elegantly handle nested cycle tracking, as you can see above. diff --git a/book/writing-programs/inputs-and-outputs.md b/book/writing-programs/inputs-and-outputs.md deleted file mode 100644 index acc29c934..000000000 --- a/book/writing-programs/inputs-and-outputs.md +++ /dev/null @@ -1,67 +0,0 @@ -# Inputs and Outputs - -In real world applications of zero-knowledge proofs, you almost always want to verify your proof in the context of some inputs and outputs. For example: - -- **Rollups**: Given a list of transactions, prove the new state of the blockchain. -- **Coprocessors**: Given a block header, prove the historical state of some storage slot inside a smart contract. -- **Attested Images**: Given a signed image, prove that you made a restricted set of image transformations. - -In this section, we cover how you pass inputs and outputs to the zkVM and create new types that support serialization. - -## Reading Data - -Data that is read is not public to the verifier by default. Use the `sp1_zkvm::io::read::` method: - -```rust,noplayground -let a = wp1_zkvm::io::read::(); -let b = wp1_zkvm::io::read::(); -let c = wp1_zkvm::io::read::(); -``` - -Note that `T` must implement the `serde::Serialize` and `serde::Deserialize` trait. If you want to read bytes directly, you can also use the `wp1_zkvm::io::read_vec` method. - -```rust,noplayground -let my_vec = wp1_zkvm::io::read_vec(); -``` - -## Commiting Data - -Committing to data makes the data public to the verifier. Use the `sp1_zkvm::io::commit::` method: - -```rust,noplayground -sp1_zkvm::io::commit::(&a); -sp1_zkvm::io::commit::(&b); -sp1_zkvm::io::commit::(&c); -``` - -Note that `T` must implement the `Serialize` and `Deserialize` trait. If you want to write bytes directly, you can also use `wp1_zkvm::io::write_slice` method: - -```rust,noplayground -let mut my_slice = [0_u8; 32]; -sp1_zkvm::io::commit_slice(&my_slice); -``` - -## Creating Serializable Types - -Typically, you can implement the `Serialize` and `Deserialize` traits using a simple derive macro on a struct. - -```rust,noplayground -use serde::{Serialize, de::Deserialize}; - -#[derive(Serialize, Deserialize)] -struct MyStruct { - a: u32, - b: u64, - c: String -} -``` - -For more complex usecases, refer to the [Serde docs](https://serde.rs/). - -## Example - -Here is a basic example of using inputs and outputs with more complex types. - -```rust,noplayground -{{#include ../../examples/io/program/src/main.rs}} -``` diff --git a/book/writing-programs/patched-crates.md b/book/writing-programs/patched-crates.md deleted file mode 100644 index 2f739fc13..000000000 --- a/book/writing-programs/patched-crates.md +++ /dev/null @@ -1,100 +0,0 @@ -# Patched Crates - -We maintain forks of commonly used libraries in blockchain infrastructure to significantly accelerate the execution of certain operations. -Under the hood, we use [precompiles](./precompiles.md) to achieve tremendous performance improvements in proof generation time. - -**If you know of a library or library version that you think should be patched, please open an issue or a pull request!** - -## Supported Libraries - -| Crate Name | Repository | Notes | -| ------------------- | ------------------------------------------------------------------------------------- | ---------------------- | -| sha2 | [sp1-patches/RustCrypto-hashes](https://github.com/sp1-patches/RustCrypto-hashes) | sha256 | -| tiny-keccak | [sp1-patches/tiny-keccak](https://github.com/sp1-patches/tiny-keccak) | keccak256 | -| ed25519-consensus | [sp1-patches/ed25519-consensus](https://github.com/sp1-patches/ed25519-consensus) | ed25519 verify | -| curve25519-dalek-ng | [sp1-patches/curve25519-dalek-ng](https://github.com/sp1-patches/curve25519-dalek-ng) | ed25519 verify | -| curve25519-dalek | [sp1-patches/curve25519-dalek](https://github.com/sp1-patches/curve25519-dalek) | ed25519 verify | -| revm-precompile | [sp1-patches/revm](https://github.com/sp1-patches/revm) | ecrecover precompile | -| reth-primitives | [sp1-patches/reth](https://github.com/sp1-patches/reth) | ecrecover transactions | - -## Using Patched Crates - -To use the patched libraries, you can use corresponding patch entries in your program's `Cargo.toml` such as: - -```toml -[patch.crates-io] -sha2-v0-9-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-v0.9.8" } -sha2-v0-10-6 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-v0.10.6" } -sha2-v0-10-8 = { git = "https://github.com/sp1-patches/RustCrypto-hashes", package = "sha2", branch = "patch-v0.10.8" } -curve25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", branch = "patch-v4.1.1" } -curve25519-dalek-ng = { git = "https://github.com/sp1-patches/curve25519-dalek-ng", branch = "patch-v4.1.1" } -ed25519-consensus = { git = "https://github.com/sp1-patches/ed25519-consensus", branch = "patch-v2.1.0" } -tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", branch = "patch-v2.0.2" } -revm = { git = "https://github.com/sp1-patches/revm", branch = "patch-v5.0.0" } -reth-primitives = { git = "https://github.com/sp1-patches/reth", default-features = false, branch = "sp1-reth" } -``` - -You may also need to update your `Cargo.lock` file. For example: - -```bash -cargo update -p ed25519-consensus -``` - -If you encounter issues relating to cargo / git, you can try setting `CARGO_NET_GIT_FETCH_WITH_CLI`: - -``` -CARGO_NET_GIT_FETCH_WITH_CLI=true cargo update -p ed25519-consensus -``` - -You can permanently set this value in `~/.cargo/config`: - -```toml -[net] -git-fetch-with-cli = true -``` - -### Sanity Checks - -**You must make sure your patch is in the workspace root, otherwise it will not be applied.** - -You can check if the patch was applied by running a command like the following: - -```bash -cargo tree -p sha2 -cargo tree -p sha2@0.9.8 -``` - -Next to the package name, it should have a link to the Github repository that you patched with. - -**Checking whether a precompile is used** - -To check if a precompile is used by your program, when running the script to generate a proof, make sure to use the `RUST_LOG=info` environment variable and set up `utils::setup_logger()` in your script. Then, when you run the script, you should see a log message like the following: - -```bash -2024-03-02T19:10:39.570244Z INFO runtime.run(...): ... -2024-03-02T19:10:39.570244Z INFO runtime.run(...): ... -2024-03-02T19:10:40.003907Z INFO runtime.prove(...): Sharding the execution record. -2024-03-02T19:10:40.003916Z INFO runtime.prove(...): Generating trace for each chip. -2024-03-02T19:10:40.003918Z INFO runtime.prove(...): Record stats before generate_trace (incomplete): ShardStats { - nb_cpu_events: 7476561, - nb_add_events: 2126546, - nb_mul_events: 11116, - nb_sub_events: 54075, - nb_bitwise_events: 646940, - nb_shift_left_events: 142595, - nb_shift_right_events: 274016, - nb_divrem_events: 0, - nb_lt_events: 81862, - nb_field_events: 0, - nb_sha_extend_events: 0, - nb_sha_compress_events: 0, - nb_keccak_permute_events: 2916, - nb_ed_add_events: 0, - nb_ed_decompress_events: 0, - nb_weierstrass_add_events: 0, - nb_weierstrass_double_events: 0, - nb_k256_decompress_events: 0, -} -``` - -The `ShardStats` struct contains the number of events for each "table" from the execution of the program, including precompile tables. In the example above, the `nb_keccak_permute_events` field is `2916`, indicating that the precompile for the Keccak permutation was used. \ No newline at end of file diff --git a/book/writing-programs/precompiles.md b/book/writing-programs/precompiles.md deleted file mode 100644 index c4b00a961..000000000 --- a/book/writing-programs/precompiles.md +++ /dev/null @@ -1,122 +0,0 @@ -# Precompiles - -Precompiles are built into the SP1 zkVM and accelerate commonly used operations such as elliptic curve arithmetic and hashing. -Under the hood, precompiles are implemented as custom tables dedicated to proving one or few operations. **They typically improve the performance -of executing expensive operations by a few order of magnitudes.** - -Inside the zkVM, precompiles are exposed as system calls executed through the `ecall` RISC-V instruction. -Each precompile has a unique system call number and implements an interface for the computation. - -SP1 also has been designed specifically to make it easy for external contributors to create and extend the zkVM with their own precompiles. -To learn more about this, you can look at implementations of existing precompiles in the [precompiles](https://github.com/wormhole-foundation/wp1/tree/main/core/src/syscall/precompiles) folder. More documentation on this will be coming soon. - -## Supported Precompiles - -Typically, we recommend you interact with precompiles through [patches](./patched-crates.md), which are crates patched -to use these precompiles under the hood. However, if you are an advanced user you can interact -with the precompiles directly using extern system calls. - -Here is a list of extern system calls that use precompiles. - -### SHA256 Extend - -Executes the SHA256 extend operation on a word array. - -```rust,noplayground -pub extern "C" fn syscall_sha256_extend(w: *mut u32); -``` - -### SHA256 Compress - -Executes the SHA256 compress operation on a word array and a given state. - -```rust,noplayground -pub extern "C" fn syscall_sha256_compress(w: *mut u32, state: *mut u32); -``` - -### Keccak256 Permute - -Executes the Keccak256 permutation function on the given state. - -```rust,noplayground -pub extern "C" fn syscall_keccak_permute(state: *mut u64); -``` - -#### Ed25519 Add - -Adds two points on the ed25519 curve. The result is stored in the first point. - -```rust,noplayground -pub extern "C" fn syscall_ed_add(p: *mut u32, q: *mut u32); -``` - -#### Ed25519 Decompress. - -Decompresses a compressed Ed25519 point. - -The second half of the input array should contain the compressed Y point with the final bit as -the sign bit. The first half of the input array will be overwritten with the decompressed point, -and the sign bit will be removed. - -```rust,noplayground -pub extern "C" fn syscall_ed_decompress(point: &mut [u8; 64]) -``` - -#### Secp256k1 Add - -Adds two Secp256k1 points. The result is stored in the first point. - -```rust,noplayground -pub extern "C" fn syscall_secp256k1_add(p: *mut u32, q: *mut u32) -``` - -#### Secp256k1 Double - -Doubles a Secp256k1 point inplace. - -```rust,noplayground -pub extern "C" fn syscall_secp256k1_double(p: *mut u32) -``` - -#### Secp256k1 Decompress - -Decompess a Secp256k1 point. - -The input array should be 32 bytes long, with the first 16 bytes containing the X coordinate in -big-endian format. The second half of the input will be overwritten with the decompressed point. - -```rust,noplayground -pub extern "C" fn syscall_secp256k1_decompress(point: &mut [u8; 64], is_odd: bool); -``` - -#### Bn254 Add - -Adds two Bn254 points. The result is stored in the first point. - -```rust,noplayground -pub extern "C" fn syscall_bn254_add(p: *mut u32, q: *mut u32) -``` - -#### Bn254 Double - -Doubles a Bn256 point inplace. - -```rust,noplayground -pub extern "C" fn syscall_bn254_double(p: *mut u32) -``` - -#### Bls12-381 Add - -Adds two Bls12-381 points in place. - -```rust,noplayground -pub extern "C" fn syscall_bls12381_g1_add(p: *mut u32, q: *mut u32) -``` - -#### Bls12-381 Double - -Doubles a Bls12-381 point in place. - -```rust,noplayground -pub extern "C" fn syscall_bls12381_g1_double(p: *mut u32) -``` \ No newline at end of file diff --git a/book/writing-programs/setup.md b/book/writing-programs/setup.md deleted file mode 100644 index 1cda757ac..000000000 --- a/book/writing-programs/setup.md +++ /dev/null @@ -1,73 +0,0 @@ -# Writing Programs: Setup - -In this section, we will teach you how to setup a self-contained crate which can be compiled as an program that can be executed inside the zkVM. - -## CLI (Recommended) - -The recommended way to setup your first program to prove inside the zkVM is using the method described in [Quickstart](../getting-started/quickstart.md) which will create a program folder. - -```bash -cargo prove new -cd program -``` - -#### Build - -To build the program, simply run: - -``` -cargo prove build -``` - -This will compile the ELF that can be executed in the zkVM and put the executable in `elf/riscv32im-succinct-zkvm-elf`. - - -## Manual - -You can also manually setup a project. First create a new cargo project: - -```bash -cargo new program -cd program -``` - -#### Cargo Manifest - -Inside this crate, add the `wp1-zkvm` crate as a dependency. Your `Cargo.toml` should look like as follows: - -```rust,noplayground -[workspace] -[package] -version = "0.1.0" -name = "program" -edition = "2021" - -[dependencies] -wp1-zkvm = { git = "https://github.com/wormhole-foundation/wp1.git" } -``` - -The `wp1-zkvm` crate includes necessary utilities for your program, including handling inputs and outputs, -precompiles, patches, and more. - -#### main.rs - -Inside the `src/main.rs` file, you must make sure to include these two lines to ensure that the crate -properly compiles. - -```rust,noplayground -#![no_main] -wp1_zkvm::entrypoint!(main); -``` - -These two lines of code wrap your main function with some additional logic to ensure that your program compiles correctly with the RISCV target. - - -#### Build - -To build the program, simply run: - -``` -cargo prove build -``` - -This will compile the ELF (RISCV binary) that can be executed in the zkVM and put the executable in `elf/riscv32im-succinct-zkvm-elf`. \ No newline at end of file diff --git a/cli/Cargo.toml b/cli/Cargo.toml index d08796844..8dab824e7 100644 --- a/cli/Cargo.toml +++ b/cli/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-cli" +name = "sphinx-cli" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -15,9 +15,9 @@ anyhow = { workspace = true, features = ["backtrace"] } cargo_metadata = { workspace = true } clap = { workspace = true, features = ["derive", "env"] } home = { workspace = true } -wp1-prover = { path = "../prover" } -wp1-sdk = { path = "../sdk" } -wp1-core = { path = "../core" } +sphinx-prover = { path = "../prover" } +sphinx-sdk = { path = "../sdk" } +sphinx-core = { path = "../core" } reqwest = { workspace = true, features = [ "stream", "json", diff --git a/cli/src/assets/program/Cargo.toml b/cli/src/assets/program/Cargo.toml index 62b06cf50..0517ea061 100644 --- a/cli/src/assets/program/Cargo.toml +++ b/cli/src/assets/program/Cargo.toml @@ -5,4 +5,4 @@ name = "unnamed-program" edition = "2021" [dependencies] -wp1-zkvm = { git = "ssh://git@github.com/wormhole-foundation/wp1.git" } \ No newline at end of file +sphinx-zkvm = { git = "ssh://git@github.com/lurk-lab/sphinx.git" } \ No newline at end of file diff --git a/cli/src/assets/program/main.rs b/cli/src/assets/program/main.rs index 6cf2df5da..398434267 100644 --- a/cli/src/assets/program/main.rs +++ b/cli/src/assets/program/main.rs @@ -1,13 +1,13 @@ //! A simple program to be proven inside the zkVM. #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); pub fn main() { // NOTE: values of n larger than 186 will overflow the u128 type, // resulting in output that doesn't match fibonacci sequence. // However, the resulting proof will still be valid! - let n = wp1_zkvm::io::read::(); + let n = sphinx_zkvm::io::read::(); let mut a: u128 = 0; let mut b: u128 = 1; let mut sum: u128; @@ -17,6 +17,6 @@ pub fn main() { b = sum; } - wp1_zkvm::io::commit(&a); - wp1_zkvm::io::commit(&b); + sphinx_zkvm::io::commit(&a); + sphinx_zkvm::io::commit(&b); } diff --git a/cli/src/assets/script/Cargo.toml b/cli/src/assets/script/Cargo.toml index 437834f26..207a506e6 100644 --- a/cli/src/assets/script/Cargo.toml +++ b/cli/src/assets/script/Cargo.toml @@ -5,7 +5,7 @@ name = "unnamed-script" edition = "2021" [dependencies] -wp1-sdk = { git = "ssh://git@github.com/wormhole-foundation/wp1.git" } +sphinx-sdk = { git = "ssh://git@github.com/lurk-lab/sphinx.git" } [build-dependencies] -wp1-helper = { git = "ssh://git@github.com/wormhole-foundation/wp1.git" } \ No newline at end of file +sphinx-helper = { git = "ssh://git@github.com/lurk-lab/sphinx.git" } \ No newline at end of file diff --git a/cli/src/assets/script/build.rs b/cli/src/assets/script/build.rs index b41eb01f9..f1c66e12a 100644 --- a/cli/src/assets/script/build.rs +++ b/cli/src/assets/script/build.rs @@ -1,3 +1,3 @@ fn main() { - wp1_helper::build_program(&format!("{}/../program", env!("CARGO_MANIFEST_DIR"))); + sphinx_helper::build_program(&format!("{}/../program", env!("CARGO_MANIFEST_DIR"))); } diff --git a/cli/src/assets/script/main.rs b/cli/src/assets/script/main.rs index 9bbf642e6..4661f6231 100644 --- a/cli/src/assets/script/main.rs +++ b/cli/src/assets/script/main.rs @@ -1,12 +1,12 @@ //! A simple script to generate and verify the proof of a given program. -use wp1_sdk::{ProverClient, SP1Stdin}; +use sphinx_sdk::{ProverClient, SphinxStdin}; const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); fn main() { // Generate proof. - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let n = 186u32; stdin.write(&n); let client = ProverClient::new(); diff --git a/cli/src/bin/cargo-prove.rs b/cli/src/bin/cargo-prove.rs index 9525ddae8..02cb3d89e 100644 --- a/cli/src/bin/cargo-prove.rs +++ b/cli/src/bin/cargo-prove.rs @@ -1,11 +1,11 @@ use anyhow::Result; use clap::{Parser, Subcommand}; -use wp1_cli::{ +use sphinx_cli::{ commands::{ build::BuildCmd, build_toolchain::BuildToolchainCmd, install_toolchain::InstallToolchainCmd, new::NewCmd, prove::ProveCmd, }, - SP1_VERSION_MESSAGE, + SPHINX_VERSION_MESSAGE, }; #[derive(Parser)] @@ -15,7 +15,7 @@ pub enum Cargo { } #[derive(clap::Args)] -#[command(author, about, long_about = None, args_conflicts_with_subcommands = true, version = SP1_VERSION_MESSAGE)] +#[command(author, about, long_about = None, args_conflicts_with_subcommands = true, version = SPHINX_VERSION_MESSAGE)] pub struct ProveCli { #[clap(subcommand)] pub command: Option, diff --git a/cli/src/commands/install_toolchain.rs b/cli/src/commands/install_toolchain.rs index ef7fc7e3c..a72793664 100644 --- a/cli/src/commands/install_toolchain.rs +++ b/cli/src/commands/install_toolchain.rs @@ -3,10 +3,10 @@ use clap::Parser; use home::home_dir; use rand::{distributions::Alphanumeric, Rng}; use reqwest::Client; +use sphinx_sdk::artifacts::download_file; use std::fs::{self}; use std::io::Read; use std::process::Command; -use wp1_sdk::artifacts::download_file; #[cfg(target_family = "unix")] use std::os::unix::fs::PermissionsExt; diff --git a/cli/src/commands/prove.rs b/cli/src/commands/prove.rs index c62c6a5f4..92ba6d5f8 100644 --- a/cli/src/commands/prove.rs +++ b/cli/src/commands/prove.rs @@ -3,9 +3,9 @@ use std::{env, fs::File, io::Read, path::PathBuf, str::FromStr, time::Instant}; use anstyle::*; use anyhow::Result; use clap::Parser; -use wp1_core::utils::{setup_logger, setup_tracer}; -use wp1_prover::SP1Stdin; -use wp1_sdk::ProverClient; +use sphinx_core::utils::{setup_logger, setup_tracer}; +use sphinx_prover::SphinxStdin; +use sphinx_sdk::ProverClient; use crate::{ build::{build_program, BuildArgs}, @@ -97,7 +97,7 @@ impl ProveCmd { .read_to_end(&mut elf) .expect("failed to read from input file"); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); if let Some(ref input) = self.input { match input { Input::FilePath(ref path) => { diff --git a/cli/src/lib.rs b/cli/src/lib.rs index 5c09ac5bb..c26c48617 100644 --- a/cli/src/lib.rs +++ b/cli/src/lib.rs @@ -9,8 +9,8 @@ use reqwest::Client; pub const RUSTUP_TOOLCHAIN_NAME: &str = "succinct"; -pub const SP1_VERSION_MESSAGE: &str = concat!( - "wp1", +pub const SPHINX_VERSION_MESSAGE: &str = concat!( + "sphinx", " (", env!("VERGEN_GIT_SHA"), " ", diff --git a/core/Cargo.toml b/core/Cargo.toml index df310496d..2533cd8fc 100644 --- a/core/Cargo.toml +++ b/core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-core" +name = "sphinx-core" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -32,8 +32,8 @@ p3-symmetric = { workspace = true } p3-uni-stark = { workspace = true } p3-util = { workspace = true } rrs-lib = { workspace = true } -wp1-derive = { path = "../derive" } -wp1-primitives = { path = "../primitives" } +sphinx-derive = { path = "../derive" } +sphinx-primitives = { path = "../primitives" } anyhow = { workspace = true } arrayref = { workspace = true } @@ -66,7 +66,7 @@ tiny-keccak = { workspace = true, features = ["keccak"] } criterion = { workspace = true } num = { workspace = true, features = ["rand"] } rand = { workspace = true } -wp1-zkvm = { path = "../zkvm/entrypoint" } +sphinx-zkvm = { path = "../zkvm/entrypoint" } [features] debug = [] diff --git a/core/benches/fibonacci.rs b/core/benches/fibonacci.rs index e5c5047ae..48e67f9db 100644 --- a/core/benches/fibonacci.rs +++ b/core/benches/fibonacci.rs @@ -1,8 +1,8 @@ use std::collections::HashMap; use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use wp1_core::{ - io::SP1Stdin, +use sphinx_core::{ + io::SphinxStdin, runtime::{Program, Runtime}, stark::RiscvAir, utils::{prove, prove_simple, BabyBearPoseidon2}, @@ -97,7 +97,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { b.iter(|| { prove( black_box(&program), - &SP1Stdin::new(), + &SphinxStdin::new(), BabyBearPoseidon2::new(), ) }) @@ -108,6 +108,6 @@ pub fn criterion_benchmark(c: &mut Criterion) { run_and_prove_group.finish(); } -// cargo criterion --bench fibonacci --package wp1-core +// cargo criterion --bench fibonacci --package sphinx-core criterion_group!(benches, criterion_benchmark); criterion_main!(benches); diff --git a/core/benches/main.rs b/core/benches/main.rs index 05cc7b79c..b099bb394 100644 --- a/core/benches/main.rs +++ b/core/benches/main.rs @@ -1,7 +1,7 @@ use criterion::{black_box, criterion_group, criterion_main, Criterion}; -use wp1_core::io::SP1Stdin; -use wp1_core::runtime::{Program, Runtime}; -use wp1_core::utils::{prove, BabyBearPoseidon2}; +use sphinx_core::io::SphinxStdin; +use sphinx_core::runtime::{Program, Runtime}; +use sphinx_core::utils::{prove, BabyBearPoseidon2}; #[allow(unreachable_code)] pub fn criterion_benchmark(c: &mut Criterion) { @@ -22,7 +22,7 @@ pub fn criterion_benchmark(c: &mut Criterion) { b.iter(|| { prove( black_box(&program), - &SP1Stdin::new(), + &SphinxStdin::new(), BabyBearPoseidon2::new(), ) }) diff --git a/core/src/air/builder.rs b/core/src/air/builder.rs index d4222ed65..a2b59fe34 100644 --- a/core/src/air/builder.rs +++ b/core/src/air/builder.rs @@ -631,7 +631,7 @@ pub trait MachineAirBuilder: } /// A trait which contains all helper methods for building SP1 machine AIRs. -pub trait SP1AirBuilder: +pub trait SphinxAirBuilder: MachineAirBuilder + ByteAirBuilder + WordAirBuilder @@ -659,7 +659,7 @@ impl MemoryAirBuilder for AB {} impl ProgramAirBuilder for AB {} impl ExtensionAirBuilder for AB {} impl MachineAirBuilder for AB {} -impl SP1AirBuilder for AB {} +impl SphinxAirBuilder for AB {} impl<'a, SC: StarkGenericConfig> EmptyMessageBuilder for ProverConstraintFolder<'a, SC> {} impl<'a, SC: StarkGenericConfig> EmptyMessageBuilder for VerifierConstraintFolder<'a, SC> {} diff --git a/core/src/air/extension.rs b/core/src/air/extension.rs index 673821af9..9acb1c64b 100644 --- a/core/src/air/extension.rs +++ b/core/src/air/extension.rs @@ -4,7 +4,7 @@ use p3_field::{ extension::{BinomialExtensionField, BinomiallyExtendable}, AbstractExtensionField, AbstractField, Field, }; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; const DEGREE: usize = 4; diff --git a/core/src/air/machine.rs b/core/src/air/machine.rs index 65f611693..04d5042e4 100644 --- a/core/src/air/machine.rs +++ b/core/src/air/machine.rs @@ -1,7 +1,7 @@ use p3_air::BaseAir; use p3_field::Field; use p3_matrix::dense::RowMajorMatrix; -pub use wp1_derive::MachineAir; +pub use sphinx_derive::MachineAir; use crate::{runtime::Program, stark::MachineRecord}; diff --git a/core/src/air/public_values.rs b/core/src/air/public_values.rs index 955a79dce..36c18b681 100644 --- a/core/src/air/public_values.rs +++ b/core/src/air/public_values.rs @@ -11,7 +11,7 @@ use super::Word; use crate::stark::PROOF_MAX_NUM_PVS; /// The number of non padded elements in the SP1 proofs public values vec. -pub const SP1_PROOF_NUM_PV_ELTS: usize = size_of::, u8>>(); +pub const SPHINX_PROOF_NUM_PV_ELTS: usize = size_of::, u8>>(); /// The number of 32 bit words in the SP1 proof's committed value digest. pub const PV_DIGEST_NUM_WORDS: usize = 8; @@ -131,7 +131,7 @@ mod tests { fn test_public_values_digest_num_words_consistency_zkvm() { assert_eq!( public_values::PV_DIGEST_NUM_WORDS, - wp1_zkvm::PV_DIGEST_NUM_WORDS + sphinx_zkvm::PV_DIGEST_NUM_WORDS ); } } diff --git a/core/src/air/word.rs b/core/src/air/word.rs index 91be840f2..77a39e3f4 100644 --- a/core/src/air/word.rs +++ b/core/src/air/word.rs @@ -7,7 +7,7 @@ use std::{ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; use serde::{Deserialize, Serialize}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::BaseAirBuilder; diff --git a/core/src/alu/add_sub/mod.rs b/core/src/alu/add_sub/mod.rs index f460f6628..7ea030013 100644 --- a/core/src/alu/add_sub/mod.rs +++ b/core/src/alu/add_sub/mod.rs @@ -9,7 +9,7 @@ use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use p3_maybe_rayon::prelude::ParallelIterator; use p3_maybe_rayon::prelude::ParallelSlice; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, Word}, diff --git a/core/src/alu/bitwise/mod.rs b/core/src/alu/bitwise/mod.rs index a24c0e201..8cb0b1958 100644 --- a/core/src/alu/bitwise/mod.rs +++ b/core/src/alu/bitwise/mod.rs @@ -7,7 +7,7 @@ use p3_air::{Air, BaseAir}; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::{AluAirBuilder, ByteAirBuilder, MachineAir}; diff --git a/core/src/alu/divrem/mod.rs b/core/src/alu/divrem/mod.rs index 762d1125f..ff212b086 100644 --- a/core/src/alu/divrem/mod.rs +++ b/core/src/alu/divrem/mod.rs @@ -72,7 +72,7 @@ use p3_field::AbstractField; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use self::utils::eval_abs_value; use crate::air::Word; diff --git a/core/src/alu/lt/mod.rs b/core/src/alu/lt/mod.rs index 6e4666774..8d965153b 100644 --- a/core/src/alu/lt/mod.rs +++ b/core/src/alu/lt/mod.rs @@ -10,7 +10,7 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use p3_maybe_rayon::prelude::*; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::{AluAirBuilder, BaseAirBuilder, ByteAirBuilder, MachineAir}; diff --git a/core/src/alu/mul/mod.rs b/core/src/alu/mul/mod.rs index 04cc80cf0..bbdab712b 100644 --- a/core/src/alu/mul/mod.rs +++ b/core/src/alu/mul/mod.rs @@ -42,7 +42,7 @@ use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use p3_maybe_rayon::prelude::ParallelIterator; use p3_maybe_rayon::prelude::ParallelSlice; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::{AluAirBuilder, ByteAirBuilder, MachineAir, WordAirBuilder}; diff --git a/core/src/alu/sll/mod.rs b/core/src/alu/sll/mod.rs index bdfe157d6..ecc84530d 100644 --- a/core/src/alu/sll/mod.rs +++ b/core/src/alu/sll/mod.rs @@ -40,7 +40,7 @@ use p3_field::AbstractField; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::{AluAirBuilder, ByteAirBuilder, MachineAir, WordAirBuilder}; diff --git a/core/src/alu/sr/mod.rs b/core/src/alu/sr/mod.rs index ce8c5571e..2b52df3f3 100644 --- a/core/src/alu/sr/mod.rs +++ b/core/src/alu/sr/mod.rs @@ -53,7 +53,7 @@ use p3_field::AbstractField; use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::{AluAirBuilder, ByteAirBuilder, MachineAir, WordAirBuilder}; diff --git a/core/src/bytes/columns.rs b/core/src/bytes/columns.rs index 459b9676b..56a965992 100644 --- a/core/src/bytes/columns.rs +++ b/core/src/bytes/columns.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::NUM_BYTE_OPS; diff --git a/core/src/cpu/columns/auipc.rs b/core/src/cpu/columns/auipc.rs index 9c0f5908a..2663b882d 100644 --- a/core/src/cpu/columns/auipc.rs +++ b/core/src/cpu/columns/auipc.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; diff --git a/core/src/cpu/columns/branch.rs b/core/src/cpu/columns/branch.rs index e40f075c4..c042f0597 100644 --- a/core/src/cpu/columns/branch.rs +++ b/core/src/cpu/columns/branch.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; diff --git a/core/src/cpu/columns/ecall.rs b/core/src/cpu/columns/ecall.rs index 558044109..b6ce3b9a2 100644 --- a/core/src/cpu/columns/ecall.rs +++ b/core/src/cpu/columns/ecall.rs @@ -1,5 +1,5 @@ +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_derive::AlignedBorrow; use crate::{air::PV_DIGEST_NUM_WORDS, operations::IsZeroOperation}; diff --git a/core/src/cpu/columns/instruction.rs b/core/src/cpu/columns/instruction.rs index 23ecf3029..df442b881 100644 --- a/core/src/cpu/columns/instruction.rs +++ b/core/src/cpu/columns/instruction.rs @@ -1,7 +1,7 @@ use std::{iter::once, mem::size_of, vec::IntoIter}; use p3_field::PrimeField; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ air::Word, diff --git a/core/src/cpu/columns/jump.rs b/core/src/cpu/columns/jump.rs index 35f282b7d..152bbddbd 100644 --- a/core/src/cpu/columns/jump.rs +++ b/core/src/cpu/columns/jump.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; diff --git a/core/src/cpu/columns/memory.rs b/core/src/cpu/columns/memory.rs index 3527d28dd..ab27164f0 100644 --- a/core/src/cpu/columns/memory.rs +++ b/core/src/cpu/columns/memory.rs @@ -1,6 +1,6 @@ use std::{array, mem::size_of}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{air::Word, memory::MemoryReadWriteCols}; diff --git a/core/src/cpu/columns/mod.rs b/core/src/cpu/columns/mod.rs index 702e43d99..09e0ad67c 100644 --- a/core/src/cpu/columns/mod.rs +++ b/core/src/cpu/columns/mod.rs @@ -18,7 +18,7 @@ pub use memory::*; pub use opcode::*; pub use opcode_specific::*; use p3_util::indices_arr; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ air::Word, diff --git a/core/src/cpu/columns/opcode.rs b/core/src/cpu/columns/opcode.rs index 076fec9e4..71ed31052 100644 --- a/core/src/cpu/columns/opcode.rs +++ b/core/src/cpu/columns/opcode.rs @@ -1,7 +1,7 @@ use std::{mem::size_of, vec::IntoIter}; use p3_field::PrimeField; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::runtime::{Instruction, Opcode}; diff --git a/core/src/io.rs b/core/src/io.rs index 19ab00fa6..e5fcd39f4 100644 --- a/core/src/io.rs +++ b/core/src/io.rs @@ -8,7 +8,7 @@ use serde::{de::DeserializeOwned, Deserialize, Serialize}; /// Standard input for the prover. #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SP1Stdin { +pub struct SphinxStdin { /// Input stored as a vec of vec of bytes. It's stored this way because the read syscall reads /// a vec of bytes at a time. pub buffer: Vec>, @@ -21,18 +21,18 @@ pub struct SP1Stdin { /// Public values for the prover. #[derive(Debug, Clone, Serialize, Deserialize)] -pub struct SP1PublicValues { +pub struct SphinxPublicValues { buffer: Buffer, } -impl Default for SP1Stdin { +impl Default for SphinxStdin { fn default() -> Self { Self::new() } } -impl SP1Stdin { - /// Create a new `SP1Stdin`. +impl SphinxStdin { + /// Create a new `SphinxStdin`. pub fn new() -> Self { Self { buffer: Vec::new(), @@ -41,7 +41,7 @@ impl SP1Stdin { } } - /// Create a `SP1Stdin` from a slice of bytes. + /// Create a `SphinxStdin` from a slice of bytes. pub fn from(data: &[u8]) -> Self { Self { buffer: vec![data.to_vec()], @@ -89,13 +89,13 @@ impl SP1Stdin { } } -impl Default for SP1PublicValues { +impl Default for SphinxPublicValues { fn default() -> Self { Self::new() } } -impl SP1PublicValues { +impl SphinxPublicValues { /// Create a new `SP1PublicValues`. pub fn new() -> Self { Self { @@ -163,7 +163,7 @@ impl SP1PublicValues { } } -impl AsRef<[u8]> for SP1PublicValues { +impl AsRef<[u8]> for SphinxPublicValues { fn as_ref(&self) -> &[u8] { &self.buffer.data } @@ -216,7 +216,7 @@ mod tests { let test_hex = "1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef1234567890abcdef"; let test_bytes = hex::decode(test_hex).unwrap(); - let mut public_values = SP1PublicValues::new(); + let mut public_values = SphinxPublicValues::new(); public_values.write_slice(&test_bytes); let hash = public_values.hash(); diff --git a/core/src/memory/columns.rs b/core/src/memory/columns.rs index 2f9224d00..7602d47b8 100644 --- a/core/src/memory/columns.rs +++ b/core/src/memory/columns.rs @@ -1,4 +1,4 @@ -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; diff --git a/core/src/memory/global.rs b/core/src/memory/global.rs index 9b9229777..9a2ac38c3 100644 --- a/core/src/memory/global.rs +++ b/core/src/memory/global.rs @@ -6,7 +6,7 @@ use core::{ use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::{AbstractField, PrimeField}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::MemoryInitializeFinalizeEvent; use crate::{ diff --git a/core/src/memory/program.rs b/core/src/memory/program.rs index b73871bed..f311c2da9 100644 --- a/core/src/memory/program.rs +++ b/core/src/memory/program.rs @@ -6,7 +6,7 @@ use p3_field::PrimeField; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{AirInteraction, BaseAirBuilder, PublicValues}; use crate::air::{MachineAir, Word}; diff --git a/core/src/operations/add.rs b/core/src/operations/add.rs index b349e74cc..1fce9652a 100644 --- a/core/src/operations/add.rs +++ b/core/src/operations/add.rs @@ -4,7 +4,7 @@ use crate::runtime::ExecutionRecord; use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; /// A set of columns needed to compute the add of two words. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] diff --git a/core/src/operations/add4.rs b/core/src/operations/add4.rs index 60b3b9ce8..aecd25e0d 100644 --- a/core/src/operations/add4.rs +++ b/core/src/operations/add4.rs @@ -1,6 +1,6 @@ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::WordAirBuilder; diff --git a/core/src/operations/add5.rs b/core/src/operations/add5.rs index a8ff6ba44..f469c83b1 100644 --- a/core/src/operations/add5.rs +++ b/core/src/operations/add5.rs @@ -1,6 +1,6 @@ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Word; use crate::air::WordAirBuilder; diff --git a/core/src/operations/and.rs b/core/src/operations/and.rs index 4b7a2c632..72ab07c3f 100644 --- a/core/src/operations/and.rs +++ b/core/src/operations/and.rs @@ -1,5 +1,5 @@ use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::ByteAirBuilder; use crate::air::Word; diff --git a/core/src/operations/field/extensions/quadratic/mod.rs b/core/src/operations/field/extensions/quadratic/mod.rs index b55cb404d..a9b04765b 100644 --- a/core/src/operations/field/extensions/quadratic/mod.rs +++ b/core/src/operations/field/extensions/quadratic/mod.rs @@ -6,7 +6,7 @@ use hybrid_array::{typenum::Unsigned, Array}; use num::{BigUint, Integer, One, Zero}; use p3_air::AirBuilder; use p3_field::{AbstractField, PrimeField32}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{Polynomial, WordAirBuilder}; use crate::bytes::event::ByteRecord; @@ -376,7 +376,7 @@ mod tests { use p3_field::{AbstractField, Field, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use rand::thread_rng; - use wp1_derive::AlignedBorrow; + use sphinx_derive::AlignedBorrow; use super::{QuadFieldOpCols, QuadFieldOperation}; use crate::air::MachineAir; diff --git a/core/src/operations/field/extensions/quadratic/sqrt.rs b/core/src/operations/field/extensions/quadratic/sqrt.rs index 00ccb479b..94cfd2eee 100644 --- a/core/src/operations/field/extensions/quadratic/sqrt.rs +++ b/core/src/operations/field/extensions/quadratic/sqrt.rs @@ -5,8 +5,8 @@ use crate::operations::field::params::{FieldParameters, Limbs}; use crate::operations::field::range::FieldRangeCols; use num::BigUint; use p3_field::PrimeField32; +use sphinx_derive::AlignedBorrow; use std::fmt::Debug; -use wp1_derive::AlignedBorrow; use super::QuadFieldOpCols; @@ -129,7 +129,7 @@ mod tests { use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use rand::thread_rng; - use wp1_derive::AlignedBorrow; + use sphinx_derive::AlignedBorrow; #[derive(AlignedBorrow, Debug, Clone)] pub struct TestCols { diff --git a/core/src/operations/field/field_den.rs b/core/src/operations/field/field_den.rs index 71a20eaa5..1a7580818 100644 --- a/core/src/operations/field/field_den.rs +++ b/core/src/operations/field/field_den.rs @@ -3,7 +3,7 @@ use std::fmt::Debug; use hybrid_array::{typenum::Unsigned, Array}; use num::BigUint; use p3_field::PrimeField32; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::params::{FieldParameters, Limbs, WITNESS_LIMBS}; use super::util::{compute_root_quotient_and_shift, split_u16_limbs_to_u8_limbs}; @@ -159,7 +159,7 @@ mod tests { use p3_field::{Field, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use rand::thread_rng; - use wp1_derive::AlignedBorrow; + use sphinx_derive::AlignedBorrow; use super::{FieldDenCols, Limbs}; diff --git a/core/src/operations/field/field_inner_product.rs b/core/src/operations/field/field_inner_product.rs index 3d80bb1e3..aec17555e 100644 --- a/core/src/operations/field/field_inner_product.rs +++ b/core/src/operations/field/field_inner_product.rs @@ -4,7 +4,7 @@ use hybrid_array::{typenum::Unsigned, Array}; use num::{BigUint, Integer, Zero}; use p3_field::{AbstractField, PrimeField32}; use p3_maybe_rayon::prelude::*; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::params::{FieldParameters, Limbs, WITNESS_LIMBS}; use super::util::{compute_root_quotient_and_shift, split_u16_limbs_to_u8_limbs}; @@ -148,7 +148,7 @@ mod tests { use p3_field::{Field, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use rand::thread_rng; - use wp1_derive::AlignedBorrow; + use sphinx_derive::AlignedBorrow; use super::{FieldInnerProductCols, Limbs}; diff --git a/core/src/operations/field/field_op.rs b/core/src/operations/field/field_op.rs index 9abfd8a8b..cd9cb5fc5 100644 --- a/core/src/operations/field/field_op.rs +++ b/core/src/operations/field/field_op.rs @@ -4,7 +4,7 @@ use hybrid_array::{typenum::Unsigned, Array}; use num::{BigUint, Integer, Zero}; use p3_air::AirBuilder; use p3_field::PrimeField32; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::params::{FieldParameters, Limbs, WITNESS_LIMBS}; use super::util::{compute_root_quotient_and_shift, split_u16_limbs_to_u8_limbs}; @@ -237,7 +237,7 @@ mod tests { use p3_field::{Field, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use rand::thread_rng; - use wp1_derive::AlignedBorrow; + use sphinx_derive::AlignedBorrow; use super::{FieldOpCols, FieldOperation, Limbs}; diff --git a/core/src/operations/field/field_sqrt.rs b/core/src/operations/field/field_sqrt.rs index 941ed31f6..47e9f78ec 100644 --- a/core/src/operations/field/field_sqrt.rs +++ b/core/src/operations/field/field_sqrt.rs @@ -2,7 +2,7 @@ use std::fmt::Debug; use num::BigUint; use p3_field::PrimeField32; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::field_op::FieldOpCols; use super::params::Limbs; @@ -115,7 +115,7 @@ mod tests { use p3_field::{Field, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use rand::thread_rng; - use wp1_derive::AlignedBorrow; + use sphinx_derive::AlignedBorrow; use super::{FieldSqrtCols, Limbs}; diff --git a/core/src/operations/field/range.rs b/core/src/operations/field/range.rs index 6f079c0ee..3f1ef2039 100644 --- a/core/src/operations/field/range.rs +++ b/core/src/operations/field/range.rs @@ -8,7 +8,7 @@ use p3_field::AbstractField; use p3_field::PrimeField32; use std::fmt::Debug; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ air::ByteAirBuilder, diff --git a/core/src/operations/fixed_rotate_right.rs b/core/src/operations/fixed_rotate_right.rs index eee3a2fd9..a24e39b5b 100644 --- a/core/src/operations/fixed_rotate_right.rs +++ b/core/src/operations/fixed_rotate_right.rs @@ -1,5 +1,5 @@ use p3_field::{AbstractField, Field}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::ByteAirBuilder; use crate::air::Word; diff --git a/core/src/operations/fixed_shift_right.rs b/core/src/operations/fixed_shift_right.rs index acc84428c..8064def41 100644 --- a/core/src/operations/fixed_shift_right.rs +++ b/core/src/operations/fixed_shift_right.rs @@ -1,5 +1,5 @@ use p3_field::{AbstractField, Field}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::ByteAirBuilder; use crate::air::Word; diff --git a/core/src/operations/is_equal_word.rs b/core/src/operations/is_equal_word.rs index d6a108d6b..ce92ea81d 100644 --- a/core/src/operations/is_equal_word.rs +++ b/core/src/operations/is_equal_word.rs @@ -1,5 +1,5 @@ use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::IsZeroWordOperation; use crate::air::{BaseAirBuilder, Word}; diff --git a/core/src/operations/is_zero.rs b/core/src/operations/is_zero.rs index 262e3a774..d9187a507 100644 --- a/core/src/operations/is_zero.rs +++ b/core/src/operations/is_zero.rs @@ -7,7 +7,7 @@ use crate::air::BaseAirBuilder; use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; /// A set of columns needed to compute whether the given word is 0. #[derive(AlignedBorrow, Default, Debug, Clone, Copy)] diff --git a/core/src/operations/is_zero_word.rs b/core/src/operations/is_zero_word.rs index 04b4d7866..6f4d3c05f 100644 --- a/core/src/operations/is_zero_word.rs +++ b/core/src/operations/is_zero_word.rs @@ -4,7 +4,7 @@ //! this operation doesn't do a range check. use p3_air::AirBuilder; use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::IsZeroOperation; use crate::{ diff --git a/core/src/operations/not.rs b/core/src/operations/not.rs index 0d850c123..6568347e2 100644 --- a/core/src/operations/not.rs +++ b/core/src/operations/not.rs @@ -1,6 +1,6 @@ use p3_air::AirBuilder; use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::ByteAirBuilder; use crate::air::Word; diff --git a/core/src/operations/or.rs b/core/src/operations/or.rs index cd862a1e7..c06f690b0 100644 --- a/core/src/operations/or.rs +++ b/core/src/operations/or.rs @@ -1,5 +1,5 @@ use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::ByteAirBuilder; use crate::air::Word; diff --git a/core/src/operations/xor.rs b/core/src/operations/xor.rs index 88e26d5b1..9da6a1c26 100644 --- a/core/src/operations/xor.rs +++ b/core/src/operations/xor.rs @@ -1,5 +1,5 @@ use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::ByteAirBuilder; use crate::air::Word; diff --git a/core/src/program/mod.rs b/core/src/program/mod.rs index 7827b47bd..64b16d6d2 100644 --- a/core/src/program/mod.rs +++ b/core/src/program/mod.rs @@ -7,7 +7,7 @@ use std::collections::HashMap; use p3_air::{Air, BaseAir, PairBuilder}; use p3_field::PrimeField; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ air::{MachineAir, ProgramAirBuilder}, diff --git a/core/src/runtime/syscall.rs b/core/src/runtime/syscall.rs index 3697a6500..815d6768a 100644 --- a/core/src/runtime/syscall.rs +++ b/core/src/runtime/syscall.rs @@ -21,7 +21,7 @@ use crate::syscall::precompiles::weierstrass::{ }; use crate::syscall::{ SyscallCommit, SyscallCommitDeferred, SyscallEnterUnconstrained, SyscallExitUnconstrained, - SyscallHalt, SyscallHintLen, SyscallHintRead, SyscallVerifySP1Proof, SyscallWrite, + SyscallHalt, SyscallHintLen, SyscallHintRead, SyscallVerifySphinxProof, SyscallWrite, }; use crate::utils::ec::edwards::ed25519::Ed25519; use crate::utils::ec::weierstrass::bls12_381::{Bls12381, Bls12381BaseField}; @@ -110,7 +110,7 @@ pub enum SyscallCode { COMMIT_DEFERRED_PROOFS = 0x00_00_00_1A, /// Executes the `VERIFY_SP1_PROOF` precompile. - VERIFY_SP1_PROOF = 0x00_00_00_1B, + VERIFY_SPHINX_PROOF = 0x00_00_00_1B, /// Executes the `HINT_LEN` precompile. HINT_LEN = 0x00_00_00_F0, @@ -146,7 +146,7 @@ impl SyscallCode { 0x00_01_01_79 => SyscallCode::BLS12381_FP2_MUL, 0x00_00_00_10 => SyscallCode::COMMIT, 0x00_00_00_1A => SyscallCode::COMMIT_DEFERRED_PROOFS, - 0x00_00_00_1B => SyscallCode::VERIFY_SP1_PROOF, + 0x00_00_00_1B => SyscallCode::VERIFY_SPHINX_PROOF, 0x00_00_00_F0 => SyscallCode::HINT_LEN, 0x00_00_00_F1 => SyscallCode::HINT_READ, 0x00_01_01_71 => SyscallCode::BLS12381_G1_ADD, @@ -362,8 +362,8 @@ pub fn default_syscall_map() -> HashMap> { Arc::new(SyscallCommitDeferred::new()), ); syscall_map.insert( - SyscallCode::VERIFY_SP1_PROOF, - Arc::new(SyscallVerifySP1Proof::new()), + SyscallCode::VERIFY_SPHINX_PROOF, + Arc::new(SyscallVerifySphinxProof::new()), ); syscall_map.insert(SyscallCode::HINT_LEN, Arc::new(SyscallHintLen::new())); syscall_map.insert(SyscallCode::HINT_READ, Arc::new(SyscallHintRead::new())); @@ -421,82 +421,84 @@ mod tests { fn test_syscall_consistency_zkvm() { for code in SyscallCode::iter() { match code { - SyscallCode::HALT => assert_eq!(code as u32, wp1_zkvm::syscalls::HALT), - SyscallCode::WRITE => assert_eq!(code as u32, wp1_zkvm::syscalls::WRITE), + SyscallCode::HALT => assert_eq!(code as u32, sphinx_zkvm::syscalls::HALT), + SyscallCode::WRITE => assert_eq!(code as u32, sphinx_zkvm::syscalls::WRITE), SyscallCode::ENTER_UNCONSTRAINED => { - assert_eq!(code as u32, wp1_zkvm::syscalls::ENTER_UNCONSTRAINED) + assert_eq!(code as u32, sphinx_zkvm::syscalls::ENTER_UNCONSTRAINED) } SyscallCode::EXIT_UNCONSTRAINED => { - assert_eq!(code as u32, wp1_zkvm::syscalls::EXIT_UNCONSTRAINED) + assert_eq!(code as u32, sphinx_zkvm::syscalls::EXIT_UNCONSTRAINED) + } + SyscallCode::SHA_EXTEND => { + assert_eq!(code as u32, sphinx_zkvm::syscalls::SHA_EXTEND) } - SyscallCode::SHA_EXTEND => assert_eq!(code as u32, wp1_zkvm::syscalls::SHA_EXTEND), SyscallCode::SHA_COMPRESS => { - assert_eq!(code as u32, wp1_zkvm::syscalls::SHA_COMPRESS) + assert_eq!(code as u32, sphinx_zkvm::syscalls::SHA_COMPRESS) } - SyscallCode::ED_ADD => assert_eq!(code as u32, wp1_zkvm::syscalls::ED_ADD), + SyscallCode::ED_ADD => assert_eq!(code as u32, sphinx_zkvm::syscalls::ED_ADD), SyscallCode::ED_DECOMPRESS => { - assert_eq!(code as u32, wp1_zkvm::syscalls::ED_DECOMPRESS) + assert_eq!(code as u32, sphinx_zkvm::syscalls::ED_DECOMPRESS) } SyscallCode::KECCAK_PERMUTE => { - assert_eq!(code as u32, wp1_zkvm::syscalls::KECCAK_PERMUTE) + assert_eq!(code as u32, sphinx_zkvm::syscalls::KECCAK_PERMUTE) } SyscallCode::SECP256K1_ADD => { - assert_eq!(code as u32, wp1_zkvm::syscalls::SECP256K1_ADD) + assert_eq!(code as u32, sphinx_zkvm::syscalls::SECP256K1_ADD) } SyscallCode::SECP256K1_DOUBLE => { - assert_eq!(code as u32, wp1_zkvm::syscalls::SECP256K1_DOUBLE) + assert_eq!(code as u32, sphinx_zkvm::syscalls::SECP256K1_DOUBLE) } SyscallCode::BLAKE3_COMPRESS_INNER => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLAKE3_COMPRESS_INNER) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLAKE3_COMPRESS_INNER) } SyscallCode::SECP256K1_DECOMPRESS => { - assert_eq!(code as u32, wp1_zkvm::syscalls::SECP256K1_DECOMPRESS) + assert_eq!(code as u32, sphinx_zkvm::syscalls::SECP256K1_DECOMPRESS) } - SyscallCode::BN254_ADD => assert_eq!(code as u32, wp1_zkvm::syscalls::BN254_ADD), + SyscallCode::BN254_ADD => assert_eq!(code as u32, sphinx_zkvm::syscalls::BN254_ADD), SyscallCode::BN254_DOUBLE => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BN254_DOUBLE) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BN254_DOUBLE) } SyscallCode::BLS12381_FP_ADD => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_FP_ADD) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_FP_ADD) } SyscallCode::BLS12381_FP_SUB => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_FP_SUB) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_FP_SUB) } SyscallCode::BLS12381_FP_MUL => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_FP_MUL) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_FP_MUL) } SyscallCode::BLS12381_FP2_ADD => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_FP2_ADD) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_FP2_ADD) } SyscallCode::BLS12381_FP2_SUB => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_FP2_SUB) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_FP2_SUB) } SyscallCode::BLS12381_FP2_MUL => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_FP2_MUL) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_FP2_MUL) } SyscallCode::BLS12381_G1_ADD => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_G1_ADD) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_G1_ADD) } SyscallCode::BLS12381_G1_DOUBLE => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_G1_DOUBLE) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_G1_DOUBLE) } - SyscallCode::COMMIT => assert_eq!(code as u32, wp1_zkvm::syscalls::COMMIT), + SyscallCode::COMMIT => assert_eq!(code as u32, sphinx_zkvm::syscalls::COMMIT), SyscallCode::BLS12381_G1_DECOMPRESS => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_G1_DECOMPRESS) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_G1_DECOMPRESS) } SyscallCode::COMMIT_DEFERRED_PROOFS => { - assert_eq!(code as u32, wp1_zkvm::syscalls::COMMIT_DEFERRED_PROOFS) + assert_eq!(code as u32, sphinx_zkvm::syscalls::COMMIT_DEFERRED_PROOFS) } - SyscallCode::VERIFY_SP1_PROOF => { - assert_eq!(code as u32, wp1_zkvm::syscalls::VERIFY_SP1_PROOF) + SyscallCode::VERIFY_SPHINX_PROOF => { + assert_eq!(code as u32, sphinx_zkvm::syscalls::VERIFY_SPHINX_PROOF) } - SyscallCode::HINT_LEN => assert_eq!(code as u32, wp1_zkvm::syscalls::HINT_LEN), - SyscallCode::HINT_READ => assert_eq!(code as u32, wp1_zkvm::syscalls::HINT_READ), + SyscallCode::HINT_LEN => assert_eq!(code as u32, sphinx_zkvm::syscalls::HINT_LEN), + SyscallCode::HINT_READ => assert_eq!(code as u32, sphinx_zkvm::syscalls::HINT_READ), SyscallCode::BLS12381_G2_ADD => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_G2_ADD) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_G2_ADD) } SyscallCode::BLS12381_G2_DOUBLE => { - assert_eq!(code as u32, wp1_zkvm::syscalls::BLS12381_G2_DOUBLE) + assert_eq!(code as u32, sphinx_zkvm::syscalls::BLS12381_G2_DOUBLE) } } } diff --git a/core/src/stark/air.rs b/core/src/stark/air.rs index 6151b3758..7f7f7b93b 100644 --- a/core/src/stark/air.rs +++ b/core/src/stark/air.rs @@ -1,6 +1,6 @@ use super::StarkMachine; -pub use crate::air::SP1AirBuilder; -use crate::air::{MachineAir, SP1_PROOF_NUM_PV_ELTS}; +pub use crate::air::SphinxAirBuilder; +use crate::air::{MachineAir, SPHINX_PROOF_NUM_PV_ELTS}; use crate::memory::{MemoryChipType, MemoryProgramChip}; use crate::stark::Chip; use crate::syscall::precompiles::bls12_381::g1_decompress::Bls12381G1DecompressChip; @@ -123,7 +123,7 @@ impl RiscvAir { .into_iter() .map(Chip::new) .collect::>(); - StarkMachine::new(config, chips, SP1_PROOF_NUM_PV_ELTS) + StarkMachine::new(config, chips, SPHINX_PROOF_NUM_PV_ELTS) } /// Get all the different RISC-V AIRs. diff --git a/core/src/stark/machine.rs b/core/src/stark/machine.rs index b099dcea3..38554a685 100644 --- a/core/src/stark/machine.rs +++ b/core/src/stark/machine.rs @@ -514,7 +514,7 @@ pub mod tests { use serial_test::serial; - use crate::io::SP1Stdin; + use crate::io::SphinxStdin; use crate::runtime::tests::fibonacci_program; use crate::runtime::tests::simple_memory_program; use crate::runtime::tests::simple_program; @@ -680,7 +680,7 @@ pub mod tests { setup_logger(); let program = fibonacci_program(); - let stdin = SP1Stdin::new(); + let stdin = SphinxStdin::new(); prove(&program, &stdin, BabyBearPoseidon2::new()).unwrap(); } diff --git a/core/src/syscall/hint.rs b/core/src/syscall/hint.rs index c9a602b5e..2522b1f60 100644 --- a/core/src/syscall/hint.rs +++ b/core/src/syscall/hint.rs @@ -87,7 +87,7 @@ mod tests { use rand::RngCore; use crate::{ - io::SP1Stdin, + io::SphinxStdin, runtime::Program, utils::{prove, setup_logger, BabyBearPoseidon2}, }; @@ -103,7 +103,7 @@ mod tests { let mut data = vec![0u8; 1021]; rng.fill_bytes(&mut data); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&data); stdin.write_vec(data); diff --git a/core/src/syscall/precompiles/blake3/compress/columns.rs b/core/src/syscall/precompiles/blake3/compress/columns.rs index 55a3ed328..7c0d00346 100644 --- a/core/src/syscall/precompiles/blake3/compress/columns.rs +++ b/core/src/syscall/precompiles/blake3/compress/columns.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::{ g::GOperation, NUM_MSG_WORDS_PER_CALL, NUM_STATE_WORDS_PER_CALL, OPERATION_COUNT, ROUND_COUNT, diff --git a/core/src/syscall/precompiles/blake3/compress/g.rs b/core/src/syscall/precompiles/blake3/compress/g.rs index 31f3289b1..cfd3a1454 100644 --- a/core/src/syscall/precompiles/blake3/compress/g.rs +++ b/core/src/syscall/precompiles/blake3/compress/g.rs @@ -1,5 +1,5 @@ use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::g_func; use crate::{ diff --git a/core/src/syscall/precompiles/bls12_381/g1_decompress.rs b/core/src/syscall/precompiles/bls12_381/g1_decompress.rs index 8502bbfc9..a27d44059 100644 --- a/core/src/syscall/precompiles/bls12_381/g1_decompress.rs +++ b/core/src/syscall/precompiles/bls12_381/g1_decompress.rs @@ -9,7 +9,7 @@ use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use serde::{Deserialize, Serialize}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{AluAirBuilder, ByteAirBuilder, MemoryAirBuilder}; use crate::bytes::{ByteLookupEvent, ByteOpcode}; @@ -474,7 +474,7 @@ where mod tests { use super::bls12_381_g1_decompress; use crate::{ - io::SP1Stdin, + io::SphinxStdin, operations::field::params::FieldParameters, runtime::{Instruction, Opcode, SyscallCode}, stark::SwCurve, @@ -645,7 +645,7 @@ mod tests { let pt_compressed = pt_affine.to_compressed(); let pt_uncompressed = pt_affine.to_uncompressed(); - let inputs = SP1Stdin::from(&pt_compressed[..]); + let inputs = SphinxStdin::from(&pt_compressed[..]); let mut public_values = run_test_io(Program::from(BLS12381_G1_DECOMPRESS_ELF), &inputs).unwrap(); @@ -663,7 +663,7 @@ mod tests { let pt_affine = G1Affine::from_compressed(candidate).unwrap(); let pt_uncompressed = pt_affine.to_uncompressed(); - let inputs = SP1Stdin::from(&pt_compressed[..]); + let inputs = SphinxStdin::from(&pt_compressed[..]); let mut public_values = run_test_io(Program::from(BLS12381_G1_DECOMPRESS_ELF), &inputs).unwrap(); @@ -684,7 +684,7 @@ mod tests { let mut public_values = run_test_io( Program::from(BLS12381_G1_DECOMPRESS_ELF), - &SP1Stdin::from(&compressed), + &SphinxStdin::from(&compressed), ) .unwrap(); let mut result = [0; 96]; diff --git a/core/src/syscall/precompiles/bls12_381/g2_add.rs b/core/src/syscall/precompiles/bls12_381/g2_add.rs index fcc37e078..0a1711058 100644 --- a/core/src/syscall/precompiles/bls12_381/g2_add.rs +++ b/core/src/syscall/precompiles/bls12_381/g2_add.rs @@ -20,8 +20,8 @@ use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use serde::Deserialize; use serde::Serialize; +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_derive::AlignedBorrow; /// Chip for adding to BLS12-381 G2Affine points (A and B). /// diff --git a/core/src/syscall/precompiles/bls12_381/g2_double.rs b/core/src/syscall/precompiles/bls12_381/g2_double.rs index b75ec1b6e..29715c5dc 100644 --- a/core/src/syscall/precompiles/bls12_381/g2_double.rs +++ b/core/src/syscall/precompiles/bls12_381/g2_double.rs @@ -4,7 +4,7 @@ use crate::memory::{MemoryCols, MemoryWriteCols}; use crate::operations::field::extensions::quadratic::{QuadFieldOpCols, QuadFieldOperation}; use crate::operations::field::params::{FieldParameters, Limbs, WORDS_QUAD_EXT_CURVEPOINT}; use crate::runtime::{ExecutionRecord, MemoryWriteRecord, Syscall, SyscallCode, SyscallContext}; -use crate::stark::SP1AirBuilder; +use crate::stark::SphinxAirBuilder; use crate::utils::ec::weierstrass::bls12_381::{bls12381_double, Bls12381BaseField}; use crate::utils::{limbs_from_prev_access, pad_vec_rows}; use crate::Program; @@ -17,8 +17,8 @@ use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use serde::Deserialize; use serde::Serialize; +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_derive::AlignedBorrow; /// Chip for doubling a BLS12-381 G2Affine point (P). /// @@ -304,7 +304,7 @@ impl MachineAir for Bls12381G2AffineDoubleChip { } } -impl Air for Bls12381G2AffineDoubleChip +impl Air for Bls12381G2AffineDoubleChip where AB::F: PrimeField32, { diff --git a/core/src/syscall/precompiles/edwards/ed_add.rs b/core/src/syscall/precompiles/edwards/ed_add.rs index 4f525572e..cbba5d5ac 100644 --- a/core/src/syscall/precompiles/edwards/ed_add.rs +++ b/core/src/syscall/precompiles/edwards/ed_add.rs @@ -15,7 +15,7 @@ use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use p3_maybe_rayon::prelude::IntoParallelRefIterator; use p3_maybe_rayon::prelude::ParallelIterator; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{AluAirBuilder, MemoryAirBuilder}; use crate::bytes::event::ByteRecord; diff --git a/core/src/syscall/precompiles/edwards/ed_decompress.rs b/core/src/syscall/precompiles/edwards/ed_decompress.rs index b617bb35e..2d65816fc 100644 --- a/core/src/syscall/precompiles/edwards/ed_decompress.rs +++ b/core/src/syscall/precompiles/edwards/ed_decompress.rs @@ -11,7 +11,7 @@ use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use serde::{Deserialize, Serialize}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::MachineAir; use crate::air::MachineAirBuilder; diff --git a/core/src/syscall/precompiles/field/add.rs b/core/src/syscall/precompiles/field/add.rs index 3deb51e6e..82b25ac77 100644 --- a/core/src/syscall/precompiles/field/add.rs +++ b/core/src/syscall/precompiles/field/add.rs @@ -11,8 +11,8 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; +use sphinx_derive::AlignedBorrow; use tracing::instrument; -use wp1_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, MemoryAirBuilder}, diff --git a/core/src/syscall/precompiles/field/mul.rs b/core/src/syscall/precompiles/field/mul.rs index 9a1a8a9dc..32e13f59a 100644 --- a/core/src/syscall/precompiles/field/mul.rs +++ b/core/src/syscall/precompiles/field/mul.rs @@ -11,8 +11,8 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; +use sphinx_derive::AlignedBorrow; use tracing::instrument; -use wp1_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, MemoryAirBuilder}, diff --git a/core/src/syscall/precompiles/field/sub.rs b/core/src/syscall/precompiles/field/sub.rs index 52013ddcd..15725343b 100644 --- a/core/src/syscall/precompiles/field/sub.rs +++ b/core/src/syscall/precompiles/field/sub.rs @@ -11,8 +11,8 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; +use sphinx_derive::AlignedBorrow; use tracing::instrument; -use wp1_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, MemoryAirBuilder}, diff --git a/core/src/syscall/precompiles/keccak256/air.rs b/core/src/syscall/precompiles/keccak256/air.rs index 4996b6188..ff919428f 100644 --- a/core/src/syscall/precompiles/keccak256/air.rs +++ b/core/src/syscall/precompiles/keccak256/air.rs @@ -131,7 +131,7 @@ where #[cfg(test)] mod test { - use crate::io::{SP1PublicValues, SP1Stdin}; + use crate::io::{SphinxPublicValues, SphinxStdin}; use crate::runtime::Program; use crate::stark::{RiscvAir, StarkGenericConfig}; use crate::utils::{prove, setup_logger, tests::KECCAK256_ELF, BabyBearPoseidon2}; @@ -159,7 +159,7 @@ mod test { outputs.push(hash); } - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&NUM_TEST_CASES); for input in inputs.iter() { stdin.write(&input); @@ -169,7 +169,7 @@ mod test { let program = Program::from(KECCAK256_ELF); let (proof, public_values) = prove(&program, &stdin, config).unwrap(); - let mut public_values = SP1PublicValues::from(&public_values); + let mut public_values = SphinxPublicValues::from(&public_values); let config = BabyBearPoseidon2::new(); let mut challenger = config.challenger(); diff --git a/core/src/syscall/precompiles/keccak256/columns.rs b/core/src/syscall/precompiles/keccak256/columns.rs index ddfc85a7e..fd191adbf 100644 --- a/core/src/syscall/precompiles/keccak256/columns.rs +++ b/core/src/syscall/precompiles/keccak256/columns.rs @@ -1,7 +1,7 @@ use core::mem::size_of; use p3_keccak_air::KeccakCols; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use super::STATE_NUM_WORDS; use crate::memory::MemoryReadWriteCols; diff --git a/core/src/syscall/precompiles/quad_field/add.rs b/core/src/syscall/precompiles/quad_field/add.rs index 8bbbda286..3ee56f9b9 100644 --- a/core/src/syscall/precompiles/quad_field/add.rs +++ b/core/src/syscall/precompiles/quad_field/add.rs @@ -11,8 +11,8 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; +use sphinx_derive::AlignedBorrow; use tracing::instrument; -use wp1_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, MemoryAirBuilder}, diff --git a/core/src/syscall/precompiles/quad_field/mul.rs b/core/src/syscall/precompiles/quad_field/mul.rs index 6cb0ac8ee..06a05b040 100644 --- a/core/src/syscall/precompiles/quad_field/mul.rs +++ b/core/src/syscall/precompiles/quad_field/mul.rs @@ -11,8 +11,8 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; +use sphinx_derive::AlignedBorrow; use tracing::instrument; -use wp1_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, MemoryAirBuilder}, diff --git a/core/src/syscall/precompiles/quad_field/sub.rs b/core/src/syscall/precompiles/quad_field/sub.rs index 59b8f0e71..e21390c18 100644 --- a/core/src/syscall/precompiles/quad_field/sub.rs +++ b/core/src/syscall/precompiles/quad_field/sub.rs @@ -11,8 +11,8 @@ use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_maybe_rayon::prelude::{IntoParallelRefIterator, ParallelIterator}; use serde::{Deserialize, Serialize}; +use sphinx_derive::AlignedBorrow; use tracing::instrument; -use wp1_derive::AlignedBorrow; use crate::{ air::{AluAirBuilder, MachineAir, MemoryAirBuilder}, diff --git a/core/src/syscall/precompiles/secp256k1/decompress.rs b/core/src/syscall/precompiles/secp256k1/decompress.rs index ca61ab993..5eff9bafc 100644 --- a/core/src/syscall/precompiles/secp256k1/decompress.rs +++ b/core/src/syscall/precompiles/secp256k1/decompress.rs @@ -9,7 +9,7 @@ use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::{AbstractField, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; use serde::{Deserialize, Serialize}; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{AluAirBuilder, ByteAirBuilder, MemoryAirBuilder}; use crate::bytes::event::ByteRecord; @@ -394,7 +394,7 @@ where #[cfg(test)] mod tests { use crate::{ - io::SP1Stdin, + io::SphinxStdin, utils::{self, run_test_io, tests::SECP256K1_DECOMPRESS_ELF}, Program, }; @@ -413,7 +413,7 @@ mod tests { let decompressed = encoded.as_bytes(); let compressed = public_key.to_sec1_bytes(); - let inputs = SP1Stdin::from(&compressed); + let inputs = SphinxStdin::from(&compressed); let mut public_values = run_test_io(Program::from(SECP256K1_DECOMPRESS_ELF), &inputs).unwrap(); diff --git a/core/src/syscall/precompiles/sha256/compress/columns.rs b/core/src/syscall/precompiles/sha256/compress/columns.rs index 945adc91b..a424f4951 100644 --- a/core/src/syscall/precompiles/sha256/compress/columns.rs +++ b/core/src/syscall/precompiles/sha256/compress/columns.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ air::Word, diff --git a/core/src/syscall/precompiles/sha256/extend/columns.rs b/core/src/syscall/precompiles/sha256/extend/columns.rs index 1822c97be..0ac6114e3 100644 --- a/core/src/syscall/precompiles/sha256/extend/columns.rs +++ b/core/src/syscall/precompiles/sha256/extend/columns.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ memory::{MemoryReadCols, MemoryWriteCols}, diff --git a/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs b/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs index 4491b4c7d..35b6158b5 100644 --- a/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs +++ b/core/src/syscall/precompiles/weierstrass/weierstrass_add.rs @@ -14,7 +14,7 @@ use p3_field::AbstractField; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{AluAirBuilder, MachineAir, MemoryAirBuilder}; use crate::bytes::event::ByteRecord; diff --git a/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs b/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs index 031c98212..c12c5b2cd 100644 --- a/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs +++ b/core/src/syscall/precompiles/weierstrass/weierstrass_double.rs @@ -15,7 +15,7 @@ use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; use p3_maybe_rayon::prelude::ParallelIterator; use p3_maybe_rayon::prelude::ParallelSlice; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::{AluAirBuilder, MachineAir, MemoryAirBuilder}; use crate::bytes::event::ByteRecord; diff --git a/core/src/syscall/verify.rs b/core/src/syscall/verify.rs index ff7b2edf7..9b95ca051 100644 --- a/core/src/syscall/verify.rs +++ b/core/src/syscall/verify.rs @@ -7,21 +7,21 @@ use crate::{ /// Verifies an SP1 recursive verifier proof. Note that this syscall only verifies the proof during /// runtime. The actual constraint-level verification is deferred to the recursive layer, where /// proofs are witnessed and verified in order to reconstruct the deferred_proofs_digest. -pub struct SyscallVerifySP1Proof; +pub struct SyscallVerifySphinxProof; -impl SyscallVerifySP1Proof { +impl SyscallVerifySphinxProof { pub fn new() -> Self { Self } } -impl Default for SyscallVerifySP1Proof { +impl Default for SyscallVerifySphinxProof { fn default() -> Self { Self::new() } } -impl Syscall for SyscallVerifySP1Proof { +impl Syscall for SyscallVerifySphinxProof { #[allow(unused_variables, unused_mut)] fn execute( &self, diff --git a/core/src/utils/config.rs b/core/src/utils/config.rs index d503bddc9..e1b1457f4 100644 --- a/core/src/utils/config.rs +++ b/core/src/utils/config.rs @@ -15,7 +15,7 @@ use p3_symmetric::Hash; use p3_symmetric::{PaddingFreeSponge, TruncatedPermutation}; use serde::Deserialize; use serde::Serialize; -use wp1_primitives::poseidon2_init; +use sphinx_primitives::poseidon2_init; pub const DIGEST_SIZE: usize = 8; @@ -52,7 +52,7 @@ pub fn inner_perm() -> InnerPerm { } /// The FRI config for sp1 proofs. -pub fn wp1_fri_config() -> FriConfig { +pub fn sphinx_fri_config() -> FriConfig { let perm = inner_perm(); let hash = InnerHash::new(perm.clone()); let compress = InnerCompress::new(perm.clone()); diff --git a/core/src/utils/prove.rs b/core/src/utils/prove.rs index abd90043a..e11636af2 100644 --- a/core/src/utils/prove.rs +++ b/core/src/utils/prove.rs @@ -13,7 +13,7 @@ use size::Size; use thiserror::Error; use crate::air::MachineAir; -use crate::io::{SP1PublicValues, SP1Stdin}; +use crate::io::{SphinxPublicValues, SphinxStdin}; use crate::lookup::InteractionBuilder; use crate::runtime::ExecutionError; use crate::runtime::{ExecutionRecord, MemoryRecord, ShardingConfig}; @@ -34,7 +34,7 @@ use crate::{ const LOG_DEGREE_BOUND: usize = 31; #[derive(Error, Debug)] -pub enum SP1CoreProverError { +pub enum SphinxCoreProverError { #[error("failed to execute program: {0}")] ExecutionError(ExecutionError), #[error("io error: {0}")] @@ -46,7 +46,7 @@ pub enum SP1CoreProverError { pub fn prove_simple( config: SC, runtime: Runtime, -) -> Result, SP1CoreProverError> +) -> Result, SphinxCoreProverError> where SC::Challenger: Clone, OpeningProof: Send + Sync, @@ -80,9 +80,9 @@ where pub fn prove( program: &Program, - stdin: &SP1Stdin, + stdin: &SphinxStdin, config: SC, -) -> Result<(MachineProof, Vec), SP1CoreProverError> +) -> Result<(MachineProof, Vec), SphinxCoreProverError> where SC::Challenger: Clone, OpeningProof: Send + Sync, @@ -107,7 +107,9 @@ where // If we don't need to batch, we can just run the program normally and prove it. if env::shard_batch_size() == 0 { // Execute the runtime and collect all the events.. - runtime.run().map_err(SP1CoreProverError::ExecutionError)?; + runtime + .run() + .map_err(SphinxCoreProverError::ExecutionError)?; // If debugging is enabled, we will also debug the constraints. #[cfg(feature = "debug")] @@ -128,18 +130,18 @@ where // Execute the runtime until we reach a checkpoint. let (checkpoint, done) = runtime .execute_state() - .map_err(SP1CoreProverError::ExecutionError)?; + .map_err(SphinxCoreProverError::ExecutionError)?; // Save the checkpoint to a temp file. - let mut tempfile = tempfile::tempfile().map_err(SP1CoreProverError::IoError)?; + let mut tempfile = tempfile::tempfile().map_err(SphinxCoreProverError::IoError)?; let mut writer = io::BufWriter::new(&mut tempfile); bincode::serialize_into(&mut writer, &checkpoint) - .map_err(SP1CoreProverError::SerializationError)?; - writer.flush().map_err(SP1CoreProverError::IoError)?; + .map_err(SphinxCoreProverError::SerializationError)?; + writer.flush().map_err(SphinxCoreProverError::IoError)?; drop(writer); tempfile .seek(io::SeekFrom::Start(0)) - .map_err(SP1CoreProverError::IoError)?; + .map_err(SphinxCoreProverError::IoError)?; checkpoints.push(tempfile); // If we've reached the final checkpoint, break out of the loop. @@ -227,15 +229,15 @@ where /// Runs a program and returns the public values stream. pub fn run_test_io( program: Program, - inputs: &SP1Stdin, -) -> Result> { + inputs: &SphinxStdin, +) -> Result> { let runtime = tracing::info_span!("runtime.run(...)").in_scope(|| { let mut runtime = Runtime::new(program); runtime.write_vecs(&inputs.buffer); runtime.run().unwrap(); runtime }); - let public_values = SP1PublicValues::from(&runtime.state.public_values_stream); + let public_values = SphinxPublicValues::from(&runtime.state.public_values_stream); let _ = run_test_core(runtime)?; Ok(public_values) } @@ -432,7 +434,7 @@ pub mod baby_bear_poseidon2 { use p3_poseidon2::{Poseidon2, Poseidon2ExternalMatrixGeneral}; use p3_symmetric::{PaddingFreeSponge, TruncatedPermutation}; use serde::{Deserialize, Serialize}; - use wp1_primitives::RC_16_30; + use sphinx_primitives::RC_16_30; use crate::stark::StarkGenericConfig; diff --git a/core/src/utils/tracer.rs b/core/src/utils/tracer.rs index f3dfc8cfd..48d1f218c 100644 --- a/core/src/utils/tracer.rs +++ b/core/src/utils/tracer.rs @@ -15,9 +15,9 @@ pub fn setup_tracer() { .with_default_directive("log::=off".parse().unwrap()) .from_env_lossy(); if tracer_config == "info" { - env_filter = env_filter.add_directive("wp1_core=info".parse().unwrap()); + env_filter = env_filter.add_directive("sphinx_core=info".parse().unwrap()); } else if tracer_config == "debug" { - env_filter = env_filter.add_directive("wp1_core=debug".parse().unwrap()); + env_filter = env_filter.add_directive("sphinx_core=debug".parse().unwrap()); } Registry::default() .with(env_filter) diff --git a/derive/Cargo.toml b/derive/Cargo.toml index e87dbdda8..3130c5b1d 100644 --- a/derive/Cargo.toml +++ b/derive/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-derive" +name = "sphinx-derive" version = "0.1.0" edition.workspace = true repository.workspace = true diff --git a/derive/src/lib.rs b/derive/src/lib.rs index 4c8b05944..a8f57b225 100644 --- a/derive/src/lib.rs +++ b/derive/src/lib.rs @@ -87,14 +87,14 @@ pub fn aligned_borrow_derive(input: TokenStream) -> TokenStream { #[proc_macro_derive( MachineAir, - attributes(wp1_core_path, execution_record_path, program_path, builder_path) + attributes(sphinx_core_path, execution_record_path, program_path, builder_path) )] pub fn machine_air_derive(input: TokenStream) -> TokenStream { let ast: DeriveInput = syn::parse(input).unwrap(); let name = &ast.ident; let generics = &ast.generics; - let wp1_core_path = find_wp1_core_path(&ast.attrs); + let sphinx_core_path = find_sphinx_core_path(&ast.attrs); let execution_record_path = find_execution_record_path(&ast.attrs); let program_path = find_program_path(&ast.attrs); let builder_path = find_builder_path(&ast.attrs); @@ -140,47 +140,47 @@ pub fn machine_air_derive(input: TokenStream) -> TokenStream { let name_arms = variants.iter().map(|(variant_name, field)| { let field_ty = &field.ty; quote! { - #name::#variant_name(x) => <#field_ty as #wp1_core_path::air::MachineAir>::name(x) + #name::#variant_name(x) => <#field_ty as #sphinx_core_path::air::MachineAir>::name(x) } }); let preprocessed_width_arms = variants.iter().map(|(variant_name, field)| { let field_ty = &field.ty; quote! { - #name::#variant_name(x) => <#field_ty as #wp1_core_path::air::MachineAir>::preprocessed_width(x) + #name::#variant_name(x) => <#field_ty as #sphinx_core_path::air::MachineAir>::preprocessed_width(x) } }); let generate_preprocessed_trace_arms = variants.iter().map(|(variant_name, field)| { let field_ty = &field.ty; quote! { - #name::#variant_name(x) => <#field_ty as #wp1_core_path::air::MachineAir>::generate_preprocessed_trace(x, program) + #name::#variant_name(x) => <#field_ty as #sphinx_core_path::air::MachineAir>::generate_preprocessed_trace(x, program) } }); let generate_trace_arms = variants.iter().map(|(variant_name, field)| { let field_ty = &field.ty; quote! { - #name::#variant_name(x) => <#field_ty as #wp1_core_path::air::MachineAir>::generate_trace(x, input, output) + #name::#variant_name(x) => <#field_ty as #sphinx_core_path::air::MachineAir>::generate_trace(x, input, output) } }); let generate_dependencies_arms = variants.iter().map(|(variant_name, field)| { let field_ty = &field.ty; quote! { - #name::#variant_name(x) => <#field_ty as #wp1_core_path::air::MachineAir>::generate_dependencies(x, input, output) + #name::#variant_name(x) => <#field_ty as #sphinx_core_path::air::MachineAir>::generate_dependencies(x, input, output) } }); let included_arms = variants.iter().map(|(variant_name, field)| { let field_ty = &field.ty; quote! { - #name::#variant_name(x) => <#field_ty as #wp1_core_path::air::MachineAir>::included(x, shard) + #name::#variant_name(x) => <#field_ty as #sphinx_core_path::air::MachineAir>::included(x, shard) } }); let machine_air = quote! { - impl #impl_generics #wp1_core_path::air::MachineAir for #name #ty_generics #where_clause { + impl #impl_generics #sphinx_core_path::air::MachineAir for #name #ty_generics #where_clause { type Record = #execution_record_path; type Program = #program_path; @@ -286,11 +286,11 @@ pub fn cycle_tracker(_attr: TokenStream, item: TokenStream) -> TokenStream { let result = quote! { #visibility fn #name #generics (#inputs) #output #where_clause { - wp1_zkvm::precompiles::unconstrained! { + sphinx_zkvm::precompiles::unconstrained! { println!("cycle-tracker-start: {}", stringify!(#name)); } let result = (|| #block)(); - wp1_zkvm::precompiles::unconstrained! { + sphinx_zkvm::precompiles::unconstrained! { println!("cycle-tracker-end: {}", stringify!(#name)); } result @@ -300,9 +300,9 @@ pub fn cycle_tracker(_attr: TokenStream, item: TokenStream) -> TokenStream { result.into() } -fn find_wp1_core_path(attrs: &[syn::Attribute]) -> syn::Ident { +fn find_sphinx_core_path(attrs: &[syn::Attribute]) -> syn::Ident { for attr in attrs { - if attr.path.is_ident("wp1_core_path") { + if attr.path.is_ident("sphinx_core_path") { if let Ok(syn::Meta::NameValue(meta)) = attr.parse_meta() { if let syn::Lit::Str(lit_str) = &meta.lit { return syn::Ident::new(&lit_str.value(), lit_str.span()); @@ -355,5 +355,5 @@ fn find_builder_path(attrs: &[syn::Attribute]) -> syn::Path { } } } - parse_quote!(crate::air::SP1AirBuilder) + parse_quote!(crate::air::SphinxAirBuilder) } diff --git a/eval.sh b/eval.sh index 29e70a4d3..d84b163cd 100755 --- a/eval.sh +++ b/eval.sh @@ -35,7 +35,7 @@ for program in "${programs[@]}"; do for hash_fn in "${hash_functions[@]}"; do for shard_size in "${shard_sizes[@]}"; do echo "Running $program with hash function $hash_fn and shard size $shard_size, $runs times" - if ! CARGO_NET_GIT_FETCH_WITH_CLI=true RUSTFLAGS='-C target-cpu=native' cargo run -p wp1-eval --release -- \ + if ! CARGO_NET_GIT_FETCH_WITH_CLI=true RUSTFLAGS='-C target-cpu=native' cargo run -p sphinx-eval --release -- \ --program $program --hashfn $hash_fn --shard-size $shard_size --benchmark-path "$benchmark_path" --elf-path "$elf_path" --runs $runs; then echo "Error running evaluation for $program with hash function $hash_fn and shard size $shard_size" fi @@ -43,4 +43,4 @@ for program in "${programs[@]}"; do done cd "$root_directory" -done \ No newline at end of file +done diff --git a/eval/Cargo.toml b/eval/Cargo.toml index ba2cd0c72..aaea6640d 100644 --- a/eval/Cargo.toml +++ b/eval/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "wp1-eval" +name = "sphinx-eval" version = "0.1.0" edition.workspace = true repository.workspace = true license.workspace = true [dependencies] -wp1-core = { path = "../core" } -wp1-prover = { path = "../prover" } +sphinx-core = { path = "../core" } +sphinx-prover = { path = "../prover" } clap = { workspace = true, features = ["derive"] } csv = { workspace = true } diff --git a/eval/src/main.rs b/eval/src/main.rs index db1b2cd21..971c052c8 100644 --- a/eval/src/main.rs +++ b/eval/src/main.rs @@ -8,10 +8,10 @@ use std::{ use clap::{command, Parser}; use csv::WriterBuilder; use serde::Serialize; -use wp1_core::runtime::{Program, Runtime}; -use wp1_core::utils::{prove_simple, BabyBearBlake3, BabyBearKeccak, BabyBearPoseidon2}; -use wp1_prover::utils::get_cycles; -use wp1_prover::SP1Stdin; +use sphinx_core::runtime::{Program, Runtime}; +use sphinx_core::utils::{prove_simple, BabyBearBlake3, BabyBearKeccak, BabyBearPoseidon2}; +use sphinx_prover::utils::get_cycles; +use sphinx_prover::SphinxStdin; /// An identifier used to select the hash function to evaluate. #[derive(clap::ValueEnum, Clone)] @@ -90,7 +90,7 @@ fn main() { // Load the program. let elf_path = &args.elf_path; let elf = fs::read(elf_path).expect("Failed to read ELF file"); - let cycles = get_cycles(&elf, &SP1Stdin::new()); + let cycles = get_cycles(&elf, &SphinxStdin::new()); // Initialize total duration counters. let mut total_execution_duration = 0f64; diff --git a/examples/bls12381-pairing/program/Cargo.lock b/examples/bls12381-pairing/program/Cargo.lock index e06cb4255..1af262ae1 100644 --- a/examples/bls12381-pairing/program/Cargo.lock +++ b/examples/bls12381-pairing/program/Cargo.lock @@ -55,7 +55,7 @@ name = "bls12381-pairing" version = "0.1.0" dependencies = [ "bls12_381", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -465,34 +493,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/bls12381-pairing/program/Cargo.toml b/examples/bls12381-pairing/program/Cargo.toml index e8dead4b6..43924295b 100644 --- a/examples/bls12381-pairing/program/Cargo.toml +++ b/examples/bls12381-pairing/program/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } bls12_381 = { git = "https://github.com/lurk-lab/bls12_381", branch = "zkvm" } diff --git a/examples/bls12381-pairing/program/elf/riscv32im-succinct-zkvm-elf b/examples/bls12381-pairing/program/elf/riscv32im-succinct-zkvm-elf index 5c89d25da..c683339ab 100755 Binary files a/examples/bls12381-pairing/program/elf/riscv32im-succinct-zkvm-elf and b/examples/bls12381-pairing/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/bls12381-pairing/program/src/main.rs b/examples/bls12381-pairing/program/src/main.rs index 161afe6c8..bfe711a36 100644 --- a/examples/bls12381-pairing/program/src/main.rs +++ b/examples/bls12381-pairing/program/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); const G1PT: [u8; 96] = [23, 26, 103, 2, 161, 174, 37, 31, 120, 196, 135, 71, 133, 211, 217, 230, 78, 42, 97, 193, 109, 173, 165, 178, 128, 217, 222, 231, 195, 100, 24, 188, 115, 42, 226, 169, 253, 119, 117, 24, 11, 232, 196, 198, 139, 250, 73, 0, 17, 148, 114, 156, 231, 202, 45, 65, 27, 153, 217, 138, 105, 147, 217, 139, 106, 45, 5, 139, 226, 164, 145, 19, 41, 164, 158, 59, 248, 105, 249, 236, 231, 82, 146, 117, 39, 14, 212, 73, 14, 94, 55, 32, 140, 156, 252, 115]; diff --git a/examples/bls12381-pairing/script/Cargo.lock b/examples/bls12381-pairing/script/Cargo.lock index 1eb52519f..d90058f32 100644 --- a/examples/bls12381-pairing/script/Cargo.lock +++ b/examples/bls12381-pairing/script/Cargo.lock @@ -929,8 +929,8 @@ name = "bls12381-pairing-script" version = "0.1.0" dependencies = [ "bincode", - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3802,6 +3802,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4698,300 +4992,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/bls12381-pairing/script/Cargo.toml b/examples/bls12381-pairing/script/Cargo.toml index 0608fa49f..a05de9992 100644 --- a/examples/bls12381-pairing/script/Cargo.toml +++ b/examples/bls12381-pairing/script/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] bincode = "1.3.3" -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/bls12381-pairing/script/src/main.rs b/examples/bls12381-pairing/script/src/main.rs index 924d08f01..e4318771e 100644 --- a/examples/bls12381-pairing/script/src/main.rs +++ b/examples/bls12381-pairing/script/src/main.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -8,7 +8,7 @@ fn main() { utils::setup_logger(); // Create an input stream. - let stdin = SP1Stdin::new(); + let stdin = SphinxStdin::new(); // Generate the proof for the given program. let client = ProverClient::new(); diff --git a/examples/chess/program/Cargo.lock b/examples/chess/program/Cargo.lock index 1e386d043..a15548beb 100644 --- a/examples/chess/program/Cargo.lock +++ b/examples/chess/program/Cargo.lock @@ -128,7 +128,7 @@ name = "chess-program" version = "0.1.0" dependencies = [ "chess", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -572,6 +572,34 @@ dependencies = [ "rand_core 0.6.4", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand 0.8.5", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -658,34 +686,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand 0.8.5", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/chess/program/Cargo.toml b/examples/chess/program/Cargo.toml index 9b036cf05..46440ed22 100644 --- a/examples/chess/program/Cargo.toml +++ b/examples/chess/program/Cargo.toml @@ -6,4 +6,4 @@ edition = "2021" [dependencies] chess = "3.2.0" -wp1-zkvm = { path = "../../../zkvm/entrypoint" } \ No newline at end of file +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } \ No newline at end of file diff --git a/examples/chess/program/elf/riscv32im-succinct-zkvm-elf b/examples/chess/program/elf/riscv32im-succinct-zkvm-elf index 21b62c4da..122fe4ec6 100755 Binary files a/examples/chess/program/elf/riscv32im-succinct-zkvm-elf and b/examples/chess/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/chess/program/src/main.rs b/examples/chess/program/src/main.rs index 65208607d..960f3aaf5 100644 --- a/examples/chess/program/src/main.rs +++ b/examples/chess/program/src/main.rs @@ -1,13 +1,13 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use chess::{Board, ChessMove}; use std::str::FromStr; pub fn main() { // Read the board position in Forsyth-Edwards Notation (FEN), and a move in Standard Algebraic Notation (SAN) - let fen = wp1_zkvm::io::read::(); - let san = wp1_zkvm::io::read::(); + let fen = sphinx_zkvm::io::read::(); + let san = sphinx_zkvm::io::read::(); // Generate the chessboard from the FEN input let b = Board::from_str(&fen).expect("valid FEN board"); @@ -16,5 +16,5 @@ pub fn main() { let is_valid_move = ChessMove::from_san(&b, &san).is_ok(); // Write whether or not the move is legal - wp1_zkvm::io::commit(&is_valid_move); + sphinx_zkvm::io::commit(&is_valid_move); } diff --git a/examples/chess/script/Cargo.lock b/examples/chess/script/Cargo.lock index e67698fb0..a87e813a3 100644 --- a/examples/chess/script/Cargo.lock +++ b/examples/chess/script/Cargo.lock @@ -1065,8 +1065,8 @@ checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" name = "chess-script" version = "0.1.0" dependencies = [ - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3801,6 +3801,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4697,300 +4991,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/chess/script/Cargo.toml b/examples/chess/script/Cargo.toml index 8440e2cc5..2c23f06ab 100644 --- a/examples/chess/script/Cargo.toml +++ b/examples/chess/script/Cargo.toml @@ -5,7 +5,7 @@ name = "chess-script" edition = "2021" [dependencies] -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/chess/script/build.rs b/examples/chess/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/chess/script/build.rs +++ b/examples/chess/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/chess/script/src/main.rs b/examples/chess/script/src/main.rs index a275d2b4d..07f2e502f 100644 --- a/examples/chess/script/src/main.rs +++ b/examples/chess/script/src/main.rs @@ -1,9 +1,9 @@ -use wp1_sdk::{ProverClient, SP1Stdin}; +use sphinx_sdk::{ProverClient, SphinxStdin}; const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); fn main() { - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); // FEN representation of a chessboard in its initial state let fen = "rnbqkbnr/pppppppp/8/8/8/8/PPPPPPPP/RNBQKBNR w KQkq - 0 1".to_string(); diff --git a/examples/cycle-tracking/program/Cargo.lock b/examples/cycle-tracking/program/Cargo.lock index b64cff6e1..a6cfc1415 100644 --- a/examples/cycle-tracking/program/Cargo.lock +++ b/examples/cycle-tracking/program/Cargo.lock @@ -110,8 +110,8 @@ dependencies = [ name = "cycle-tracking-program" version = "0.1.0" dependencies = [ - "wp1-derive", - "wp1-zkvm", + "sphinx-derive", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,43 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -476,43 +513,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/cycle-tracking/program/Cargo.toml b/examples/cycle-tracking/program/Cargo.toml index 44de7ed70..9c58575a2 100644 --- a/examples/cycle-tracking/program/Cargo.toml +++ b/examples/cycle-tracking/program/Cargo.toml @@ -5,5 +5,5 @@ name = "cycle-tracking-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } -wp1-derive = { path = "../../../derive" } \ No newline at end of file +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-derive = { path = "../../../derive" } \ No newline at end of file diff --git a/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf b/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf index 86a265ba7..360e19487 100755 Binary files a/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf and b/examples/cycle-tracking/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/cycle-tracking/program/src/main.rs b/examples/cycle-tracking/program/src/main.rs index 96540b7b7..e57c59085 100644 --- a/examples/cycle-tracking/program/src/main.rs +++ b/examples/cycle-tracking/program/src/main.rs @@ -1,7 +1,7 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); -#[wp1_derive::cycle_tracker] +#[sphinx_derive::cycle_tracker] pub fn expensive_function(x: usize) -> usize { let mut y = 1; for _ in 0..100 { diff --git a/examples/cycle-tracking/script/Cargo.lock b/examples/cycle-tracking/script/Cargo.lock index f5a9aa435..a6c45e46c 100644 --- a/examples/cycle-tracking/script/Cargo.lock +++ b/examples/cycle-tracking/script/Cargo.lock @@ -1315,8 +1315,8 @@ dependencies = [ name = "cycle-tracking-script" version = "0.1.0" dependencies = [ - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3801,6 +3801,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4697,300 +4991,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/cycle-tracking/script/Cargo.toml b/examples/cycle-tracking/script/Cargo.toml index baffe93dc..1e9b6c380 100644 --- a/examples/cycle-tracking/script/Cargo.toml +++ b/examples/cycle-tracking/script/Cargo.toml @@ -5,7 +5,7 @@ name = "cycle-tracking-script" edition = "2021" [dependencies] -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/cycle-tracking/script/build.rs b/examples/cycle-tracking/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/cycle-tracking/script/build.rs +++ b/examples/cycle-tracking/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/cycle-tracking/script/src/main.rs b/examples/cycle-tracking/script/src/main.rs index 924d08f01..e4318771e 100644 --- a/examples/cycle-tracking/script/src/main.rs +++ b/examples/cycle-tracking/script/src/main.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -8,7 +8,7 @@ fn main() { utils::setup_logger(); // Create an input stream. - let stdin = SP1Stdin::new(); + let stdin = SphinxStdin::new(); // Generate the proof for the given program. let client = ProverClient::new(); diff --git a/examples/fibonacci/program/Cargo.lock b/examples/fibonacci/program/Cargo.lock index 6b5207242..925403f95 100644 --- a/examples/fibonacci/program/Cargo.lock +++ b/examples/fibonacci/program/Cargo.lock @@ -177,7 +177,7 @@ dependencies = [ name = "fibonacci-program" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/fibonacci/program/Cargo.toml b/examples/fibonacci/program/Cargo.toml index 4ef3160e6..661f749ad 100644 --- a/examples/fibonacci/program/Cargo.toml +++ b/examples/fibonacci/program/Cargo.toml @@ -5,4 +5,4 @@ name = "fibonacci-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } diff --git a/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf b/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf index a9cc548f8..1f2713803 100755 Binary files a/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf and b/examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/fibonacci/program/src/main.rs b/examples/fibonacci/program/src/main.rs index d5a49ea95..455121cfe 100644 --- a/examples/fibonacci/program/src/main.rs +++ b/examples/fibonacci/program/src/main.rs @@ -6,17 +6,17 @@ // Under the hood, we wrap your main function with some extra code so that it behaves properly // inside the zkVM. #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); pub fn main() { // Read an input to the program. // // Behind the scenes, this compiles down to a custom system call which handles reading inputs // from the prover. - let n = wp1_zkvm::io::read::(); + let n = sphinx_zkvm::io::read::(); // Write n to public input - wp1_zkvm::io::commit(&n); + sphinx_zkvm::io::commit(&n); // Compute the n'th fibonacci number, using normal Rust code. let mut a = 0; @@ -32,6 +32,6 @@ pub fn main() { // // Behind the scenes, this also compiles down to a custom system call which handles writing // outputs to the prover. - wp1_zkvm::io::commit(&a); - wp1_zkvm::io::commit(&b); + sphinx_zkvm::io::commit(&a); + sphinx_zkvm::io::commit(&b); } diff --git a/examples/fibonacci/script/Cargo.lock b/examples/fibonacci/script/Cargo.lock index 468e8046e..dbaadc5ac 100644 --- a/examples/fibonacci/script/Cargo.lock +++ b/examples/fibonacci/script/Cargo.lock @@ -1577,8 +1577,8 @@ name = "fibonacci-script" version = "0.1.0" dependencies = [ "bincode", - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3802,6 +3802,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4698,300 +4992,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/fibonacci/script/Cargo.toml b/examples/fibonacci/script/Cargo.toml index 5d87c5a50..6a2892367 100644 --- a/examples/fibonacci/script/Cargo.toml +++ b/examples/fibonacci/script/Cargo.toml @@ -7,10 +7,10 @@ default-run = "fibonacci-script" [dependencies] bincode = "1.3.3" -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } [[bin]] name = "groth16" diff --git a/examples/fibonacci/script/bin/compressed.rs b/examples/fibonacci/script/bin/compressed.rs index 60662c152..1706b9d64 100644 --- a/examples/fibonacci/script/bin/compressed.rs +++ b/examples/fibonacci/script/bin/compressed.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -9,7 +9,7 @@ fn main() { // Create an input stream and write '500' to it. let n = 500u32; - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&n); // Generate the constant-sized proof for the given program and input. diff --git a/examples/fibonacci/script/bin/execute.rs b/examples/fibonacci/script/bin/execute.rs index 6a5826c98..55731b97e 100644 --- a/examples/fibonacci/script/bin/execute.rs +++ b/examples/fibonacci/script/bin/execute.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -10,7 +10,7 @@ fn main() { // Create an input stream and write '500' to it. let n = 500u32; - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&n); let client = ProverClient::new(); diff --git a/examples/fibonacci/script/bin/groth16.rs b/examples/fibonacci/script/bin/groth16.rs index 3ac305b98..5e0fe7232 100644 --- a/examples/fibonacci/script/bin/groth16.rs +++ b/examples/fibonacci/script/bin/groth16.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -10,7 +10,7 @@ fn main() { // Create an input stream and write '500' to it. let n = 500u32; - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&n); // Generate the proof for the given program and input. diff --git a/examples/fibonacci/script/build.rs b/examples/fibonacci/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/fibonacci/script/build.rs +++ b/examples/fibonacci/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/fibonacci/script/src/main.rs b/examples/fibonacci/script/src/main.rs index d5cd8a810..c9b9b9492 100644 --- a/examples/fibonacci/script/src/main.rs +++ b/examples/fibonacci/script/src/main.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -10,7 +10,7 @@ fn main() { // Create an input stream and write '500' to it. let n = 500u32; - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&n); // Generate the proof for the given program and input. diff --git a/examples/io/program/Cargo.lock b/examples/io/program/Cargo.lock index 027cb4cc4..75d21ae09 100644 --- a/examples/io/program/Cargo.lock +++ b/examples/io/program/Cargo.lock @@ -235,7 +235,7 @@ name = "io-program" version = "0.1.0" dependencies = [ "serde", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -465,34 +493,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/io/program/Cargo.toml b/examples/io/program/Cargo.toml index bb65b481c..5160e05d6 100644 --- a/examples/io/program/Cargo.toml +++ b/examples/io/program/Cargo.toml @@ -5,5 +5,5 @@ name = "io-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } serde = { version = "1.0.195", features = ["derive"] } \ No newline at end of file diff --git a/examples/io/program/elf/riscv32im-succinct-zkvm-elf b/examples/io/program/elf/riscv32im-succinct-zkvm-elf index afa3f5878..e4bda4c37 100755 Binary files a/examples/io/program/elf/riscv32im-succinct-zkvm-elf and b/examples/io/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/io/program/src/main.rs b/examples/io/program/src/main.rs index 08a3dddf2..5d68d96d8 100644 --- a/examples/io/program/src/main.rs +++ b/examples/io/program/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use serde::{Deserialize, Serialize}; @@ -11,10 +11,10 @@ struct MyPointUnaligned { } pub fn main() { - let p1 = wp1_zkvm::io::read::(); + let p1 = sphinx_zkvm::io::read::(); println!("Read point: {:?}", p1); - let p2 = wp1_zkvm::io::read::(); + let p2 = sphinx_zkvm::io::read::(); println!("Read point: {:?}", p2); let p3: MyPointUnaligned = MyPointUnaligned { @@ -23,5 +23,5 @@ pub fn main() { b: p1.b && p2.b, }; println!("Addition of 2 points: {:?}", p3); - wp1_zkvm::io::commit(&p3); + sphinx_zkvm::io::commit(&p3); } diff --git a/examples/io/script/Cargo.lock b/examples/io/script/Cargo.lock index c9ca7826d..4f0e95ca6 100644 --- a/examples/io/script/Cargo.lock +++ b/examples/io/script/Cargo.lock @@ -2100,8 +2100,8 @@ name = "io-script" version = "0.1.0" dependencies = [ "serde", - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3802,6 +3802,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4698,300 +4992,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/io/script/Cargo.toml b/examples/io/script/Cargo.toml index 11d79c75b..a8bcc1333 100644 --- a/examples/io/script/Cargo.toml +++ b/examples/io/script/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] serde = { version = "1.0.196", features = ["derive"] } -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/io/script/build.rs b/examples/io/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/io/script/build.rs +++ b/examples/io/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/io/script/src/main.rs b/examples/io/script/src/main.rs index b83c27d4e..e9cfd396d 100644 --- a/examples/io/script/src/main.rs +++ b/examples/io/script/src/main.rs @@ -1,5 +1,5 @@ use serde::{Deserialize, Serialize}; -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -16,7 +16,7 @@ fn main() { utils::setup_logger(); // Create an input stream. - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let p = MyPointUnaligned { x: 1, y: 2, diff --git a/examples/is-prime/program/Cargo.toml b/examples/is-prime/program/Cargo.toml index 65080a9a0..962dd7a54 100644 --- a/examples/is-prime/program/Cargo.toml +++ b/examples/is-prime/program/Cargo.toml @@ -5,4 +5,4 @@ name = "is-prime-program" edition = "2021" [dependencies] -wp1-zkvm = { git = "ssh://git@github.com/wormhole-foundation/wp1.git" } \ No newline at end of file +sphinx-zkvm = { git = "ssh://git@github.com/lurk-lab/sphinx.git" } \ No newline at end of file diff --git a/examples/is-prime/program/src/main.rs b/examples/is-prime/program/src/main.rs index 3961e0065..d880f0633 100644 --- a/examples/is-prime/program/src/main.rs +++ b/examples/is-prime/program/src/main.rs @@ -1,12 +1,12 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); pub fn main() { - let n = wp1_zkvm::io::read::(); + let n = sphinx_zkvm::io::read::(); let is_prime = is_prime(n); - wp1_zkvm::io::commit(&is_prime); + sphinx_zkvm::io::commit(&is_prime); } // Returns if divisible via immediate checks than 6k ± 1. diff --git a/examples/is-prime/script/Cargo.lock b/examples/is-prime/script/Cargo.lock index 2588e0079..f51d1df16 100644 --- a/examples/is-prime/script/Cargo.lock +++ b/examples/is-prime/script/Cargo.lock @@ -2073,7 +2073,7 @@ checksum = "8f518f335dce6725a761382244631d86cf0ccb2863413590b31338feb467f9c3" name = "is-prime-script" version = "0.1.0" dependencies = [ - "wp1-sdk", + "sphinx-sdk", ] [[package]] @@ -3765,6 +3765,292 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4661,292 +4947,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/is-prime/script/Cargo.toml b/examples/is-prime/script/Cargo.toml index 558a7ba81..e3f672248 100644 --- a/examples/is-prime/script/Cargo.toml +++ b/examples/is-prime/script/Cargo.toml @@ -5,4 +5,4 @@ name = "is-prime-script" edition = "2021" [dependencies] -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } diff --git a/examples/is-prime/script/src/main.rs b/examples/is-prime/script/src/main.rs index 03143f607..e930246a3 100644 --- a/examples/is-prime/script/src/main.rs +++ b/examples/is-prime/script/src/main.rs @@ -1,5 +1,5 @@ //! A program that takes a number `n` as input, and writes if `n` is prime as an output. -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -7,7 +7,7 @@ fn main() { // Setup a tracer for logging. utils::setup_logger(); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); // Create an input stream and write '29' to it let n = 29u64; diff --git a/examples/json/program/Cargo.lock b/examples/json/program/Cargo.lock index 37644fa80..e0749f9b7 100644 --- a/examples/json/program/Cargo.lock +++ b/examples/json/program/Cargo.lock @@ -243,7 +243,7 @@ dependencies = [ "lib", "serde", "serde_json", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -440,6 +440,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -497,34 +525,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/json/program/Cargo.toml b/examples/json/program/Cargo.toml index eba7d9acd..ee423e76e 100644 --- a/examples/json/program/Cargo.toml +++ b/examples/json/program/Cargo.toml @@ -5,7 +5,7 @@ name = "json-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } serde_json = "1.0.113" serde = "1.0.197" lib = { path = "../lib" } diff --git a/examples/json/program/elf/riscv32im-succinct-zkvm-elf b/examples/json/program/elf/riscv32im-succinct-zkvm-elf index 3cd6fd93b..84acb18ea 100755 Binary files a/examples/json/program/elf/riscv32im-succinct-zkvm-elf and b/examples/json/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/json/program/src/main.rs b/examples/json/program/src/main.rs index dc0c97dc1..57039531d 100644 --- a/examples/json/program/src/main.rs +++ b/examples/json/program/src/main.rs @@ -1,17 +1,17 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use lib::{Account, Transaction}; // Custom structs. use serde_json::Value; // Generic JSON. fn main() { // read generic JSON example inputs. - let data_str = wp1_zkvm::io::read::(); - let key = wp1_zkvm::io::read::(); + let data_str = sphinx_zkvm::io::read::(); + let key = sphinx_zkvm::io::read::(); // read custom struct example inputs. - let mut old_account_state = wp1_zkvm::io::read::(); - let txs = wp1_zkvm::io::read::>(); + let mut old_account_state = sphinx_zkvm::io::read::(); + let txs = sphinx_zkvm::io::read::>(); // do stuff with generic JSON. let v: Value = serde_json::from_str(&data_str).unwrap(); @@ -27,6 +27,6 @@ fn main() { new_account_state.balance += tx.amount; } } - wp1_zkvm::io::commit(&val); - wp1_zkvm::io::commit(&new_account_state); + sphinx_zkvm::io::commit(&val); + sphinx_zkvm::io::commit(&new_account_state); } diff --git a/examples/json/script/Cargo.lock b/examples/json/script/Cargo.lock index 6fd56b670..3362c8811 100644 --- a/examples/json/script/Cargo.lock +++ b/examples/json/script/Cargo.lock @@ -2156,8 +2156,8 @@ dependencies = [ "lib", "serde", "serde_json", - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3811,6 +3811,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4707,300 +5001,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/json/script/Cargo.toml b/examples/json/script/Cargo.toml index 65c8a9432..7c466f9d4 100644 --- a/examples/json/script/Cargo.toml +++ b/examples/json/script/Cargo.toml @@ -7,8 +7,8 @@ edition = "2021" [dependencies] serde = "1.0.197" serde_json = "1.0.114" -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } lib = { path = "../lib" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/json/script/build.rs b/examples/json/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/json/script/build.rs +++ b/examples/json/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/json/script/src/main.rs b/examples/json/script/src/main.rs index 58186a110..8a5a27136 100644 --- a/examples/json/script/src/main.rs +++ b/examples/json/script/src/main.rs @@ -1,7 +1,7 @@ //! A simple script to generate and verify the proof of a given program. use lib::{Account, Transaction}; -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; const JSON_ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -10,7 +10,7 @@ fn main() { utils::setup_logger(); // Generate proof. - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); // Generic sample JSON (as a string input). let data_str = r#" diff --git a/examples/regex/program/Cargo.lock b/examples/regex/program/Cargo.lock index 2ecaf35fb..a6c2c1b39 100644 --- a/examples/regex/program/Cargo.lock +++ b/examples/regex/program/Cargo.lock @@ -378,7 +378,7 @@ name = "regex-program" version = "0.1.0" dependencies = [ "regex", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -452,6 +452,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -509,34 +537,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/regex/program/Cargo.toml b/examples/regex/program/Cargo.toml index 12e77b687..a34284ddc 100644 --- a/examples/regex/program/Cargo.toml +++ b/examples/regex/program/Cargo.toml @@ -5,5 +5,5 @@ name = "regex-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } regex = "1.10.3" diff --git a/examples/regex/program/elf/riscv32im-succinct-zkvm-elf b/examples/regex/program/elf/riscv32im-succinct-zkvm-elf index f46698225..ddcbae094 100755 Binary files a/examples/regex/program/elf/riscv32im-succinct-zkvm-elf and b/examples/regex/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/regex/program/src/main.rs b/examples/regex/program/src/main.rs index 30fdd7ae2..51963d20a 100644 --- a/examples/regex/program/src/main.rs +++ b/examples/regex/program/src/main.rs @@ -1,7 +1,7 @@ //! A simple program that takes a regex pattern and a string and returns whether the string //! matches the pattern. #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use regex::Regex; @@ -12,8 +12,8 @@ use regex::Regex; pub fn main() { // Read two inputs from the prover: a regex pattern and a target string. - let pattern = wp1_zkvm::io::read::(); - let target_string = wp1_zkvm::io::read::(); + let pattern = sphinx_zkvm::io::read::(); + let target_string = sphinx_zkvm::io::read::(); // Try to compile the regex pattern. If it fails, write `false` as output and return. let regex = match Regex::new(&pattern) { @@ -27,5 +27,5 @@ pub fn main() { let result = regex.is_match(&target_string); // Write the result (true or false) to the output. - wp1_zkvm::io::commit(&result); + sphinx_zkvm::io::commit(&result); } diff --git a/examples/regex/script/Cargo.lock b/examples/regex/script/Cargo.lock index 99a9238a1..68dfa721d 100644 --- a/examples/regex/script/Cargo.lock +++ b/examples/regex/script/Cargo.lock @@ -3281,9 +3281,9 @@ dependencies = [ name = "regex-script" version = "0.1.0" dependencies = [ - "wp1-core", - "wp1-helper", - "wp1-sdk", + "sphinx-core", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3802,6 +3802,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4698,300 +4992,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/regex/script/Cargo.toml b/examples/regex/script/Cargo.toml index 3af1ff0b5..5c13dd4e0 100644 --- a/examples/regex/script/Cargo.toml +++ b/examples/regex/script/Cargo.toml @@ -5,8 +5,8 @@ name = "regex-script" edition = "2021" [dependencies] -wp1-core = { path = "../../../core" } -wp1-sdk = { path = "../../../sdk" } +sphinx-core = { path = "../../../core" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/regex/script/build.rs b/examples/regex/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/regex/script/build.rs +++ b/examples/regex/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/regex/script/src/main.rs b/examples/regex/script/src/main.rs index 1311db51c..94a89d0f9 100644 --- a/examples/regex/script/src/main.rs +++ b/examples/regex/script/src/main.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; /// The ELF we want to execute inside the zkVM. const REGEX_IO_ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -8,7 +8,7 @@ fn main() { utils::setup_logger(); // Create a new stdin with d the input for the program. - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let pattern = "a+".to_string(); let target_string = "an era of truth, not trust".to_string(); diff --git a/examples/rsa/program/Cargo.lock b/examples/rsa/program/Cargo.lock index 2e749be27..af5a6b211 100644 --- a/examples/rsa/program/Cargo.lock +++ b/examples/rsa/program/Cargo.lock @@ -529,7 +529,7 @@ dependencies = [ "rand", "rsa", "sha2 0.9.8", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -605,6 +605,34 @@ version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2 0.10.8", + "sphinx-precompiles", +] + [[package]] name = "spin" version = "0.5.2" @@ -678,34 +706,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2 0.10.8", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/rsa/program/Cargo.toml b/examples/rsa/program/Cargo.toml index 124e1bb39..9badbc6d8 100644 --- a/examples/rsa/program/Cargo.toml +++ b/examples/rsa/program/Cargo.toml @@ -5,7 +5,7 @@ name = "rsa-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } digest = "0.10.7" rand = "0.8.5" rsa = "0.6" # Check for the latest version diff --git a/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf b/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf index ddda3a708..0de518d10 100755 Binary files a/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf and b/examples/rsa/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/rsa/program/src/main.rs b/examples/rsa/program/src/main.rs index d74bc315c..a1ec13552 100644 --- a/examples/rsa/program/src/main.rs +++ b/examples/rsa/program/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use rsa::PaddingScheme; use rsa::PublicKey; @@ -11,9 +11,9 @@ pub fn main() { // Read an input to the program. // // Behind the scenes, this compiles down to a custom system call which handles reading inputs - let pk_der = wp1_zkvm::io::read::>(); - let message = wp1_zkvm::io::read::>(); - let signature = wp1_zkvm::io::read::>(); + let pk_der = sphinx_zkvm::io::read::>(); + let message = sphinx_zkvm::io::read::>(); + let signature = sphinx_zkvm::io::read::>(); let public_key = RsaPublicKey::from_public_key_der(&pk_der).unwrap(); @@ -38,5 +38,5 @@ pub fn main() { // Write the output of the program. // // Behind the scenes, this also compiles down to a custom system call which handles writing - wp1_zkvm::io::commit(&verified); + sphinx_zkvm::io::commit(&verified); } diff --git a/examples/rsa/script/Cargo.lock b/examples/rsa/script/Cargo.lock index 3d0243e76..22b7fa658 100644 --- a/examples/rsa/script/Cargo.lock +++ b/examples/rsa/script/Cargo.lock @@ -3476,8 +3476,8 @@ name = "rsa-script" version = "0.1.0" dependencies = [ "rsa", - "wp1-helper", - "wp1-sdk", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -3897,6 +3897,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4803,300 +5097,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/rsa/script/Cargo.toml b/examples/rsa/script/Cargo.toml index 7f9f4ed61..e02a37137 100644 --- a/examples/rsa/script/Cargo.toml +++ b/examples/rsa/script/Cargo.toml @@ -6,7 +6,7 @@ edition = "2021" [dependencies] rsa = "0.6" -wp1-sdk = { path = "../../../sdk" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/rsa/script/build.rs b/examples/rsa/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/rsa/script/build.rs +++ b/examples/rsa/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/rsa/script/src/main.rs b/examples/rsa/script/src/main.rs index 784f2a94d..3c4fecd46 100644 --- a/examples/rsa/script/src/main.rs +++ b/examples/rsa/script/src/main.rs @@ -2,7 +2,7 @@ use rsa::{ pkcs8::{DecodePrivateKey, DecodePublicKey}, RsaPrivateKey, RsaPublicKey, }; -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; use std::vec; /// The ELF we want to execute inside the zkVM. @@ -16,7 +16,7 @@ fn main() { utils::setup_logger(); // Create a new stdin with the input for the program. - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let private_key = RsaPrivateKey::from_pkcs8_der(RSA_2048_PRIV_DER).unwrap(); let public_key = RsaPublicKey::from_public_key_der(RSA_2048_PUB_DER).unwrap(); diff --git a/examples/ssz-withdrawals/program/Cargo.lock b/examples/ssz-withdrawals/program/Cargo.lock index dae291ebd..19df5beba 100644 --- a/examples/ssz-withdrawals/program/Cargo.lock +++ b/examples/ssz-withdrawals/program/Cargo.lock @@ -1343,6 +1343,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2 0.10.8", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -1364,8 +1392,8 @@ dependencies = [ "serde_json", "serde_with", "sha2 0.9.8", + "sphinx-zkvm", "ssz_rs", - "wp1-zkvm", ] [[package]] @@ -1736,34 +1764,6 @@ dependencies = [ "memchr", ] -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2 0.10.8", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/ssz-withdrawals/program/Cargo.toml b/examples/ssz-withdrawals/program/Cargo.toml index b66cef8aa..ac90f03a1 100644 --- a/examples/ssz-withdrawals/program/Cargo.toml +++ b/examples/ssz-withdrawals/program/Cargo.toml @@ -5,7 +5,7 @@ name = "ssz-withdrawals-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } hex-literal = "0.4.1" ssz_rs = { version = "0.9.0", features = ["serde"] } serde_json = "1.0.111" diff --git a/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf b/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf index 2cc6651f7..26681901f 100755 Binary files a/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf and b/examples/ssz-withdrawals/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/ssz-withdrawals/program/src/main.rs b/examples/ssz-withdrawals/program/src/main.rs index 24344c450..8da004d60 100644 --- a/examples/ssz-withdrawals/program/src/main.rs +++ b/examples/ssz-withdrawals/program/src/main.rs @@ -2,7 +2,7 @@ //! sum of all beacon partial withdrawals in [start_slot, end_slot) to the given eigenpod address. #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); mod beacon; diff --git a/examples/ssz-withdrawals/script/Cargo.lock b/examples/ssz-withdrawals/script/Cargo.lock index a8aaf590b..a5de76958 100644 --- a/examples/ssz-withdrawals/script/Cargo.lock +++ b/examples/ssz-withdrawals/script/Cargo.lock @@ -3793,6 +3793,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -3813,9 +4107,9 @@ dependencies = [ name = "ssz-withdrawals-script" version = "0.1.0" dependencies = [ - "wp1-core", - "wp1-helper", - "wp1-sdk", + "sphinx-core", + "sphinx-helper", + "sphinx-sdk", ] [[package]] @@ -4698,300 +4992,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/ssz-withdrawals/script/Cargo.toml b/examples/ssz-withdrawals/script/Cargo.toml index 350f35f2c..44634c328 100644 --- a/examples/ssz-withdrawals/script/Cargo.toml +++ b/examples/ssz-withdrawals/script/Cargo.toml @@ -5,8 +5,8 @@ name = "ssz-withdrawals-script" edition = "2021" [dependencies] -wp1-core = { path = "../../../core" } -wp1-sdk = { path = "../../../sdk" } +sphinx-core = { path = "../../../core" } +sphinx-sdk = { path = "../../../sdk" } [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/ssz-withdrawals/script/build.rs b/examples/ssz-withdrawals/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/ssz-withdrawals/script/build.rs +++ b/examples/ssz-withdrawals/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/ssz-withdrawals/script/src/main.rs b/examples/ssz-withdrawals/script/src/main.rs index 32edb128a..053e747ee 100644 --- a/examples/ssz-withdrawals/script/src/main.rs +++ b/examples/ssz-withdrawals/script/src/main.rs @@ -1,4 +1,4 @@ -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; const ELF: &[u8] = include_bytes!("../../program/elf/riscv32im-succinct-zkvm-elf"); @@ -7,7 +7,7 @@ fn main() { // utils::setup_tracer(); utils::setup_logger(); - let stdin = SP1Stdin::new(); + let stdin = SphinxStdin::new(); let client = ProverClient::new(); let (pk, vk) = client.setup(ELF); let proof = client.prove_compressed(&pk, stdin).expect("proving failed"); diff --git a/examples/tendermint/program/Cargo.lock b/examples/tendermint/program/Cargo.lock index 59dfb7fee..895872e11 100644 --- a/examples/tendermint/program/Cargo.lock +++ b/examples/tendermint/program/Cargo.lock @@ -743,6 +743,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2 0.10.8", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -849,8 +877,8 @@ dependencies = [ "serde", "serde_cbor", "serde_json", + "sphinx-zkvm", "tendermint-light-client-verifier", - "wp1-zkvm", ] [[package]] @@ -923,34 +951,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2 0.10.8", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/tendermint/program/Cargo.toml b/examples/tendermint/program/Cargo.toml index 3581b79d6..395367b7d 100644 --- a/examples/tendermint/program/Cargo.toml +++ b/examples/tendermint/program/Cargo.toml @@ -5,7 +5,7 @@ name = "tendermint-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../../zkvm/entrypoint" } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } serde = { version = "1.0", default-features = false, features = ["derive"] } tendermint-light-client-verifier = { git = "https://github.com/i-m-aditya/tendermint-rs.git", branch = "i-m-aditya/break-loop-on-having-enough-voting-power", default-features = false, features = [ diff --git a/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf b/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf index 2a95fa969..cf84ba62b 100755 Binary files a/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf and b/examples/tendermint/program/elf/riscv32im-succinct-zkvm-elf differ diff --git a/examples/tendermint/program/src/main.rs b/examples/tendermint/program/src/main.rs index b6bd3de57..706d68c7a 100644 --- a/examples/tendermint/program/src/main.rs +++ b/examples/tendermint/program/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use core::time::Duration; use tendermint_light_client_verifier::{ @@ -9,13 +9,13 @@ use tendermint_light_client_verifier::{ fn main() { // Normally we could just do this to read in the LightBlocks, but bincode doesn't work with LightBlock. // This is likely a bug in tendermint-rs. - // let light_block_1 = wp1_zkvm::io::read::(); - // let light_block_2 = wp1_zkvm::io::read::(); + // let light_block_1 = sphinx_zkvm::io::read::(); + // let light_block_2 = sphinx_zkvm::io::read::(); println!("cycle-tracker-start: io"); println!("cycle-tracker-start: reading bytes"); - let encoded_1 = wp1_zkvm::io::read_vec(); - let encoded_2 = wp1_zkvm::io::read_vec(); + let encoded_1 = sphinx_zkvm::io::read_vec(); + let encoded_2 = sphinx_zkvm::io::read_vec(); println!("cycle-tracker-end: reading bytes"); println!("first 10 bytes: {:?}", &encoded_1[..10]); println!("first 10 bytes: {:?}", &encoded_2[..10]); @@ -41,8 +41,8 @@ fn main() { println!("cycle-tracker-end: header hash"); println!("cycle-tracker-start: public input headers"); - wp1_zkvm::io::commit_slice(header_hash_1.as_bytes()); - wp1_zkvm::io::commit_slice(header_hash_2.as_bytes()); + sphinx_zkvm::io::commit_slice(header_hash_1.as_bytes()); + sphinx_zkvm::io::commit_slice(header_hash_2.as_bytes()); println!("cycle-tracker-end: public input headers"); println!("cycle-tracker-start: verify"); @@ -63,7 +63,7 @@ fn main() { println!("cycle-tracker-start: public inputs verdict"); let verdict_encoded = serde_cbor::to_vec(&verdict).unwrap(); - wp1_zkvm::io::commit_slice(verdict_encoded.as_slice()); + sphinx_zkvm::io::commit_slice(verdict_encoded.as_slice()); println!("cycle-tracker-end: public inputs verdict"); match verdict { diff --git a/examples/tendermint/script/Cargo.lock b/examples/tendermint/script/Cargo.lock index d7a9de7e1..b17717a9e 100644 --- a/examples/tendermint/script/Cargo.lock +++ b/examples/tendermint/script/Cargo.lock @@ -3960,6 +3960,300 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "sphinx-core" +version = "0.1.0" +dependencies = [ + "anyhow", + "arrayref", + "bincode", + "blake3", + "blake3-zkvm", + "bls12_381 0.8.0", + "cfg-if", + "curve25519-dalek", + "elf", + "elliptic-curve", + "hex", + "hybrid-array", + "itertools 0.12.1", + "k256", + "lazy_static", + "log", + "nohash-hasher", + "num", + "num-bigint 0.4.5", + "num_cpus", + "p3-air", + "p3-baby-bear", + "p3-blake3", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-keccak", + "p3-keccak-air", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-uni-stark", + "p3-util", + "rayon-scan", + "rrs-lib", + "serde", + "serde_with", + "serial_test", + "size", + "sphinx-derive", + "sphinx-primitives", + "strum", + "strum_macros", + "tempfile", + "thiserror", + "tracing", + "tracing-forest", + "tracing-subscriber", + "web-time", +] + +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-helper" +version = "0.1.0" +dependencies = [ + "cargo_metadata", + "chrono", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-prover" +version = "0.1.0" +dependencies = [ + "anyhow", + "backtrace", + "bincode", + "clap", + "futures", + "hex", + "home", + "indicatif", + "itertools 0.12.1", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-field", + "rayon", + "reqwest", + "serde", + "serde_json", + "serial_test", + "sha2 0.10.8", + "size", + "sphinx-core", + "sphinx-primitives", + "sphinx-recursion-circuit", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-gnark-ffi", + "sphinx-recursion-program", + "tempfile", + "thiserror", + "tokio", + "tracing", + "tracing-appender", + "tracing-subscriber", +] + +[[package]] +name = "sphinx-recursion-circuit" +version = "0.1.0" +dependencies = [ + "bincode", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "sphinx-recursion-program", +] + +[[package]] +name = "sphinx-recursion-compiler" +version = "0.1.0" +dependencies = [ + "backtrace", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-commit", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "serde", + "sphinx-core", + "sphinx-recursion-core", + "sphinx-recursion-derive", + "tracing", +] + +[[package]] +name = "sphinx-recursion-core" +version = "0.1.0" +dependencies = [ + "arrayref", + "backtrace", + "ff 0.13.0", + "hashbrown 0.14.5", + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-bn254-fr", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "serde", + "serde_with", + "sphinx-core", + "sphinx-derive", + "sphinx-primitives", + "static_assertions", + "tracing", + "zkhash", +] + +[[package]] +name = "sphinx-recursion-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-recursion-gnark-ffi" +version = "0.1.0" +dependencies = [ + "bindgen", + "cc", + "crossbeam", + "log", + "num-bigint 0.4.5", + "p3-baby-bear", + "p3-field", + "rand", + "reqwest", + "serde", + "serde_json", + "sphinx-recursion-compiler", + "subtle-encoding", + "tempfile", +] + +[[package]] +name = "sphinx-recursion-program" +version = "0.1.0" +dependencies = [ + "itertools 0.12.1", + "p3-air", + "p3-baby-bear", + "p3-challenger", + "p3-commit", + "p3-dft", + "p3-field", + "p3-fri", + "p3-matrix", + "p3-maybe-rayon", + "p3-merkle-tree", + "p3-poseidon2", + "p3-symmetric", + "p3-util", + "rand", + "serde", + "sphinx-core", + "sphinx-recursion-compiler", + "sphinx-recursion-core", + "tracing", +] + +[[package]] +name = "sphinx-sdk" +version = "0.1.0" +dependencies = [ + "alloy", + "anyhow", + "async-trait", + "axum", + "bincode", + "dotenv", + "futures", + "hex", + "indicatif", + "log", + "num-bigint 0.4.5", + "p3-commit", + "p3-field", + "p3-matrix", + "prost", + "reqwest", + "reqwest-middleware", + "serde", + "serde_json", + "sha2 0.10.8", + "sphinx-core", + "sphinx-prover", + "tempfile", + "tokio", + "tracing", + "twirp", + "vergen", +] + [[package]] name = "spin" version = "0.5.2" @@ -4184,12 +4478,12 @@ dependencies = [ "serde_cbor", "serde_json", "sha2 0.10.8", + "sphinx-core", + "sphinx-helper", + "sphinx-sdk", "tendermint", "tendermint-light-client-verifier", "tokio", - "wp1-core", - "wp1-helper", - "wp1-sdk", ] [[package]] @@ -4962,300 +5256,6 @@ dependencies = [ "windows-sys 0.48.0", ] -[[package]] -name = "wp1-core" -version = "0.1.0" -dependencies = [ - "anyhow", - "arrayref", - "bincode", - "blake3", - "blake3-zkvm", - "bls12_381 0.8.0", - "cfg-if", - "curve25519-dalek", - "elf", - "elliptic-curve", - "hex", - "hybrid-array", - "itertools 0.12.1", - "k256", - "lazy_static", - "log", - "nohash-hasher", - "num", - "num-bigint 0.4.5", - "num_cpus", - "p3-air", - "p3-baby-bear", - "p3-blake3", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-keccak", - "p3-keccak-air", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-uni-stark", - "p3-util", - "rayon-scan", - "rrs-lib", - "serde", - "serde_with", - "serial_test", - "size", - "strum", - "strum_macros", - "tempfile", - "thiserror", - "tracing", - "tracing-forest", - "tracing-subscriber", - "web-time", - "wp1-derive", - "wp1-primitives", -] - -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-helper" -version = "0.1.0" -dependencies = [ - "cargo_metadata", - "chrono", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-prover" -version = "0.1.0" -dependencies = [ - "anyhow", - "backtrace", - "bincode", - "clap", - "futures", - "hex", - "home", - "indicatif", - "itertools 0.12.1", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-field", - "rayon", - "reqwest", - "serde", - "serde_json", - "serial_test", - "sha2 0.10.8", - "size", - "tempfile", - "thiserror", - "tokio", - "tracing", - "tracing-appender", - "tracing-subscriber", - "wp1-core", - "wp1-primitives", - "wp1-recursion-circuit", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-gnark-ffi", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-circuit" -version = "0.1.0" -dependencies = [ - "bincode", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-util", - "serde", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", - "wp1-recursion-derive", - "wp1-recursion-program", -] - -[[package]] -name = "wp1-recursion-compiler" -version = "0.1.0" -dependencies = [ - "backtrace", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-commit", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-core", - "wp1-recursion-derive", -] - -[[package]] -name = "wp1-recursion-core" -version = "0.1.0" -dependencies = [ - "arrayref", - "backtrace", - "ff 0.13.0", - "hashbrown 0.14.5", - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-bn254-fr", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "serde", - "serde_with", - "static_assertions", - "tracing", - "wp1-core", - "wp1-derive", - "wp1-primitives", - "zkhash", -] - -[[package]] -name = "wp1-recursion-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-recursion-gnark-ffi" -version = "0.1.0" -dependencies = [ - "bindgen", - "cc", - "crossbeam", - "log", - "num-bigint 0.4.5", - "p3-baby-bear", - "p3-field", - "rand", - "reqwest", - "serde", - "serde_json", - "subtle-encoding", - "tempfile", - "wp1-recursion-compiler", -] - -[[package]] -name = "wp1-recursion-program" -version = "0.1.0" -dependencies = [ - "itertools 0.12.1", - "p3-air", - "p3-baby-bear", - "p3-challenger", - "p3-commit", - "p3-dft", - "p3-field", - "p3-fri", - "p3-matrix", - "p3-maybe-rayon", - "p3-merkle-tree", - "p3-poseidon2", - "p3-symmetric", - "p3-util", - "rand", - "serde", - "tracing", - "wp1-core", - "wp1-recursion-compiler", - "wp1-recursion-core", -] - -[[package]] -name = "wp1-sdk" -version = "0.1.0" -dependencies = [ - "alloy", - "anyhow", - "async-trait", - "axum", - "bincode", - "dotenv", - "futures", - "hex", - "indicatif", - "log", - "num-bigint 0.4.5", - "p3-commit", - "p3-field", - "p3-matrix", - "prost", - "reqwest", - "reqwest-middleware", - "serde", - "serde_json", - "sha2 0.10.8", - "tempfile", - "tokio", - "tracing", - "twirp", - "vergen", - "wp1-core", - "wp1-prover", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/examples/tendermint/script/Cargo.toml b/examples/tendermint/script/Cargo.toml index c100b9d6b..6aa8a74e5 100644 --- a/examples/tendermint/script/Cargo.toml +++ b/examples/tendermint/script/Cargo.toml @@ -5,8 +5,8 @@ name = "tendermint-script" edition = "2021" [dependencies] -wp1-core = { path = "../../../core", features = ["neon"] } -wp1-sdk = { path = "../../../sdk" } +sphinx-core = { path = "../../../core", features = ["neon"] } +sphinx-sdk = { path = "../../../sdk" } reqwest = { version = "0.12.3", features = ["json"] } tokio = { version = "1", features = ["full"] } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } @@ -21,4 +21,4 @@ serde_cbor = "0.11.2" sha2 = "0.10.8" [build-dependencies] -wp1-helper = { path = "../../../helper" } +sphinx-helper = { path = "../../../helper" } diff --git a/examples/tendermint/script/build.rs b/examples/tendermint/script/build.rs index 3705d9ef4..d2c752e6c 100644 --- a/examples/tendermint/script/build.rs +++ b/examples/tendermint/script/build.rs @@ -1,4 +1,4 @@ -use wp1_helper::build_program; +use sphinx_helper::build_program; fn main() { build_program("../program") diff --git a/examples/tendermint/script/src/main.rs b/examples/tendermint/script/src/main.rs index fe99283f0..0115f8dfd 100644 --- a/examples/tendermint/script/src/main.rs +++ b/examples/tendermint/script/src/main.rs @@ -2,7 +2,7 @@ use std::time::Duration; use tokio::runtime::Runtime; use reqwest::Client; -use wp1_sdk::{utils, ProverClient, SP1Stdin}; +use sphinx_sdk::{utils, ProverClient, SphinxStdin}; use tendermint_light_client_verifier::options::Options; use tendermint_light_client_verifier::types::LightBlock; @@ -47,7 +47,7 @@ fn main() { let expected_verdict = verify_blocks(light_block_1.clone(), light_block_2.clone()); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let encoded_1 = serde_cbor::to_vec(&light_block_1).unwrap(); let encoded_2 = serde_cbor::to_vec(&light_block_2).unwrap(); diff --git a/helper/Cargo.toml b/helper/Cargo.toml index 2448ad396..e4cac89e0 100644 --- a/helper/Cargo.toml +++ b/helper/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-helper" +name = "sphinx-helper" version = "0.1.0" edition.workspace = true repository.workspace = true diff --git a/primitives/Cargo.toml b/primitives/Cargo.toml index 9542e3b84..73822fe28 100644 --- a/primitives/Cargo.toml +++ b/primitives/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-primitives" +name = "sphinx-primitives" version = "0.1.0" edition.workspace = true repository.workspace = true diff --git a/primitives/src/lib.rs b/primitives/src/lib.rs index 9c0837f89..0cd6863d3 100644 --- a/primitives/src/lib.rs +++ b/primitives/src/lib.rs @@ -1,4 +1,4 @@ -//! wp1-primitives contains types and functions that are used in both sp1-core and sp1-zkvm. +//! sphinx-primitives contains types and functions that are used in both sp1-core and sp1-zkvm. //! Because it is imported in the zkvm entrypoint, it should be kept minimal. use lazy_static::lazy_static; diff --git a/prover/Cargo.toml b/prover/Cargo.toml index 92f72eb0b..bc8e0bfcf 100644 --- a/prover/Cargo.toml +++ b/prover/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-prover" +name = "sphinx-prover" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -8,13 +8,13 @@ license.workspace = true # See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html [dependencies] -wp1-recursion-program = { path = "../recursion/program" } -wp1-recursion-circuit = { path = "../recursion/circuit" } -wp1-recursion-compiler = { path = "../recursion/compiler" } -wp1-recursion-core = { path = "../recursion/core" } -wp1-recursion-gnark-ffi = { path = "../recursion/gnark-ffi" } -wp1-core = { path = "../core" } -wp1-primitives = { path = "../primitives" } +sphinx-recursion-program = { path = "../recursion/program" } +sphinx-recursion-circuit = { path = "../recursion/circuit" } +sphinx-recursion-compiler = { path = "../recursion/compiler" } +sphinx-recursion-core = { path = "../recursion/core" } +sphinx-recursion-gnark-ffi = { path = "../recursion/gnark-ffi" } +sphinx-core = { path = "../core" } +sphinx-primitives = { path = "../primitives" } p3-field = { workspace = true } p3-challenger = { workspace = true } p3-baby-bear = { workspace = true } @@ -53,4 +53,4 @@ name = "e2e" path = "scripts/e2e.rs" [features] -neon = ["wp1-core/neon"] +neon = ["sphinx-core/neon"] diff --git a/prover/Makefile b/prover/Makefile index 89e2c4207..b16d65602 100644 --- a/prover/Makefile +++ b/prover/Makefile @@ -6,7 +6,7 @@ all: build-groth16: mkdir -p build && \ RUSTFLAGS='-C target-cpu=native' \ - cargo run -p wp1-prover --release --bin build_groth16 -- \ + cargo run -p sphinx-prover --release --bin build_groth16 -- \ --build-dir=./build release-groth16: @@ -14,24 +14,24 @@ release-groth16: test-e2e: RUSTFLAGS='-C target-cpu=native' \ - cargo test --package wp1-prover --lib --release -- tests::test_e2e --exact --show-output + cargo test --package sphinx-prover --lib --release -- tests::test_e2e --exact --show-output fibonacci-sweep: mkdir -p scripts/results && \ rm -f scripts/results/fibonacci_sweep.log && \ RUSTFLAGS='-C target-cpu=native -C target_feature=+avx512ifma,+avx512vl' \ RUST_LOG=info \ - cargo run --package wp1-prover --release --bin fibonacci_sweep + cargo run --package sphinx-prover --release --bin fibonacci_sweep tendermint-sweep: mkdir -p scripts/results && \ rm -f scripts/results/tendermint_sweep.log && \ RUSTFLAGS='-C target-cpu=native -C target_feature=+avx512ifma,+avx512vl' \ RUST_LOG=info \ - cargo run --package wp1-prover --release --bin tendermint_sweep + cargo run --package sphinx-prover --release --bin tendermint_sweep fibonacci-groth16: mkdir -p scripts/results && \ RUSTFLAGS='-C target-cpu=native -C target_feature=+avx512ifma,+avx512vl' \ RUST_LOG=info \ - cargo run --package wp1-prover --release --bin fibonacci_groth16 + cargo run --package sphinx-prover --release --bin fibonacci_groth16 diff --git a/prover/scripts/build_groth16.rs b/prover/scripts/build_groth16.rs index ab3065284..77267f8e4 100644 --- a/prover/scripts/build_groth16.rs +++ b/prover/scripts/build_groth16.rs @@ -1,8 +1,8 @@ use std::path::PathBuf; use clap::Parser; -use wp1_core::utils::setup_logger; -use wp1_prover::build::build_groth16_artifacts_with_dummy; +use sphinx_core::utils::setup_logger; +use sphinx_prover::build::build_groth16_artifacts_with_dummy; #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] diff --git a/prover/scripts/e2e.rs b/prover/scripts/e2e.rs index 2b40e8c98..dd26f217e 100644 --- a/prover/scripts/e2e.rs +++ b/prover/scripts/e2e.rs @@ -4,14 +4,14 @@ use std::path::PathBuf; use clap::Parser; use p3_baby_bear::BabyBear; use p3_field::PrimeField; -use wp1_core::io::SP1Stdin; -use wp1_prover::utils::{babybear_bytes_to_bn254, babybears_to_bn254, words_to_bytes}; -use wp1_prover::SP1Prover; -use wp1_recursion_circuit::stark::build_wrap_circuit; -use wp1_recursion_circuit::witness::Witnessable; -use wp1_recursion_compiler::ir::Witness; -use wp1_recursion_core::air::RecursionPublicValues; -use wp1_recursion_gnark_ffi::Groth16Prover; +use sphinx_core::io::SphinxStdin; +use sphinx_prover::utils::{babybear_bytes_to_bn254, babybears_to_bn254, words_to_bytes}; +use sphinx_prover::SphinxProver; +use sphinx_recursion_circuit::stark::build_wrap_circuit; +use sphinx_recursion_circuit::witness::Witnessable; +use sphinx_recursion_compiler::ir::Witness; +use sphinx_recursion_core::air::RecursionPublicValues; +use sphinx_recursion_gnark_ffi::Groth16Prover; #[derive(Parser, Debug)] #[clap(author, version, about, long_about = None)] @@ -21,7 +21,7 @@ struct Args { } pub fn main() { - wp1_core::utils::setup_logger(); + sphinx_core::utils::setup_logger(); std::env::set_var("RECONSTRUCT_COMMITMENTS", "false"); let args = Args::parse(); @@ -30,13 +30,13 @@ pub fn main() { let elf = include_bytes!("../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); tracing::info!("initializing prover"); - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); tracing::info!("setup elf"); let (pk, vk) = prover.setup(elf); tracing::info!("prove core"); - let stdin = SP1Stdin::new(); + let stdin = SphinxStdin::new(); let core_proof = prover.prove_core(&pk, &stdin).unwrap(); tracing::info!("Compress"); @@ -54,7 +54,7 @@ pub fn main() { tracing::info!("building template witness"); let pv: &RecursionPublicValues<_> = wrapped_proof.proof.public_values.as_slice().borrow(); - let vkey_hash = babybears_to_bn254(&pv.wp1_vk_digest); + let vkey_hash = babybears_to_bn254(&pv.sphinx_vk_digest); let committed_values_digest_bytes: [BabyBear; 32] = words_to_bytes(&pv.committed_value_digest) .try_into() .unwrap(); diff --git a/prover/scripts/fibonacci_groth16.rs b/prover/scripts/fibonacci_groth16.rs index ab069973b..6d67c1181 100644 --- a/prover/scripts/fibonacci_groth16.rs +++ b/prover/scripts/fibonacci_groth16.rs @@ -5,8 +5,8 @@ use std::time::Instant; use itertools::iproduct; use tracing_subscriber::EnvFilter; use tracing_subscriber::{fmt::format::FmtSpan, util::SubscriberInitExt}; -use wp1_core::io::SP1Stdin; -use wp1_prover::SP1Prover; +use sphinx_core::io::SphinxStdin; +use sphinx_prover::SphinxProver; fn main() { // Setup tracer. @@ -34,7 +34,7 @@ fn main() { std::env::set_var("RECONSTRUCT_COMMITMENTS", "false"); // Initialize prover. - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); // Setup sweep. let iterations = [480000u32]; @@ -53,7 +53,7 @@ fn main() { std::env::set_var("SHARD_SIZE", shard_size.to_string()); tracing::info!("proving leaves"); - let stdin = SP1Stdin { + let stdin = SphinxStdin { buffer: vec![bincode::serialize::(&iterations).unwrap()], ptr: 0, proofs: vec![], diff --git a/prover/scripts/fibonacci_sweep.rs b/prover/scripts/fibonacci_sweep.rs index 449cb645b..7a2664538 100644 --- a/prover/scripts/fibonacci_sweep.rs +++ b/prover/scripts/fibonacci_sweep.rs @@ -5,8 +5,8 @@ use std::{fs::File, io::BufWriter, io::Write, time::Instant}; use itertools::iproduct; use tracing_subscriber::EnvFilter; use tracing_subscriber::{fmt::format::FmtSpan, util::SubscriberInitExt}; -use wp1_core::io::SP1Stdin; -use wp1_prover::SP1Prover; +use sphinx_core::io::SphinxStdin; +use sphinx_prover::SphinxProver; fn main() { // Setup tracer. @@ -34,7 +34,7 @@ fn main() { std::env::set_var("RECONSTRUCT_COMMITMENTS", "false"); // Initialize prover. - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); // Setup sweep. let iterations = [480000u32]; @@ -56,7 +56,7 @@ fn main() { ); std::env::set_var("SHARD_SIZE", shard_size.to_string()); - let stdin = SP1Stdin { + let stdin = SphinxStdin { buffer: vec![bincode::serialize::(&iterations).unwrap()], ptr: 0, proofs: vec![], diff --git a/prover/scripts/tendermint_sweep.rs b/prover/scripts/tendermint_sweep.rs index 5bebd551e..f8877d040 100644 --- a/prover/scripts/tendermint_sweep.rs +++ b/prover/scripts/tendermint_sweep.rs @@ -5,8 +5,8 @@ use std::{fs::File, io::BufWriter, io::Write, time::Instant}; use itertools::iproduct; use tracing_subscriber::EnvFilter; use tracing_subscriber::{fmt::format::FmtSpan, util::SubscriberInitExt}; -use wp1_core::io::SP1Stdin; -use wp1_prover::SP1Prover; +use sphinx_core::io::SphinxStdin; +use sphinx_prover::SphinxProver; fn main() { // Setup tracer. @@ -34,7 +34,7 @@ fn main() { std::env::set_var("RECONSTRUCT_COMMITMENTS", "false"); // Initialize prover. - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); // Setup sweep. let iterations = [480000u32]; @@ -56,7 +56,7 @@ fn main() { ); std::env::set_var("SHARD_SIZE", shard_size.to_string()); - let stdin = SP1Stdin { + let stdin = SphinxStdin { buffer: vec![bincode::serialize::(&iterations).unwrap()], ptr: 0, proofs: vec![], diff --git a/prover/src/build.rs b/prover/src/build.rs index 431456a87..0e08e9bd9 100644 --- a/prover/src/build.rs +++ b/prover/src/build.rs @@ -2,19 +2,19 @@ use std::borrow::Borrow; use std::path::PathBuf; use p3_baby_bear::BabyBear; -use wp1_core::stark::StarkVerifyingKey; -use wp1_core::{io::SP1Stdin, stark::ShardProof}; -pub use wp1_recursion_circuit::stark::build_wrap_circuit; -pub use wp1_recursion_circuit::witness::Witnessable; -pub use wp1_recursion_compiler::ir::Witness; -use wp1_recursion_compiler::{config::OuterConfig, constraints::Constraint}; -use wp1_recursion_core::air::RecursionPublicValues; -pub use wp1_recursion_core::stark::utils::wp1_dev_mode; -use wp1_recursion_gnark_ffi::Groth16Prover; +use sphinx_core::stark::StarkVerifyingKey; +use sphinx_core::{io::SphinxStdin, stark::ShardProof}; +pub use sphinx_recursion_circuit::stark::build_wrap_circuit; +pub use sphinx_recursion_circuit::witness::Witnessable; +pub use sphinx_recursion_compiler::ir::Witness; +use sphinx_recursion_compiler::{config::OuterConfig, constraints::Constraint}; +use sphinx_recursion_core::air::RecursionPublicValues; +pub use sphinx_recursion_core::stark::utils::sphinx_dev_mode; +use sphinx_recursion_gnark_ffi::Groth16Prover; use crate::install::{install_groth16_artifacts, GROTH16_ARTIFACTS_COMMIT}; use crate::utils::{babybear_bytes_to_bn254, babybears_to_bn254, words_to_bytes}; -use crate::{OuterSC, SP1Prover}; +use crate::{OuterSC, SphinxProver}; /// Tries to install the Groth16 artifacts if they are not already installed. pub fn try_install_groth16_artifacts() -> PathBuf { @@ -99,7 +99,7 @@ pub fn build_constraints_and_witness( .in_scope(|| build_wrap_circuit(template_vk, template_proof)); let pv: &RecursionPublicValues = template_proof.public_values.as_slice().borrow(); - let vkey_hash = babybears_to_bn254(&pv.wp1_vk_digest); + let vkey_hash = babybears_to_bn254(&pv.sphinx_vk_digest); let committed_values_digest_bytes: [BabyBear; 32] = words_to_bytes(&pv.committed_value_digest) .try_into() .unwrap(); @@ -120,13 +120,13 @@ pub fn dummy_proof() -> (StarkVerifyingKey, ShardProof) { let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); tracing::info!("initializing prover"); - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); tracing::info!("setup elf"); let (pk, vk) = prover.setup(elf); tracing::info!("prove core"); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&500u32); let core_proof = prover.prove_core(&pk, &stdin).unwrap(); diff --git a/prover/src/lib.rs b/prover/src/lib.rs index e31516727..10e23cc80 100644 --- a/prover/src/lib.rs +++ b/prover/src/lib.rs @@ -23,46 +23,47 @@ use p3_challenger::CanObserve; use p3_field::{AbstractField, PrimeField}; use rayon::iter::{IntoParallelIterator, ParallelIterator}; use rayon::prelude::*; -use tracing::instrument; -use types::{ - SP1CoreProof, SP1CoreProofData, SP1ProvingKey, SP1RecursionProverError, SP1ReduceProof, - SP1VerifyingKey, -}; -use utils::words_to_bytes; -use wp1_core::air::{PublicValues, Word}; -pub use wp1_core::io::{SP1PublicValues, SP1Stdin}; -use wp1_core::runtime::{ExecutionError, Runtime}; -use wp1_core::stark::{Challenge, StarkProvingKey}; -use wp1_core::stark::{Challenger, MachineVerificationError}; -use wp1_core::utils::DIGEST_SIZE; -use wp1_core::{ +use sphinx_core::air::{PublicValues, Word}; +pub use sphinx_core::io::{SphinxPublicValues, SphinxStdin}; +use sphinx_core::runtime::{ExecutionError, Runtime}; +use sphinx_core::stark::{Challenge, StarkProvingKey}; +use sphinx_core::stark::{Challenger, MachineVerificationError}; +use sphinx_core::utils::DIGEST_SIZE; +use sphinx_core::{ runtime::Program, stark::{ LocalProver, RiscvAir, ShardProof, StarkGenericConfig, StarkMachine, StarkVerifyingKey, Val, }, - utils::{BabyBearPoseidon2, SP1CoreProverError}, + utils::{BabyBearPoseidon2, SphinxCoreProverError}, }; -use wp1_primitives::hash_deferred_proof; -use wp1_recursion_circuit::witness::Witnessable; -use wp1_recursion_compiler::config::InnerConfig; -use wp1_recursion_compiler::ir::Witness; -use wp1_recursion_core::{ +use sphinx_primitives::hash_deferred_proof; +use sphinx_recursion_circuit::witness::Witnessable; +use sphinx_recursion_compiler::config::InnerConfig; +use sphinx_recursion_compiler::ir::Witness; +use sphinx_recursion_core::{ air::RecursionPublicValues, runtime::{RecursionProgram, Runtime as RecursionRuntime}, stark::{config::BabyBearPoseidon2Outer, RecursionAir}, }; -pub use wp1_recursion_gnark_ffi::plonk_bn254::PlonkBn254Proof; -use wp1_recursion_gnark_ffi::plonk_bn254::PlonkBn254Prover; -pub use wp1_recursion_gnark_ffi::Groth16Proof; -use wp1_recursion_gnark_ffi::Groth16Prover; -use wp1_recursion_program::hints::Hintable; -pub use wp1_recursion_program::machine::ReduceProgramType; -use wp1_recursion_program::machine::{ - SP1CompressVerifier, SP1DeferredVerifier, SP1RecursiveVerifier, SP1RootVerifier, +pub use sphinx_recursion_gnark_ffi::plonk_bn254::PlonkBn254Proof; +use sphinx_recursion_gnark_ffi::plonk_bn254::PlonkBn254Prover; +pub use sphinx_recursion_gnark_ffi::Groth16Proof; +use sphinx_recursion_gnark_ffi::Groth16Prover; +use sphinx_recursion_program::hints::Hintable; +pub use sphinx_recursion_program::machine::ReduceProgramType; +use sphinx_recursion_program::machine::{ + SphinxCompressVerifier, SphinxDeferredVerifier, SphinxRecursiveVerifier, SphinxRootVerifier, }; -pub use wp1_recursion_program::machine::{ - SP1DeferredMemoryLayout, SP1RecursionMemoryLayout, SP1ReduceMemoryLayout, SP1RootMemoryLayout, +pub use sphinx_recursion_program::machine::{ + SphinxDeferredMemoryLayout, SphinxRecursionMemoryLayout, SphinxReduceMemoryLayout, + SphinxRootMemoryLayout, +}; +use tracing::instrument; +use types::{ + SphinxCoreProof, SphinxCoreProofData, SphinxProvingKey, SphinxRecursionProverError, + SphinxReduceProof, SphinxVerifyingKey, }; +use utils::words_to_bytes; /// The configuration for the core prover. pub type CoreSC = BabyBearPoseidon2; @@ -82,7 +83,7 @@ pub type CompressAir = RecursionAir; pub type WrapAir = RecursionAir; /// A end-to-end prover implementation for the SP1 RISC-V zkVM. -pub struct SP1Prover { +pub struct SphinxProver { /// The program that can recursively verify a set of proofs into a single proof. pub recursion_program: RecursionProgram, @@ -141,23 +142,24 @@ pub struct SP1Prover { pub wrap_machine: StarkMachine::Val>>, } -impl SP1Prover { +impl SphinxProver { /// Initializes a new [SP1Prover]. #[instrument(name = "initialize prover", level = "info", skip_all)] pub fn new() -> Self { let core_machine = RiscvAir::machine(CoreSC::default()); // Get the recursive verifier and setup the proving and verifying keys. - let recursion_program = SP1RecursiveVerifier::::build(&core_machine); + let recursion_program = SphinxRecursiveVerifier::::build(&core_machine); let compress_machine = ReduceAir::machine(InnerSC::default()); let (rec_pk, rec_vk) = compress_machine.setup(&recursion_program); // Get the deferred program and keys. - let deferred_program = SP1DeferredVerifier::::build(&compress_machine); + let deferred_program = + SphinxDeferredVerifier::::build(&compress_machine); let (deferred_pk, deferred_vk) = compress_machine.setup(&deferred_program); // Make the reduce program and keys. - let compress_program = SP1CompressVerifier::::build( + let compress_program = SphinxCompressVerifier::::build( &compress_machine, &rec_vk, &deferred_vk, @@ -166,13 +168,13 @@ impl SP1Prover { // Get the compress program, machine, and keys. let shrink_program = - SP1RootVerifier::::build(&compress_machine, &compress_vk, true); + SphinxRootVerifier::::build(&compress_machine, &compress_vk, true); let shrink_machine = CompressAir::machine(InnerSC::compressed()); let (shrink_pk, shrink_vk) = shrink_machine.setup(&shrink_program); // Get the wrap program, machine, and keys. let wrap_program = - SP1RootVerifier::::build(&shrink_machine, &shrink_vk, false); + SphinxRootVerifier::::build(&shrink_machine, &shrink_vk, false); let wrap_machine = WrapAir::wrap_machine(OuterSC::default()); let (wrap_pk, wrap_vk) = wrap_machine.setup(&wrap_program); @@ -201,11 +203,11 @@ impl SP1Prover { /// Creates a proving key and a verifying key for a given RISC-V ELF. #[instrument(name = "setup", level = "info", skip_all)] - pub fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) { + pub fn setup(&self, elf: &[u8]) -> (SphinxProvingKey, SphinxVerifyingKey) { let program = Program::from(elf); let (pk, vk) = self.core_machine.setup(&program); - let vk = SP1VerifyingKey { vk }; - let pk = SP1ProvingKey { + let vk = SphinxVerifyingKey { vk }; + let pk = SphinxProvingKey { pk, elf: elf.to_vec(), vk: vk.clone(), @@ -215,7 +217,7 @@ impl SP1Prover { /// Generate a proof of an SP1 program with the specified inputs. #[instrument(name = "execute", level = "info", skip_all)] - pub fn execute(elf: &[u8], stdin: &SP1Stdin) -> Result { + pub fn execute(elf: &[u8], stdin: &SphinxStdin) -> Result { let program = Program::from(elf); let mut runtime = Runtime::new(program); runtime.write_vecs(&stdin.buffer); @@ -223,7 +225,9 @@ impl SP1Prover { runtime.write_proof(proof.clone(), vkey.clone()); } runtime.run_untraced()?; - Ok(SP1PublicValues::from(&runtime.state.public_values_stream)) + Ok(SphinxPublicValues::from( + &runtime.state.public_values_stream, + )) } /// Generate shard proofs which split up and prove the valid execution of a RISC-V program with @@ -231,15 +235,15 @@ impl SP1Prover { #[instrument(name = "prove_core", level = "info", skip_all)] pub fn prove_core( &self, - pk: &SP1ProvingKey, - stdin: &SP1Stdin, - ) -> Result { + pk: &SphinxProvingKey, + stdin: &SphinxStdin, + ) -> Result { let config = CoreSC::default(); let program = Program::from(&pk.elf); - let (proof, public_values_stream) = wp1_core::utils::prove(&program, stdin, config)?; - let public_values = SP1PublicValues::from(&public_values_stream); - Ok(SP1CoreProof { - proof: SP1CoreProofData(proof.shard_proofs), + let (proof, public_values_stream) = sphinx_core::utils::prove(&program, stdin, config)?; + let public_values = SphinxPublicValues::from(&public_values_stream); + Ok(SphinxCoreProof { + proof: SphinxCoreProofData(proof.shard_proofs), stdin: stdin.clone(), public_values, }) @@ -252,7 +256,7 @@ impl SP1Prover { shard_proofs: &[ShardProof], batch_size: usize, is_complete: bool, - ) -> Vec>> { + ) -> Vec>> { let mut core_inputs = Vec::new(); let mut reconstruct_challenger = self.core_machine.config().challenger(); vk.observe_into(&mut reconstruct_challenger); @@ -261,7 +265,7 @@ impl SP1Prover { for batch in shard_proofs.chunks(batch_size) { let proofs = batch.to_vec(); - core_inputs.push(SP1RecursionMemoryLayout { + core_inputs.push(SphinxRecursionMemoryLayout { vk, machine: &self.core_machine, shard_proofs: proofs, @@ -300,7 +304,7 @@ impl SP1Prover { last_proof_pv: &PublicValues, BabyBear>, deferred_proofs: &[ShardProof], batch_size: usize, - ) -> Vec>> { + ) -> Vec>> { // Prepare the inputs for the deferred proofs recursive verification. let mut deferred_digest = [Val::::zero(); DIGEST_SIZE]; let mut deferred_inputs = Vec::new(); @@ -308,14 +312,14 @@ impl SP1Prover { for batch in deferred_proofs.chunks(batch_size) { let proofs = batch.to_vec(); - deferred_inputs.push(SP1DeferredMemoryLayout { + deferred_inputs.push(SphinxDeferredMemoryLayout { compress_vk: &self.compress_vk, machine: &self.compress_machine, proofs, start_reconstruct_deferred_digest: deferred_digest.to_vec(), is_complete: false, - wp1_vk: vk, - wp1_machine: &self.core_machine, + sphinx_vk: vk, + sphinx_machine: &self.core_machine, end_pc: Val::::zero(), end_shard: last_proof_pv.shard, leaf_challenger: leaf_challenger.clone(), @@ -332,14 +336,14 @@ impl SP1Prover { #[allow(clippy::type_complexity)] pub fn get_first_layer_inputs<'a>( &'a self, - vk: &'a SP1VerifyingKey, + vk: &'a SphinxVerifyingKey, leaf_challenger: &'a Challenger, shard_proofs: &[ShardProof], deferred_proofs: &[ShardProof], batch_size: usize, ) -> ( - Vec>>, - Vec>>, + Vec>>, + Vec>>, ) { let is_complete = shard_proofs.len() == 1 && deferred_proofs.is_empty(); let core_inputs = self.get_recursion_core_inputs( @@ -364,10 +368,10 @@ impl SP1Prover { #[instrument(name = "compress", level = "info", skip_all)] pub fn compress( &self, - vk: &SP1VerifyingKey, - proof: SP1CoreProof, + vk: &SphinxVerifyingKey, + proof: SphinxCoreProof, deferred_proofs: Vec>, - ) -> Result, SP1RecursionProverError> { + ) -> Result, SphinxRecursionProverError> { // Set the batch size for the reduction tree. let batch_size = 2; @@ -470,7 +474,7 @@ impl SP1Prover { let (shard_proofs, kinds) = batch.iter().cloned().unzip::<_, _, Vec<_>, Vec<_>>(); - let input = SP1ReduceMemoryLayout { + let input = SphinxReduceMemoryLayout { compress_vk: &self.compress_vk, recursive_machine: &self.compress_machine, shard_proofs, @@ -497,7 +501,7 @@ impl SP1Prover { // Restore the prover parameters. env::set_var(RECONSTRUCT_COMMITMENTS_ENV_VAR, rc); - Ok(SP1ReduceProof { + Ok(SphinxReduceProof { proof: reduce_proof.0, }) } @@ -532,14 +536,14 @@ impl SP1Prover { #[instrument(name = "shrink", level = "info", skip_all)] pub fn shrink( &self, - reduced_proof: SP1ReduceProof, - ) -> Result, SP1RecursionProverError> { + reduced_proof: SphinxReduceProof, + ) -> Result, SphinxRecursionProverError> { // Setup the prover parameters. let rc = env::var(RECONSTRUCT_COMMITMENTS_ENV_VAR).unwrap_or_default(); env::set_var(RECONSTRUCT_COMMITMENTS_ENV_VAR, "false"); // Make the compress proof. - let input = SP1RootMemoryLayout { + let input = SphinxRootMemoryLayout { machine: &self.compress_machine, proof: reduced_proof.proof, is_reduce: true, @@ -570,7 +574,7 @@ impl SP1Prover { // Restore the prover parameters. env::set_var(RECONSTRUCT_COMMITMENTS_ENV_VAR, rc); - Ok(SP1ReduceProof { + Ok(SphinxReduceProof { proof: compress_proof.shard_proofs.pop().unwrap(), }) } @@ -579,13 +583,13 @@ impl SP1Prover { #[instrument(name = "wrap_bn254", level = "info", skip_all)] pub fn wrap_bn254( &self, - compressed_proof: SP1ReduceProof, - ) -> Result, SP1RecursionProverError> { + compressed_proof: SphinxReduceProof, + ) -> Result, SphinxRecursionProverError> { // Setup the prover parameters. let rc = env::var(RECONSTRUCT_COMMITMENTS_ENV_VAR).unwrap_or_default(); env::set_var(RECONSTRUCT_COMMITMENTS_ENV_VAR, "false"); - let input = SP1RootMemoryLayout { + let input = SphinxRootMemoryLayout { machine: &self.shrink_machine, proof: compressed_proof.proof, is_reduce: false, @@ -631,16 +635,20 @@ impl SP1Prover { // Restore the prover parameters. env::set_var(RECONSTRUCT_COMMITMENTS_ENV_VAR, rc); - Ok(SP1ReduceProof { + Ok(SphinxReduceProof { proof: wrap_proof.shard_proofs.pop().unwrap(), }) } /// Wrap the STARK proven over a SNARK-friendly field into a Groth16 proof. #[instrument(name = "wrap_groth16", level = "info", skip_all)] - pub fn wrap_groth16(&self, proof: SP1ReduceProof, build_dir: &Path) -> Groth16Proof { - let vkey_digest = proof.wp1_vkey_digest_bn254(); - let commited_values_digest = proof.wp1_commited_values_digest_bn254(); + pub fn wrap_groth16( + &self, + proof: SphinxReduceProof, + build_dir: &Path, + ) -> Groth16Proof { + let vkey_digest = proof.sphinx_vkey_digest_bn254(); + let commited_values_digest = proof.sphinx_commited_values_digest_bn254(); let mut witness = Witness::default(); proof.proof.write(&mut witness); @@ -679,7 +687,7 @@ impl SP1Prover { let committed_values_digest = words_to_bytes(&pv.committed_value_digest); digest = hash_deferred_proof( &digest, - &pv.wp1_vk_digest, + &pv.sphinx_vk_digest, &committed_values_digest.try_into().unwrap(), ); } @@ -687,7 +695,7 @@ impl SP1Prover { } } -impl Default for SP1Prover { +impl Default for SphinxProver { fn default() -> Self { Self::new() } @@ -705,9 +713,9 @@ mod tests { use anyhow::Result; use p3_field::PrimeField32; use serial_test::serial; + use sphinx_core::io::SphinxStdin; + use sphinx_core::utils::setup_logger; use types::HashableKey; - use wp1_core::io::SP1Stdin; - use wp1_core::utils::setup_logger; /// Tests an end-to-end workflow of proving a program across the entire proof generation /// pipeline. @@ -722,13 +730,13 @@ mod tests { let elf = include_bytes!("../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); tracing::info!("initializing prover"); - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); tracing::info!("setup elf"); let (pk, vk) = prover.setup(elf); tracing::info!("prove core"); - let stdin = SP1Stdin::new(); + let stdin = SphinxStdin::new(); let core_proof = prover.prove_core(&pk, &stdin)?; let public_values = core_proof.public_values.clone(); @@ -766,11 +774,11 @@ mod tests { prover.verify_wrap_bn254(&wrapped_bn254_proof, &vk).unwrap(); tracing::info!("checking vkey hash babybear"); - let vk_digest_babybear = wrapped_bn254_proof.wp1_vkey_digest_babybear(); + let vk_digest_babybear = wrapped_bn254_proof.sphinx_vkey_digest_babybear(); assert_eq!(vk_digest_babybear, vk.hash_babybear()); tracing::info!("checking vkey hash bn254"); - let vk_digest_bn254 = wrapped_bn254_proof.wp1_vkey_digest_bn254(); + let vk_digest_bn254 = wrapped_bn254_proof.sphinx_vkey_digest_bn254(); assert_eq!(vk_digest_bn254, vk.hash_bn254()); tracing::info!("generate groth16 proof"); @@ -798,7 +806,7 @@ mod tests { let verify_elf = include_bytes!("../../tests/verify-proof/elf/riscv32im-succinct-zkvm-elf"); tracing::info!("initializing prover"); - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); tracing::info!("setup keccak elf"); let (keccak_pk, keccak_vk) = prover.setup(keccak_elf); @@ -807,7 +815,7 @@ mod tests { let (verify_pk, verify_vk) = prover.setup(verify_elf); tracing::info!("prove subproof 1"); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&1usize); stdin.write(&vec![0u8, 0, 0]); let deferred_proof_1 = prover.prove_core(&keccak_pk, &stdin)?; @@ -815,7 +823,7 @@ mod tests { // Generate a second proof of keccak of various inputs. tracing::info!("prove subproof 2"); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&3usize); stdin.write(&vec![0u8, 1, 2]); stdin.write(&vec![2, 3, 4]); @@ -832,7 +840,7 @@ mod tests { let deferred_reduce_2 = prover.compress(&keccak_vk, deferred_proof_2, vec![])?; // Run verify program with keccak vkey, subproofs, and their committed values. - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let vkey_digest = keccak_vk.hash_babybear(); let vkey_digest: [u32; 8] = vkey_digest .iter() @@ -876,7 +884,7 @@ mod tests { fn test_inner( program_elf: &[u8], deferred_proofs_num: usize, - program_inputs: Vec<&SP1Stdin>, + program_inputs: Vec<&SphinxStdin>, ) { assert_eq!(deferred_proofs_num, program_inputs.len()); @@ -890,7 +898,7 @@ mod tests { include_bytes!("../../tests/verify-proof/elf/riscv32im-succinct-zkvm-elf"); tracing::info!("initializing prover"); - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); tracing::info!("setup elf"); let (program_pk, program_vk) = prover.setup(program_elf); @@ -914,7 +922,7 @@ mod tests { }); // Aggregate deferred proofs - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); let vkey_digest = program_vk.hash_babybear(); let vkey_digest: [u32; 8] = vkey_digest .iter() @@ -954,12 +962,20 @@ mod tests { test_inner( bls12381_g2_add_elf, 3, - vec![&SP1Stdin::new(), &SP1Stdin::new(), &SP1Stdin::new()], + vec![ + &SphinxStdin::new(), + &SphinxStdin::new(), + &SphinxStdin::new(), + ], ); test_inner( bls12381_g2_double_elf, 3, - vec![&SP1Stdin::new(), &SP1Stdin::new(), &SP1Stdin::new()], + vec![ + &SphinxStdin::new(), + &SphinxStdin::new(), + &SphinxStdin::new(), + ], ); } } diff --git a/prover/src/types.rs b/prover/src/types.rs index 2f73590fb..03c0df972 100644 --- a/prover/src/types.rs +++ b/prover/src/types.rs @@ -8,15 +8,15 @@ use p3_commit::{Pcs, TwoAdicMultiplicativeCoset}; use p3_field::PrimeField; use p3_field::{AbstractField, PrimeField32, TwoAdicField}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use thiserror::Error; -use wp1_core::{ - io::{SP1PublicValues, SP1Stdin}, +use sphinx_core::{ + io::{SphinxPublicValues, SphinxStdin}, stark::{ShardProof, StarkGenericConfig, StarkProvingKey, StarkVerifyingKey}, utils::DIGEST_SIZE, }; -use wp1_primitives::poseidon2_hash; -use wp1_recursion_core::{air::RecursionPublicValues, stark::config::BabyBearPoseidon2Outer}; -use wp1_recursion_gnark_ffi::{plonk_bn254::PlonkBn254Proof, Groth16Proof}; +use sphinx_primitives::poseidon2_hash; +use sphinx_recursion_core::{air::RecursionPublicValues, stark::config::BabyBearPoseidon2Outer}; +use sphinx_recursion_gnark_ffi::{plonk_bn254::PlonkBn254Proof, Groth16Proof}; +use thiserror::Error; use crate::utils::words_to_bytes_be; use crate::{utils::babybear_bytes_to_bn254, words_to_bytes}; @@ -24,16 +24,16 @@ use crate::{utils::babybears_to_bn254, CoreSC, InnerSC}; /// The information necessary to generate a proof for a given RISC-V program. #[derive(Clone, Serialize, Deserialize)] -pub struct SP1ProvingKey { +pub struct SphinxProvingKey { pub pk: StarkProvingKey, pub elf: Vec, /// Verifying key is also included as we need it for recursion - pub vk: SP1VerifyingKey, + pub vk: SphinxVerifyingKey, } /// The information necessary to verify a proof for a given RISC-V program. #[derive(Clone, Serialize, Deserialize)] -pub struct SP1VerifyingKey { +pub struct SphinxVerifyingKey { pub vk: StarkVerifyingKey, } @@ -63,7 +63,7 @@ pub trait HashableKey { } } -impl HashableKey for SP1VerifyingKey { +impl HashableKey for SphinxVerifyingKey { fn hash_babybear(&self) -> [BabyBear; DIGEST_SIZE] { self.vk.hash_babybear() } @@ -110,13 +110,13 @@ where #[derive(Serialize, Deserialize, Clone)] #[serde(bound(serialize = "P: Serialize"))] #[serde(bound(deserialize = "P: DeserializeOwned"))] -pub struct SP1ProofWithMetadata { +pub struct SphinxProofWithMetadata { pub proof: P, - pub stdin: SP1Stdin, - pub public_values: SP1PublicValues, + pub stdin: SphinxStdin, + pub public_values: SphinxPublicValues, } -impl SP1ProofWithMetadata

{ +impl SphinxProofWithMetadata

{ pub fn save(&self, path: impl AsRef) -> Result<()> { bincode::serialize_into(File::create(path).expect("failed to open file"), self) .map_err(Into::into) @@ -128,7 +128,7 @@ impl SP1ProofWithMetadata

{ } } -impl std::fmt::Debug for SP1ProofWithMetadata

{ +impl std::fmt::Debug for SphinxProofWithMetadata

{ fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { f.debug_struct("SP1ProofWithMetadata") .field("proof", &self.proof) @@ -137,49 +137,49 @@ impl std::fmt::Debug for SP1ProofWithMetadata

{ } /// A proof of an SP1 program without any wrapping. -pub type SP1CoreProof = SP1ProofWithMetadata; +pub type SphinxCoreProof = SphinxProofWithMetadata; /// An SP1 proof that has been recursively reduced into a single proof. This proof can be verified /// within SP1 programs. -pub type SP1ReducedProof = SP1ProofWithMetadata; +pub type SphinxReducedProof = SphinxProofWithMetadata; /// An SP1 proof that has been wrapped into a single Groth16 proof and can be verified onchain. -pub type SP1Groth16Proof = SP1ProofWithMetadata; +pub type SphinxGroth16Proof = SphinxProofWithMetadata; /// An SP1 proof that has been wrapped into a single Plonk proof and can be verified onchain. -pub type SP1PlonkProof = SP1ProofWithMetadata; +pub type SphinxPlonkProof = SphinxProofWithMetadata; #[derive(Serialize, Deserialize, Clone)] -pub struct SP1CoreProofData(pub Vec>); +pub struct SphinxCoreProofData(pub Vec>); #[derive(Serialize, Deserialize, Clone)] -pub struct SP1ReducedProofData(pub ShardProof); +pub struct SphinxReducedProofData(pub ShardProof); #[derive(Serialize, Deserialize, Clone)] -pub struct SP1Groth16ProofData(pub Groth16Proof); +pub struct SphinxGroth16ProofData(pub Groth16Proof); #[derive(Serialize, Deserialize, Clone)] -pub struct SP1PlonkProofData(pub PlonkBn254Proof); +pub struct SphinxPlonkProofData(pub PlonkBn254Proof); /// An intermediate proof which proves the execution over a range of shards. #[derive(Serialize, Deserialize, Clone)] #[serde(bound(serialize = "ShardProof: Serialize"))] #[serde(bound(deserialize = "ShardProof: Deserialize<'de>"))] -pub struct SP1ReduceProof { +pub struct SphinxReduceProof { pub proof: ShardProof, } -impl SP1ReduceProof { - pub fn wp1_vkey_digest_babybear(&self) -> [BabyBear; 8] { +impl SphinxReduceProof { + pub fn sphinx_vkey_digest_babybear(&self) -> [BabyBear; 8] { let proof = &self.proof; let pv: &RecursionPublicValues = proof.public_values.as_slice().borrow(); - pv.wp1_vk_digest + pv.sphinx_vk_digest } - pub fn wp1_vkey_digest_bn254(&self) -> Bn254Fr { - babybears_to_bn254(&self.wp1_vkey_digest_babybear()) + pub fn sphinx_vkey_digest_bn254(&self) -> Bn254Fr { + babybears_to_bn254(&self.sphinx_vkey_digest_babybear()) } - pub fn wp1_commited_values_digest_bn254(&self) -> Bn254Fr { + pub fn sphinx_commited_values_digest_bn254(&self) -> Bn254Fr { let proof = &self.proof; let pv: &RecursionPublicValues = proof.public_values.as_slice().borrow(); let committed_values_digest_bytes: [BabyBear; 32] = @@ -192,10 +192,10 @@ impl SP1ReduceProof { /// A proof that can be reduced along with other proofs into one proof. #[derive(Serialize, Deserialize, Clone)] -pub enum SP1ReduceProofWrapper { - Core(SP1ReduceProof), - Recursive(SP1ReduceProof), +pub enum SphinxReduceProofWrapper { + Core(SphinxReduceProof), + Recursive(SphinxReduceProof), } #[derive(Error, Debug)] -pub enum SP1RecursionProverError {} +pub enum SphinxRecursionProverError {} diff --git a/prover/src/utils.rs b/prover/src/utils.rs index 80d330d47..4b0f58ee5 100644 --- a/prover/src/utils.rs +++ b/prover/src/utils.rs @@ -8,18 +8,18 @@ use p3_baby_bear::BabyBear; use p3_bn254_fr::Bn254Fr; use p3_field::AbstractField; use p3_field::PrimeField32; -use tokio::{runtime, task::block_in_place}; -use wp1_core::{ +use sphinx_core::{ air::Word, - io::SP1Stdin, + io::SphinxStdin, runtime::{Program, Runtime}, }; +use tokio::{runtime, task::block_in_place}; -use crate::SP1CoreProofData; +use crate::SphinxCoreProofData; pub const RECONSTRUCT_COMMITMENTS_ENV_VAR: &str = "RECONSTRUCT_COMMITMENTS"; -impl SP1CoreProofData { +impl SphinxCoreProofData { pub fn save(&self, path: &str) -> Result<(), std::io::Error> { let data = serde_json::to_string(self).unwrap(); fs::write(path, data).unwrap(); @@ -28,7 +28,7 @@ impl SP1CoreProofData { } /// Get the number of cycles for a given program. -pub fn get_cycles(elf: &[u8], stdin: &SP1Stdin) -> u64 { +pub fn get_cycles(elf: &[u8], stdin: &SphinxStdin) -> u64 { let program = Program::from(elf); let mut runtime = Runtime::new(program); runtime.write_vecs(&stdin.buffer); diff --git a/prover/src/verify.rs b/prover/src/verify.rs index 6ebafe6c2..1ca174b49 100644 --- a/prover/src/verify.rs +++ b/prover/src/verify.rs @@ -4,19 +4,19 @@ use anyhow::Result; use num_bigint::BigUint; use p3_baby_bear::BabyBear; use p3_field::{AbstractField, PrimeField}; -use thiserror::Error; -use wp1_core::{ +use sphinx_core::{ air::PublicValues, - io::SP1PublicValues, + io::SphinxPublicValues, stark::{MachineProof, MachineVerificationError, StarkGenericConfig}, utils::BabyBearPoseidon2, }; -use wp1_recursion_core::{air::RecursionPublicValues, stark::config::BabyBearPoseidon2Outer}; -use wp1_recursion_gnark_ffi::{Groth16Proof, Groth16Prover}; +use sphinx_recursion_core::{air::RecursionPublicValues, stark::config::BabyBearPoseidon2Outer}; +use sphinx_recursion_gnark_ffi::{Groth16Proof, Groth16Prover}; +use thiserror::Error; use crate::{ - types::HashableKey, CoreSC, OuterSC, SP1CoreProofData, SP1Prover, SP1ReduceProof, - SP1VerifyingKey, + types::HashableKey, CoreSC, OuterSC, SphinxCoreProofData, SphinxProver, SphinxReduceProof, + SphinxVerifyingKey, }; #[derive(Error, Debug)] @@ -27,13 +27,13 @@ pub enum Groth16VerificationError { InvalidPublicValues, } -impl SP1Prover { +impl SphinxProver { /// Verify a core proof by verifying the shards, verifying lookup bus, verifying that the /// shards are contiguous and complete. pub fn verify( &self, - proof: &SP1CoreProofData, - vk: &SP1VerifyingKey, + proof: &SphinxCoreProofData, + vk: &SphinxVerifyingKey, ) -> Result<(), MachineVerificationError> { let mut challenger = self.core_machine.config().challenger(); let machine_proof = MachineProof { @@ -102,8 +102,8 @@ impl SP1Prover { /// Verify a compressed proof. pub fn verify_compressed( &self, - proof: &SP1ReduceProof, - vk: &SP1VerifyingKey, + proof: &SphinxReduceProof, + vk: &SphinxVerifyingKey, ) -> Result<(), MachineVerificationError> { let mut challenger = self.compress_machine.config().challenger(); let machine_proof = MachineProof { @@ -125,7 +125,7 @@ impl SP1Prover { // Verify that the proof is for the sp1 vkey we are expecting. let vkey_hash = vk.hash_babybear(); - if public_values.wp1_vk_digest != vkey_hash { + if public_values.sphinx_vk_digest != vkey_hash { return Err(MachineVerificationError::InvalidPublicValues( "sp1 vk hash mismatch", )); @@ -145,8 +145,8 @@ impl SP1Prover { /// Verify a shrink proof. pub fn verify_shrink( &self, - proof: &SP1ReduceProof, - vk: &SP1VerifyingKey, + proof: &SphinxReduceProof, + vk: &SphinxVerifyingKey, ) -> Result<(), MachineVerificationError> { let mut challenger = self.shrink_machine.config().challenger(); let machine_proof = MachineProof { @@ -168,7 +168,7 @@ impl SP1Prover { // Verify that the proof is for the sp1 vkey we are expecting. let vkey_hash = vk.hash_babybear(); - if public_values.wp1_vk_digest != vkey_hash { + if public_values.sphinx_vk_digest != vkey_hash { return Err(MachineVerificationError::InvalidPublicValues( "sp1 vk hash mismatch", )); @@ -180,8 +180,8 @@ impl SP1Prover { /// Verify a wrap bn254 proof. pub fn verify_wrap_bn254( &self, - proof: &SP1ReduceProof, - vk: &SP1VerifyingKey, + proof: &SphinxReduceProof, + vk: &SphinxVerifyingKey, ) -> Result<(), MachineVerificationError> { let mut challenger = self.wrap_machine.config().challenger(); let machine_proof = MachineProof { @@ -203,7 +203,7 @@ impl SP1Prover { // Verify that the proof is for the sp1 vkey we are expecting. let vkey_hash = vk.hash_babybear(); - if public_values.wp1_vk_digest != vkey_hash { + if public_values.sphinx_vk_digest != vkey_hash { return Err(MachineVerificationError::InvalidPublicValues( "sp1 vk hash mismatch", )); @@ -216,8 +216,8 @@ impl SP1Prover { pub fn verify_groth16( &self, proof: &Groth16Proof, - vk: &SP1VerifyingKey, - public_values: &SP1PublicValues, + vk: &SphinxVerifyingKey, + public_values: &SphinxPublicValues, build_dir: &Path, ) -> Result<()> { let prover = Groth16Prover::new(); @@ -236,8 +236,8 @@ impl SP1Prover { /// Verify the vk_hash and public_values_hash in the public inputs of the Groth16Proof match the expected values. pub fn verify_groth16_public_inputs( - vk: &SP1VerifyingKey, - public_values: &SP1PublicValues, + vk: &SphinxVerifyingKey, + public_values: &SphinxPublicValues, groth16_public_inputs: &[String], ) -> Result<()> { let expected_vk_hash = BigUint::from_str(&groth16_public_inputs[0])?; diff --git a/recursion/circuit/Cargo.toml b/recursion/circuit/Cargo.toml index 58de54f5f..72cdc5d9b 100644 --- a/recursion/circuit/Cargo.toml +++ b/recursion/circuit/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-recursion-circuit" +name = "sphinx-recursion-circuit" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -14,13 +14,13 @@ p3-commit = { workspace = true } p3-fri = { workspace = true } p3-matrix = { workspace = true } p3-util = { workspace = true } -wp1-recursion-core = { path = "../core" } -wp1-core = { path = "../../core" } +sphinx-recursion-core = { path = "../core" } +sphinx-core = { path = "../../core" } itertools = { workspace = true } serde = { workspace = true, features = ["derive"] } -wp1-recursion-derive = { path = "../derive" } -wp1-recursion-compiler = { path = "../compiler" } -wp1-recursion-program = { path = "../program" } +sphinx-recursion-derive = { path = "../derive" } +sphinx-recursion-compiler = { path = "../compiler" } +sphinx-recursion-program = { path = "../program" } p3-bn254-fr = { workspace = true } p3-baby-bear = { workspace = true } bincode = { workspace = true } @@ -34,4 +34,4 @@ p3-merkle-tree = { workspace = true } p3-poseidon2 = { workspace = true } zkhash = { workspace = true } rand = { workspace = true } -wp1-recursion-gnark-ffi = { path = "../gnark-ffi" } +sphinx-recursion-gnark-ffi = { path = "../gnark-ffi" } diff --git a/recursion/circuit/src/challenger.rs b/recursion/circuit/src/challenger.rs index fe964666d..e2685d252 100644 --- a/recursion/circuit/src/challenger.rs +++ b/recursion/circuit/src/challenger.rs @@ -1,5 +1,5 @@ use p3_field::{AbstractField, Field}; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Ext, Felt, Var}; +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Ext, Felt, Var}; use crate::{poseidon2::Poseidon2CircuitBuilder, DIGEST_SIZE, SPONGE_SIZE}; @@ -151,12 +151,12 @@ mod tests { AbstractField, }; use p3_symmetric::Hash; - use wp1_recursion_compiler::config::OuterConfig; - use wp1_recursion_compiler::constraints::ConstraintCompiler; - use wp1_recursion_compiler::ir::SymbolicExt; - use wp1_recursion_compiler::ir::{Builder, Witness}; - use wp1_recursion_core::stark::config::{outer_perm, OuterChallenger}; - use wp1_recursion_gnark_ffi::Groth16Prover; + use sphinx_recursion_compiler::config::OuterConfig; + use sphinx_recursion_compiler::constraints::ConstraintCompiler; + use sphinx_recursion_compiler::ir::SymbolicExt; + use sphinx_recursion_compiler::ir::{Builder, Witness}; + use sphinx_recursion_core::stark::config::{outer_perm, OuterChallenger}; + use sphinx_recursion_gnark_ffi::Groth16Prover; use super::{reduce_32, split_32}; use crate::{challenger::MultiField32ChallengerVariable, DIGEST_SIZE}; diff --git a/recursion/circuit/src/constraints.rs b/recursion/circuit/src/constraints.rs index 38c16ac72..dda7c55a9 100644 --- a/recursion/circuit/src/constraints.rs +++ b/recursion/circuit/src/constraints.rs @@ -3,18 +3,18 @@ use p3_commit::LagrangeSelectors; use p3_field::AbstractExtensionField; use p3_field::AbstractField; use p3_field::TwoAdicField; -use wp1_core::air::MachineAir; -use wp1_core::stark::AirOpenedValues; -use wp1_core::stark::PROOF_MAX_NUM_PVS; -use wp1_core::stark::{MachineChip, StarkGenericConfig}; -use wp1_recursion_compiler::ir::Array; -use wp1_recursion_compiler::ir::ExtensionOperand; -use wp1_recursion_compiler::ir::Felt; -use wp1_recursion_compiler::ir::{Builder, Config, Ext}; -use wp1_recursion_compiler::prelude::SymbolicExt; -use wp1_recursion_program::commit::PolynomialSpaceVariable; - -use wp1_recursion_program::stark::RecursiveVerifierConstraintFolder; +use sphinx_core::air::MachineAir; +use sphinx_core::stark::AirOpenedValues; +use sphinx_core::stark::PROOF_MAX_NUM_PVS; +use sphinx_core::stark::{MachineChip, StarkGenericConfig}; +use sphinx_recursion_compiler::ir::Array; +use sphinx_recursion_compiler::ir::ExtensionOperand; +use sphinx_recursion_compiler::ir::Felt; +use sphinx_recursion_compiler::ir::{Builder, Config, Ext}; +use sphinx_recursion_compiler::prelude::SymbolicExt; +use sphinx_recursion_program::commit::PolynomialSpaceVariable; + +use sphinx_recursion_program::stark::RecursiveVerifierConstraintFolder; use crate::{ domain::TwoAdicMultiplicativeCosetVariable, @@ -169,21 +169,21 @@ mod tests { use p3_challenger::{CanObserve, FieldChallenger}; use p3_commit::{Pcs, PolynomialSpace}; use serde::{de::DeserializeOwned, Serialize}; - use wp1_core::stark::{ + use sphinx_core::stark::{ Chip, Com, Dom, LocalProver, OpeningProof, PcsProverData, ShardCommitment, ShardMainData, ShardProof, StarkGenericConfig, StarkMachine, }; - use wp1_recursion_compiler::{ + use sphinx_recursion_compiler::{ config::OuterConfig, constraints::ConstraintCompiler, ir::{Builder, Witness}, prelude::ExtConst, }; - use wp1_recursion_core::{ + use sphinx_recursion_core::{ runtime::Runtime, stark::{config::BabyBearPoseidon2Outer, RecursionAirWideDeg3}, }; - use wp1_recursion_gnark_ffi::Groth16Prover; + use sphinx_recursion_gnark_ffi::Groth16Prover; use crate::stark::{tests::basic_program, StarkVerifierCircuit}; @@ -287,7 +287,7 @@ mod tests { type EF = ::Challenge; type A = RecursionAirWideDeg3; - wp1_core::utils::setup_logger(); + sphinx_core::utils::setup_logger(); let program = basic_program::(); let config = SC::new(); let mut runtime = Runtime::::new_no_perm(&program); diff --git a/recursion/circuit/src/domain.rs b/recursion/circuit/src/domain.rs index 401184932..47caad1a1 100644 --- a/recursion/circuit/src/domain.rs +++ b/recursion/circuit/src/domain.rs @@ -1,7 +1,7 @@ use p3_commit::{LagrangeSelectors, TwoAdicMultiplicativeCoset}; use p3_field::{AbstractExtensionField, AbstractField, Field, TwoAdicField}; -use wp1_recursion_compiler::prelude::*; -use wp1_recursion_program::{commit::PolynomialSpaceVariable, fri::types::FriConfigVariable}; +use sphinx_recursion_compiler::prelude::*; +use sphinx_recursion_program::{commit::PolynomialSpaceVariable, fri::types::FriConfigVariable}; #[derive(Clone, Copy)] pub struct TwoAdicMultiplicativeCosetVariable { diff --git a/recursion/circuit/src/fri.rs b/recursion/circuit/src/fri.rs index cae9094ac..4ec799143 100644 --- a/recursion/circuit/src/fri.rs +++ b/recursion/circuit/src/fri.rs @@ -4,11 +4,11 @@ use p3_field::{AbstractField, TwoAdicField}; use p3_fri::FriConfig; use p3_matrix::Dimensions; use p3_util::log2_strict_usize; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::{ ir::{Builder, Config, Felt}, prelude::*, }; -use wp1_recursion_core::stark::config::OuterChallengeMmcs; +use sphinx_recursion_core::stark::config::OuterChallengeMmcs; use crate::{ challenger::MultiField32ChallengerVariable, @@ -244,16 +244,16 @@ pub mod tests { use p3_fri::{verifier, TwoAdicFriPcsProof}; use p3_matrix::dense::RowMajorMatrix; use rand::rngs::OsRng; - use wp1_recursion_compiler::{ + use sphinx_recursion_compiler::{ config::OuterConfig, constraints::ConstraintCompiler, ir::{Builder, Ext, Felt, SymbolicExt, Var, Witness}, }; - use wp1_recursion_core::stark::config::{ + use sphinx_recursion_core::stark::config::{ outer_perm, test_fri_config, OuterChallenge, OuterChallengeMmcs, OuterChallenger, OuterCompress, OuterDft, OuterFriProof, OuterHash, OuterPcs, OuterVal, OuterValMmcs, }; - use wp1_recursion_gnark_ffi::Groth16Prover; + use sphinx_recursion_gnark_ffi::Groth16Prover; use super::{verify_shape_and_sample_challenges, verify_two_adic_pcs, TwoAdicPcsRoundVariable}; use crate::{ diff --git a/recursion/circuit/src/lib.rs b/recursion/circuit/src/lib.rs index 05648c37e..c1a973ea3 100644 --- a/recursion/circuit/src/lib.rs +++ b/recursion/circuit/src/lib.rs @@ -24,13 +24,13 @@ mod tests { use p3_baby_bear::BabyBear; use p3_bn254_fr::Bn254Fr; use p3_field::AbstractField; - use wp1_recursion_compiler::config::OuterConfig; - use wp1_recursion_compiler::constraints::ConstraintCompiler; - use wp1_recursion_compiler::ir::Config; - use wp1_recursion_compiler::ir::Ext; - use wp1_recursion_compiler::ir::ExtConst; - use wp1_recursion_compiler::ir::{Builder, Felt, Witness}; - use wp1_recursion_gnark_ffi::Groth16Prover; + use sphinx_recursion_compiler::config::OuterConfig; + use sphinx_recursion_compiler::constraints::ConstraintCompiler; + use sphinx_recursion_compiler::ir::Config; + use sphinx_recursion_compiler::ir::Ext; + use sphinx_recursion_compiler::ir::ExtConst; + use sphinx_recursion_compiler::ir::{Builder, Felt, Witness}; + use sphinx_recursion_gnark_ffi::Groth16Prover; #[test] fn test_base_babybear() { diff --git a/recursion/circuit/src/mmcs.rs b/recursion/circuit/src/mmcs.rs index 6de1d0ffc..268920daf 100644 --- a/recursion/circuit/src/mmcs.rs +++ b/recursion/circuit/src/mmcs.rs @@ -2,7 +2,7 @@ use std::cmp::Reverse; use itertools::Itertools; use p3_matrix::Dimensions; -use wp1_recursion_compiler::ir::{Builder, Config, Felt, Var}; +use sphinx_recursion_compiler::ir::{Builder, Config, Felt, Var}; use crate::{poseidon2::Poseidon2CircuitBuilder, types::OuterDigestVariable}; diff --git a/recursion/circuit/src/poseidon2.rs b/recursion/circuit/src/poseidon2.rs index 8816a9827..4f078c5cb 100644 --- a/recursion/circuit/src/poseidon2.rs +++ b/recursion/circuit/src/poseidon2.rs @@ -2,7 +2,7 @@ use itertools::Itertools; use p3_field::{AbstractField, Field}; -use wp1_recursion_compiler::ir::{Builder, Config, DslIr, Felt, Var}; +use sphinx_recursion_compiler::ir::{Builder, Config, DslIr, Felt, Var}; use crate::{challenger::reduce_32, types::OuterDigestVariable, DIGEST_SIZE, RATE, SPONGE_SIZE}; @@ -52,11 +52,11 @@ pub mod tests { use p3_bn254_fr::Bn254Fr; use p3_field::AbstractField; use p3_symmetric::{CryptographicHasher, Permutation, PseudoCompressionFunction}; - use wp1_recursion_compiler::config::OuterConfig; - use wp1_recursion_compiler::constraints::ConstraintCompiler; - use wp1_recursion_compiler::ir::{Builder, Felt, Var, Witness}; - use wp1_recursion_core::stark::config::{outer_perm, OuterCompress, OuterHash}; - use wp1_recursion_gnark_ffi::Groth16Prover; + use sphinx_recursion_compiler::config::OuterConfig; + use sphinx_recursion_compiler::constraints::ConstraintCompiler; + use sphinx_recursion_compiler::ir::{Builder, Felt, Var, Witness}; + use sphinx_recursion_core::stark::config::{outer_perm, OuterCompress, OuterHash}; + use sphinx_recursion_gnark_ffi::Groth16Prover; use crate::{poseidon2::Poseidon2CircuitBuilder, types::OuterDigestVariable}; diff --git a/recursion/circuit/src/stark.rs b/recursion/circuit/src/stark.rs index e6452cdc6..b8467b8ce 100644 --- a/recursion/circuit/src/stark.rs +++ b/recursion/circuit/src/stark.rs @@ -10,22 +10,22 @@ use p3_baby_bear::BabyBear; use p3_bn254_fr::Bn254Fr; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::{AbstractField, TwoAdicField}; -use wp1_core::stark::{Com, ShardProof, PROOF_MAX_NUM_PVS}; -use wp1_core::{ +use sphinx_core::stark::{Com, ShardProof, PROOF_MAX_NUM_PVS}; +use sphinx_core::{ air::MachineAir, stark::{ShardCommitment, StarkGenericConfig, StarkMachine, StarkVerifyingKey}, }; -use wp1_recursion_compiler::config::OuterConfig; -use wp1_recursion_compiler::constraints::{Constraint, ConstraintCompiler}; -use wp1_recursion_compiler::ir::{Builder, Config, Felt, Var}; -use wp1_recursion_compiler::ir::{Usize, Witness}; -use wp1_recursion_compiler::prelude::SymbolicVar; -use wp1_recursion_core::air::RecursionPublicValues; -use wp1_recursion_core::stark::config::{outer_fri_config, BabyBearPoseidon2Outer}; -use wp1_recursion_core::stark::RecursionAirSkinnyDeg7; -use wp1_recursion_program::commit::PolynomialSpaceVariable; -use wp1_recursion_program::stark::RecursiveVerifierConstraintFolder; -use wp1_recursion_program::types::QuotientDataValues; +use sphinx_recursion_compiler::config::OuterConfig; +use sphinx_recursion_compiler::constraints::{Constraint, ConstraintCompiler}; +use sphinx_recursion_compiler::ir::{Builder, Config, Felt, Var}; +use sphinx_recursion_compiler::ir::{Usize, Witness}; +use sphinx_recursion_compiler::prelude::SymbolicVar; +use sphinx_recursion_core::air::RecursionPublicValues; +use sphinx_recursion_core::stark::config::{outer_fri_config, BabyBearPoseidon2Outer}; +use sphinx_recursion_core::stark::RecursionAirSkinnyDeg7; +use sphinx_recursion_program::commit::PolynomialSpaceVariable; +use sphinx_recursion_program::stark::RecursiveVerifierConstraintFolder; +use sphinx_recursion_program::types::QuotientDataValues; use crate::domain::{new_coset, TwoAdicMultiplicativeCosetVariable}; use crate::types::TwoAdicPcsMatsVariable; @@ -277,7 +277,7 @@ pub fn build_wrap_circuit( builder.assert_felt_eq(pv.is_complete, one_felt); // Convert pv.sp1_vk_digest into Bn254 - let pv_vkey_hash = babybears_to_bn254(&mut builder, &pv.wp1_vk_digest); + let pv_vkey_hash = babybears_to_bn254(&mut builder, &pv.sphinx_vk_digest); // Vkey hash must match the witnessed commited_values_digest that we are committing to. builder.assert_var_eq(pv_vkey_hash, vkey_hash); @@ -356,7 +356,7 @@ pub fn build_wrap_circuit( pub(crate) mod tests { use p3_field::PrimeField32; - use wp1_recursion_core::{ + use sphinx_recursion_core::{ cpu::Instruction, runtime::{Opcode, RecursionProgram}, }; diff --git a/recursion/circuit/src/types.rs b/recursion/circuit/src/types.rs index b34b0263e..012a4bb05 100644 --- a/recursion/circuit/src/types.rs +++ b/recursion/circuit/src/types.rs @@ -1,11 +1,13 @@ use p3_air::BaseAir; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::AbstractExtensionField; -use wp1_core::{ +use sphinx_core::{ air::MachineAir, stark::{AirOpenedValues, Chip, ChipOpenedValues, ShardCommitment}, }; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Ext, ExtConst, Felt, FromConstant, Var}; +use sphinx_recursion_compiler::ir::{ + Array, Builder, Config, Ext, ExtConst, Felt, FromConstant, Var, +}; use crate::DIGEST_SIZE; diff --git a/recursion/circuit/src/utils.rs b/recursion/circuit/src/utils.rs index 35c1754f4..bd3c89db9 100644 --- a/recursion/circuit/src/utils.rs +++ b/recursion/circuit/src/utils.rs @@ -1,7 +1,7 @@ use p3_field::AbstractField; -use wp1_core::air::Word; -use wp1_recursion_compiler::ir::{Builder, Config, Felt, Var}; -use wp1_recursion_core::runtime::DIGEST_SIZE; +use sphinx_core::air::Word; +use sphinx_recursion_compiler::ir::{Builder, Config, Felt, Var}; +use sphinx_recursion_core::runtime::DIGEST_SIZE; // TODO: this can be done much more efficiently, but in the meantime this should work pub fn felt2var(builder: &mut Builder, felt: Felt) -> Var { diff --git a/recursion/circuit/src/witness.rs b/recursion/circuit/src/witness.rs index f87abb887..aadc52d32 100644 --- a/recursion/circuit/src/witness.rs +++ b/recursion/circuit/src/witness.rs @@ -1,12 +1,12 @@ use p3_bn254_fr::Bn254Fr; -use wp1_core::stark::{ +use sphinx_core::stark::{ AirOpenedValues, ChipOpenedValues, ShardCommitment, ShardOpenedValues, ShardProof, }; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::{ config::OuterConfig, ir::{Builder, Config, Ext, Felt, Var, Witness}, }; -use wp1_recursion_core::stark::config::{ +use sphinx_recursion_core::stark::config::{ BabyBearPoseidon2Outer, OuterBatchOpening, OuterChallenge, OuterCommitPhaseStep, OuterDigest, OuterFriProof, OuterPcsProof, OuterQueryProof, OuterVal, }; @@ -330,13 +330,13 @@ mod tests { use p3_baby_bear::BabyBear; use p3_bn254_fr::Bn254Fr; use p3_field::AbstractField; - use wp1_recursion_compiler::{ + use sphinx_recursion_compiler::{ config::OuterConfig, constraints::ConstraintCompiler, ir::{Builder, ExtConst, Witness}, }; - use wp1_recursion_core::stark::config::OuterChallenge; - use wp1_recursion_gnark_ffi::Groth16Prover; + use sphinx_recursion_core::stark::config::OuterChallenge; + use sphinx_recursion_gnark_ffi::Groth16Prover; #[test] fn test_witness_simple() { diff --git a/recursion/compiler/Cargo.toml b/recursion/compiler/Cargo.toml index a9d845610..33e57c6f3 100644 --- a/recursion/compiler/Cargo.toml +++ b/recursion/compiler/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-recursion-compiler" +name = "sphinx-recursion-compiler" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -15,11 +15,11 @@ p3-fri = { workspace = true } p3-matrix = { workspace = true } p3-symmetric = { workspace = true } p3-util = { workspace = true } -wp1-recursion-core = { path = "../core" } -wp1-core = { path = "../../core" } +sphinx-recursion-core = { path = "../core" } +sphinx-core = { path = "../../core" } itertools = { workspace = true } serde = { workspace = true, features = ["derive"] } -wp1-recursion-derive = { path = "../derive" } +sphinx-recursion-derive = { path = "../derive" } p3-bn254-fr = { workspace = true } p3-baby-bear = { workspace = true } p3-poseidon2 = { workspace = true } diff --git a/recursion/compiler/examples/fibonacci.rs b/recursion/compiler/examples/fibonacci.rs index a4fa9d4bc..e2514d0b5 100644 --- a/recursion/compiler/examples/fibonacci.rs +++ b/recursion/compiler/examples/fibonacci.rs @@ -1,10 +1,10 @@ use p3_field::AbstractField; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::{ +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::{ asm::AsmBuilder, ir::{Felt, Var}, }; -use wp1_recursion_core::runtime::Runtime; +use sphinx_recursion_core::runtime::Runtime; fn fibonacci(n: u32) -> u32 { if n == 0 { diff --git a/recursion/compiler/src/asm/builder.rs b/recursion/compiler/src/asm/builder.rs index f3ef866ad..7621fc8b2 100644 --- a/recursion/compiler/src/asm/builder.rs +++ b/recursion/compiler/src/asm/builder.rs @@ -1,5 +1,5 @@ use p3_field::{ExtensionField, PrimeField32, TwoAdicField}; -use wp1_recursion_core::runtime::RecursionProgram; +use sphinx_recursion_core::runtime::RecursionProgram; use super::{config::AsmConfig, AsmCompiler, AssemblyCode}; use crate::prelude::Builder; diff --git a/recursion/compiler/src/asm/code.rs b/recursion/compiler/src/asm/code.rs index 3e691e5aa..6deb2fda5 100644 --- a/recursion/compiler/src/asm/code.rs +++ b/recursion/compiler/src/asm/code.rs @@ -3,7 +3,7 @@ use core::{fmt, fmt::Display}; use backtrace::Backtrace; use p3_field::{ExtensionField, PrimeField32}; -use wp1_recursion_core::runtime::RecursionProgram; +use sphinx_recursion_core::runtime::RecursionProgram; use super::AsmInstruction; diff --git a/recursion/compiler/src/asm/compiler.rs b/recursion/compiler/src/asm/compiler.rs index 3b5a555a9..e33568c61 100644 --- a/recursion/compiler/src/asm/compiler.rs +++ b/recursion/compiler/src/asm/compiler.rs @@ -3,7 +3,7 @@ use std::collections::BTreeSet; use backtrace::Backtrace; use p3_field::{ExtensionField, PrimeField32, TwoAdicField}; -use wp1_recursion_core::runtime::{RecursionProgram, STACK_SIZE}; +use sphinx_recursion_core::runtime::{RecursionProgram, STACK_SIZE}; use super::{config::AsmConfig, AssemblyCode, BasicBlock, IndexTriple, ValueOrConst}; use crate::{ diff --git a/recursion/compiler/src/asm/instruction.rs b/recursion/compiler/src/asm/instruction.rs index 25d0a4e6d..af8e8ace5 100644 --- a/recursion/compiler/src/asm/instruction.rs +++ b/recursion/compiler/src/asm/instruction.rs @@ -2,8 +2,8 @@ use alloc::{collections::BTreeMap, format}; use core::fmt; use p3_field::{ExtensionField, PrimeField32}; -use wp1_recursion_core::cpu::Instruction; -use wp1_recursion_core::runtime::{Opcode, PERMUTATION_WIDTH}; +use sphinx_recursion_core::cpu::Instruction; +use sphinx_recursion_core::runtime::{Opcode, PERMUTATION_WIDTH}; use super::A0; use crate::util::canonical_i32_to_field; diff --git a/recursion/compiler/src/config.rs b/recursion/compiler/src/config.rs index a75167545..d563229f0 100644 --- a/recursion/compiler/src/config.rs +++ b/recursion/compiler/src/config.rs @@ -1,7 +1,7 @@ use p3_baby_bear::BabyBear; use p3_bn254_fr::Bn254Fr; use p3_field::extension::BinomialExtensionField; -use wp1_core::utils::{InnerChallenge, InnerVal}; +use sphinx_core::utils::{InnerChallenge, InnerVal}; use crate::{asm::AsmConfig, prelude::Config}; diff --git a/recursion/compiler/src/ir/bits.rs b/recursion/compiler/src/ir/bits.rs index f415a6078..0441a0da2 100644 --- a/recursion/compiler/src/ir/bits.rs +++ b/recursion/compiler/src/ir/bits.rs @@ -1,5 +1,5 @@ use p3_field::AbstractField; -use wp1_recursion_core::runtime::NUM_BITS; +use sphinx_recursion_core::runtime::NUM_BITS; use super::{Array, Builder, Config, DslIr, Felt, Usize, Var}; diff --git a/recursion/compiler/src/ir/fold.rs b/recursion/compiler/src/ir/fold.rs index c6b198290..9bf5918ab 100644 --- a/recursion/compiler/src/ir/fold.rs +++ b/recursion/compiler/src/ir/fold.rs @@ -1,4 +1,4 @@ -use wp1_recursion_derive::DslVariable; +use sphinx_recursion_derive::DslVariable; use super::{Ext, Felt, Var}; use crate::ir::{Array, Builder, Config, MemIndex, MemVariable, Ptr, Variable}; diff --git a/recursion/compiler/src/ir/poseidon.rs b/recursion/compiler/src/ir/poseidon.rs index 30bf97bbe..63a5d6393 100644 --- a/recursion/compiler/src/ir/poseidon.rs +++ b/recursion/compiler/src/ir/poseidon.rs @@ -1,5 +1,5 @@ use p3_field::AbstractField; -use wp1_recursion_core::runtime::{DIGEST_SIZE, HASH_RATE, PERMUTATION_WIDTH}; +use sphinx_recursion_core::runtime::{DIGEST_SIZE, HASH_RATE, PERMUTATION_WIDTH}; use super::{Array, Builder, Config, DslIr, Ext, Felt, Usize, Var}; diff --git a/recursion/compiler/src/ir/utils.rs b/recursion/compiler/src/ir/utils.rs index e5faa996c..272fa5bd7 100644 --- a/recursion/compiler/src/ir/utils.rs +++ b/recursion/compiler/src/ir/utils.rs @@ -224,8 +224,8 @@ mod tests { use p3_field::{AbstractField, PrimeField32}; use p3_util::reverse_bits_len; use rand::{thread_rng, Rng}; - use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; - use wp1_recursion_core::runtime::{Runtime, NUM_BITS}; + use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; + use sphinx_recursion_core::runtime::{Runtime, NUM_BITS}; use crate::{ asm::AsmBuilder, diff --git a/recursion/compiler/src/lib.rs b/recursion/compiler/src/lib.rs index b6320bf2e..77aad3926 100644 --- a/recursion/compiler/src/lib.rs +++ b/recursion/compiler/src/lib.rs @@ -9,7 +9,7 @@ pub mod ir; pub mod util; pub mod prelude { - pub use wp1_recursion_derive::DslVariable; + pub use sphinx_recursion_derive::DslVariable; pub use crate::{asm::AsmCompiler, ir::*}; } diff --git a/recursion/compiler/tests/arithmetic.rs b/recursion/compiler/tests/arithmetic.rs index 9dea29272..7398646bb 100644 --- a/recursion/compiler/tests/arithmetic.rs +++ b/recursion/compiler/tests/arithmetic.rs @@ -1,11 +1,11 @@ use p3_field::AbstractField; use rand::{thread_rng, Rng}; -use wp1_core::stark::StarkGenericConfig; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::asm::AsmBuilder; -use wp1_recursion_compiler::ir::{Ext, Felt, SymbolicExt}; -use wp1_recursion_compiler::ir::{ExtConst, Var}; -use wp1_recursion_core::runtime::Runtime; +use sphinx_core::stark::StarkGenericConfig; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::asm::AsmBuilder; +use sphinx_recursion_compiler::ir::{Ext, Felt, SymbolicExt}; +use sphinx_recursion_compiler::ir::{ExtConst, Var}; +use sphinx_recursion_core::runtime::Runtime; #[test] fn test_compiler_arithmetic() { diff --git a/recursion/compiler/tests/array.rs b/recursion/compiler/tests/array.rs index 6b9e2732d..7908c1a38 100644 --- a/recursion/compiler/tests/array.rs +++ b/recursion/compiler/tests/array.rs @@ -1,12 +1,12 @@ use p3_field::AbstractField; use rand::{thread_rng, Rng}; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::{ +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::{ asm::AsmBuilder, ir::{Array, Builder, Config, Ext, ExtConst, Felt, MemIndex, MemVariable, Ptr, Var, Variable}, }; -use wp1_recursion_core::runtime::Runtime; -use wp1_recursion_derive::DslVariable; +use sphinx_recursion_core::runtime::Runtime; +use sphinx_recursion_derive::DslVariable; #[derive(DslVariable, Clone, Debug)] pub struct Point { diff --git a/recursion/compiler/tests/conditionals.rs b/recursion/compiler/tests/conditionals.rs index 0e57ceb0d..f7c9b9179 100644 --- a/recursion/compiler/tests/conditionals.rs +++ b/recursion/compiler/tests/conditionals.rs @@ -1,8 +1,8 @@ use p3_baby_bear::BabyBear; use p3_field::{extension::BinomialExtensionField, AbstractField}; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::{asm::AsmBuilder, ir::Var}; -use wp1_recursion_core::runtime::Runtime; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::{asm::AsmBuilder, ir::Var}; +use sphinx_recursion_core::runtime::Runtime; #[test] fn test_compiler_conditionals() { diff --git a/recursion/compiler/tests/for_loops.rs b/recursion/compiler/tests/for_loops.rs index 7206cc738..c59b431c3 100644 --- a/recursion/compiler/tests/for_loops.rs +++ b/recursion/compiler/tests/for_loops.rs @@ -1,11 +1,11 @@ use p3_baby_bear::BabyBear; use p3_field::AbstractField; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::{ +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::{ asm::{AsmBuilder, AsmConfig}, ir::{Array, SymbolicVar, Var}, }; -use wp1_recursion_core::runtime::Runtime; +use sphinx_recursion_core::runtime::Runtime; #[test] fn test_compiler_for_loops() { diff --git a/recursion/compiler/tests/io.rs b/recursion/compiler/tests/io.rs index 3c76bd7e9..2cfe70bc8 100644 --- a/recursion/compiler/tests/io.rs +++ b/recursion/compiler/tests/io.rs @@ -1,7 +1,7 @@ use p3_field::AbstractField; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::asm::AsmBuilder; -use wp1_recursion_core::runtime::Runtime; +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::asm::AsmBuilder; +use sphinx_recursion_core::runtime::Runtime; #[test] fn test_io() { diff --git a/recursion/compiler/tests/lt.rs b/recursion/compiler/tests/lt.rs index 72af709b7..f930c4894 100644 --- a/recursion/compiler/tests/lt.rs +++ b/recursion/compiler/tests/lt.rs @@ -1,7 +1,7 @@ use p3_field::AbstractField; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::{asm::AsmBuilder, prelude::*}; -use wp1_recursion_core::runtime::Runtime; +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::{asm::AsmBuilder, prelude::*}; +use sphinx_recursion_core::runtime::Runtime; #[test] fn test_compiler_less_than() { diff --git a/recursion/compiler/tests/poseidon2.rs b/recursion/compiler/tests/poseidon2.rs index fea788960..1a2eb3322 100644 --- a/recursion/compiler/tests/poseidon2.rs +++ b/recursion/compiler/tests/poseidon2.rs @@ -1,12 +1,12 @@ use p3_field::{AbstractField, PrimeField32}; use p3_symmetric::Permutation; use rand::{thread_rng, Rng}; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::{ +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::{ asm::AsmBuilder, ir::{Array, Var}, }; -use wp1_recursion_core::runtime::{Runtime, PERMUTATION_WIDTH}; +use sphinx_recursion_core::runtime::{Runtime, PERMUTATION_WIDTH}; #[test] fn test_compiler_poseidon2_permute() { diff --git a/recursion/compiler/tests/public_values.rs b/recursion/compiler/tests/public_values.rs index dbbb1e258..367c2f39a 100644 --- a/recursion/compiler/tests/public_values.rs +++ b/recursion/compiler/tests/public_values.rs @@ -1,7 +1,7 @@ use p3_field::AbstractField; -use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; -use wp1_recursion_compiler::{asm::AsmBuilder, prelude::*}; -use wp1_recursion_core::runtime::Runtime; +use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; +use sphinx_recursion_compiler::{asm::AsmBuilder, prelude::*}; +use sphinx_recursion_core::runtime::Runtime; #[test] fn test_compiler_public_values() { diff --git a/recursion/core/Cargo.toml b/recursion/core/Cargo.toml index cee6b4aa9..553449dc9 100644 --- a/recursion/core/Cargo.toml +++ b/recursion/core/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-recursion-core" +name = "sphinx-recursion-core" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -13,10 +13,10 @@ p3-matrix = { workspace = true } p3-maybe-rayon = { workspace = true, features = ["parallel"] } p3-poseidon2 = { workspace = true } p3-symmetric = { workspace = true } -wp1-derive = { path = "../../derive" } -wp1-primitives = { path = "../../primitives" } +sphinx-derive = { path = "../../derive" } +sphinx-primitives = { path = "../../primitives" } tracing = { workspace = true } -wp1-core = { path = "../../core" } +sphinx-core = { path = "../../core" } hashbrown = { workspace = true } itertools = { workspace = true } p3-bn254-fr = { workspace = true } diff --git a/recursion/core/src/air/block.rs b/recursion/core/src/air/block.rs index 0959fb87d..6b53f822d 100644 --- a/recursion/core/src/air/block.rs +++ b/recursion/core/src/air/block.rs @@ -7,10 +7,10 @@ use p3_field::AbstractField; use p3_field::ExtensionField; use p3_field::Field; use serde::{Deserialize, Serialize}; -use wp1_core::air::BaseAirBuilder; -use wp1_core::air::BinomialExtension; -use wp1_core::air::ExtensionAirBuilder; -use wp1_derive::AlignedBorrow; +use sphinx_core::air::BaseAirBuilder; +use sphinx_core::air::BinomialExtension; +use sphinx_core::air::ExtensionAirBuilder; +use sphinx_derive::AlignedBorrow; use crate::runtime::D; diff --git a/recursion/core/src/air/builder.rs b/recursion/core/src/air/builder.rs index 9d6a39706..2663910d9 100644 --- a/recursion/core/src/air/builder.rs +++ b/recursion/core/src/air/builder.rs @@ -4,7 +4,7 @@ use crate::range_check::RangeCheckOpcode; use core::iter::{once, repeat}; use p3_air::{AirBuilder, AirBuilderWithPublicValues}; use p3_field::AbstractField; -use wp1_core::{ +use sphinx_core::{ air::{AirInteraction, BaseAirBuilder, MachineAirBuilder}, lookup::InteractionKind, }; @@ -12,12 +12,12 @@ use wp1_core::{ use super::Block; /// A trait which contains all helper methods for building SP1 recursion machine AIRs. -pub trait SP1RecursionAirBuilder: +pub trait SphinxRecursionAirBuilder: MachineAirBuilder + RecursionMemoryAirBuilder + RecursionInteractionAirBuilder { } -impl SP1RecursionAirBuilder for AB {} +impl SphinxRecursionAirBuilder for AB {} impl RecursionMemoryAirBuilder for AB {} impl RecursionInteractionAirBuilder for AB {} diff --git a/recursion/core/src/air/extension.rs b/recursion/core/src/air/extension.rs index db79ff9ef..aa9f34c1c 100644 --- a/recursion/core/src/air/extension.rs +++ b/recursion/core/src/air/extension.rs @@ -2,7 +2,7 @@ use p3_field::{ extension::{BinomialExtensionField, BinomiallyExtendable}, AbstractExtensionField, Field, }; -use wp1_core::air::BinomialExtension; +use sphinx_core::air::BinomialExtension; use super::Block; use crate::runtime::D; diff --git a/recursion/core/src/air/is_ext_zero.rs b/recursion/core/src/air/is_ext_zero.rs index 1695e30b1..13fc4a275 100644 --- a/recursion/core/src/air/is_ext_zero.rs +++ b/recursion/core/src/air/is_ext_zero.rs @@ -9,8 +9,8 @@ use p3_field::{ extension::{BinomialExtensionField, BinomiallyExtendable}, AbstractField, Field, }; -use wp1_core::air::{BaseAirBuilder, BinomialExtension}; -use wp1_derive::AlignedBorrow; +use sphinx_core::air::{BaseAirBuilder, BinomialExtension}; +use sphinx_derive::AlignedBorrow; use crate::{ air::{extension::BinomialExtensionUtils, Block}, diff --git a/recursion/core/src/air/multi_builder.rs b/recursion/core/src/air/multi_builder.rs index 9c131649f..18cfa1c70 100644 --- a/recursion/core/src/air/multi_builder.rs +++ b/recursion/core/src/air/multi_builder.rs @@ -1,5 +1,5 @@ use p3_air::{AirBuilder, ExtensionBuilder, FilteredAirBuilder, PermutationAirBuilder}; -use wp1_core::air::MessageBuilder; +use sphinx_core::air::MessageBuilder; /// The MultiBuilder is used for the multi table. It is used to create a virtual builder for one of /// the sub tables in the multi table. diff --git a/recursion/core/src/air/public_values.rs b/recursion/core/src/air/public_values.rs index e89533009..aa7990978 100644 --- a/recursion/core/src/air/public_values.rs +++ b/recursion/core/src/air/public_values.rs @@ -5,15 +5,15 @@ use p3_challenger::DuplexChallenger; use p3_field::PrimeField32; use p3_symmetric::CryptographicPermutation; use serde::{Deserialize, Serialize}; -use static_assertions::const_assert_eq; -use std::mem::size_of; -use std::mem::transmute; -use wp1_core::{ +use sphinx_core::{ air::{Word, POSEIDON_NUM_WORDS}, stark::PROOF_MAX_NUM_PVS, utils::indices_arr, }; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; +use static_assertions::const_assert_eq; +use std::mem::size_of; +use std::mem::transmute; pub const PV_DIGEST_NUM_WORDS: usize = 8; @@ -100,7 +100,7 @@ pub struct RecursionPublicValues { pub end_reconstruct_deferred_digest: [T; POSEIDON_NUM_WORDS], /// The commitment to the sp1 program being proven. - pub wp1_vk_digest: [T; DIGEST_SIZE], + pub sphinx_vk_digest: [T; DIGEST_SIZE], /// The commitment to the compress key being used in recursive verification. pub compress_vk_digest: [T; DIGEST_SIZE], diff --git a/recursion/core/src/cpu/air/alu.rs b/recursion/core/src/cpu/air/alu.rs index f77acaa2e..51cd69092 100644 --- a/recursion/core/src/cpu/air/alu.rs +++ b/recursion/core/src/cpu/air/alu.rs @@ -1,9 +1,9 @@ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; -use wp1_core::air::{BinomialExtension, ExtensionAirBuilder}; +use sphinx_core::air::{BinomialExtension, ExtensionAirBuilder}; use crate::{ - air::{BinomialExtensionUtils, SP1RecursionAirBuilder}, + air::{BinomialExtensionUtils, SphinxRecursionAirBuilder}, cpu::{CpuChip, CpuCols}, memory::MemoryCols, }; @@ -12,7 +12,7 @@ impl CpuChip { /// Eval the ALU instructions. pub fn eval_alu(&self, builder: &mut AB, local: &CpuCols) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { let one = AB::Expr::one(); let is_alu_instruction = self.is_alu_instruction::(local); diff --git a/recursion/core/src/cpu/air/branch.rs b/recursion/core/src/cpu/air/branch.rs index 70a661ed1..f6569652a 100644 --- a/recursion/core/src/cpu/air/branch.rs +++ b/recursion/core/src/cpu/air/branch.rs @@ -1,9 +1,9 @@ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; -use wp1_core::air::{BinomialExtension, ExtensionAirBuilder}; +use sphinx_core::air::{BinomialExtension, ExtensionAirBuilder}; use crate::{ - air::{BinomialExtensionUtils, IsExtZeroOperation, SP1RecursionAirBuilder}, + air::{BinomialExtensionUtils, IsExtZeroOperation, SphinxRecursionAirBuilder}, cpu::{CpuChip, CpuCols}, memory::MemoryCols, }; @@ -16,7 +16,7 @@ impl CpuChip { local: &CpuCols, next_pc: &mut AB::Expr, ) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { let branch_cols = local.opcode_specific.branch(); let is_branch_instruction = self.is_branch_instruction::(local); diff --git a/recursion/core/src/cpu/air/jump.rs b/recursion/core/src/cpu/air/jump.rs index 7accec831..8666e6ca4 100644 --- a/recursion/core/src/cpu/air/jump.rs +++ b/recursion/core/src/cpu/air/jump.rs @@ -2,7 +2,7 @@ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; use crate::{ - air::SP1RecursionAirBuilder, + air::SphinxRecursionAirBuilder, cpu::{CpuChip, CpuCols}, memory::MemoryCols, runtime::STACK_SIZE, @@ -19,7 +19,7 @@ impl CpuChip { next: &CpuCols, next_pc: &mut AB::Expr, ) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { // Verify the next row's fp. builder diff --git a/recursion/core/src/cpu/air/memory.rs b/recursion/core/src/cpu/air/memory.rs index ca075c681..004c48c31 100644 --- a/recursion/core/src/cpu/air/memory.rs +++ b/recursion/core/src/cpu/air/memory.rs @@ -1,9 +1,9 @@ use p3_air::AirBuilder; use p3_field::Field; -use wp1_core::runtime::MemoryAccessPosition; +use sphinx_core::runtime::MemoryAccessPosition; use crate::{ - air::{BlockBuilder, SP1RecursionAirBuilder}, + air::{BlockBuilder, SphinxRecursionAirBuilder}, cpu::{CpuChip, CpuCols}, memory::MemoryCols, }; @@ -12,7 +12,7 @@ impl CpuChip { // Eval the MEMORY instructions. pub fn eval_memory(&self, builder: &mut AB, local: &CpuCols) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { let is_memory_instr = self.is_memory_instruction::(local); let index = local.c.value()[0]; diff --git a/recursion/core/src/cpu/air/mod.rs b/recursion/core/src/cpu/air/mod.rs index 37913d418..8849689c3 100644 --- a/recursion/core/src/cpu/air/mod.rs +++ b/recursion/core/src/cpu/air/mod.rs @@ -11,17 +11,17 @@ use std::borrow::Borrow; use p3_air::{Air, AirBuilder}; use p3_field::{AbstractField, Field}; use p3_matrix::Matrix; -use wp1_core::air::BaseAirBuilder; +use sphinx_core::air::BaseAirBuilder; use crate::{ - air::{RecursionPublicValues, SP1RecursionAirBuilder, RECURSIVE_PROOF_NUM_PV_ELTS}, + air::{RecursionPublicValues, SphinxRecursionAirBuilder, RECURSIVE_PROOF_NUM_PV_ELTS}, cpu::{CpuChip, CpuCols}, memory::MemoryCols, }; impl Air for CpuChip where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { fn eval(&self, builder: &mut AB) { let main = builder.main(); @@ -102,7 +102,7 @@ impl CpuChip { /// is stored in the `a` operand. pub fn eval_clk(&self, builder: &mut AB, local: &CpuCols, next: &CpuCols) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { builder .when_transition() @@ -124,7 +124,7 @@ impl CpuChip { local: &CpuCols, next: &CpuCols, ) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { builder.assert_bool(local.is_real); @@ -141,7 +141,7 @@ impl CpuChip { /// Expr to check for alu instructions. pub fn is_alu_instruction(&self, local: &CpuCols) -> AB::Expr where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { local.selectors.is_add + local.selectors.is_sub @@ -152,7 +152,7 @@ impl CpuChip { /// Expr to check for branch instructions. pub fn is_branch_instruction(&self, local: &CpuCols) -> AB::Expr where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { local.selectors.is_beq + local.selectors.is_bne + local.selectors.is_bneinc } @@ -160,7 +160,7 @@ impl CpuChip { /// Expr to check for jump instructions. pub fn is_jump_instruction(&self, local: &CpuCols) -> AB::Expr where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { local.selectors.is_jal + local.selectors.is_jalr } @@ -168,7 +168,7 @@ impl CpuChip { /// Expr to check for memory instructions. pub fn is_memory_instruction(&self, local: &CpuCols) -> AB::Expr where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { local.selectors.is_load + local.selectors.is_store } @@ -176,7 +176,7 @@ impl CpuChip { /// Expr to check for instructions that only read from operand `a`. pub fn is_op_a_read_only_instruction(&self, local: &CpuCols) -> AB::Expr where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { local.selectors.is_beq + local.selectors.is_bne @@ -188,7 +188,7 @@ impl CpuChip { /// Expr to check for instructions that are commit instructions. pub fn is_commit_instruction(&self, local: &CpuCols) -> AB::Expr where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { local.selectors.is_commit.into() } diff --git a/recursion/core/src/cpu/air/operands.rs b/recursion/core/src/cpu/air/operands.rs index 21783f32b..83bcac993 100644 --- a/recursion/core/src/cpu/air/operands.rs +++ b/recursion/core/src/cpu/air/operands.rs @@ -1,8 +1,8 @@ use p3_field::{AbstractField, Field}; -use wp1_core::runtime::MemoryAccessPosition; +use sphinx_core::runtime::MemoryAccessPosition; use crate::{ - air::{BlockBuilder, SP1RecursionAirBuilder}, + air::{BlockBuilder, SphinxRecursionAirBuilder}, cpu::{CpuChip, CpuCols}, memory::MemoryCols, }; @@ -11,7 +11,7 @@ impl CpuChip { /// Eval the operands. pub fn eval_operands(&self, builder: &mut AB, local: &CpuCols) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { // Constraint the case of immediates for the b and c operands. builder diff --git a/recursion/core/src/cpu/air/public_values.rs b/recursion/core/src/cpu/air/public_values.rs index 0256870f8..459b64ea6 100644 --- a/recursion/core/src/cpu/air/public_values.rs +++ b/recursion/core/src/cpu/air/public_values.rs @@ -2,7 +2,7 @@ use p3_air::AirBuilder; use p3_field::{AbstractField, Field}; use crate::{ - air::{BlockBuilder, SP1RecursionAirBuilder}, + air::{BlockBuilder, SphinxRecursionAirBuilder}, cpu::{CpuChip, CpuCols}, memory::MemoryCols, runtime::DIGEST_SIZE, @@ -18,7 +18,7 @@ impl CpuChip { local: &CpuCols, commit_digest: &[AB::Expr; DIGEST_SIZE], ) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { let public_values_cols = local.opcode_specific.public_values(); let is_commit_instruction = self.is_commit_instruction::(local); diff --git a/recursion/core/src/cpu/air/system.rs b/recursion/core/src/cpu/air/system.rs index 68e744484..5179baf3c 100644 --- a/recursion/core/src/cpu/air/system.rs +++ b/recursion/core/src/cpu/air/system.rs @@ -1,9 +1,9 @@ use p3_air::AirBuilder; use p3_field::Field; -use wp1_core::air::BaseAirBuilder; +use sphinx_core::air::BaseAirBuilder; use crate::{ - air::SP1RecursionAirBuilder, + air::SphinxRecursionAirBuilder, cpu::{CpuChip, CpuCols}, }; @@ -19,7 +19,7 @@ impl CpuChip { local: &CpuCols, next: &CpuCols, ) where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { builder .when(local.is_real) diff --git a/recursion/core/src/cpu/columns/branch.rs b/recursion/core/src/cpu/columns/branch.rs index b446693ed..d8fe2b643 100644 --- a/recursion/core/src/cpu/columns/branch.rs +++ b/recursion/core/src/cpu/columns/branch.rs @@ -1,6 +1,6 @@ +use sphinx_core::air::BinomialExtension; +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_core::air::BinomialExtension; -use wp1_derive::AlignedBorrow; use crate::air::IsExtZeroOperation; diff --git a/recursion/core/src/cpu/columns/instruction.rs b/recursion/core/src/cpu/columns/instruction.rs index ea51ce497..260fc504c 100644 --- a/recursion/core/src/cpu/columns/instruction.rs +++ b/recursion/core/src/cpu/columns/instruction.rs @@ -1,7 +1,7 @@ use std::{iter::once, vec::IntoIter}; use p3_field::PrimeField; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{air::Block, cpu::Instruction}; diff --git a/recursion/core/src/cpu/columns/memory.rs b/recursion/core/src/cpu/columns/memory.rs index 661016f8f..3d74a4f48 100644 --- a/recursion/core/src/cpu/columns/memory.rs +++ b/recursion/core/src/cpu/columns/memory.rs @@ -1,5 +1,5 @@ +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_derive::AlignedBorrow; use crate::memory::MemoryReadWriteCols; diff --git a/recursion/core/src/cpu/columns/mod.rs b/recursion/core/src/cpu/columns/mod.rs index 7a9ca20e9..29bc9b694 100644 --- a/recursion/core/src/cpu/columns/mod.rs +++ b/recursion/core/src/cpu/columns/mod.rs @@ -2,8 +2,8 @@ use std::mem::{size_of, transmute}; use crate::memory::{MemoryReadCols, MemoryReadWriteCols}; use p3_air::BaseAir; -use wp1_core::utils::indices_arr; -use wp1_derive::AlignedBorrow; +use sphinx_core::utils::indices_arr; +use sphinx_derive::AlignedBorrow; mod branch; mod instruction; diff --git a/recursion/core/src/cpu/columns/opcode.rs b/recursion/core/src/cpu/columns/opcode.rs index b9d26d07e..20d0ae348 100644 --- a/recursion/core/src/cpu/columns/opcode.rs +++ b/recursion/core/src/cpu/columns/opcode.rs @@ -1,5 +1,5 @@ use p3_field::Field; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{cpu::Instruction, runtime::Opcode}; diff --git a/recursion/core/src/cpu/columns/public_values.rs b/recursion/core/src/cpu/columns/public_values.rs index 883ed28a7..718820faf 100644 --- a/recursion/core/src/cpu/columns/public_values.rs +++ b/recursion/core/src/cpu/columns/public_values.rs @@ -1,5 +1,5 @@ +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_derive::AlignedBorrow; use crate::runtime::DIGEST_SIZE; diff --git a/recursion/core/src/cpu/trace.rs b/recursion/core/src/cpu/trace.rs index 075df2325..8b80d8976 100644 --- a/recursion/core/src/cpu/trace.rs +++ b/recursion/core/src/cpu/trace.rs @@ -2,11 +2,11 @@ use std::borrow::BorrowMut; use p3_field::{extension::BinomiallyExtendable, PrimeField32}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use tracing::instrument; -use wp1_core::{ +use sphinx_core::{ air::{BinomialExtension, MachineAir}, utils::pad_rows_fixed, }; +use tracing::instrument; use crate::{ air::BinomialExtensionUtils, diff --git a/recursion/core/src/fri_fold/mod.rs b/recursion/core/src/fri_fold/mod.rs index 272680a21..943ba8d14 100644 --- a/recursion/core/src/fri_fold/mod.rs +++ b/recursion/core/src/fri_fold/mod.rs @@ -10,13 +10,13 @@ use p3_field::AbstractField; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; +use sphinx_core::air::{BaseAirBuilder, BinomialExtension, ExtensionAirBuilder, MachineAir}; +use sphinx_core::utils::pad_rows_fixed; +use sphinx_derive::AlignedBorrow; use std::borrow::BorrowMut; use tracing::instrument; -use wp1_core::air::{BaseAirBuilder, BinomialExtension, ExtensionAirBuilder, MachineAir}; -use wp1_core::utils::pad_rows_fixed; -use wp1_derive::AlignedBorrow; -use crate::air::SP1RecursionAirBuilder; +use crate::air::SphinxRecursionAirBuilder; use crate::memory::MemoryRecord; use crate::runtime::{ExecutionRecord, RecursionProgram}; @@ -370,7 +370,7 @@ impl FriFoldChip { impl Air for FriFoldChip where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { fn eval(&self, builder: &mut AB) { let main = builder.main(); diff --git a/recursion/core/src/memory/air.rs b/recursion/core/src/memory/air.rs index 9a8d0e573..b5d968653 100644 --- a/recursion/core/src/memory/air.rs +++ b/recursion/core/src/memory/air.rs @@ -4,12 +4,12 @@ use std::borrow::{Borrow, BorrowMut}; use p3_air::{Air, BaseAir}; use p3_field::PrimeField32; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use tracing::instrument; -use wp1_core::{ +use sphinx_core::{ air::{AirInteraction, MachineAir, MemoryAirBuilder}, lookup::InteractionKind, utils::pad_rows_fixed, }; +use tracing::instrument; use super::columns::MemoryInitCols; use crate::memory::MemoryGlobalChip; diff --git a/recursion/core/src/memory/columns.rs b/recursion/core/src/memory/columns.rs index d04179657..84012cb44 100644 --- a/recursion/core/src/memory/columns.rs +++ b/recursion/core/src/memory/columns.rs @@ -1,4 +1,4 @@ -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::air::Block; diff --git a/recursion/core/src/multi/mod.rs b/recursion/core/src/multi/mod.rs index 1f7e36202..1b548ef4e 100644 --- a/recursion/core/src/multi/mod.rs +++ b/recursion/core/src/multi/mod.rs @@ -5,11 +5,11 @@ use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; -use wp1_core::air::{BaseAirBuilder, MachineAir}; -use wp1_core::utils::pad_rows_fixed; -use wp1_derive::AlignedBorrow; +use sphinx_core::air::{BaseAirBuilder, MachineAir}; +use sphinx_core::utils::pad_rows_fixed; +use sphinx_derive::AlignedBorrow; -use crate::air::{MultiBuilder, SP1RecursionAirBuilder}; +use crate::air::{MultiBuilder, SphinxRecursionAirBuilder}; use crate::fri_fold::{FriFoldChip, FriFoldCols}; use crate::poseidon2::{Poseidon2Chip, Poseidon2Cols}; use crate::runtime::{ExecutionRecord, RecursionProgram}; @@ -117,7 +117,7 @@ impl MachineAir for MultiChip { impl Air for MultiChip where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { fn eval(&self, builder: &mut AB) { let main = builder.main(); @@ -223,9 +223,9 @@ mod tests { use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_poseidon2::Poseidon2; use p3_poseidon2::Poseidon2ExternalMatrixGeneral; - use wp1_core::stark::StarkGenericConfig; - use wp1_core::utils::inner_perm; - use wp1_core::{ + use sphinx_core::stark::StarkGenericConfig; + use sphinx_core::utils::inner_perm; + use sphinx_core::{ air::MachineAir, utils::{uni_stark_prove, uni_stark_verify, BabyBearPoseidon2}, }; diff --git a/recursion/core/src/poseidon2/columns.rs b/recursion/core/src/poseidon2/columns.rs index 754c85b65..25152a42e 100644 --- a/recursion/core/src/poseidon2/columns.rs +++ b/recursion/core/src/poseidon2/columns.rs @@ -1,4 +1,4 @@ -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{memory::MemoryReadWriteSingleCols, poseidon2_wide::external::WIDTH}; diff --git a/recursion/core/src/poseidon2/external.rs b/recursion/core/src/poseidon2/external.rs index 0226a5fc5..98812828e 100644 --- a/recursion/core/src/poseidon2/external.rs +++ b/recursion/core/src/poseidon2/external.rs @@ -4,9 +4,9 @@ use p3_air::AirBuilder; use p3_air::{Air, BaseAir}; use p3_field::AbstractField; use p3_matrix::Matrix; +use sphinx_core::air::{BaseAirBuilder, ExtensionAirBuilder}; +use sphinx_primitives::RC_16_30_U32; use std::ops::Add; -use wp1_core::air::{BaseAirBuilder, ExtensionAirBuilder}; -use wp1_primitives::RC_16_30_U32; use crate::air::{RecursionInteractionAirBuilder, RecursionMemoryAirBuilder}; use crate::memory::MemoryCols; @@ -351,9 +351,9 @@ mod tests { use p3_matrix::{dense::RowMajorMatrix, Matrix}; use p3_poseidon2::Poseidon2; use p3_poseidon2::Poseidon2ExternalMatrixGeneral; - use wp1_core::stark::StarkGenericConfig; - use wp1_core::utils::inner_perm; - use wp1_core::{ + use sphinx_core::stark::StarkGenericConfig; + use sphinx_core::utils::inner_perm; + use sphinx_core::{ air::MachineAir, utils::{uni_stark_prove, uni_stark_verify, BabyBearPoseidon2}, }; diff --git a/recursion/core/src/poseidon2/trace.rs b/recursion/core/src/poseidon2/trace.rs index 2856ecb52..8030f6bbc 100644 --- a/recursion/core/src/poseidon2/trace.rs +++ b/recursion/core/src/poseidon2/trace.rs @@ -2,9 +2,9 @@ use std::borrow::BorrowMut; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; +use sphinx_core::{air::MachineAir, utils::pad_rows_fixed}; +use sphinx_primitives::RC_16_30_U32; use tracing::instrument; -use wp1_core::{air::MachineAir, utils::pad_rows_fixed}; -use wp1_primitives::RC_16_30_U32; use crate::{ poseidon2_wide::{external_linear_layer, internal_linear_layer}, diff --git a/recursion/core/src/poseidon2_wide/columns.rs b/recursion/core/src/poseidon2_wide/columns.rs index fe0f1349d..0d241055f 100644 --- a/recursion/core/src/poseidon2_wide/columns.rs +++ b/recursion/core/src/poseidon2_wide/columns.rs @@ -1,6 +1,6 @@ use std::mem::size_of; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::memory::{MemoryReadSingleCols, MemoryReadWriteSingleCols}; diff --git a/recursion/core/src/poseidon2_wide/external.rs b/recursion/core/src/poseidon2_wide/external.rs index aef568e3b..cbcedb28f 100644 --- a/recursion/core/src/poseidon2_wide/external.rs +++ b/recursion/core/src/poseidon2_wide/external.rs @@ -8,13 +8,13 @@ use p3_air::{Air, BaseAir}; use p3_field::{AbstractField, PrimeField32}; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; +use sphinx_core::air::{BaseAirBuilder, MachineAir}; +use sphinx_core::utils::pad_rows_fixed; +use sphinx_primitives::RC_16_30_U32; use std::borrow::BorrowMut; use tracing::instrument; -use wp1_core::air::{BaseAirBuilder, MachineAir}; -use wp1_core::utils::pad_rows_fixed; -use wp1_primitives::RC_16_30_U32; -use crate::air::SP1RecursionAirBuilder; +use crate::air::SphinxRecursionAirBuilder; use crate::memory::MemoryCols; use crate::poseidon2_wide::{external_linear_layer, internal_linear_layer}; @@ -342,7 +342,7 @@ impl BaseAir for Poseidon2WideChip { } } -fn eval_mem(builder: &mut AB, local: &Poseidon2MemCols) { +fn eval_mem(builder: &mut AB, local: &Poseidon2MemCols) { // Evaluate all of the memory. for i in 0..WIDTH { let input_addr = if i < WIDTH / 2 { @@ -383,7 +383,7 @@ fn eval_mem(builder: &mut AB, local: &Poseidon2MemCo impl Air for Poseidon2WideChip where - AB: SP1RecursionAirBuilder, + AB: SphinxRecursionAirBuilder, { fn eval(&self, builder: &mut AB) { assert!(DEGREE >= 3, "Minimum supported constraint degree is 3"); @@ -456,9 +456,9 @@ mod tests { use p3_matrix::dense::RowMajorMatrix; use p3_poseidon2::{Poseidon2, Poseidon2ExternalMatrixGeneral}; use p3_symmetric::Permutation; - use wp1_core::air::MachineAir; - use wp1_core::stark::StarkGenericConfig; - use wp1_core::utils::{inner_perm, uni_stark_prove, uni_stark_verify, BabyBearPoseidon2}; + use sphinx_core::air::MachineAir; + use sphinx_core::stark::StarkGenericConfig; + use sphinx_core::utils::{inner_perm, uni_stark_prove, uni_stark_verify, BabyBearPoseidon2}; use zkhash::ark_ff::UniformRand; /// A test generating a trace for a single permutation that checks that the output is correct diff --git a/recursion/core/src/program/mod.rs b/recursion/core/src/program/mod.rs index a69290305..4bfb43d2f 100644 --- a/recursion/core/src/program/mod.rs +++ b/recursion/core/src/program/mod.rs @@ -1,16 +1,16 @@ -use crate::air::SP1RecursionAirBuilder; +use crate::air::SphinxRecursionAirBuilder; use core::borrow::{Borrow, BorrowMut}; use core::mem::size_of; use p3_air::{Air, BaseAir, PairBuilder}; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; use p3_matrix::Matrix; +use sphinx_core::air::MachineAir; +use sphinx_core::utils::pad_rows_fixed; use std::collections::HashMap; use tracing::instrument; -use wp1_core::air::MachineAir; -use wp1_core::utils::pad_rows_fixed; -use wp1_derive::AlignedBorrow; +use sphinx_derive::AlignedBorrow; use crate::{ cpu::columns::{InstructionCols, OpcodeSelectorCols}, @@ -153,7 +153,7 @@ impl BaseAir for ProgramChip { impl Air for ProgramChip where - AB: SP1RecursionAirBuilder + PairBuilder, + AB: SphinxRecursionAirBuilder + PairBuilder, { fn eval(&self, builder: &mut AB) { let main = builder.main(); diff --git a/recursion/core/src/range_check/air.rs b/recursion/core/src/range_check/air.rs index 3e64b7680..24c301fe1 100644 --- a/recursion/core/src/range_check/air.rs +++ b/recursion/core/src/range_check/air.rs @@ -7,7 +7,7 @@ use p3_matrix::Matrix; use super::columns::{RangeCheckMultCols, RangeCheckPreprocessedCols, NUM_RANGE_CHECK_MULT_COLS}; use super::{RangeCheckChip, RangeCheckOpcode}; -use crate::air::SP1RecursionAirBuilder; +use crate::air::SphinxRecursionAirBuilder; impl BaseAir for RangeCheckChip { fn width(&self) -> usize { @@ -15,7 +15,7 @@ impl BaseAir for RangeCheckChip { } } -impl Air for RangeCheckChip { +impl Air for RangeCheckChip { /// Eval's the range check chip. fn eval(&self, builder: &mut AB) { let main = builder.main(); diff --git a/recursion/core/src/range_check/columns.rs b/recursion/core/src/range_check/columns.rs index db76b8e89..a7201c846 100644 --- a/recursion/core/src/range_check/columns.rs +++ b/recursion/core/src/range_check/columns.rs @@ -1,5 +1,5 @@ +use sphinx_derive::AlignedBorrow; use std::mem::size_of; -use wp1_derive::AlignedBorrow; use super::NUM_RANGE_CHECK_OPS; diff --git a/recursion/core/src/range_check/trace.rs b/recursion/core/src/range_check/trace.rs index 198c7b2d7..c5ee4c715 100644 --- a/recursion/core/src/range_check/trace.rs +++ b/recursion/core/src/range_check/trace.rs @@ -2,7 +2,7 @@ use std::borrow::BorrowMut; use p3_field::PrimeField32; use p3_matrix::dense::RowMajorMatrix; -use wp1_core::air::MachineAir; +use sphinx_core::air::MachineAir; use super::{ columns::{RangeCheckMultCols, NUM_RANGE_CHECK_MULT_COLS, NUM_RANGE_CHECK_PREPROCESSED_COLS}, diff --git a/recursion/core/src/runtime/mod.rs b/recursion/core/src/runtime/mod.rs index 4912a8801..7169987ad 100644 --- a/recursion/core/src/runtime/mod.rs +++ b/recursion/core/src/runtime/mod.rs @@ -16,7 +16,7 @@ use p3_poseidon2::{Poseidon2, Poseidon2ExternalMatrixGeneral}; use p3_symmetric::{CryptographicPermutation, Permutation}; pub use program::*; pub use record::*; -use wp1_core::runtime::MemoryAccessPosition; +use sphinx_core::runtime::MemoryAccessPosition; use crate::air::Block; use crate::cpu::CpuEvent; @@ -847,7 +847,7 @@ where #[cfg(test)] mod tests { use p3_field::AbstractField; - use wp1_core::{ + use sphinx_core::{ stark::{RiscvAir, StarkGenericConfig}, utils::BabyBearPoseidon2, }; diff --git a/recursion/core/src/runtime/program.rs b/recursion/core/src/runtime/program.rs index 7c6adbea6..d02a874bd 100644 --- a/recursion/core/src/runtime/program.rs +++ b/recursion/core/src/runtime/program.rs @@ -1,7 +1,7 @@ use backtrace::Backtrace; use p3_field::Field; use serde::{Deserialize, Serialize}; -use wp1_core::air::MachineProgram; +use sphinx_core::air::MachineProgram; use super::Instruction; diff --git a/recursion/core/src/runtime/record.rs b/recursion/core/src/runtime/record.rs index 826a02464..7509a4073 100644 --- a/recursion/core/src/runtime/record.rs +++ b/recursion/core/src/runtime/record.rs @@ -2,7 +2,7 @@ use std::collections::{BTreeMap, HashMap}; use std::sync::Arc; use p3_field::{AbstractField, PrimeField32}; -use wp1_core::stark::{MachineRecord, PROOF_MAX_NUM_PVS}; +use sphinx_core::stark::{MachineRecord, PROOF_MAX_NUM_PVS}; use super::RecursionProgram; use crate::air::Block; diff --git a/recursion/core/src/stark/config.rs b/recursion/core/src/stark/config.rs index add25dab8..886c1c9ae 100644 --- a/recursion/core/src/stark/config.rs +++ b/recursion/core/src/stark/config.rs @@ -15,7 +15,7 @@ use p3_symmetric::Hash; use p3_symmetric::{MultiField32PaddingFreeSponge, TruncatedPermutation}; use serde::Deserialize; use serde::Serialize; -use wp1_core::stark::StarkGenericConfig; +use sphinx_core::stark::StarkGenericConfig; use super::poseidon2::bn254_poseidon2_rc3; use super::utils; @@ -69,7 +69,7 @@ pub fn outer_fri_config() -> FriConfig { let hash = OuterHash::new(perm.clone()).unwrap(); let compress = OuterCompress::new(perm.clone()); let challenge_mmcs = OuterChallengeMmcs::new(OuterValMmcs::new(hash, compress)); - let num_queries = if utils::wp1_dev_mode() { + let num_queries = if utils::sphinx_dev_mode() { 1 } else { match std::env::var("FRI_QUERIES") { diff --git a/recursion/core/src/stark/mod.rs b/recursion/core/src/stark/mod.rs index 4fc3b7a38..4ab9b3de4 100644 --- a/recursion/core/src/stark/mod.rs +++ b/recursion/core/src/stark/mod.rs @@ -3,8 +3,8 @@ pub mod poseidon2; pub mod utils; use p3_field::{extension::BinomiallyExtendable, PrimeField32}; -use wp1_core::stark::{Chip, StarkGenericConfig, StarkMachine, PROOF_MAX_NUM_PVS}; -use wp1_derive::MachineAir; +use sphinx_core::stark::{Chip, StarkGenericConfig, StarkMachine, PROOF_MAX_NUM_PVS}; +use sphinx_derive::MachineAir; use crate::runtime::D; use crate::{ @@ -19,10 +19,10 @@ pub type RecursionAirWideDeg3 = RecursionAir; pub type RecursionAirSkinnyDeg7 = RecursionAir; #[derive(MachineAir)] -#[wp1_core_path = "wp1_core"] +#[sphinx_core_path = "sphinx_core"] #[execution_record_path = "crate::runtime::ExecutionRecord"] #[program_path = "crate::runtime::RecursionProgram"] -#[builder_path = "crate::air::SP1RecursionAirBuilder"] +#[builder_path = "crate::air::SphinxRecursionAirBuilder"] pub enum RecursionAir, const DEGREE: usize> { Program(ProgramChip), Cpu(CpuChip), diff --git a/recursion/core/src/stark/utils.rs b/recursion/core/src/stark/utils.rs index 81c606362..f94c0b55d 100644 --- a/recursion/core/src/stark/utils.rs +++ b/recursion/core/src/stark/utils.rs @@ -1,7 +1,7 @@ use p3_baby_bear::BabyBear; -use wp1_core::stark::StarkGenericConfig; -use wp1_core::utils; -use wp1_core::utils::BabyBearPoseidon2; +use sphinx_core::stark::StarkGenericConfig; +use sphinx_core::utils; +use sphinx_core::utils::BabyBearPoseidon2; use crate::air::Block; use crate::runtime::RecursionProgram; @@ -9,8 +9,8 @@ use crate::runtime::Runtime; use crate::stark::RecursionAir; use crate::stark::RecursionAirSkinnyDeg7; use p3_field::PrimeField32; +use sphinx_core::utils::run_test_machine; use std::collections::VecDeque; -use wp1_core::utils::run_test_machine; #[derive(PartialEq, Eq, Clone, Copy, Debug)] pub enum TestConfig { @@ -80,7 +80,7 @@ pub fn run_test_recursion( /// Groth16 proofs. This is useful for development and testing purposes. /// /// By default, the variable is disabled. -pub fn wp1_dev_mode() -> bool { +pub fn sphinx_dev_mode() -> bool { let value = std::env::var("SP1_DEV").unwrap_or_else(|_| "false".to_string()); let enabled = value == "1" || value.to_lowercase() == "true"; if enabled { diff --git a/recursion/derive/Cargo.toml b/recursion/derive/Cargo.toml index 8ac87e2bb..a3e609d63 100644 --- a/recursion/derive/Cargo.toml +++ b/recursion/derive/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-recursion-derive" +name = "sphinx-recursion-derive" version = "0.1.0" edition.workspace = true repository.workspace = true diff --git a/recursion/gnark-ffi/Cargo.toml b/recursion/gnark-ffi/Cargo.toml index d0e065c23..fc36087b8 100644 --- a/recursion/gnark-ffi/Cargo.toml +++ b/recursion/gnark-ffi/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-recursion-gnark-ffi" +name = "sphinx-recursion-gnark-ffi" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -8,7 +8,7 @@ license.workspace = true [dependencies] p3-field = { workspace = true } p3-baby-bear = { workspace = true } -wp1-recursion-compiler = { path = "../compiler" } +sphinx-recursion-compiler = { path = "../compiler" } serde = { workspace = true } serde_json = { workspace = true } tempfile = { workspace = true } diff --git a/recursion/gnark-ffi/src/groth16.rs b/recursion/gnark-ffi/src/groth16.rs index ca9f6146a..462659c05 100644 --- a/recursion/gnark-ffi/src/groth16.rs +++ b/recursion/gnark-ffi/src/groth16.rs @@ -11,7 +11,7 @@ use crate::{ use num_bigint::BigUint; use serde::{Deserialize, Serialize}; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::{ constraints::Constraint, ir::{Config, Witness}, }; @@ -80,9 +80,9 @@ impl Groth16Prover { .expect("failed to open file"); // Write the string to the file - let wp1_verifier_str = include_str!("../assets/SP1Verifier.txt"); + let sphinx_verifier_str = include_str!("../assets/SP1Verifier.txt"); groth16_verifier_file - .write_all(wp1_verifier_str.as_bytes()) + .write_all(sphinx_verifier_str.as_bytes()) .expect("Failed to write to file"); } diff --git a/recursion/gnark-ffi/src/plonk_bn254.rs b/recursion/gnark-ffi/src/plonk_bn254.rs index 025d3a126..3461f91ea 100644 --- a/recursion/gnark-ffi/src/plonk_bn254.rs +++ b/recursion/gnark-ffi/src/plonk_bn254.rs @@ -6,7 +6,7 @@ use std::{ }; use serde::{Deserialize, Serialize}; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::{ constraints::Constraint, ir::{Config, Witness}, }; diff --git a/recursion/gnark-ffi/src/witness.rs b/recursion/gnark-ffi/src/witness.rs index 70f08bb33..3bced99fa 100644 --- a/recursion/gnark-ffi/src/witness.rs +++ b/recursion/gnark-ffi/src/witness.rs @@ -6,8 +6,8 @@ use p3_field::AbstractField; use p3_field::PrimeField; use serde::Deserialize; use serde::Serialize; -use wp1_recursion_compiler::ir::Config; -use wp1_recursion_compiler::ir::Witness; +use sphinx_recursion_compiler::ir::Config; +use sphinx_recursion_compiler::ir::Witness; /// A witness that can be used to initialize values for witness generation inside Gnark. #[derive(Debug, Clone, Default, Serialize, Deserialize)] diff --git a/recursion/program/Cargo.toml b/recursion/program/Cargo.toml index dcb3885bd..46fe26484 100644 --- a/recursion/program/Cargo.toml +++ b/recursion/program/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-recursion-program" +name = "sphinx-recursion-program" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -21,9 +21,9 @@ p3-baby-bear = { workspace = true } p3-dft = { workspace = true } p3-merkle-tree = { workspace = true } p3-poseidon2 = { workspace = true } -wp1-recursion-core = { path = "../core" } -wp1-recursion-compiler = { path = "../compiler" } -wp1-core = { path = "../../core" } +sphinx-recursion-core = { path = "../core" } +sphinx-recursion-compiler = { path = "../compiler" } +sphinx-core = { path = "../../core" } itertools = { workspace = true } serde = { workspace = true, features = ["derive"] } rand = { workspace = true } diff --git a/recursion/program/Makefile b/recursion/program/Makefile index f10ee4167..46df860dc 100644 --- a/recursion/program/Makefile +++ b/recursion/program/Makefile @@ -5,4 +5,4 @@ fri-sweep: mkdir -p experiments/results && \ RUSTFLAGS='-C target-cpu=native -C target_feature=+avx512ifma,+avx512vl' \ RUST_LOG=info \ - cargo run --package wp1-recursion-program --release --bin fri_sweep \ No newline at end of file + cargo run --package sphinx-recursion-program --release --bin fri_sweep \ No newline at end of file diff --git a/recursion/program/src/challenger.rs b/recursion/program/src/challenger.rs index 43dc5099d..116296d20 100644 --- a/recursion/program/src/challenger.rs +++ b/recursion/program/src/challenger.rs @@ -1,10 +1,12 @@ use p3_field::AbstractField; -use wp1_recursion_compiler::prelude::MemIndex; -use wp1_recursion_compiler::prelude::MemVariable; -use wp1_recursion_compiler::prelude::Ptr; -use wp1_recursion_compiler::prelude::Variable; -use wp1_recursion_compiler::prelude::{Array, Builder, Config, DslVariable, Ext, Felt, Usize, Var}; -use wp1_recursion_core::runtime::{DIGEST_SIZE, PERMUTATION_WIDTH}; +use sphinx_recursion_compiler::prelude::MemIndex; +use sphinx_recursion_compiler::prelude::MemVariable; +use sphinx_recursion_compiler::prelude::Ptr; +use sphinx_recursion_compiler::prelude::Variable; +use sphinx_recursion_compiler::prelude::{ + Array, Builder, Config, DslVariable, Ext, Felt, Usize, Var, +}; +use sphinx_recursion_core::runtime::{DIGEST_SIZE, PERMUTATION_WIDTH}; use crate::fri::types::DigestVariable; use crate::types::VerifyingKeyVariable; @@ -293,16 +295,16 @@ mod tests { use p3_challenger::CanObserve; use p3_challenger::CanSample; use p3_field::AbstractField; - use wp1_core::stark::StarkGenericConfig; - use wp1_core::utils::BabyBearPoseidon2; - use wp1_recursion_compiler::asm::AsmBuilder; - use wp1_recursion_compiler::asm::AsmConfig; - use wp1_recursion_compiler::ir::Felt; - use wp1_recursion_compiler::ir::Usize; - use wp1_recursion_compiler::ir::Var; - use wp1_recursion_core::runtime::PERMUTATION_WIDTH; - use wp1_recursion_core::stark::utils::run_test_recursion; - use wp1_recursion_core::stark::utils::TestConfig; + use sphinx_core::stark::StarkGenericConfig; + use sphinx_core::utils::BabyBearPoseidon2; + use sphinx_recursion_compiler::asm::AsmBuilder; + use sphinx_recursion_compiler::asm::AsmConfig; + use sphinx_recursion_compiler::ir::Felt; + use sphinx_recursion_compiler::ir::Usize; + use sphinx_recursion_compiler::ir::Var; + use sphinx_recursion_core::runtime::PERMUTATION_WIDTH; + use sphinx_recursion_core::stark::utils::run_test_recursion; + use sphinx_recursion_core::stark::utils::TestConfig; use crate::challenger::DuplexChallengerVariable; diff --git a/recursion/program/src/commit.rs b/recursion/program/src/commit.rs index aac8fa071..f5cc4766a 100644 --- a/recursion/program/src/commit.rs +++ b/recursion/program/src/commit.rs @@ -1,5 +1,5 @@ use p3_commit::{LagrangeSelectors, PolynomialSpace}; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Ext, FromConstant, Usize}; +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Ext, FromConstant, Usize}; use crate::fri::types::{FriConfigVariable, TwoAdicPcsRoundVariable}; diff --git a/recursion/program/src/constraints.rs b/recursion/program/src/constraints.rs index 4ffa19336..c8f5d22ca 100644 --- a/recursion/program/src/constraints.rs +++ b/recursion/program/src/constraints.rs @@ -1,11 +1,11 @@ use p3_air::Air; use p3_commit::LagrangeSelectors; use p3_field::{AbstractExtensionField, AbstractField, TwoAdicField}; -use wp1_core::{ +use sphinx_core::{ air::MachineAir, stark::{AirOpenedValues, MachineChip, StarkGenericConfig, PROOF_MAX_NUM_PVS}, }; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::{ ir::{Array, Felt}, prelude::{Builder, Config, Ext, ExtConst, SymbolicExt}, }; @@ -160,8 +160,8 @@ mod tests { use p3_commit::{Pcs, PolynomialSpace}; use p3_field::PrimeField32; use serde::{de::DeserializeOwned, Serialize}; - use wp1_core::{ - io::SP1Stdin, + use sphinx_core::{ + io::SphinxStdin, runtime::Program, stark::{ Chip, Com, Dom, OpeningProof, PcsProverData, RiscvAir, ShardCommitment, ShardMainData, @@ -169,9 +169,9 @@ mod tests { }, utils::BabyBearPoseidon2, }; - use wp1_recursion_core::stark::utils::{run_test_recursion, TestConfig}; + use sphinx_recursion_core::stark::utils::{run_test_recursion, TestConfig}; - use wp1_recursion_compiler::{asm::AsmBuilder, prelude::ExtConst}; + use sphinx_recursion_compiler::{asm::AsmBuilder, prelude::ExtConst}; #[allow(clippy::type_complexity)] fn get_shard_data<'a, SC>( @@ -273,14 +273,15 @@ mod tests { type A = RiscvAir; // Generate a dummy proof. - wp1_core::utils::setup_logger(); + sphinx_core::utils::setup_logger(); let elf = include_bytes!("../../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); let machine = A::machine(SC::default()); let (_, vk) = machine.setup(&Program::from(elf)); let mut challenger = machine.config().challenger(); let (proof, _) = - wp1_core::utils::prove(&Program::from(elf), &SP1Stdin::new(), SC::default()).unwrap(); + sphinx_core::utils::prove(&Program::from(elf), &SphinxStdin::new(), SC::default()) + .unwrap(); machine.verify(&vk, &proof, &mut challenger).unwrap(); println!("Proof generated and verified successfully"); diff --git a/recursion/program/src/fri/domain.rs b/recursion/program/src/fri/domain.rs index 5d4eeb2f3..9982fbf87 100644 --- a/recursion/program/src/fri/domain.rs +++ b/recursion/program/src/fri/domain.rs @@ -1,6 +1,6 @@ use p3_commit::{LagrangeSelectors, TwoAdicMultiplicativeCoset}; use p3_field::{AbstractField, TwoAdicField}; -use wp1_recursion_compiler::prelude::*; +use sphinx_recursion_compiler::prelude::*; use super::types::FriConfigVariable; use crate::commit::PolynomialSpaceVariable; @@ -159,17 +159,17 @@ where #[cfg(test)] pub(crate) mod tests { - use wp1_core::utils::inner_fri_config; - use wp1_recursion_compiler::asm::AsmBuilder; - use wp1_recursion_core::stark::utils::{run_test_recursion, TestConfig}; + use sphinx_core::utils::inner_fri_config; + use sphinx_recursion_compiler::asm::AsmBuilder; + use sphinx_recursion_core::stark::utils::{run_test_recursion, TestConfig}; use crate::utils::const_fri_config; use super::*; use p3_commit::{Pcs, PolynomialSpace}; use rand::{thread_rng, Rng}; - use wp1_core::stark::Dom; - use wp1_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; + use sphinx_core::stark::Dom; + use sphinx_core::{stark::StarkGenericConfig, utils::BabyBearPoseidon2}; pub(crate) fn domain_assertions>( builder: &mut Builder, diff --git a/recursion/program/src/fri/hints.rs b/recursion/program/src/fri/hints.rs index bcb53b1bc..0419c52cb 100644 --- a/recursion/program/src/fri/hints.rs +++ b/recursion/program/src/fri/hints.rs @@ -1,15 +1,15 @@ use p3_field::AbstractExtensionField; use p3_field::AbstractField; -use wp1_core::utils::{ +use sphinx_core::utils::{ InnerBatchOpening, InnerChallenge, InnerCommitPhaseStep, InnerDigest, InnerFriProof, InnerPcsProof, InnerQueryProof, InnerVal, }; -use wp1_recursion_compiler::config::InnerConfig; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::config::InnerConfig; +use sphinx_recursion_compiler::{ asm::AsmConfig, ir::{Array, Builder, Config}, }; -use wp1_recursion_core::{air::Block, runtime::DIGEST_SIZE}; +use sphinx_recursion_core::{air::Block, runtime::DIGEST_SIZE}; use super::types::{BatchOpeningVariable, TwoAdicPcsProofVariable}; use crate::{ diff --git a/recursion/program/src/fri/mod.rs b/recursion/program/src/fri/mod.rs index e9d184538..c3be98d4f 100644 --- a/recursion/program/src/fri/mod.rs +++ b/recursion/program/src/fri/mod.rs @@ -4,23 +4,23 @@ pub mod two_adic_pcs; pub mod types; pub use domain::*; +use sphinx_recursion_compiler::ir::ExtensionOperand; +use sphinx_recursion_compiler::ir::Ptr; +use sphinx_recursion_core::runtime::DIGEST_SIZE; pub use two_adic_pcs::*; -use wp1_recursion_compiler::ir::ExtensionOperand; -use wp1_recursion_compiler::ir::Ptr; -use wp1_recursion_core::runtime::DIGEST_SIZE; use p3_field::AbstractField; use p3_field::Field; use p3_field::TwoAdicField; -use wp1_recursion_compiler::ir::Array; -use wp1_recursion_compiler::ir::Builder; -use wp1_recursion_compiler::ir::Config; -use wp1_recursion_compiler::ir::Ext; -use wp1_recursion_compiler::ir::Felt; -use wp1_recursion_compiler::ir::SymbolicVar; -use wp1_recursion_compiler::ir::Usize; -use wp1_recursion_compiler::ir::Var; +use sphinx_recursion_compiler::ir::Array; +use sphinx_recursion_compiler::ir::Builder; +use sphinx_recursion_compiler::ir::Config; +use sphinx_recursion_compiler::ir::Ext; +use sphinx_recursion_compiler::ir::Felt; +use sphinx_recursion_compiler::ir::SymbolicVar; +use sphinx_recursion_compiler::ir::Usize; +use sphinx_recursion_compiler::ir::Var; use self::types::DigestVariable; use self::types::DimensionsVariable; diff --git a/recursion/program/src/fri/two_adic_pcs.rs b/recursion/program/src/fri/two_adic_pcs.rs index 23816701f..6cc425378 100644 --- a/recursion/program/src/fri/two_adic_pcs.rs +++ b/recursion/program/src/fri/two_adic_pcs.rs @@ -1,8 +1,8 @@ use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::{AbstractField, TwoAdicField}; use p3_symmetric::Hash; -use wp1_recursion_compiler::prelude::*; -use wp1_recursion_core::runtime::DIGEST_SIZE; +use sphinx_recursion_compiler::prelude::*; +use sphinx_recursion_core::runtime::DIGEST_SIZE; use super::{ types::{ @@ -278,25 +278,25 @@ pub mod tests { use p3_field::AbstractField; use p3_matrix::dense::RowMajorMatrix; use rand::rngs::OsRng; - use wp1_core::utils::baby_bear_poseidon2::compressed_fri_config; - use wp1_core::utils::inner_perm; - use wp1_core::utils::InnerChallenge; - use wp1_core::utils::InnerChallenger; - use wp1_core::utils::InnerCompress; - use wp1_core::utils::InnerDft; - use wp1_core::utils::InnerHash; - use wp1_core::utils::InnerPcs; - use wp1_core::utils::InnerPcsProof; - use wp1_core::utils::InnerVal; - use wp1_core::utils::InnerValMmcs; - use wp1_recursion_compiler::config::InnerConfig; - use wp1_recursion_compiler::ir::Array; - use wp1_recursion_compiler::ir::Builder; - use wp1_recursion_compiler::ir::Usize; - use wp1_recursion_compiler::ir::Var; - use wp1_recursion_core::air::Block; - use wp1_recursion_core::runtime::RecursionProgram; - use wp1_recursion_core::runtime::DIGEST_SIZE; + use sphinx_core::utils::baby_bear_poseidon2::compressed_fri_config; + use sphinx_core::utils::inner_perm; + use sphinx_core::utils::InnerChallenge; + use sphinx_core::utils::InnerChallenger; + use sphinx_core::utils::InnerCompress; + use sphinx_core::utils::InnerDft; + use sphinx_core::utils::InnerHash; + use sphinx_core::utils::InnerPcs; + use sphinx_core::utils::InnerPcsProof; + use sphinx_core::utils::InnerVal; + use sphinx_core::utils::InnerValMmcs; + use sphinx_recursion_compiler::config::InnerConfig; + use sphinx_recursion_compiler::ir::Array; + use sphinx_recursion_compiler::ir::Builder; + use sphinx_recursion_compiler::ir::Usize; + use sphinx_recursion_compiler::ir::Var; + use sphinx_recursion_core::air::Block; + use sphinx_recursion_core::runtime::RecursionProgram; + use sphinx_recursion_core::runtime::DIGEST_SIZE; pub fn build_test_fri_with_cols_and_log2_rows( nb_cols: usize, @@ -402,7 +402,7 @@ pub mod tests { #[test] fn test_two_adic_fri_pcs_single_batch() { - use wp1_recursion_core::stark::utils::{run_test_recursion, TestConfig}; + use sphinx_recursion_core::stark::utils::{run_test_recursion, TestConfig}; let (program, witness) = build_test_fri_with_cols_and_log2_rows(10, 16); run_test_recursion(&program, Some(witness), TestConfig::All); } diff --git a/recursion/program/src/fri/types.rs b/recursion/program/src/fri/types.rs index d2d636303..3adec13c1 100644 --- a/recursion/program/src/fri/types.rs +++ b/recursion/program/src/fri/types.rs @@ -1,4 +1,4 @@ -use wp1_recursion_compiler::prelude::*; +use sphinx_recursion_compiler::prelude::*; use crate::fri::TwoAdicMultiplicativeCosetVariable; diff --git a/recursion/program/src/hints.rs b/recursion/program/src/hints.rs index dc3421ca1..e711255f0 100644 --- a/recursion/program/src/hints.rs +++ b/recursion/program/src/hints.rs @@ -3,21 +3,21 @@ use p3_challenger::DuplexChallenger; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::TwoAdicField; use p3_field::{AbstractExtensionField, AbstractField}; -use wp1_core::air::{MachineAir, Word, PV_DIGEST_NUM_WORDS}; -use wp1_core::stark::StarkGenericConfig; -use wp1_core::stark::{ +use sphinx_core::air::{MachineAir, Word, PV_DIGEST_NUM_WORDS}; +use sphinx_core::stark::StarkGenericConfig; +use sphinx_core::stark::{ AirOpenedValues, ChipOpenedValues, Com, RiscvAir, ShardCommitment, ShardOpenedValues, }; -use wp1_core::utils::{ +use sphinx_core::utils::{ BabyBearPoseidon2, InnerChallenge, InnerDigest, InnerDigestHash, InnerPcsProof, InnerPerm, InnerVal, }; -use wp1_recursion_compiler::{ +use sphinx_recursion_compiler::{ config::InnerConfig, ir::{Array, Builder, Config, Ext, Felt, MemVariable, Var}, }; -use wp1_recursion_core::air::Block; -use wp1_recursion_core::runtime::PERMUTATION_WIDTH; +use sphinx_recursion_core::air::Block; +use sphinx_recursion_core::runtime::PERMUTATION_WIDTH; use crate::challenger::DuplexChallengerVariable; use crate::fri::TwoAdicMultiplicativeCosetVariable; @@ -506,9 +506,9 @@ where } impl<'a, A: MachineAir> Hintable - for SP1RecursionMemoryLayout<'a, BabyBearPoseidon2, A> + for SphinxRecursionMemoryLayout<'a, BabyBearPoseidon2, A> { - type HintVariable = SP1RecursionMemoryLayoutVariable; + type HintVariable = SphinxRecursionMemoryLayoutVariable; fn read(builder: &mut Builder) -> Self::HintVariable { let vk = VerifyingKeyHint::<'a, BabyBearPoseidon2, A>::read(builder); @@ -518,7 +518,7 @@ impl<'a, A: MachineAir> Hintable DuplexChallenger::::read(builder); let is_complete = builder.hint_var(); - SP1RecursionMemoryLayoutVariable { + SphinxRecursionMemoryLayoutVariable { vk, shard_proofs, leaf_challenger, @@ -548,8 +548,10 @@ impl<'a, A: MachineAir> Hintable } } -impl<'a, A: MachineAir> Hintable for SP1ReduceMemoryLayout<'a, BabyBearPoseidon2, A> { - type HintVariable = SP1ReduceMemoryLayoutVariable; +impl<'a, A: MachineAir> Hintable + for SphinxReduceMemoryLayout<'a, BabyBearPoseidon2, A> +{ + type HintVariable = SphinxReduceMemoryLayoutVariable; fn read(builder: &mut Builder) -> Self::HintVariable { let compress_vk = VerifyingKeyHint::<'a, BabyBearPoseidon2, A>::read(builder); @@ -557,7 +559,7 @@ impl<'a, A: MachineAir> Hintable for SP1ReduceMemoryLayout<'a, Baby let kinds = Vec::::read(builder); let is_complete = builder.hint_var(); - SP1ReduceMemoryLayoutVariable { + SphinxReduceMemoryLayoutVariable { compress_vk, shard_proofs, kinds, @@ -590,14 +592,14 @@ impl<'a, A: MachineAir> Hintable for SP1ReduceMemoryLayout<'a, Baby } } -impl<'a, A: MachineAir> Hintable for SP1RootMemoryLayout<'a, BabyBearPoseidon2, A> { - type HintVariable = SP1RootMemoryLayoutVariable; +impl<'a, A: MachineAir> Hintable for SphinxRootMemoryLayout<'a, BabyBearPoseidon2, A> { + type HintVariable = SphinxRootMemoryLayoutVariable; fn read(builder: &mut Builder) -> Self::HintVariable { let proof = ShardProofHint::<'a, BabyBearPoseidon2, A>::read(builder); let is_reduce = builder.hint_var(); - SP1RootMemoryLayoutVariable { proof, is_reduce } + SphinxRootMemoryLayoutVariable { proof, is_reduce } } fn write(&self) -> Vec::F>>> { @@ -613,9 +615,9 @@ impl<'a, A: MachineAir> Hintable for SP1RootMemoryLayout<'a, BabyBe } impl<'a, A: MachineAir> Hintable - for SP1DeferredMemoryLayout<'a, BabyBearPoseidon2, A> + for SphinxDeferredMemoryLayout<'a, BabyBearPoseidon2, A> { - type HintVariable = SP1DeferredMemoryLayoutVariable; + type HintVariable = SphinxDeferredMemoryLayoutVariable; fn read(builder: &mut Builder) -> Self::HintVariable { let compress_vk = VerifyingKeyHint::<'a, BabyBearPoseidon2, A>::read(builder); @@ -623,19 +625,19 @@ impl<'a, A: MachineAir> Hintable let start_reconstruct_deferred_digest = Vec::::read(builder); let is_complete = builder.hint_var(); - let wp1_vk = VerifyingKeyHint::<'a, BabyBearPoseidon2, RiscvAir<_>>::read(builder); + let sphinx_vk = VerifyingKeyHint::<'a, BabyBearPoseidon2, RiscvAir<_>>::read(builder); let committed_value_digest = Vec::>::read(builder); let deferred_proofs_digest = Vec::::read(builder); let leaf_challenger = DuplexChallenger::::read(builder); let end_pc = InnerVal::read(builder); let end_shard = InnerVal::read(builder); - SP1DeferredMemoryLayoutVariable { + SphinxDeferredMemoryLayoutVariable { compress_vk, proofs, start_reconstruct_deferred_digest, is_complete, - wp1_vk, + sphinx_vk, committed_value_digest, deferred_proofs_digest, leaf_challenger, @@ -647,8 +649,8 @@ impl<'a, A: MachineAir> Hintable fn write(&self) -> Vec::F>>> { let mut stream = Vec::new(); - let wp1_vk_hint = - VerifyingKeyHint::<'a, BabyBearPoseidon2, _>::new(self.wp1_machine, self.wp1_vk); + let sphinx_vk_hint = + VerifyingKeyHint::<'a, BabyBearPoseidon2, _>::new(self.sphinx_machine, self.sphinx_vk); let compress_vk_hint = VerifyingKeyHint::<'a, BabyBearPoseidon2, _>::new(self.machine, self.compress_vk); @@ -670,7 +672,7 @@ impl<'a, A: MachineAir> Hintable stream.extend(self.start_reconstruct_deferred_digest.write()); stream.extend(usize::from(self.is_complete).write()); - stream.extend(wp1_vk_hint.write()); + stream.extend(sphinx_vk_hint.write()); stream.extend(committed_value_digest.write()); stream.extend(self.deferred_proofs_digest.write()); stream.extend(self.leaf_challenger.write()); diff --git a/recursion/program/src/machine/compress.rs b/recursion/program/src/machine/compress.rs index cad9773df..52d3ddf23 100644 --- a/recursion/program/src/machine/compress.rs +++ b/recursion/program/src/machine/compress.rs @@ -9,18 +9,18 @@ use p3_baby_bear::BabyBear; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::{AbstractField, PrimeField32, TwoAdicField}; use serde::{Deserialize, Serialize}; -use wp1_core::air::MachineAir; -use wp1_core::air::{Word, POSEIDON_NUM_WORDS, PV_DIGEST_NUM_WORDS}; -use wp1_core::stark::StarkMachine; -use wp1_core::stark::{Com, ShardProof, StarkGenericConfig, StarkVerifyingKey}; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::config::InnerConfig; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Felt, Var}; -use wp1_recursion_compiler::prelude::DslVariable; -use wp1_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; -use wp1_recursion_core::runtime::{RecursionProgram, D, DIGEST_SIZE}; - -use wp1_recursion_compiler::prelude::*; +use sphinx_core::air::MachineAir; +use sphinx_core::air::{Word, POSEIDON_NUM_WORDS, PV_DIGEST_NUM_WORDS}; +use sphinx_core::stark::StarkMachine; +use sphinx_core::stark::{Com, ShardProof, StarkGenericConfig, StarkVerifyingKey}; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::config::InnerConfig; +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Felt, Var}; +use sphinx_recursion_compiler::prelude::DslVariable; +use sphinx_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; +use sphinx_recursion_core::runtime::{RecursionProgram, D, DIGEST_SIZE}; + +use sphinx_recursion_compiler::prelude::*; use crate::challenger::{CanObserveVariable, DuplexChallengerVariable}; use crate::fri::TwoAdicFriPcsVariable; @@ -37,7 +37,7 @@ use super::utils::{commit_public_values, proof_data_from_vk, verify_public_value /// A program to verify a batch of recursive proofs and aggregate their public values. #[derive(Debug, Clone, Copy)] -pub struct SP1CompressVerifier { +pub struct SphinxCompressVerifier { _phantom: PhantomData<(C, SC, A)>, } @@ -53,7 +53,7 @@ pub enum ReduceProgramType { } /// An input layout for the reduce verifier. -pub struct SP1ReduceMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> { +pub struct SphinxReduceMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> { pub compress_vk: &'a StarkVerifyingKey, pub recursive_machine: &'a StarkMachine, pub shard_proofs: Vec>, @@ -62,14 +62,14 @@ pub struct SP1ReduceMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir { +pub struct SphinxReduceMemoryLayoutVariable { pub compress_vk: VerifyingKeyVariable, pub shard_proofs: Array>, pub kinds: Array>, pub is_complete: Var, } -impl SP1CompressVerifier +impl SphinxCompressVerifier where A: MachineAir + for<'a> Air>, { @@ -81,13 +81,13 @@ where ) -> RecursionProgram { let mut builder = Builder::::default(); - let input: SP1ReduceMemoryLayoutVariable<_> = builder.uninit(); - SP1ReduceMemoryLayout::::witness(&input, &mut builder); + let input: SphinxReduceMemoryLayoutVariable<_> = builder.uninit(); + SphinxReduceMemoryLayout::::witness(&input, &mut builder); let pcs = TwoAdicFriPcsVariable { config: const_fri_config(&mut builder, machine.config().pcs().fri_config()), }; - SP1CompressVerifier::verify( + SphinxCompressVerifier::verify( &mut builder, &pcs, machine, @@ -100,7 +100,7 @@ where } } -impl SP1CompressVerifier +impl SphinxCompressVerifier where C::F: PrimeField32 + TwoAdicField, SC: StarkGenericConfig< @@ -127,11 +127,11 @@ where builder: &mut Builder, pcs: &TwoAdicFriPcsVariable, machine: &StarkMachine, - input: SP1ReduceMemoryLayoutVariable, + input: SphinxReduceMemoryLayoutVariable, recursive_vk: &StarkVerifyingKey, deferred_vk: &StarkVerifyingKey, ) { - let SP1ReduceMemoryLayoutVariable { + let SphinxReduceMemoryLayoutVariable { compress_vk, shard_proofs, kinds, @@ -159,7 +159,7 @@ where builder.assert_usize_eq(shard_proofs.len(), kinds.len()); // Initialize the consistency check variables. - let wp1_vk_digest: [Felt<_>; DIGEST_SIZE] = array::from_fn(|_| builder.uninit()); + let sphinx_vk_digest: [Felt<_>; DIGEST_SIZE] = array::from_fn(|_| builder.uninit()); let pc: Felt<_> = builder.uninit(); let shard: Felt<_> = builder.uninit(); let mut initial_reconstruct_challenger = DuplexChallengerVariable::new(builder); @@ -273,9 +273,9 @@ where } // Initialize the sp1_vk digest - for (digest, first_digest) in wp1_vk_digest + for (digest, first_digest) in sphinx_vk_digest .iter() - .zip(current_public_values.wp1_vk_digest) + .zip(current_public_values.sphinx_vk_digest) { builder.assign(digest, first_digest); } @@ -358,9 +358,9 @@ where // consistency checks for all accumulated values. // Assert that the sp1_vk digest is always the same. - for (digest, current) in wp1_vk_digest + for (digest, current) in sphinx_vk_digest .iter() - .zip(current_public_values.wp1_vk_digest) + .zip(current_public_values.sphinx_vk_digest) { builder.assert_felt_eq(*digest, current); } @@ -434,7 +434,7 @@ where // Update the global values from the last accumulated values. // Set sp1_vk digest to the one from the proof values. - reduce_public_values.wp1_vk_digest = wp1_vk_digest; + reduce_public_values.sphinx_vk_digest = sphinx_vk_digest; // Set next_pc to be the last pc (which is the same as accumulated pc) reduce_public_values.next_pc = pc; // Set next shard to be the last shard (which is the same as accumulated shard) diff --git a/recursion/program/src/machine/core.rs b/recursion/program/src/machine/core.rs index 0c54148dd..07030c62e 100644 --- a/recursion/program/src/machine/core.rs +++ b/recursion/program/src/machine/core.rs @@ -6,18 +6,18 @@ use itertools::Itertools; use p3_baby_bear::BabyBear; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::{AbstractField, PrimeField32, TwoAdicField}; -use wp1_core::air::{MachineAir, PublicValues}; -use wp1_core::air::{Word, POSEIDON_NUM_WORDS, PV_DIGEST_NUM_WORDS}; -use wp1_core::stark::StarkMachine; -use wp1_core::stark::{Com, RiscvAir, ShardProof, StarkGenericConfig, StarkVerifyingKey}; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::config::InnerConfig; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Ext, ExtConst, Felt, Var}; -use wp1_recursion_compiler::prelude::DslVariable; -use wp1_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; -use wp1_recursion_core::runtime::{RecursionProgram, DIGEST_SIZE}; - -use wp1_recursion_compiler::prelude::*; +use sphinx_core::air::{MachineAir, PublicValues}; +use sphinx_core::air::{Word, POSEIDON_NUM_WORDS, PV_DIGEST_NUM_WORDS}; +use sphinx_core::stark::StarkMachine; +use sphinx_core::stark::{Com, RiscvAir, ShardProof, StarkGenericConfig, StarkVerifyingKey}; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::config::InnerConfig; +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Ext, ExtConst, Felt, Var}; +use sphinx_recursion_compiler::prelude::DslVariable; +use sphinx_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; +use sphinx_recursion_core::runtime::{RecursionProgram, DIGEST_SIZE}; + +use sphinx_recursion_compiler::prelude::*; use crate::challenger::{CanObserveVariable, DuplexChallengerVariable}; use crate::fri::TwoAdicFriPcsVariable; @@ -31,11 +31,11 @@ use super::utils::{assert_complete, commit_public_values}; /// A program for recursively verifying a batch of SP1 proofs. #[derive(Debug, Clone, Copy)] -pub struct SP1RecursiveVerifier { +pub struct SphinxRecursiveVerifier { _phantom: PhantomData<(C, SC)>, } -pub struct SP1RecursionMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> { +pub struct SphinxRecursionMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> { pub vk: &'a StarkVerifyingKey, pub machine: &'a StarkMachine, pub shard_proofs: Vec>, @@ -45,7 +45,7 @@ pub struct SP1RecursionMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir { +pub struct SphinxRecursionMemoryLayoutVariable { pub vk: VerifyingKeyVariable, pub shard_proofs: Array>, @@ -56,26 +56,29 @@ pub struct SP1RecursionMemoryLayoutVariable { pub is_complete: Var, } -impl SP1RecursiveVerifier { +impl SphinxRecursiveVerifier { /// Create a new instance of the program for the [BabyBearPoseidon2] config. pub fn build( machine: &StarkMachine>, ) -> RecursionProgram { let mut builder = Builder::::default(); - let input: SP1RecursionMemoryLayoutVariable<_> = builder.uninit(); - SP1RecursionMemoryLayout::>::witness(&input, &mut builder); + let input: SphinxRecursionMemoryLayoutVariable<_> = builder.uninit(); + SphinxRecursionMemoryLayout::>::witness( + &input, + &mut builder, + ); let pcs = TwoAdicFriPcsVariable { config: const_fri_config(&mut builder, machine.config().pcs().fri_config()), }; - SP1RecursiveVerifier::verify(&mut builder, &pcs, machine, input); + SphinxRecursiveVerifier::verify(&mut builder, &pcs, machine, input); builder.compile_program() } } -impl SP1RecursiveVerifier +impl SphinxRecursiveVerifier where C::F: PrimeField32 + TwoAdicField, SC: StarkGenericConfig< @@ -95,9 +98,9 @@ where builder: &mut Builder, pcs: &TwoAdicFriPcsVariable, machine: &StarkMachine>, - input: SP1RecursionMemoryLayoutVariable, + input: SphinxRecursionMemoryLayoutVariable, ) { - let SP1RecursionMemoryLayoutVariable { + let SphinxRecursionMemoryLayoutVariable { vk, shard_proofs, leaf_challenger, @@ -298,7 +301,7 @@ where recursion_public_values.next_pc = current_pc; recursion_public_values.start_shard = initial_shard; recursion_public_values.next_shard = current_shard; - recursion_public_values.wp1_vk_digest = vk_digest; + recursion_public_values.sphinx_vk_digest = vk_digest; recursion_public_values.leaf_challenger = leaf_challenger_public_values; recursion_public_values.start_reconstruct_challenger = initial_challenger_public_values; recursion_public_values.end_reconstruct_challenger = final_challenger_public_values; diff --git a/recursion/program/src/machine/deferred.rs b/recursion/program/src/machine/deferred.rs index 8bcb2fafa..362bc3d35 100644 --- a/recursion/program/src/machine/deferred.rs +++ b/recursion/program/src/machine/deferred.rs @@ -6,18 +6,18 @@ use p3_air::Air; use p3_baby_bear::BabyBear; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::{AbstractField, PrimeField32, TwoAdicField}; -use wp1_core::air::{MachineAir, WORD_SIZE}; -use wp1_core::air::{Word, POSEIDON_NUM_WORDS, PV_DIGEST_NUM_WORDS}; -use wp1_core::stark::StarkMachine; -use wp1_core::stark::{Com, RiscvAir, ShardProof, StarkGenericConfig, StarkVerifyingKey}; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::config::InnerConfig; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Felt, Var}; -use wp1_recursion_compiler::prelude::DslVariable; -use wp1_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; -use wp1_recursion_core::runtime::{RecursionProgram, DIGEST_SIZE}; - -use wp1_recursion_compiler::prelude::*; +use sphinx_core::air::{MachineAir, WORD_SIZE}; +use sphinx_core::air::{Word, POSEIDON_NUM_WORDS, PV_DIGEST_NUM_WORDS}; +use sphinx_core::stark::StarkMachine; +use sphinx_core::stark::{Com, RiscvAir, ShardProof, StarkGenericConfig, StarkVerifyingKey}; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::config::InnerConfig; +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Felt, Var}; +use sphinx_recursion_compiler::prelude::DslVariable; +use sphinx_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; +use sphinx_recursion_core::runtime::{RecursionProgram, DIGEST_SIZE}; + +use sphinx_recursion_compiler::prelude::*; use crate::challenger::{CanObserveVariable, DuplexChallengerVariable}; use crate::fri::TwoAdicFriPcsVariable; @@ -30,12 +30,12 @@ use crate::utils::{const_fri_config, get_challenger_public_values, hash_vkey, va use super::utils::{commit_public_values, verify_public_values_hash}; #[derive(Debug, Clone, Copy)] -pub struct SP1DeferredVerifier { +pub struct SphinxDeferredVerifier { _phantom: PhantomData<(C, SC, A)>, } /// Inputs that are hinted to the [SP1DeferredVerifier] program. -pub struct SP1DeferredMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> +pub struct SphinxDeferredMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> where SC::Val: PrimeField32, { @@ -47,8 +47,8 @@ where pub is_complete: bool, - pub wp1_vk: &'a StarkVerifyingKey, - pub wp1_machine: &'a StarkMachine>, + pub sphinx_vk: &'a StarkVerifyingKey, + pub sphinx_machine: &'a StarkMachine>, pub committed_value_digest: Vec>, pub deferred_proofs_digest: Vec, pub leaf_challenger: SC::Challenger, @@ -58,7 +58,7 @@ where /// A variable version of the [SP1DeferredMemoryLayout] struct. #[derive(DslVariable, Clone)] -pub struct SP1DeferredMemoryLayoutVariable { +pub struct SphinxDeferredMemoryLayoutVariable { pub compress_vk: VerifyingKeyVariable, pub proofs: Array>, @@ -67,7 +67,7 @@ pub struct SP1DeferredMemoryLayoutVariable { pub is_complete: Var, - pub wp1_vk: VerifyingKeyVariable, + pub sphinx_vk: VerifyingKeyVariable, pub committed_value_digest: Array>>, pub deferred_proofs_digest: Array>, pub leaf_challenger: DuplexChallengerVariable, @@ -75,27 +75,27 @@ pub struct SP1DeferredMemoryLayoutVariable { pub end_shard: Felt, } -impl SP1DeferredVerifier +impl SphinxDeferredVerifier where A: MachineAir + for<'a> Air>, { /// Create a new instance of the program for the [BabyBearPoseidon2] config. pub fn build(machine: &StarkMachine) -> RecursionProgram { let mut builder = Builder::::default(); - let input: SP1DeferredMemoryLayoutVariable<_> = builder.uninit(); - SP1DeferredMemoryLayout::::witness(&input, &mut builder); + let input: SphinxDeferredMemoryLayoutVariable<_> = builder.uninit(); + SphinxDeferredMemoryLayout::::witness(&input, &mut builder); let pcs = TwoAdicFriPcsVariable { config: const_fri_config(&mut builder, machine.config().pcs().fri_config()), }; - SP1DeferredVerifier::verify(&mut builder, &pcs, machine, input); + SphinxDeferredVerifier::verify(&mut builder, &pcs, machine, input); builder.compile_program() } } -impl SP1DeferredVerifier +impl SphinxDeferredVerifier where C::F: PrimeField32 + TwoAdicField, SC: StarkGenericConfig< @@ -119,16 +119,16 @@ where builder: &mut Builder, pcs: &TwoAdicFriPcsVariable, machine: &StarkMachine, - input: SP1DeferredMemoryLayoutVariable, + input: SphinxDeferredMemoryLayoutVariable, ) { // Read the inputs. - let SP1DeferredMemoryLayoutVariable { + let SphinxDeferredMemoryLayoutVariable { compress_vk, proofs, start_reconstruct_deferred_digest, is_complete, - wp1_vk, + sphinx_vk, committed_value_digest, deferred_proofs_digest, leaf_challenger, @@ -231,7 +231,7 @@ where builder.set( &mut poseidon_inputs, j + DIGEST_SIZE, - current_public_values.wp1_vk_digest[j], + current_public_values.sphinx_vk_digest[j], ); } for j in 0..PV_DIGEST_NUM_WORDS { @@ -258,8 +258,9 @@ where deferred_public_values.next_shard = end_shard; // Set the sp1_vk_digest to be the hitned value. - let wp1_vk_digest = hash_vkey(builder, &wp1_vk); - deferred_public_values.wp1_vk_digest = array::from_fn(|i| builder.get(&wp1_vk_digest, i)); + let sphinx_vk_digest = hash_vkey(builder, &sphinx_vk); + deferred_public_values.sphinx_vk_digest = + array::from_fn(|i| builder.get(&sphinx_vk_digest, i)); // Set the committed value digest to be the hitned value. for (i, public_word) in deferred_public_values diff --git a/recursion/program/src/machine/mod.rs b/recursion/program/src/machine/mod.rs index d7d260036..1a1547b98 100644 --- a/recursion/program/src/machine/mod.rs +++ b/recursion/program/src/machine/mod.rs @@ -16,15 +16,15 @@ mod tests { use p3_baby_bear::BabyBear; use p3_challenger::CanObserve; use p3_maybe_rayon::prelude::*; - use wp1_core::stark::{MachineVerificationError, RiscvAir, StarkGenericConfig}; - use wp1_core::utils::BabyBearPoseidon2; - use wp1_core::{ - io::SP1Stdin, + use sphinx_core::stark::{MachineVerificationError, RiscvAir, StarkGenericConfig}; + use sphinx_core::utils::BabyBearPoseidon2; + use sphinx_core::{ + io::SphinxStdin, runtime::Program, stark::{Challenge, LocalProver}, }; - use wp1_recursion_compiler::config::InnerConfig; - use wp1_recursion_core::{ + use sphinx_recursion_compiler::config::InnerConfig; + use sphinx_recursion_core::{ runtime::Runtime, stark::{config::BabyBearPoseidon2Outer, RecursionAir}, }; @@ -41,29 +41,30 @@ mod tests { Wrap, } - fn test_wp1_recursive_machine_verify(program: &Program, batch_size: usize, test: Test) { + fn test_sphinx_recursive_machine_verify(program: &Program, batch_size: usize, test: Test) { type SC = BabyBearPoseidon2; type F = BabyBear; type EF = Challenge; - wp1_core::utils::setup_logger(); + sphinx_core::utils::setup_logger(); let machine = RiscvAir::machine(SC::default()); let (_, vk) = machine.setup(program); // Make the recursion program. - let recursive_program = SP1RecursiveVerifier::::build(&machine); + let recursive_program = SphinxRecursiveVerifier::::build(&machine); let recursive_config = SC::default(); type A = RecursionAir; let recursive_machine = A::machine(recursive_config.clone()); let (rec_pk, rec_vk) = recursive_machine.setup(&recursive_program); // Make the deferred program. - let deferred_program = SP1DeferredVerifier::::build(&recursive_machine); + let deferred_program = + SphinxDeferredVerifier::::build(&recursive_machine); let (_, deferred_vk) = recursive_machine.setup(&deferred_program); // Make the compress program. - let reduce_program = SP1CompressVerifier::::build( + let reduce_program = SphinxCompressVerifier::::build( &recursive_machine, &rec_vk, &deferred_vk, @@ -74,17 +75,18 @@ mod tests { // Make the compress program. let compress_machine = RecursionAir::<_, 9>::machine(SC::compressed()); let compress_program = - SP1RootVerifier::::build(&recursive_machine, &compress_vk, true); + SphinxRootVerifier::::build(&recursive_machine, &compress_vk, true); let (compress_pk, compress_vk) = compress_machine.setup(&compress_program); // Make the wrap program. let wrap_machine = RecursionAir::<_, 5>::machine(BabyBearPoseidon2Outer::default()); let wrap_program = - SP1RootVerifier::::build(&compress_machine, &compress_vk, false); + SphinxRootVerifier::::build(&compress_machine, &compress_vk, false); let mut challenger = machine.config().challenger(); let time = std::time::Instant::now(); - let (proof, _) = wp1_core::utils::prove(program, &SP1Stdin::new(), SC::default()).unwrap(); + let (proof, _) = + sphinx_core::utils::prove(program, &SphinxStdin::new(), SC::default()).unwrap(); machine.verify(&vk, &proof, &mut challenger).unwrap(); tracing::info!("Proof generated successfully"); let elapsed = time.elapsed(); @@ -109,7 +111,7 @@ mod tests { for batch in proof.shard_proofs.chunks(batch_size) { let proofs = batch.to_vec(); - layouts.push(SP1RecursionMemoryLayout { + layouts.push(SphinxRecursionMemoryLayout { vk: &vk, machine: &machine, shard_proofs: proofs, @@ -214,7 +216,7 @@ mod tests { ReduceProgramType::Reduce }; let kinds = batch.iter().map(|_| kind).collect::>(); - let input = SP1ReduceMemoryLayout { + let input = SphinxReduceMemoryLayout { compress_vk: &compress_vk, recursive_machine: &recursive_machine, shard_proofs: batch.to_vec(), @@ -272,7 +274,7 @@ mod tests { let reduce_proof = recursive_proofs.pop().unwrap(); // Make the compress proof. - let input = SP1RootMemoryLayout { + let input = SphinxRootMemoryLayout { machine: &recursive_machine, proof: reduce_proof, is_reduce: true, @@ -321,7 +323,7 @@ mod tests { let (wrap_pk, wrap_vk) = wrap_machine.setup(&wrap_program); let compress_proof = compress_proof.shard_proofs.pop().unwrap(); - let input = SP1RootMemoryLayout { + let input = SphinxRootMemoryLayout { machine: &compress_machine, proof: compress_proof, is_reduce: false, @@ -359,65 +361,65 @@ mod tests { } #[test] - fn test_wp1_recursive_machine_verify_fibonacci() { + fn test_sphinx_recursive_machine_verify_fibonacci() { let elf = include_bytes!("../../../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); - test_wp1_recursive_machine_verify(&Program::from(elf), 1, Test::Recursion) + test_sphinx_recursive_machine_verify(&Program::from(elf), 1, Test::Recursion) } #[test] #[ignore] - fn test_wp1_reduce_machine_verify_fibonacci() { + fn test_sphinx_reduce_machine_verify_fibonacci() { let elf = include_bytes!("../../../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); - test_wp1_recursive_machine_verify(&Program::from(elf), 1, Test::Reduce) + test_sphinx_recursive_machine_verify(&Program::from(elf), 1, Test::Reduce) } #[test] #[ignore] - fn test_wp1_compress_machine_verify_fibonacci() { + fn test_sphinx_compress_machine_verify_fibonacci() { let elf = include_bytes!("../../../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); - test_wp1_recursive_machine_verify(&Program::from(elf), 1, Test::Compress) + test_sphinx_recursive_machine_verify(&Program::from(elf), 1, Test::Compress) } #[test] #[ignore] - fn test_wp1_wrap_machine_verify_fibonacci() { + fn test_sphinx_wrap_machine_verify_fibonacci() { let elf = include_bytes!("../../../../tests/fibonacci/elf/riscv32im-succinct-zkvm-elf"); - test_wp1_recursive_machine_verify(&Program::from(elf), 1, Test::Wrap) + test_sphinx_recursive_machine_verify(&Program::from(elf), 1, Test::Wrap) } #[test] #[ignore] - fn test_wp1_reduce_machine_verify_tendermint() { + fn test_sphinx_reduce_machine_verify_tendermint() { let elf = include_bytes!( "../../../../tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf" ); - test_wp1_recursive_machine_verify(&Program::from(elf), 2, Test::Reduce) + test_sphinx_recursive_machine_verify(&Program::from(elf), 2, Test::Reduce) } #[test] #[ignore] - fn test_wp1_recursive_machine_verify_tendermint() { + fn test_sphinx_recursive_machine_verify_tendermint() { let elf = include_bytes!( "../../../../tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf" ); - test_wp1_recursive_machine_verify(&Program::from(elf), 2, Test::Recursion) + test_sphinx_recursive_machine_verify(&Program::from(elf), 2, Test::Recursion) } #[test] #[ignore] - fn test_wp1_compress_machine_verify_tendermint() { + fn test_sphinx_compress_machine_verify_tendermint() { let elf = include_bytes!( "../../../../tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf" ); - test_wp1_recursive_machine_verify(&Program::from(elf), 2, Test::Compress) + test_sphinx_recursive_machine_verify(&Program::from(elf), 2, Test::Compress) } #[test] #[ignore] - fn test_wp1_wrap_machine_verify_tendermint() { + fn test_sphinx_wrap_machine_verify_tendermint() { let elf = include_bytes!( "../../../../tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf" ); - test_wp1_recursive_machine_verify(&Program::from(elf), 2, Test::Wrap) + test_sphinx_recursive_machine_verify(&Program::from(elf), 2, Test::Wrap) } } diff --git a/recursion/program/src/machine/root.rs b/recursion/program/src/machine/root.rs index 4414e4a24..77fdadf9e 100644 --- a/recursion/program/src/machine/root.rs +++ b/recursion/program/src/machine/root.rs @@ -4,17 +4,17 @@ use p3_air::Air; use p3_baby_bear::BabyBear; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::{AbstractField, PrimeField32, TwoAdicField}; -use wp1_core::air::MachineAir; -use wp1_core::stark::StarkMachine; -use wp1_core::stark::{Com, ShardProof, StarkGenericConfig, StarkVerifyingKey}; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::config::InnerConfig; -use wp1_recursion_compiler::ir::{Builder, Config, Felt, Var}; -use wp1_recursion_compiler::prelude::DslVariable; -use wp1_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; -use wp1_recursion_core::runtime::{RecursionProgram, DIGEST_SIZE}; - -use wp1_recursion_compiler::prelude::*; +use sphinx_core::air::MachineAir; +use sphinx_core::stark::StarkMachine; +use sphinx_core::stark::{Com, ShardProof, StarkGenericConfig, StarkVerifyingKey}; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::config::InnerConfig; +use sphinx_recursion_compiler::ir::{Builder, Config, Felt, Var}; +use sphinx_recursion_compiler::prelude::DslVariable; +use sphinx_recursion_core::air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}; +use sphinx_recursion_core::runtime::{RecursionProgram, DIGEST_SIZE}; + +use sphinx_recursion_compiler::prelude::*; use crate::challenger::{CanObserveVariable, DuplexChallengerVariable}; use crate::fri::TwoAdicFriPcsVariable; @@ -28,23 +28,23 @@ use super::utils::{commit_public_values, verify_public_values_hash}; /// The program that gets a final verifier at the root of the tree. #[derive(Debug, Clone, Copy)] -pub struct SP1RootVerifier { +pub struct SphinxRootVerifier { _phantom: std::marker::PhantomData<(C, SC, A)>, } -pub struct SP1RootMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> { +pub struct SphinxRootMemoryLayout<'a, SC: StarkGenericConfig, A: MachineAir> { pub machine: &'a StarkMachine, pub proof: ShardProof, pub is_reduce: bool, } #[derive(DslVariable, Clone)] -pub struct SP1RootMemoryLayoutVariable { +pub struct SphinxRootMemoryLayoutVariable { pub proof: ShardProofVariable, pub is_reduce: Var, } -impl SP1RootVerifier +impl SphinxRootVerifier where A: MachineAir + for<'a> Air>, { @@ -62,13 +62,13 @@ where config: const_fri_config(&mut builder, machine.config().pcs().fri_config()), }; - SP1RootVerifier::verify(&mut builder, &pcs, machine, vk, &proof, is_compress); + SphinxRootVerifier::verify(&mut builder, &pcs, machine, vk, &proof, is_compress); builder.compile_program() } } -impl SP1RootVerifier +impl SphinxRootVerifier where C::F: PrimeField32 + TwoAdicField, SC: StarkGenericConfig< diff --git a/recursion/program/src/machine/utils.rs b/recursion/program/src/machine/utils.rs index fc26d407a..9b9019262 100644 --- a/recursion/program/src/machine/utils.rs +++ b/recursion/program/src/machine/utils.rs @@ -4,12 +4,12 @@ use itertools::Itertools; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::AbstractField; -use wp1_core::{ +use sphinx_core::{ air::MachineAir, stark::{Com, StarkGenericConfig, StarkMachine, StarkVerifyingKey}, }; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Felt, Var}; -use wp1_recursion_core::{ +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Felt, Var}; +use sphinx_recursion_core::{ air::{RecursionPublicValues, RECURSIVE_PROOF_NUM_PV_ELTS}, runtime::DIGEST_SIZE, }; diff --git a/recursion/program/src/stark.rs b/recursion/program/src/stark.rs index 701d7bfc4..a33e60825 100644 --- a/recursion/program/src/stark.rs +++ b/recursion/program/src/stark.rs @@ -2,24 +2,24 @@ use p3_air::Air; use p3_commit::TwoAdicMultiplicativeCoset; use p3_field::AbstractField; use p3_field::TwoAdicField; -use wp1_core::air::MachineAir; -use wp1_core::stark::Com; -use wp1_core::stark::GenericVerifierConstraintFolder; -use wp1_core::stark::ShardProof; -use wp1_core::stark::StarkGenericConfig; -use wp1_core::stark::StarkMachine; - -use wp1_core::stark::StarkVerifyingKey; -use wp1_recursion_compiler::ir::Array; -use wp1_recursion_compiler::ir::Ext; -use wp1_recursion_compiler::ir::ExtConst; -use wp1_recursion_compiler::ir::SymbolicExt; -use wp1_recursion_compiler::ir::SymbolicVar; -use wp1_recursion_compiler::ir::Var; -use wp1_recursion_compiler::ir::{Builder, Config, Usize}; -use wp1_recursion_compiler::prelude::Felt; - -use wp1_recursion_core::runtime::DIGEST_SIZE; +use sphinx_core::air::MachineAir; +use sphinx_core::stark::Com; +use sphinx_core::stark::GenericVerifierConstraintFolder; +use sphinx_core::stark::ShardProof; +use sphinx_core::stark::StarkGenericConfig; +use sphinx_core::stark::StarkMachine; + +use sphinx_core::stark::StarkVerifyingKey; +use sphinx_recursion_compiler::ir::Array; +use sphinx_recursion_compiler::ir::Ext; +use sphinx_recursion_compiler::ir::ExtConst; +use sphinx_recursion_compiler::ir::SymbolicExt; +use sphinx_recursion_compiler::ir::SymbolicVar; +use sphinx_recursion_compiler::ir::Var; +use sphinx_recursion_compiler::ir::{Builder, Config, Usize}; +use sphinx_recursion_compiler::prelude::Felt; + +use sphinx_recursion_core::runtime::DIGEST_SIZE; use crate::challenger::CanObserveVariable; use crate::challenger::DuplexChallengerVariable; @@ -410,37 +410,37 @@ pub(crate) mod tests { use p3_challenger::{CanObserve, FieldChallenger}; use p3_field::AbstractField; use rand::Rng; - use wp1_core::air::POSEIDON_NUM_WORDS; - use wp1_core::io::SP1Stdin; - use wp1_core::runtime::Program; - use wp1_core::stark::LocalProver; - use wp1_core::utils::setup_logger; - use wp1_core::utils::InnerChallenge; - use wp1_core::utils::InnerVal; - use wp1_core::{ + use sphinx_core::air::POSEIDON_NUM_WORDS; + use sphinx_core::io::SphinxStdin; + use sphinx_core::runtime::Program; + use sphinx_core::stark::LocalProver; + use sphinx_core::utils::setup_logger; + use sphinx_core::utils::InnerChallenge; + use sphinx_core::utils::InnerVal; + use sphinx_core::{ stark::{RiscvAir, StarkGenericConfig}, utils::BabyBearPoseidon2, }; - use wp1_recursion_compiler::config::InnerConfig; - use wp1_recursion_compiler::ir::Array; - use wp1_recursion_compiler::ir::Config; - use wp1_recursion_compiler::ir::Felt; - use wp1_recursion_compiler::prelude::Usize; - use wp1_recursion_compiler::{ + use sphinx_recursion_compiler::config::InnerConfig; + use sphinx_recursion_compiler::ir::Array; + use sphinx_recursion_compiler::ir::Config; + use sphinx_recursion_compiler::ir::Felt; + use sphinx_recursion_compiler::prelude::Usize; + use sphinx_recursion_compiler::{ asm::AsmBuilder, ir::{Builder, ExtConst}, }; - use wp1_recursion_core::runtime::DIGEST_SIZE; + use sphinx_recursion_core::runtime::DIGEST_SIZE; - use wp1_recursion_core::air::RecursionPublicValues; - use wp1_recursion_core::air::RECURSION_PUBLIC_VALUES_COL_MAP; - use wp1_recursion_core::air::RECURSIVE_PROOF_NUM_PV_ELTS; - use wp1_recursion_core::runtime::RecursionProgram; - use wp1_recursion_core::runtime::Runtime; + use sphinx_recursion_core::air::RecursionPublicValues; + use sphinx_recursion_core::air::RECURSION_PUBLIC_VALUES_COL_MAP; + use sphinx_recursion_core::air::RECURSIVE_PROOF_NUM_PV_ELTS; + use sphinx_recursion_core::runtime::RecursionProgram; + use sphinx_recursion_core::runtime::Runtime; - use wp1_recursion_core::stark::utils::run_test_recursion; - use wp1_recursion_core::stark::utils::TestConfig; - use wp1_recursion_core::stark::RecursionAir; + use sphinx_recursion_core::stark::utils::run_test_recursion; + use sphinx_recursion_core::stark::utils::TestConfig; + use sphinx_recursion_core::stark::RecursionAir; type SC = BabyBearPoseidon2; type Challenge = ::Challenge; @@ -459,7 +459,8 @@ pub(crate) mod tests { let (_, vk) = machine.setup(&Program::from(elf)); let mut challenger_val = machine.config().challenger(); let (proof, _) = - wp1_core::utils::prove(&Program::from(elf), &SP1Stdin::new(), SC::default()).unwrap(); + sphinx_core::utils::prove(&Program::from(elf), &SphinxStdin::new(), SC::default()) + .unwrap(); let proofs = proof.shard_proofs; println!("Proof generated successfully"); @@ -524,7 +525,7 @@ pub(crate) mod tests { let public_values: &mut RecursionPublicValues<_> = public_values_stream.as_mut_slice().borrow_mut(); - public_values.wp1_vk_digest = [builder.constant(::F::zero()); DIGEST_SIZE]; + public_values.sphinx_vk_digest = [builder.constant(::F::zero()); DIGEST_SIZE]; public_values.next_pc = builder.constant(::F::one()); public_values.next_shard = builder.constant(::F::two()); public_values.end_reconstruct_deferred_digest = diff --git a/recursion/program/src/types.rs b/recursion/program/src/types.rs index 3dd065d1c..5380c1c74 100644 --- a/recursion/program/src/types.rs +++ b/recursion/program/src/types.rs @@ -1,10 +1,10 @@ use p3_air::BaseAir; use p3_field::{AbstractExtensionField, AbstractField}; -use wp1_core::{ +use sphinx_core::{ air::{MachineAir, Word, PV_DIGEST_NUM_WORDS, WORD_SIZE}, stark::{AirOpenedValues, Chip, ChipOpenedValues}, }; -use wp1_recursion_compiler::prelude::*; +use sphinx_recursion_compiler::prelude::*; use crate::fri::{ types::{DigestVariable, FriConfigVariable, TwoAdicPcsProofVariable}, diff --git a/recursion/program/src/utils.rs b/recursion/program/src/utils.rs index 854ad07bf..f7fa673f1 100644 --- a/recursion/program/src/utils.rs +++ b/recursion/program/src/utils.rs @@ -6,13 +6,13 @@ use p3_fri::FriConfig; use p3_merkle_tree::FieldMerkleTreeMmcs; use p3_poseidon2::{Poseidon2, Poseidon2ExternalMatrixGeneral}; use p3_symmetric::{PaddingFreeSponge, TruncatedPermutation}; -use wp1_core::air::MachineAir; -use wp1_core::stark::{Dom, ShardProof, StarkGenericConfig, StarkMachine, StarkVerifyingKey}; -use wp1_core::utils::BabyBearPoseidon2; -use wp1_recursion_compiler::asm::AsmConfig; -use wp1_recursion_compiler::ir::{Array, Builder, Config, Felt, MemVariable, Var}; -use wp1_recursion_core::air::ChallengerPublicValues; -use wp1_recursion_core::runtime::{DIGEST_SIZE, PERMUTATION_WIDTH}; +use sphinx_core::air::MachineAir; +use sphinx_core::stark::{Dom, ShardProof, StarkGenericConfig, StarkMachine, StarkVerifyingKey}; +use sphinx_core::utils::BabyBearPoseidon2; +use sphinx_recursion_compiler::asm::AsmConfig; +use sphinx_recursion_compiler::ir::{Array, Builder, Config, Felt, MemVariable, Var}; +use sphinx_recursion_core::air::ChallengerPublicValues; +use sphinx_recursion_core::runtime::{DIGEST_SIZE, PERMUTATION_WIDTH}; use crate::challenger::DuplexChallengerVariable; use crate::fri::types::FriConfigVariable; diff --git a/sdk/Cargo.toml b/sdk/Cargo.toml index 238e013e0..d359d75ab 100644 --- a/sdk/Cargo.toml +++ b/sdk/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-sdk" +name = "sphinx-sdk" version = "0.1.0" edition.workspace = true repository.workspace = true @@ -16,8 +16,8 @@ async-trait = { workspace = true } reqwest-middleware = { workspace = true } reqwest = { workspace = true, features = ["default-tls", "trust-dns", "stream"] } anyhow = { workspace = true } -wp1-prover = { path = "../prover" } -wp1-core = { path = "../core" } +sphinx-prover = { path = "../prover" } +sphinx-core = { path = "../core" } futures = { workspace = true } bincode = { workspace = true } tokio = { workspace = true, features = ["full"] } @@ -36,7 +36,7 @@ tempfile = { workspace = true } num-bigint = { workspace = true } [features] -neon = ["wp1-core/neon"] +neon = ["sphinx-core/neon"] [build-dependencies] vergen = { workspace = true, features = ["build", "git", "git2"] } diff --git a/sdk/src/artifacts.rs b/sdk/src/artifacts.rs index 69bd8a6fd..7a91b56dd 100644 --- a/sdk/src/artifacts.rs +++ b/sdk/src/artifacts.rs @@ -4,7 +4,7 @@ use anyhow::{Context, Result}; use futures::StreamExt; use indicatif::{ProgressBar, ProgressStyle}; use reqwest::Client; -pub use wp1_prover::build::{build_groth16_artifacts_with_dummy, try_install_groth16_artifacts}; +pub use sphinx_prover::build::{build_groth16_artifacts_with_dummy, try_install_groth16_artifacts}; /// Exports the soliditiy verifier for Groth16 proofs to the specified output directory. /// @@ -12,8 +12,8 @@ pub use wp1_prover::build::{build_groth16_artifacts_with_dummy, try_install_grot /// already been built. pub fn export_solidity_groth16_verifier(output_dir: impl Into) -> Result<()> { let output_dir: PathBuf = output_dir.into(); - let artifacts_dir = if wp1_prover::build::wp1_dev_mode() { - wp1_prover::build::groth16_artifacts_dev_dir() + let artifacts_dir = if sphinx_prover::build::sphinx_dev_mode() { + sphinx_prover::build::groth16_artifacts_dev_dir() } else { try_install_groth16_artifacts() }; diff --git a/sdk/src/client.rs b/sdk/src/client.rs index 8b3adee17..0594a7070 100644 --- a/sdk/src/client.rs +++ b/sdk/src/client.rs @@ -13,8 +13,8 @@ use futures::future::join_all; use reqwest::{Client as HttpClient, Url}; use reqwest_middleware::ClientWithMiddleware as HttpClientWithMiddleware; use serde::de::DeserializeOwned; +use sphinx_prover::SphinxStdin; use twirp::Client as TwirpClient; -use wp1_prover::SP1Stdin; use crate::proto::network::{ ClaimProofRequest, ClaimProofResponse, CreateProofRequest, FulfillProofRequest, @@ -28,7 +28,7 @@ use crate::proto::network::{ const DEFAULT_PROVER_NETWORK_RPC: &str = "https://rpc.succinct.xyz/"; /// The default SP1 Verifier address on all chains. -const DEFAULT_SP1_VERIFIER_ADDRESS: &str = "0xed2107448519345059eab9cddab42ddc78fbebe9"; +const DEFAULT_SPHINX_VERIFIER_ADDRESS: &str = "0xed2107448519345059eab9cddab42ddc78fbebe9"; pub struct NetworkClient { pub rpc: TwirpClient, @@ -67,9 +67,9 @@ impl NetworkClient { } // Get the address for the SP1 Verifier contract. - pub fn get_wp1_verifier_address() -> [u8; 20] { + pub fn get_sphinx_verifier_address() -> [u8; 20] { let verifier_hex = env::var("SP1_VERIFIER_ADDRESS") - .unwrap_or_else(|_| DEFAULT_SP1_VERIFIER_ADDRESS.to_string()); + .unwrap_or_else(|_| DEFAULT_SPHINX_VERIFIER_ADDRESS.to_string()); let verifier_bytes = hex::decode(verifier_hex.trim_start_matches("0x")) .expect("Invalid SP1_VERIFIER_ADDRESS format"); @@ -173,7 +173,7 @@ impl NetworkClient { pub async fn create_proof( &self, elf: &[u8], - stdin: &SP1Stdin, + stdin: &SphinxStdin, mode: ProofMode, ) -> Result { let start = SystemTime::now(); diff --git a/sdk/src/lib.rs b/sdk/src/lib.rs index 6311bec53..89bd26f30 100644 --- a/sdk/src/lib.rs +++ b/sdk/src/lib.rs @@ -12,7 +12,7 @@ pub mod auth; pub mod client; pub mod provers; pub mod utils { - pub use wp1_core::utils::setup_logger; + pub use sphinx_core::utils::setup_logger; } use std::{env, fmt::Debug, fs::File, path::Path}; @@ -20,10 +20,10 @@ use std::{env, fmt::Debug, fs::File, path::Path}; use anyhow::{Ok, Result}; pub use provers::{LocalProver, MockProver, NetworkProver, Prover}; use serde::{de::DeserializeOwned, Deserialize, Serialize}; -use wp1_core::stark::{MachineVerificationError, ShardProof}; -pub use wp1_prover::{ - types::SP1ProvingKey, types::SP1VerifyingKey, CoreSC, Groth16Proof, InnerSC, OuterSC, - PlonkBn254Proof, SP1Prover, SP1PublicValues, SP1Stdin, +use sphinx_core::stark::{MachineVerificationError, ShardProof}; +pub use sphinx_prover::{ + types::SphinxProvingKey, types::SphinxVerifyingKey, CoreSC, Groth16Proof, InnerSC, OuterSC, + PlonkBn254Proof, SphinxProver, SphinxPublicValues, SphinxStdin, }; /// A client for interacting with SP1. @@ -36,25 +36,25 @@ pub struct ProverClient { #[derive(Debug, Clone, Serialize, Deserialize)] #[serde(bound(serialize = "P: Serialize + Debug + Clone"))] #[serde(bound(deserialize = "P: DeserializeOwned + Debug + Clone"))] -pub struct SP1ProofWithPublicValues

{ +pub struct SphinxProofWithPublicValues

{ pub proof: P, - pub stdin: SP1Stdin, - pub public_values: SP1PublicValues, + pub stdin: SphinxStdin, + pub public_values: SphinxPublicValues, } /// A [SP1ProofWithPublicValues] generated with [ProverClient::prove]. -pub type SP1Proof = SP1ProofWithPublicValues>>; -pub type SP1ProofVerificationError = MachineVerificationError; +pub type SphinxProof = SphinxProofWithPublicValues>>; +pub type SphinxProofVerificationError = MachineVerificationError; /// A [SP1ProofWithPublicValues] generated with [ProverClient::prove_compressed]. -pub type SP1CompressedProof = SP1ProofWithPublicValues>; -pub type SP1CompressedProofVerificationError = MachineVerificationError; +pub type SphinxCompressedProof = SphinxProofWithPublicValues>; +pub type SphinxCompressedProofVerificationError = MachineVerificationError; /// A [SP1ProofWithPublicValues] generated with [ProverClient::prove_groth16]. -pub type SP1Groth16Proof = SP1ProofWithPublicValues; +pub type SphinxGroth16Proof = SphinxProofWithPublicValues; /// A [SP1ProofWithPublicValues] generated with [ProverClient::prove_plonk]. -pub type SP1PlonkProof = SP1ProofWithPublicValues; +pub type SphinxPlonkProof = SphinxProofWithPublicValues; impl ProverClient { /// Creates a new [ProverClient]. @@ -67,7 +67,7 @@ impl ProverClient { /// ### Examples /// /// ```no_run - /// use wp1_sdk::ProverClient; + /// use sphinx_sdk::ProverClient; /// /// std::env::set_var("SP1_PROVER", "local"); /// let client = ProverClient::new(); @@ -101,7 +101,7 @@ impl ProverClient { /// ### Examples /// /// ```no_run - /// use wp1_sdk::ProverClient; + /// use sphinx_sdk::ProverClient; /// /// let client = ProverClient::mock(); /// ``` @@ -119,7 +119,7 @@ impl ProverClient { /// ### Examples /// /// ```no_run - /// use wp1_sdk::ProverClient; + /// use sphinx_sdk::ProverClient; /// /// let client = ProverClient::local(); /// ``` @@ -136,7 +136,7 @@ impl ProverClient { /// ### Examples /// /// ```no_run - /// use wp1_sdk::ProverClient; + /// use sphinx_sdk::ProverClient; /// /// let client = ProverClient::remote(); /// ``` @@ -153,7 +153,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -162,14 +162,14 @@ impl ProverClient { /// let client = ProverClient::new(); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Execute the program on the inputs. /// let public_values = client.execute(elf, &stdin).unwrap(); /// ``` - pub fn execute(&self, elf: &[u8], stdin: &SP1Stdin) -> Result { - Ok(SP1Prover::execute(elf, stdin)?) + pub fn execute(&self, elf: &[u8], stdin: &SphinxStdin) -> Result { + Ok(SphinxProver::execute(elf, stdin)?) } /// Setup a program to be proven and verified by the SP1 RISC-V zkVM by computing the proving @@ -180,15 +180,15 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); /// let client = ProverClient::new(); - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// let (pk, vk) = client.setup(elf); /// ``` - pub fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) { + pub fn setup(&self, elf: &[u8]) -> (SphinxProvingKey, SphinxVerifyingKey) { self.prover.setup(elf) } @@ -200,7 +200,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -212,13 +212,13 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. /// let proof = client.prove(&pk, stdin).unwrap(); /// ``` - pub fn prove(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + pub fn prove(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result { self.prover.prove(pk, stdin) } @@ -229,7 +229,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -241,7 +241,7 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. @@ -249,9 +249,9 @@ impl ProverClient { /// ``` pub fn prove_compressed( &self, - pk: &SP1ProvingKey, - stdin: SP1Stdin, - ) -> Result { + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { self.prover.prove_compressed(pk, stdin) } @@ -262,7 +262,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -274,14 +274,18 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. /// let proof = client.prove_groth16(&pk, stdin).unwrap(); /// ``` /// Generates a groth16 proof, verifiable onchain, of the given elf and stdin. - pub fn prove_groth16(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + pub fn prove_groth16( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { self.prover.prove_groth16(pk, stdin) } @@ -292,7 +296,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -304,13 +308,17 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. /// let proof = client.prove_plonk(&pk, stdin).unwrap(); /// ``` - pub fn prove_plonk(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + pub fn prove_plonk( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { self.prover.prove_plonk(pk, stdin) } @@ -319,21 +327,21 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); /// let client = ProverClient::new(); /// let (pk, vk) = client.setup(elf); - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// let proof = client.prove(&pk, stdin).unwrap(); /// client.verify(&proof, &vk).unwrap(); /// ``` pub fn verify( &self, - proof: &SP1Proof, - vkey: &SP1VerifyingKey, - ) -> Result<(), SP1ProofVerificationError> { + proof: &SphinxProof, + vkey: &SphinxVerifyingKey, + ) -> Result<(), SphinxProofVerificationError> { self.prover.verify(proof, vkey) } @@ -342,7 +350,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -354,7 +362,7 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. @@ -363,8 +371,8 @@ impl ProverClient { /// ``` pub fn verify_compressed( &self, - proof: &SP1CompressedProof, - vkey: &SP1VerifyingKey, + proof: &SphinxCompressedProof, + vkey: &SphinxVerifyingKey, ) -> Result<()> { self.prover.verify_compressed(proof, vkey) } @@ -374,7 +382,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -386,7 +394,7 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. @@ -395,7 +403,11 @@ impl ProverClient { /// // Verify the proof. /// client.verify_groth16(&proof, &vk).unwrap(); /// ``` - pub fn verify_groth16(&self, proof: &SP1Groth16Proof, vkey: &SP1VerifyingKey) -> Result<()> { + pub fn verify_groth16( + &self, + proof: &SphinxGroth16Proof, + vkey: &SphinxVerifyingKey, + ) -> Result<()> { self.prover.verify_groth16(proof, vkey) } @@ -404,7 +416,7 @@ impl ProverClient { /// /// ### Examples /// ```no_run - /// use wp1_sdk::{ProverClient, SP1Stdin}; + /// use sphinx_sdk::{ProverClient, SphinxStdin}; /// /// // Load the program. /// let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); @@ -416,7 +428,7 @@ impl ProverClient { /// let (pk, vk) = client.setup(elf); /// /// // Setup the inputs. - /// let mut stdin = SP1Stdin::new(); + /// let mut stdin = SphinxStdin::new(); /// stdin.write(&10usize); /// /// // Generate the proof. @@ -425,7 +437,7 @@ impl ProverClient { /// // Verify the proof. /// client.verify_plonk(&proof, &vk).unwrap(); /// ``` - pub fn verify_plonk(&self, proof: &SP1PlonkProof, vkey: &SP1VerifyingKey) -> Result<()> { + pub fn verify_plonk(&self, proof: &SphinxPlonkProof, vkey: &SphinxVerifyingKey) -> Result<()> { self.prover.verify_plonk(proof, vkey) } } @@ -436,7 +448,7 @@ impl Default for ProverClient { } } -impl SP1ProofWithPublicValues

{ +impl SphinxProofWithPublicValues

{ /// Saves the proof to a path. pub fn save(&self, path: impl AsRef) -> Result<()> { bincode::serialize_into(File::create(path).expect("failed to open file"), self) @@ -450,7 +462,7 @@ impl SP1ProofWithPublicValues

String { format!("0x{}", self.proof.encoded_proof.clone()) } @@ -459,7 +471,7 @@ impl SP1Groth16Proof { #[cfg(test)] mod tests { - use crate::{utils, ProverClient, SP1Stdin}; + use crate::{utils, ProverClient, SphinxStdin}; #[test] fn test_execute() { @@ -467,7 +479,7 @@ mod tests { let client = ProverClient::local(); let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&10usize); client.execute(elf, &stdin).unwrap(); } @@ -478,7 +490,7 @@ mod tests { utils::setup_logger(); let client = ProverClient::local(); let elf = include_bytes!("../../tests/panic/elf/riscv32im-succinct-zkvm-elf"); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&10usize); client.execute(elf, &stdin).unwrap(); } @@ -490,7 +502,7 @@ mod tests { let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); let (pk, vk) = client.setup(elf); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&10usize); let proof = client.prove(&pk, stdin).unwrap(); client.verify(&proof, &vk).unwrap(); @@ -503,7 +515,7 @@ mod tests { let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); let (pk, vk) = client.setup(elf); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&10usize); let proof = client.prove_groth16(&pk, stdin).unwrap(); client.verify_groth16(&proof, &vk).unwrap(); @@ -516,7 +528,7 @@ mod tests { let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); let (pk, vk) = client.setup(elf); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&10usize); let proof = client.prove(&pk, stdin).unwrap(); client.verify(&proof, &vk).unwrap(); @@ -529,7 +541,7 @@ mod tests { let elf = include_bytes!("../../examples/fibonacci/program/elf/riscv32im-succinct-zkvm-elf"); let (pk, vk) = client.setup(elf); - let mut stdin = SP1Stdin::new(); + let mut stdin = SphinxStdin::new(); stdin.write(&10usize); let proof = client.prove_groth16(&pk, stdin).unwrap(); client.verify_groth16(&proof, &vk).unwrap(); diff --git a/sdk/src/provers/local.rs b/sdk/src/provers/local.rs index 6d1c1a401..3d44cafeb 100644 --- a/sdk/src/provers/local.rs +++ b/sdk/src/provers/local.rs @@ -1,20 +1,20 @@ use anyhow::Result; -use wp1_prover::{SP1Prover, SP1Stdin}; +use sphinx_prover::{SphinxProver, SphinxStdin}; use crate::{ - Prover, SP1CompressedProof, SP1Groth16Proof, SP1PlonkProof, SP1Proof, SP1ProofWithPublicValues, - SP1ProvingKey, SP1VerifyingKey, + Prover, SphinxCompressedProof, SphinxGroth16Proof, SphinxPlonkProof, SphinxProof, + SphinxProofWithPublicValues, SphinxProvingKey, SphinxVerifyingKey, }; /// An implementation of [crate::ProverClient] that can generate end-to-end proofs locally. pub struct LocalProver { - prover: SP1Prover, + prover: SphinxProver, } impl LocalProver { /// Creates a new [LocalProver]. pub fn new() -> Self { - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); Self { prover } } } @@ -24,36 +24,44 @@ impl Prover for LocalProver { "local".to_string() } - fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) { + fn setup(&self, elf: &[u8]) -> (SphinxProvingKey, SphinxVerifyingKey) { self.prover.setup(elf) } - fn wp1_prover(&self) -> &SP1Prover { + fn sphinx_prover(&self) -> &SphinxProver { &self.prover } - fn prove(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result { let proof = self.prover.prove_core(pk, &stdin)?; - Ok(SP1ProofWithPublicValues { + Ok(SphinxProofWithPublicValues { proof: proof.proof.0, stdin: proof.stdin, public_values: proof.public_values, }) } - fn prove_compressed(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove_compressed( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { let proof = self.prover.prove_core(pk, &stdin)?; let deferred_proofs = stdin.proofs.iter().map(|p| p.0.clone()).collect(); let public_values = proof.public_values.clone(); let reduce_proof = self.prover.compress(&pk.vk, proof, deferred_proofs)?; - Ok(SP1CompressedProof { + Ok(SphinxCompressedProof { proof: reduce_proof.proof, stdin, public_values, }) } - fn prove_groth16(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove_groth16( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { let proof = self.prover.prove_core(pk, &stdin)?; let deferred_proofs = stdin.proofs.iter().map(|p| p.0.clone()).collect(); let public_values = proof.public_values.clone(); @@ -61,23 +69,23 @@ impl Prover for LocalProver { let compress_proof = self.prover.shrink(reduce_proof)?; let outer_proof = self.prover.wrap_bn254(compress_proof)?; - let groth16_aritfacts = if wp1_prover::build::wp1_dev_mode() { - wp1_prover::build::try_build_groth16_artifacts_dev( + let groth16_aritfacts = if sphinx_prover::build::sphinx_dev_mode() { + sphinx_prover::build::try_build_groth16_artifacts_dev( &self.prover.wrap_vk, &outer_proof.proof, ) } else { - wp1_prover::build::try_install_groth16_artifacts() + sphinx_prover::build::try_install_groth16_artifacts() }; let proof = self.prover.wrap_groth16(outer_proof, &groth16_aritfacts); - Ok(SP1ProofWithPublicValues { + Ok(SphinxProofWithPublicValues { proof, stdin, public_values, }) } - fn prove_plonk(&self, _pk: &SP1ProvingKey, _stdin: SP1Stdin) -> Result { + fn prove_plonk(&self, _pk: &SphinxProvingKey, _stdin: SphinxStdin) -> Result { // let proof = self.prover.prove_core(pk, &stdin); // let deferred_proofs = stdin.proofs.iter().map(|p| p.0.clone()).collect(); // let public_values = proof.public_values.clone(); diff --git a/sdk/src/provers/mock.rs b/sdk/src/provers/mock.rs index 6f877345c..b52e91a2a 100644 --- a/sdk/src/provers/mock.rs +++ b/sdk/src/provers/mock.rs @@ -1,23 +1,25 @@ #![allow(unused_variables)] use crate::{ - Prover, SP1CompressedProof, SP1Groth16Proof, SP1PlonkProof, SP1Proof, - SP1ProofVerificationError, SP1ProofWithPublicValues, SP1ProvingKey, SP1VerifyingKey, + Prover, SphinxCompressedProof, SphinxGroth16Proof, SphinxPlonkProof, SphinxProof, + SphinxProofVerificationError, SphinxProofWithPublicValues, SphinxProvingKey, + SphinxVerifyingKey, }; use anyhow::Result; use p3_field::PrimeField; -use wp1_prover::{ - types::HashableKey, verify::verify_groth16_public_inputs, Groth16Proof, SP1Prover, SP1Stdin, +use sphinx_prover::{ + types::HashableKey, verify::verify_groth16_public_inputs, Groth16Proof, SphinxProver, + SphinxStdin, }; /// An implementation of [crate::ProverClient] that can generate mock proofs. pub struct MockProver { - pub(crate) prover: SP1Prover, + pub(crate) prover: SphinxProver, } impl MockProver { /// Creates a new [MockProver]. pub fn new() -> Self { - let prover = SP1Prover::new(); + let prover = SphinxProver::new(); Self { prover } } } @@ -27,17 +29,17 @@ impl Prover for MockProver { "mock".to_string() } - fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) { + fn setup(&self, elf: &[u8]) -> (SphinxProvingKey, SphinxVerifyingKey) { self.prover.setup(elf) } - fn wp1_prover(&self) -> &SP1Prover { + fn sphinx_prover(&self) -> &SphinxProver { unimplemented!("MockProver does not support SP1Prover") } - fn prove(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { - let public_values = SP1Prover::execute(&pk.elf, &stdin)?; - Ok(SP1ProofWithPublicValues { + fn prove(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result { + let public_values = SphinxProver::execute(&pk.elf, &stdin)?; + Ok(SphinxProofWithPublicValues { proof: vec![], stdin, public_values, @@ -46,15 +48,19 @@ impl Prover for MockProver { fn prove_compressed( &self, - _pk: &SP1ProvingKey, - _stdin: SP1Stdin, - ) -> Result { + _pk: &SphinxProvingKey, + _stdin: SphinxStdin, + ) -> Result { unimplemented!() } - fn prove_groth16(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { - let public_values = SP1Prover::execute(&pk.elf, &stdin)?; - Ok(SP1Groth16Proof { + fn prove_groth16( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { + let public_values = SphinxProver::execute(&pk.elf, &stdin)?; + Ok(SphinxGroth16Proof { proof: Groth16Proof { public_inputs: [ pk.vk.hash_bn254().as_canonical_biguint().to_string(), @@ -68,32 +74,32 @@ impl Prover for MockProver { }) } - fn prove_plonk(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove_plonk(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result { todo!() } fn verify( &self, - _proof: &SP1Proof, - _vkey: &SP1VerifyingKey, - ) -> Result<(), SP1ProofVerificationError> { + _proof: &SphinxProof, + _vkey: &SphinxVerifyingKey, + ) -> Result<(), SphinxProofVerificationError> { Ok(()) } fn verify_compressed( &self, - _proof: &SP1CompressedProof, - _vkey: &SP1VerifyingKey, + _proof: &SphinxCompressedProof, + _vkey: &SphinxVerifyingKey, ) -> Result<()> { Ok(()) } - fn verify_groth16(&self, proof: &SP1Groth16Proof, vkey: &SP1VerifyingKey) -> Result<()> { + fn verify_groth16(&self, proof: &SphinxGroth16Proof, vkey: &SphinxVerifyingKey) -> Result<()> { verify_groth16_public_inputs(vkey, &proof.public_values, &proof.proof.public_inputs)?; Ok(()) } - fn verify_plonk(&self, _proof: &SP1PlonkProof, _vkey: &SP1VerifyingKey) -> Result<()> { + fn verify_plonk(&self, _proof: &SphinxPlonkProof, _vkey: &SphinxVerifyingKey) -> Result<()> { Ok(()) } } diff --git a/sdk/src/provers/mod.rs b/sdk/src/provers/mod.rs index 30670c3e4..ffd32979b 100644 --- a/sdk/src/provers/mod.rs +++ b/sdk/src/provers/mod.rs @@ -2,55 +2,67 @@ mod local; mod mock; mod network; -use crate::{SP1CompressedProof, SP1Groth16Proof, SP1PlonkProof, SP1Proof}; +use crate::{SphinxCompressedProof, SphinxGroth16Proof, SphinxPlonkProof, SphinxProof}; use anyhow::Result; pub use local::LocalProver; pub use mock::MockProver; pub use network::NetworkProver; -use wp1_core::stark::MachineVerificationError; -use wp1_prover::types::SP1CoreProofData; -use wp1_prover::types::SP1ProvingKey; -use wp1_prover::types::SP1ReduceProof; -use wp1_prover::types::SP1VerifyingKey; -use wp1_prover::CoreSC; -use wp1_prover::SP1Prover; -use wp1_prover::SP1Stdin; +use sphinx_core::stark::MachineVerificationError; +use sphinx_prover::types::SphinxCoreProofData; +use sphinx_prover::types::SphinxProvingKey; +use sphinx_prover::types::SphinxReduceProof; +use sphinx_prover::types::SphinxVerifyingKey; +use sphinx_prover::CoreSC; +use sphinx_prover::SphinxProver; +use sphinx_prover::SphinxStdin; /// An implementation of [crate::ProverClient]. pub trait Prover: Send + Sync { fn id(&self) -> String; - fn wp1_prover(&self) -> &SP1Prover; + fn sphinx_prover(&self) -> &SphinxProver; - fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey); + fn setup(&self, elf: &[u8]) -> (SphinxProvingKey, SphinxVerifyingKey); /// Prove the execution of a RISCV ELF with the given inputs. - fn prove(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result; + fn prove(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result; /// Generate a compressed proof of the execution of a RISCV ELF with the given inputs. - fn prove_compressed(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result; + fn prove_compressed( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result; /// Given an SP1 program and input, generate a Groth16 proof that can be verified on-chain. - fn prove_groth16(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result; + fn prove_groth16( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result; /// Given an SP1 program and input, generate a PLONK proof that can be verified on-chain. - fn prove_plonk(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result; + fn prove_plonk(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result; /// Verify that an SP1 proof is valid given its vkey and metadata. fn verify( &self, - proof: &SP1Proof, - vkey: &SP1VerifyingKey, + proof: &SphinxProof, + vkey: &SphinxVerifyingKey, ) -> Result<(), MachineVerificationError> { - self.wp1_prover() - .verify(&SP1CoreProofData(proof.proof.clone()), vkey) + self.sphinx_prover() + .verify(&SphinxCoreProofData(proof.proof.clone()), vkey) } /// Verify that a compressed SP1 proof is valid given its vkey and metadata. - fn verify_compressed(&self, proof: &SP1CompressedProof, vkey: &SP1VerifyingKey) -> Result<()> { - self.wp1_prover() + fn verify_compressed( + &self, + proof: &SphinxCompressedProof, + vkey: &SphinxVerifyingKey, + ) -> Result<()> { + self.sphinx_prover() .verify_compressed( - &SP1ReduceProof { + &SphinxReduceProof { proof: proof.proof.clone(), }, vkey, @@ -60,21 +72,26 @@ pub trait Prover: Send + Sync { /// Verify that a SP1 Groth16 proof is valid. Verify that the public inputs of the Groth16Proof match /// the hash of the VK and the committed public values of the SP1ProofWithPublicValues. - fn verify_groth16(&self, proof: &SP1Groth16Proof, vkey: &SP1VerifyingKey) -> Result<()> { - let wp1_prover = self.wp1_prover(); + fn verify_groth16(&self, proof: &SphinxGroth16Proof, vkey: &SphinxVerifyingKey) -> Result<()> { + let sphinx_prover = self.sphinx_prover(); - let groth16_aritfacts = if wp1_prover::build::wp1_dev_mode() { - wp1_prover::build::groth16_artifacts_dev_dir() + let groth16_aritfacts = if sphinx_prover::build::sphinx_dev_mode() { + sphinx_prover::build::groth16_artifacts_dev_dir() } else { - wp1_prover::build::groth16_artifacts_dir() + sphinx_prover::build::groth16_artifacts_dir() }; - wp1_prover.verify_groth16(&proof.proof, vkey, &proof.public_values, &groth16_aritfacts)?; + sphinx_prover.verify_groth16( + &proof.proof, + vkey, + &proof.public_values, + &groth16_aritfacts, + )?; Ok(()) } /// Verify that a SP1 PLONK proof is valid given its vkey and metadata. - fn verify_plonk(&self, _proof: &SP1PlonkProof, _vkey: &SP1VerifyingKey) -> Result<()> { + fn verify_plonk(&self, _proof: &SphinxPlonkProof, _vkey: &SphinxVerifyingKey) -> Result<()> { Ok(()) } } diff --git a/sdk/src/provers/network.rs b/sdk/src/provers/network.rs index e5ae7500b..17b750dba 100644 --- a/sdk/src/provers/network.rs +++ b/sdk/src/provers/network.rs @@ -7,14 +7,15 @@ use crate::{ Prover, }; use crate::{ - SP1CompressedProof, SP1Groth16Proof, SP1PlonkProof, SP1Proof, SP1ProvingKey, SP1VerifyingKey, + SphinxCompressedProof, SphinxGroth16Proof, SphinxPlonkProof, SphinxProof, SphinxProvingKey, + SphinxVerifyingKey, }; use anyhow::{Context, Result}; use serde::de::DeserializeOwned; +use sphinx_core::runtime::{Program, Runtime}; +use sphinx_prover::utils::block_on; +use sphinx_prover::{SphinxProver, SphinxStdin}; use tokio::{runtime, time::sleep}; -use wp1_core::runtime::{Program, Runtime}; -use wp1_prover::utils::block_on; -use wp1_prover::{SP1Prover, SP1Stdin}; use super::LocalProver; @@ -39,7 +40,7 @@ impl NetworkProver { pub(crate) async fn prove_async( &self, elf: &[u8], - stdin: SP1Stdin, + stdin: SphinxStdin, mode: ProofMode, ) -> Result

{ let client = &self.client; @@ -98,7 +99,7 @@ impl NetworkProver { rt.block_on(async { let client = &self.client; - let verifier = NetworkClient::get_wp1_verifier_address(); + let verifier = NetworkClient::get_sphinx_verifier_address(); let mut tx_details = Vec::new(); for ((i, callback), callback_data) in @@ -155,27 +156,35 @@ impl Prover for NetworkProver { "remote".to_string() } - fn setup(&self, elf: &[u8]) -> (SP1ProvingKey, SP1VerifyingKey) { + fn setup(&self, elf: &[u8]) -> (SphinxProvingKey, SphinxVerifyingKey) { self.local_prover.setup(elf) } - fn wp1_prover(&self) -> &SP1Prover { - self.local_prover.wp1_prover() + fn sphinx_prover(&self) -> &SphinxProver { + self.local_prover.sphinx_prover() } - fn prove(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result { block_on(self.prove_async(&pk.elf, stdin, ProofMode::Core)) } - fn prove_compressed(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove_compressed( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { block_on(self.prove_async(&pk.elf, stdin, ProofMode::Compressed)) } - fn prove_groth16(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove_groth16( + &self, + pk: &SphinxProvingKey, + stdin: SphinxStdin, + ) -> Result { block_on(self.prove_async(&pk.elf, stdin, ProofMode::Groth16)) } - fn prove_plonk(&self, pk: &SP1ProvingKey, stdin: SP1Stdin) -> Result { + fn prove_plonk(&self, pk: &SphinxProvingKey, stdin: SphinxStdin) -> Result { block_on(self.prove_async(&pk.elf, stdin, ProofMode::Plonk)) } } diff --git a/tests/blake3-compress/Cargo.lock b/tests/blake3-compress/Cargo.lock index 342e6a1ce..348c8aa17 100644 --- a/tests/blake3-compress/Cargo.lock +++ b/tests/blake3-compress/Cargo.lock @@ -45,7 +45,7 @@ dependencies = [ name = "blake3-compress-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/blake3-compress/Cargo.toml b/tests/blake3-compress/Cargo.toml index 88a4e9239..66462a7d3 100644 --- a/tests/blake3-compress/Cargo.toml +++ b/tests/blake3-compress/Cargo.toml @@ -5,4 +5,4 @@ name = "blake3-compress-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file diff --git a/tests/blake3-compress/elf/riscv32im-succinct-zkvm-elf b/tests/blake3-compress/elf/riscv32im-succinct-zkvm-elf index 68ec0c1cf..1b1169189 100755 Binary files a/tests/blake3-compress/elf/riscv32im-succinct-zkvm-elf and b/tests/blake3-compress/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/blake3-compress/src/main.rs b/tests/blake3-compress/src/main.rs index ea7da8405..7ed308992 100644 --- a/tests/blake3-compress/src/main.rs +++ b/tests/blake3-compress/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_blake3_compress_inner(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-fp-add/Cargo.lock b/tests/bls12381-fp-add/Cargo.lock index d8610c304..3ebfbca00 100644 --- a/tests/bls12381-fp-add/Cargo.lock +++ b/tests/bls12381-fp-add/Cargo.lock @@ -62,7 +62,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-fp-add/Cargo.toml b/tests/bls12381-fp-add/Cargo.toml index b95e33bf9..01b4688ed 100644 --- a/tests/bls12381-fp-add/Cargo.toml +++ b/tests/bls12381-fp-add/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-fp-add/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-fp-add/elf/riscv32im-succinct-zkvm-elf index fc382f299..09bffe7d7 100755 Binary files a/tests/bls12381-fp-add/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-fp-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-fp-add/src/main.rs b/tests/bls12381-fp-add/src/main.rs index f5c149cac..fe36f2f28 100644 --- a/tests/bls12381-fp-add/src/main.rs +++ b/tests/bls12381-fp-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_fp_add(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-fp-mul/Cargo.lock b/tests/bls12381-fp-mul/Cargo.lock index 1c4dad9ec..e5450b3b0 100644 --- a/tests/bls12381-fp-mul/Cargo.lock +++ b/tests/bls12381-fp-mul/Cargo.lock @@ -62,7 +62,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-fp-mul/Cargo.toml b/tests/bls12381-fp-mul/Cargo.toml index 44ef7580b..3addf1956 100644 --- a/tests/bls12381-fp-mul/Cargo.toml +++ b/tests/bls12381-fp-mul/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-fp-mul/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-fp-mul/elf/riscv32im-succinct-zkvm-elf index 92c84974b..b376b15a4 100755 Binary files a/tests/bls12381-fp-mul/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-fp-mul/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-fp-mul/src/main.rs b/tests/bls12381-fp-mul/src/main.rs index e353214d0..b0e7d6807 100644 --- a/tests/bls12381-fp-mul/src/main.rs +++ b/tests/bls12381-fp-mul/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_fp_mul(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-fp-sub/Cargo.lock b/tests/bls12381-fp-sub/Cargo.lock index e66fb79d4..b889bac3c 100644 --- a/tests/bls12381-fp-sub/Cargo.lock +++ b/tests/bls12381-fp-sub/Cargo.lock @@ -62,7 +62,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-fp-sub/Cargo.toml b/tests/bls12381-fp-sub/Cargo.toml index e372fb438..04bd8d876 100644 --- a/tests/bls12381-fp-sub/Cargo.toml +++ b/tests/bls12381-fp-sub/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-fp-sub/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-fp-sub/elf/riscv32im-succinct-zkvm-elf index bc3ce9f6e..581d05dac 100755 Binary files a/tests/bls12381-fp-sub/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-fp-sub/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-fp-sub/src/main.rs b/tests/bls12381-fp-sub/src/main.rs index 321d7da79..f0f2e5d4f 100644 --- a/tests/bls12381-fp-sub/src/main.rs +++ b/tests/bls12381-fp-sub/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_fp_sub(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-fp2-add/Cargo.lock b/tests/bls12381-fp2-add/Cargo.lock index 1a69e5881..0063be504 100644 --- a/tests/bls12381-fp2-add/Cargo.lock +++ b/tests/bls12381-fp2-add/Cargo.lock @@ -62,7 +62,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-fp2-add/Cargo.toml b/tests/bls12381-fp2-add/Cargo.toml index 9554c2d47..014d83f8a 100644 --- a/tests/bls12381-fp2-add/Cargo.toml +++ b/tests/bls12381-fp2-add/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-fp2-add/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-fp2-add/elf/riscv32im-succinct-zkvm-elf index 9d9981ee6..a83e2f94c 100755 Binary files a/tests/bls12381-fp2-add/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-fp2-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-fp2-add/src/main.rs b/tests/bls12381-fp2-add/src/main.rs index 0840904f7..9b4c7987a 100644 --- a/tests/bls12381-fp2-add/src/main.rs +++ b/tests/bls12381-fp2-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_fp2_add(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-fp2-mul/Cargo.lock b/tests/bls12381-fp2-mul/Cargo.lock index 764316815..a5157c0e4 100644 --- a/tests/bls12381-fp2-mul/Cargo.lock +++ b/tests/bls12381-fp2-mul/Cargo.lock @@ -62,7 +62,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-fp2-mul/Cargo.toml b/tests/bls12381-fp2-mul/Cargo.toml index c9d8b1c9c..5c6cc2445 100644 --- a/tests/bls12381-fp2-mul/Cargo.toml +++ b/tests/bls12381-fp2-mul/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-fp2-mul/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-fp2-mul/elf/riscv32im-succinct-zkvm-elf index 7f1f611a2..8283ff35b 100755 Binary files a/tests/bls12381-fp2-mul/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-fp2-mul/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-fp2-mul/src/main.rs b/tests/bls12381-fp2-mul/src/main.rs index f8e7d14b4..9b828e181 100644 --- a/tests/bls12381-fp2-mul/src/main.rs +++ b/tests/bls12381-fp2-mul/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_fp2_mul(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-fp2-sub/Cargo.lock b/tests/bls12381-fp2-sub/Cargo.lock index fd64d7ace..dcd87e7fa 100644 --- a/tests/bls12381-fp2-sub/Cargo.lock +++ b/tests/bls12381-fp2-sub/Cargo.lock @@ -62,7 +62,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-fp2-sub/Cargo.toml b/tests/bls12381-fp2-sub/Cargo.toml index 4c2660bf4..46cb8f934 100644 --- a/tests/bls12381-fp2-sub/Cargo.toml +++ b/tests/bls12381-fp2-sub/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-fp2-sub/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-fp2-sub/elf/riscv32im-succinct-zkvm-elf index 66351f1ba..0742f8143 100755 Binary files a/tests/bls12381-fp2-sub/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-fp2-sub/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-fp2-sub/src/main.rs b/tests/bls12381-fp2-sub/src/main.rs index 59474256a..05ef647f3 100644 --- a/tests/bls12381-fp2-sub/src/main.rs +++ b/tests/bls12381-fp2-sub/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_fp2_sub(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-g1-add/Cargo.lock b/tests/bls12381-g1-add/Cargo.lock index 8499fc293..8543a11b1 100644 --- a/tests/bls12381-g1-add/Cargo.lock +++ b/tests/bls12381-g1-add/Cargo.lock @@ -61,7 +61,7 @@ name = "bls12381-add-test" version = "0.1.0" dependencies = [ "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -475,6 +475,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -532,34 +560,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-g1-add/Cargo.toml b/tests/bls12381-g1-add/Cargo.toml index 81a920744..5f2bf8c48 100644 --- a/tests/bls12381-g1-add/Cargo.toml +++ b/tests/bls12381-g1-add/Cargo.toml @@ -5,5 +5,5 @@ name = "bls12381-add-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-g1-add/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-g1-add/elf/riscv32im-succinct-zkvm-elf index 27ed5e38b..46eedcc3c 100755 Binary files a/tests/bls12381-g1-add/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-g1-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-g1-add/src/main.rs b/tests/bls12381-g1-add/src/main.rs index 603e17915..f640cdad8 100644 --- a/tests/bls12381-g1-add/src/main.rs +++ b/tests/bls12381-g1-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_g1_add(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-g1-decompress/Cargo.lock b/tests/bls12381-g1-decompress/Cargo.lock index e531cf9a6..12c2866b0 100644 --- a/tests/bls12381-g1-decompress/Cargo.lock +++ b/tests/bls12381-g1-decompress/Cargo.lock @@ -54,7 +54,7 @@ dependencies = [ name = "bls-decompress-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-g1-decompress/Cargo.toml b/tests/bls12381-g1-decompress/Cargo.toml index a0b7b9b94..1a682e801 100644 --- a/tests/bls12381-g1-decompress/Cargo.toml +++ b/tests/bls12381-g1-decompress/Cargo.toml @@ -5,4 +5,4 @@ name = "bls-decompress-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } diff --git a/tests/bls12381-g1-decompress/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-g1-decompress/elf/riscv32im-succinct-zkvm-elf index d07b8e42e..589262dbd 100755 Binary files a/tests/bls12381-g1-decompress/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-g1-decompress/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-g1-decompress/src/main.rs b/tests/bls12381-g1-decompress/src/main.rs index e248c6572..72cc76694 100644 --- a/tests/bls12381-g1-decompress/src/main.rs +++ b/tests/bls12381-g1-decompress/src/main.rs @@ -1,12 +1,12 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_g1_decompress(p: &mut [u8; 96]); } pub fn main() { - let compressed_key: [u8; 48] = wp1_zkvm::io::read_vec().try_into().unwrap(); + let compressed_key: [u8; 48] = sphinx_zkvm::io::read_vec().try_into().unwrap(); let mut decompressed_key: [u8; 96] = [0u8; 96]; decompressed_key[..48].copy_from_slice(&compressed_key); @@ -17,5 +17,5 @@ pub fn main() { } println!("after: {:?}", decompressed_key); - wp1_zkvm::io::commit_slice(&decompressed_key); + sphinx_zkvm::io::commit_slice(&decompressed_key); } diff --git a/tests/bls12381-g1-double/Cargo.lock b/tests/bls12381-g1-double/Cargo.lock index 0254b52c0..ab9005671 100644 --- a/tests/bls12381-g1-double/Cargo.lock +++ b/tests/bls12381-g1-double/Cargo.lock @@ -61,7 +61,7 @@ name = "bls12381-double-test" version = "0.1.0" dependencies = [ "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -475,6 +475,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -532,34 +560,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-g1-double/Cargo.toml b/tests/bls12381-g1-double/Cargo.toml index 993b64fea..540444d13 100644 --- a/tests/bls12381-g1-double/Cargo.toml +++ b/tests/bls12381-g1-double/Cargo.toml @@ -5,5 +5,5 @@ name = "bls12381-double-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } num = { version = "0.4.1", default-features = false } diff --git a/tests/bls12381-g1-double/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-g1-double/elf/riscv32im-succinct-zkvm-elf index 9f0f9ed61..385a00c46 100755 Binary files a/tests/bls12381-g1-double/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-g1-double/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-g1-double/src/main.rs b/tests/bls12381-g1-double/src/main.rs index 9f0e5e1b6..993b2e312 100644 --- a/tests/bls12381-g1-double/src/main.rs +++ b/tests/bls12381-g1-double/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_g1_double(p: *mut u32); diff --git a/tests/bls12381-g1-scalarmul/Cargo.lock b/tests/bls12381-g1-scalarmul/Cargo.lock index d57a8c175..297f4cec5 100644 --- a/tests/bls12381-g1-scalarmul/Cargo.lock +++ b/tests/bls12381-g1-scalarmul/Cargo.lock @@ -55,8 +55,8 @@ name = "bls12381-mul-test" version = "0.1.0" dependencies = [ "hybrid-array", - "wp1-derive", - "wp1-zkvm", + "sphinx-derive", + "sphinx-zkvm", ] [[package]] @@ -409,6 +409,43 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -477,43 +514,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-g1-scalarmul/Cargo.toml b/tests/bls12381-g1-scalarmul/Cargo.toml index 0e21ad9df..2b61cc321 100644 --- a/tests/bls12381-g1-scalarmul/Cargo.toml +++ b/tests/bls12381-g1-scalarmul/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } -wp1-derive = { path = "../../derive" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-derive = { path = "../../derive" } hybrid-array = "0.2.0-rc" \ No newline at end of file diff --git a/tests/bls12381-g1-scalarmul/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-g1-scalarmul/elf/riscv32im-succinct-zkvm-elf index d3028726d..a016f0af3 100755 Binary files a/tests/bls12381-g1-scalarmul/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-g1-scalarmul/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-g1-scalarmul/src/main.rs b/tests/bls12381-g1-scalarmul/src/main.rs index dfa9781db..5db43b2c5 100644 --- a/tests/bls12381-g1-scalarmul/src/main.rs +++ b/tests/bls12381-g1-scalarmul/src/main.rs @@ -1,11 +1,11 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use hybrid_array::typenum::U24; -use wp1_zkvm::precompiles::bls12_381::Bls12381; -use wp1_zkvm::precompiles::utils::AffinePoint; +use sphinx_zkvm::precompiles::bls12_381::Bls12381; +use sphinx_zkvm::precompiles::utils::AffinePoint; -#[wp1_derive::cycle_tracker] +#[sphinx_derive::cycle_tracker] pub fn main() { // generator. // 3685416753713387016781088315183077757961620795782546409894578378688607592378376318836054947676345821548104185464507 diff --git a/tests/bls12381-g2-add/Cargo.lock b/tests/bls12381-g2-add/Cargo.lock index 87a902597..c5e3e44ea 100644 --- a/tests/bls12381-g2-add/Cargo.lock +++ b/tests/bls12381-g2-add/Cargo.lock @@ -54,7 +54,7 @@ dependencies = [ name = "bls12381-g2-add-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-g2-add/Cargo.toml b/tests/bls12381-g2-add/Cargo.toml index 2ee435c4d..71d73208d 100644 --- a/tests/bls12381-g2-add/Cargo.toml +++ b/tests/bls12381-g2-add/Cargo.toml @@ -5,4 +5,4 @@ name = "bls12381-g2-add-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } diff --git a/tests/bls12381-g2-add/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-g2-add/elf/riscv32im-succinct-zkvm-elf index 7f2ecf0a8..8121e581d 100755 Binary files a/tests/bls12381-g2-add/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-g2-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-g2-add/src/main.rs b/tests/bls12381-g2-add/src/main.rs index 78efeb607..d0a42a32b 100644 --- a/tests/bls12381-g2-add/src/main.rs +++ b/tests/bls12381-g2-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_g2_add(p: *mut u32, q: *const u32); diff --git a/tests/bls12381-g2-double/Cargo.lock b/tests/bls12381-g2-double/Cargo.lock index f557a63a4..c823ce849 100644 --- a/tests/bls12381-g2-double/Cargo.lock +++ b/tests/bls12381-g2-double/Cargo.lock @@ -54,7 +54,7 @@ dependencies = [ name = "bls12381-g2-double-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bls12381-g2-double/Cargo.toml b/tests/bls12381-g2-double/Cargo.toml index 5fd6a35e2..f085cf3f9 100644 --- a/tests/bls12381-g2-double/Cargo.toml +++ b/tests/bls12381-g2-double/Cargo.toml @@ -5,4 +5,4 @@ name = "bls12381-g2-double-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } diff --git a/tests/bls12381-g2-double/elf/riscv32im-succinct-zkvm-elf b/tests/bls12381-g2-double/elf/riscv32im-succinct-zkvm-elf index 667d71659..026fea03a 100755 Binary files a/tests/bls12381-g2-double/elf/riscv32im-succinct-zkvm-elf and b/tests/bls12381-g2-double/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bls12381-g2-double/src/main.rs b/tests/bls12381-g2-double/src/main.rs index d262cdbaf..a8dbcde5b 100644 --- a/tests/bls12381-g2-double/src/main.rs +++ b/tests/bls12381-g2-double/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bls12381_g2_double(p: *mut u32); diff --git a/tests/bn254-add/Cargo.lock b/tests/bn254-add/Cargo.lock index 491b64e77..1eea7cae3 100644 --- a/tests/bn254-add/Cargo.lock +++ b/tests/bn254-add/Cargo.lock @@ -75,7 +75,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bn254-add/Cargo.toml b/tests/bn254-add/Cargo.toml index 4a8d21197..aacab6bfd 100644 --- a/tests/bn254-add/Cargo.toml +++ b/tests/bn254-add/Cargo.toml @@ -5,6 +5,6 @@ name = "bn254-add-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } \ No newline at end of file diff --git a/tests/bn254-add/elf/riscv32im-succinct-zkvm-elf b/tests/bn254-add/elf/riscv32im-succinct-zkvm-elf index ce9e68273..4bd4ada4e 100755 Binary files a/tests/bn254-add/elf/riscv32im-succinct-zkvm-elf and b/tests/bn254-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bn254-add/src/main.rs b/tests/bn254-add/src/main.rs index 3c62098fe..e1a051d23 100644 --- a/tests/bn254-add/src/main.rs +++ b/tests/bn254-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bn254_add(p: *mut u32, q: *const u32); diff --git a/tests/bn254-double/Cargo.lock b/tests/bn254-double/Cargo.lock index 8256dd97e..7b1163276 100644 --- a/tests/bn254-double/Cargo.lock +++ b/tests/bn254-double/Cargo.lock @@ -75,7 +75,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bn254-double/Cargo.toml b/tests/bn254-double/Cargo.toml index 9bf400a41..eb461c03e 100644 --- a/tests/bn254-double/Cargo.toml +++ b/tests/bn254-double/Cargo.toml @@ -5,6 +5,6 @@ name = "bn254-double-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } \ No newline at end of file diff --git a/tests/bn254-double/elf/riscv32im-succinct-zkvm-elf b/tests/bn254-double/elf/riscv32im-succinct-zkvm-elf index 68b406ffb..4e463f12f 100755 Binary files a/tests/bn254-double/elf/riscv32im-succinct-zkvm-elf and b/tests/bn254-double/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bn254-double/src/main.rs b/tests/bn254-double/src/main.rs index 4e7df5a35..b560de643 100644 --- a/tests/bn254-double/src/main.rs +++ b/tests/bn254-double/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_bn254_double(p: *mut u32); diff --git a/tests/bn254-mul/Cargo.lock b/tests/bn254-mul/Cargo.lock index 583e834c1..3911a59f9 100644 --- a/tests/bn254-mul/Cargo.lock +++ b/tests/bn254-mul/Cargo.lock @@ -67,8 +67,8 @@ dependencies = [ name = "bn254-mul-test" version = "0.1.0" dependencies = [ - "wp1-derive", - "wp1-zkvm", + "sphinx-derive", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,43 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -476,43 +513,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/bn254-mul/Cargo.toml b/tests/bn254-mul/Cargo.toml index e7f46cae8..e8b654723 100644 --- a/tests/bn254-mul/Cargo.toml +++ b/tests/bn254-mul/Cargo.toml @@ -5,5 +5,5 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } -wp1-derive = { path = "../../derive" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-derive = { path = "../../derive" } \ No newline at end of file diff --git a/tests/bn254-mul/elf/riscv32im-succinct-zkvm-elf b/tests/bn254-mul/elf/riscv32im-succinct-zkvm-elf index 02db0d121..71749d6df 100755 Binary files a/tests/bn254-mul/elf/riscv32im-succinct-zkvm-elf and b/tests/bn254-mul/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/bn254-mul/src/main.rs b/tests/bn254-mul/src/main.rs index 4e3753613..f46ec0f7f 100644 --- a/tests/bn254-mul/src/main.rs +++ b/tests/bn254-mul/src/main.rs @@ -1,10 +1,10 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); -use wp1_zkvm::precompiles::bn254::Bn254; -use wp1_zkvm::precompiles::utils::AffinePoint; +use sphinx_zkvm::precompiles::bn254::Bn254; +use sphinx_zkvm::precompiles::utils::AffinePoint; -#[wp1_derive::cycle_tracker] +#[sphinx_derive::cycle_tracker] pub fn main() { // generator. // 1 diff --git a/tests/cycle-tracker/Cargo.lock b/tests/cycle-tracker/Cargo.lock index fbfeb4ad8..f8f06fc32 100644 --- a/tests/cycle-tracker/Cargo.lock +++ b/tests/cycle-tracker/Cargo.lock @@ -110,8 +110,8 @@ dependencies = [ name = "cycle-tracker-test" version = "0.1.0" dependencies = [ - "wp1-derive", - "wp1-zkvm", + "sphinx-derive", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,43 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -476,43 +513,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/cycle-tracker/Cargo.toml b/tests/cycle-tracker/Cargo.toml index 3f285b92e..2aeed3c9e 100644 --- a/tests/cycle-tracker/Cargo.toml +++ b/tests/cycle-tracker/Cargo.toml @@ -5,5 +5,5 @@ name = "cycle-tracker-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } -wp1-derive = { path = "../../derive" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-derive = { path = "../../derive" } \ No newline at end of file diff --git a/tests/cycle-tracker/elf/riscv32im-succinct-zkvm-elf b/tests/cycle-tracker/elf/riscv32im-succinct-zkvm-elf index 5a019cce1..df10392e6 100755 Binary files a/tests/cycle-tracker/elf/riscv32im-succinct-zkvm-elf and b/tests/cycle-tracker/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/cycle-tracker/src/main.rs b/tests/cycle-tracker/src/main.rs index 7858d9ee3..9bc6d8504 100644 --- a/tests/cycle-tracker/src/main.rs +++ b/tests/cycle-tracker/src/main.rs @@ -1,9 +1,9 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use std::hint::black_box; -#[wp1_derive::cycle_tracker] +#[sphinx_derive::cycle_tracker] pub fn f(x: usize) -> usize { x + 1 } diff --git a/tests/ecrecover/Cargo.lock b/tests/ecrecover/Cargo.lock index be183cc45..3fae29230 100644 --- a/tests/ecrecover/Cargo.lock +++ b/tests/ecrecover/Cargo.lock @@ -155,7 +155,7 @@ dependencies = [ "hex-literal", "k256", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -483,6 +483,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -540,34 +568,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/ecrecover/Cargo.toml b/tests/ecrecover/Cargo.toml index 043194de6..fa0318531 100644 --- a/tests/ecrecover/Cargo.toml +++ b/tests/ecrecover/Cargo.toml @@ -5,7 +5,7 @@ name = "ecrecover-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } k256 = { version = "0.13.3", features = ["ecdsa"] } diff --git a/tests/ecrecover/elf/riscv32im-succinct-zkvm-elf b/tests/ecrecover/elf/riscv32im-succinct-zkvm-elf index cfc9d8c24..aa3832c74 100755 Binary files a/tests/ecrecover/elf/riscv32im-succinct-zkvm-elf and b/tests/ecrecover/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/ecrecover/src/main.rs b/tests/ecrecover/src/main.rs index beaeed888..511eb0d2b 100644 --- a/tests/ecrecover/src/main.rs +++ b/tests/ecrecover/src/main.rs @@ -1,9 +1,9 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use hex_literal::hex; -use wp1_zkvm::precompiles::io; -use wp1_zkvm::precompiles::secp256k1::ecrecover; +use sphinx_zkvm::precompiles::io; +use sphinx_zkvm::precompiles::secp256k1::ecrecover; pub fn main() { // recovery param: 1 diff --git a/tests/ed-add/Cargo.lock b/tests/ed-add/Cargo.lock index 519595969..55031a9e2 100644 --- a/tests/ed-add/Cargo.lock +++ b/tests/ed-add/Cargo.lock @@ -154,7 +154,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/ed-add/Cargo.toml b/tests/ed-add/Cargo.toml index 0f9ba07de..7fd25c66d 100644 --- a/tests/ed-add/Cargo.toml +++ b/tests/ed-add/Cargo.toml @@ -5,6 +5,6 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } \ No newline at end of file diff --git a/tests/ed-add/elf/riscv32im-succinct-zkvm-elf b/tests/ed-add/elf/riscv32im-succinct-zkvm-elf index 12342ab91..312d2aab9 100755 Binary files a/tests/ed-add/elf/riscv32im-succinct-zkvm-elf and b/tests/ed-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/ed-add/src/main.rs b/tests/ed-add/src/main.rs index eca130083..fe186d7b9 100644 --- a/tests/ed-add/src/main.rs +++ b/tests/ed-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_ed_add(p: *mut u32, q: *const u32); diff --git a/tests/ed-decompress/Cargo.lock b/tests/ed-decompress/Cargo.lock index c79517098..d266c3c3f 100644 --- a/tests/ed-decompress/Cargo.lock +++ b/tests/ed-decompress/Cargo.lock @@ -147,7 +147,7 @@ name = "ed-decompress-test" version = "0.1.0" dependencies = [ "hex-literal", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -414,6 +414,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -471,34 +499,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/ed-decompress/Cargo.toml b/tests/ed-decompress/Cargo.toml index e819cb2fe..9d26a1931 100644 --- a/tests/ed-decompress/Cargo.toml +++ b/tests/ed-decompress/Cargo.toml @@ -5,5 +5,5 @@ name = "ed-decompress-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" \ No newline at end of file diff --git a/tests/ed-decompress/elf/riscv32im-succinct-zkvm-elf b/tests/ed-decompress/elf/riscv32im-succinct-zkvm-elf index ca9942646..bd982965d 100755 Binary files a/tests/ed-decompress/elf/riscv32im-succinct-zkvm-elf and b/tests/ed-decompress/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/ed-decompress/src/main.rs b/tests/ed-decompress/src/main.rs index 360f30cc6..1fecf9f3b 100644 --- a/tests/ed-decompress/src/main.rs +++ b/tests/ed-decompress/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use hex_literal::hex; diff --git a/tests/ed25519/Cargo.lock b/tests/ed25519/Cargo.lock index 0620184ae..d4aefdef0 100644 --- a/tests/ed25519/Cargo.lock +++ b/tests/ed25519/Cargo.lock @@ -197,7 +197,7 @@ version = "0.1.0" dependencies = [ "ed25519-dalek", "hex-literal", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -491,6 +491,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -548,34 +576,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/ed25519/Cargo.toml b/tests/ed25519/Cargo.toml index f57ed8f6d..71f78a87b 100644 --- a/tests/ed25519/Cargo.toml +++ b/tests/ed25519/Cargo.toml @@ -5,7 +5,7 @@ name = "ed25519-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } ed25519-dalek = { git = "https://github.com/sp1-patches/curve25519-dalek", branch = "patch-v4.1.1" } hex-literal = "0.4.1" diff --git a/tests/ed25519/elf/riscv32im-succinct-zkvm-elf b/tests/ed25519/elf/riscv32im-succinct-zkvm-elf index 061356009..08f9f3bdd 100755 Binary files a/tests/ed25519/elf/riscv32im-succinct-zkvm-elf and b/tests/ed25519/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/ed25519/src/main.rs b/tests/ed25519/src/main.rs index af8c52173..0fb748fa7 100644 --- a/tests/ed25519/src/main.rs +++ b/tests/ed25519/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use ed25519_dalek::*; use hex_literal::hex; diff --git a/tests/fibonacci/Cargo.lock b/tests/fibonacci/Cargo.lock index 1f463d099..db81e46e1 100644 --- a/tests/fibonacci/Cargo.lock +++ b/tests/fibonacci/Cargo.lock @@ -177,7 +177,7 @@ dependencies = [ name = "fibonacci-program-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/fibonacci/Cargo.toml b/tests/fibonacci/Cargo.toml index 10bd350ca..53cd4cc43 100644 --- a/tests/fibonacci/Cargo.toml +++ b/tests/fibonacci/Cargo.toml @@ -5,4 +5,4 @@ name = "fibonacci-program-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } diff --git a/tests/fibonacci/elf/riscv32im-succinct-zkvm-elf b/tests/fibonacci/elf/riscv32im-succinct-zkvm-elf index ba5b4deeb..faa9f8595 100755 Binary files a/tests/fibonacci/elf/riscv32im-succinct-zkvm-elf and b/tests/fibonacci/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/fibonacci/src/main.rs b/tests/fibonacci/src/main.rs index 83ee069c2..c3b620c6e 100644 --- a/tests/fibonacci/src/main.rs +++ b/tests/fibonacci/src/main.rs @@ -6,7 +6,7 @@ // Under the hood, we wrap your main function with some extra code so that it behaves properly // inside the zkVM. #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); pub fn main() { // Read an input to the program. @@ -23,6 +23,6 @@ pub fn main() { a = b; b = c; } - wp1_zkvm::io::commit(&a); - wp1_zkvm::io::commit(&b); + sphinx_zkvm::io::commit(&a); + sphinx_zkvm::io::commit(&b); } diff --git a/tests/hint-io/Cargo.lock b/tests/hint-io/Cargo.lock index 62dbae6a3..949a52bbb 100644 --- a/tests/hint-io/Cargo.lock +++ b/tests/hint-io/Cargo.lock @@ -216,7 +216,7 @@ dependencies = [ name = "hint-io-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/hint-io/Cargo.toml b/tests/hint-io/Cargo.toml index 72d6c1eef..fbbf2c49f 100644 --- a/tests/hint-io/Cargo.toml +++ b/tests/hint-io/Cargo.toml @@ -5,4 +5,4 @@ name = "hint-io-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } diff --git a/tests/hint-io/elf/riscv32im-succinct-zkvm-elf b/tests/hint-io/elf/riscv32im-succinct-zkvm-elf index 20aa870b5..0613af35a 100755 Binary files a/tests/hint-io/elf/riscv32im-succinct-zkvm-elf and b/tests/hint-io/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/hint-io/src/main.rs b/tests/hint-io/src/main.rs index ca26cb53b..8fabd2592 100644 --- a/tests/hint-io/src/main.rs +++ b/tests/hint-io/src/main.rs @@ -1,18 +1,18 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); pub fn main() { let x = Box::new([1u8; 1023]); println!("x[0..20] = {:?}", &x[0..20]); println!("x ptr: {:p}", &x as *const _); drop(x); - let a = wp1_zkvm::io::read::>(); + let a = sphinx_zkvm::io::read::>(); println!("a[0..20] = {:?}", &a[0..20]); println!("a ptr: {:p}", &a as *const _); println!("a.len() = {}", a.len()); let y = Box::new([2u8; 5]); println!("y = {:?}", y); - let b = wp1_zkvm::io::read_vec(); + let b = sphinx_zkvm::io::read_vec(); println!("b[0..20] = {:?}", &b[0..20]); println!("b ptr: {:p}", b.as_ptr()); diff --git a/tests/keccak-permute/Cargo.lock b/tests/keccak-permute/Cargo.lock index 11f4e7361..b37d7e70a 100644 --- a/tests/keccak-permute/Cargo.lock +++ b/tests/keccak-permute/Cargo.lock @@ -248,7 +248,7 @@ dependencies = [ name = "keccak-permute-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/keccak-permute/Cargo.toml b/tests/keccak-permute/Cargo.toml index 4ebe5700a..39d8c5057 100644 --- a/tests/keccak-permute/Cargo.toml +++ b/tests/keccak-permute/Cargo.toml @@ -5,4 +5,4 @@ name = "keccak-permute-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file diff --git a/tests/keccak-permute/elf/riscv32im-succinct-zkvm-elf b/tests/keccak-permute/elf/riscv32im-succinct-zkvm-elf index 2fd217fd4..d99ef7e13 100755 Binary files a/tests/keccak-permute/elf/riscv32im-succinct-zkvm-elf and b/tests/keccak-permute/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/keccak-permute/src/main.rs b/tests/keccak-permute/src/main.rs index 141bcf7dd..e954660da 100644 --- a/tests/keccak-permute/src/main.rs +++ b/tests/keccak-permute/src/main.rs @@ -1,7 +1,7 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); -use wp1_zkvm::syscalls::syscall_keccak_permute; +use sphinx_zkvm::syscalls::syscall_keccak_permute; pub fn main() { for _ in 0..25 { diff --git a/tests/keccak256/Cargo.lock b/tests/keccak256/Cargo.lock index 2ece5e197..0f843e86b 100644 --- a/tests/keccak256/Cargo.lock +++ b/tests/keccak256/Cargo.lock @@ -254,8 +254,8 @@ dependencies = [ name = "keccak256-test" version = "0.1.0" dependencies = [ + "sphinx-zkvm", "tiny-keccak", - "wp1-zkvm", ] [[package]] @@ -414,6 +414,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -480,34 +508,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/keccak256/Cargo.toml b/tests/keccak256/Cargo.toml index 4d5e2688f..4168b978c 100644 --- a/tests/keccak256/Cargo.toml +++ b/tests/keccak256/Cargo.toml @@ -5,5 +5,5 @@ name = "keccak256-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } tiny-keccak = { git = "https://github.com/sp1-patches/tiny-keccak", branch="patch-v2.0.2", features = ["keccak"] } diff --git a/tests/keccak256/elf/riscv32im-succinct-zkvm-elf b/tests/keccak256/elf/riscv32im-succinct-zkvm-elf index 7d036b7cc..c1488d540 100755 Binary files a/tests/keccak256/elf/riscv32im-succinct-zkvm-elf and b/tests/keccak256/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/keccak256/src/main.rs b/tests/keccak256/src/main.rs index b93549272..734223166 100644 --- a/tests/keccak256/src/main.rs +++ b/tests/keccak256/src/main.rs @@ -1,16 +1,16 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use tiny_keccak::{Hasher, Keccak}; pub fn main() { - let num_cases = wp1_zkvm::io::read::(); + let num_cases = sphinx_zkvm::io::read::(); for _ in 0..num_cases { - let input = wp1_zkvm::io::read::>(); + let input = sphinx_zkvm::io::read::>(); let mut hasher = Keccak::v256(); hasher.update(&input); let mut output = [0u8; 32]; hasher.finalize(&mut output); - wp1_zkvm::io::commit(&output); + sphinx_zkvm::io::commit(&output); } } diff --git a/tests/panic/Cargo.lock b/tests/panic/Cargo.lock index 9eee5fc4f..b7ab5b596 100644 --- a/tests/panic/Cargo.lock +++ b/tests/panic/Cargo.lock @@ -269,8 +269,8 @@ dependencies = [ name = "panic-test" version = "0.1.0" dependencies = [ - "wp1-derive", - "wp1-zkvm", + "sphinx-derive", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,43 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -476,43 +513,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/panic/Cargo.toml b/tests/panic/Cargo.toml index f99c9ff4e..b58613a23 100644 --- a/tests/panic/Cargo.toml +++ b/tests/panic/Cargo.toml @@ -5,5 +5,5 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } -wp1-derive = { path = "../../derive" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-derive = { path = "../../derive" } diff --git a/tests/panic/elf/riscv32im-succinct-zkvm-elf b/tests/panic/elf/riscv32im-succinct-zkvm-elf index 1d182327e..22bd17bce 100755 Binary files a/tests/panic/elf/riscv32im-succinct-zkvm-elf and b/tests/panic/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/panic/src/main.rs b/tests/panic/src/main.rs index afb42d4a2..43e904f4c 100644 --- a/tests/panic/src/main.rs +++ b/tests/panic/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); pub fn main() { assert_eq!(0, 1); diff --git a/tests/secp256k1-add/Cargo.lock b/tests/secp256k1-add/Cargo.lock index d8988023b..da4d822ca 100644 --- a/tests/secp256k1-add/Cargo.lock +++ b/tests/secp256k1-add/Cargo.lock @@ -438,7 +438,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/secp256k1-add/Cargo.toml b/tests/secp256k1-add/Cargo.toml index 6a90a46be..ce09c3a00 100644 --- a/tests/secp256k1-add/Cargo.toml +++ b/tests/secp256k1-add/Cargo.toml @@ -5,6 +5,6 @@ name = "secp256k1-add-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } \ No newline at end of file diff --git a/tests/secp256k1-add/elf/riscv32im-succinct-zkvm-elf b/tests/secp256k1-add/elf/riscv32im-succinct-zkvm-elf index 05bc6242d..7f1bc06f2 100755 Binary files a/tests/secp256k1-add/elf/riscv32im-succinct-zkvm-elf and b/tests/secp256k1-add/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/secp256k1-add/src/main.rs b/tests/secp256k1-add/src/main.rs index 0dfcd0b57..d13e90a8a 100644 --- a/tests/secp256k1-add/src/main.rs +++ b/tests/secp256k1-add/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_secp256k1_add(p: *mut u32, q: *const u32); diff --git a/tests/secp256k1-decompress/Cargo.lock b/tests/secp256k1-decompress/Cargo.lock index d6fc12821..3fc4440a6 100644 --- a/tests/secp256k1-decompress/Cargo.lock +++ b/tests/secp256k1-decompress/Cargo.lock @@ -363,7 +363,7 @@ dependencies = [ name = "secp256k1-decompress-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/secp256k1-decompress/Cargo.toml b/tests/secp256k1-decompress/Cargo.toml index 7900d481d..37e25ed5b 100644 --- a/tests/secp256k1-decompress/Cargo.toml +++ b/tests/secp256k1-decompress/Cargo.toml @@ -5,4 +5,4 @@ name = "secp256k1-decompress-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file diff --git a/tests/secp256k1-decompress/elf/riscv32im-succinct-zkvm-elf b/tests/secp256k1-decompress/elf/riscv32im-succinct-zkvm-elf index 1ce00819d..069c6b9ab 100755 Binary files a/tests/secp256k1-decompress/elf/riscv32im-succinct-zkvm-elf and b/tests/secp256k1-decompress/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/secp256k1-decompress/src/main.rs b/tests/secp256k1-decompress/src/main.rs index 989acc480..ccc38d27c 100644 --- a/tests/secp256k1-decompress/src/main.rs +++ b/tests/secp256k1-decompress/src/main.rs @@ -1,12 +1,12 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_secp256k1_decompress(compressed_key: &mut [u8; 64], is_odd: bool); } pub fn main() { - let compressed_key: [u8; 33] = wp1_zkvm::io::read_vec().try_into().unwrap(); + let compressed_key: [u8; 33] = sphinx_zkvm::io::read_vec().try_into().unwrap(); let mut decompressed_key: [u8; 64] = [0; 64]; decompressed_key[..32].copy_from_slice(&compressed_key[1..]); @@ -23,5 +23,5 @@ pub fn main() { result[0] = 4; result[1..].copy_from_slice(&decompressed_key); - wp1_zkvm::io::commit_slice(&result); + sphinx_zkvm::io::commit_slice(&result); } diff --git a/tests/secp256k1-double/Cargo.lock b/tests/secp256k1-double/Cargo.lock index 8548c8d45..4a48742a6 100644 --- a/tests/secp256k1-double/Cargo.lock +++ b/tests/secp256k1-double/Cargo.lock @@ -438,7 +438,7 @@ version = "0.1.0" dependencies = [ "hex-literal", "num", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -482,6 +482,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -539,34 +567,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/secp256k1-double/Cargo.toml b/tests/secp256k1-double/Cargo.toml index 329fe9944..3c6246e19 100644 --- a/tests/secp256k1-double/Cargo.toml +++ b/tests/secp256k1-double/Cargo.toml @@ -5,6 +5,6 @@ name = "secp256k1-double-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" num = { version = "0.4.1", default-features = false } \ No newline at end of file diff --git a/tests/secp256k1-double/elf/riscv32im-succinct-zkvm-elf b/tests/secp256k1-double/elf/riscv32im-succinct-zkvm-elf index 81a2f79a0..be8a10d56 100755 Binary files a/tests/secp256k1-double/elf/riscv32im-succinct-zkvm-elf and b/tests/secp256k1-double/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/secp256k1-double/src/main.rs b/tests/secp256k1-double/src/main.rs index cb0b28645..67ea831af 100644 --- a/tests/secp256k1-double/src/main.rs +++ b/tests/secp256k1-double/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); extern "C" { fn syscall_secp256k1_double(p: *mut u32); diff --git a/tests/secp256k1-mul/Cargo.lock b/tests/secp256k1-mul/Cargo.lock index d8a4cb9ce..14449b975 100644 --- a/tests/secp256k1-mul/Cargo.lock +++ b/tests/secp256k1-mul/Cargo.lock @@ -363,8 +363,8 @@ dependencies = [ name = "secp256k1-mul-test" version = "0.1.0" dependencies = [ - "wp1-derive", - "wp1-zkvm", + "sphinx-derive", + "sphinx-zkvm", ] [[package]] @@ -408,6 +408,43 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-derive" +version = "0.1.0" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -476,43 +513,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-derive" -version = "0.1.0" -dependencies = [ - "proc-macro2", - "quote", - "syn 1.0.109", -] - -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/secp256k1-mul/Cargo.toml b/tests/secp256k1-mul/Cargo.toml index eaad6ce0a..82318984c 100644 --- a/tests/secp256k1-mul/Cargo.toml +++ b/tests/secp256k1-mul/Cargo.toml @@ -5,5 +5,5 @@ version = "0.1.0" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } -wp1-derive = { path = "../../derive" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-derive = { path = "../../derive" } \ No newline at end of file diff --git a/tests/secp256k1-mul/elf/riscv32im-succinct-zkvm-elf b/tests/secp256k1-mul/elf/riscv32im-succinct-zkvm-elf index 2132f618f..0b45ffb1c 100755 Binary files a/tests/secp256k1-mul/elf/riscv32im-succinct-zkvm-elf and b/tests/secp256k1-mul/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/secp256k1-mul/src/main.rs b/tests/secp256k1-mul/src/main.rs index 8ddbad6b5..af826a17b 100644 --- a/tests/secp256k1-mul/src/main.rs +++ b/tests/secp256k1-mul/src/main.rs @@ -1,10 +1,10 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); -use wp1_zkvm::precompiles::secp256k1::Secp256k1Operations; -use wp1_zkvm::precompiles::utils::AffinePoint; +use sphinx_zkvm::precompiles::secp256k1::Secp256k1Operations; +use sphinx_zkvm::precompiles::utils::AffinePoint; -#[wp1_derive::cycle_tracker] +#[sphinx_derive::cycle_tracker] pub fn main() { // generator. // 55066263022277343669578718895168534326250603453777594175500187360389116729240 diff --git a/tests/sha-compress/Cargo.lock b/tests/sha-compress/Cargo.lock index c673d8698..420f1db44 100644 --- a/tests/sha-compress/Cargo.lock +++ b/tests/sha-compress/Cargo.lock @@ -383,7 +383,7 @@ dependencies = [ name = "sha-compress-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/sha-compress/Cargo.toml b/tests/sha-compress/Cargo.toml index 3d0dddfa2..90b8bb149 100644 --- a/tests/sha-compress/Cargo.toml +++ b/tests/sha-compress/Cargo.toml @@ -5,4 +5,4 @@ name = "sha-compress-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file diff --git a/tests/sha-compress/elf/riscv32im-succinct-zkvm-elf b/tests/sha-compress/elf/riscv32im-succinct-zkvm-elf index b680bf31a..cec922d57 100755 Binary files a/tests/sha-compress/elf/riscv32im-succinct-zkvm-elf and b/tests/sha-compress/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/sha-compress/src/main.rs b/tests/sha-compress/src/main.rs index 5a40a40ea..f57f5b708 100644 --- a/tests/sha-compress/src/main.rs +++ b/tests/sha-compress/src/main.rs @@ -1,7 +1,7 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); -use wp1_zkvm::syscalls::syscall_sha256_compress; +use sphinx_zkvm::syscalls::syscall_sha256_compress; pub fn main() { let mut w = [1u32; 64]; diff --git a/tests/sha-extend/Cargo.lock b/tests/sha-extend/Cargo.lock index 72da82463..9712a4578 100644 --- a/tests/sha-extend/Cargo.lock +++ b/tests/sha-extend/Cargo.lock @@ -383,7 +383,7 @@ dependencies = [ name = "sha-extend-test" version = "0.1.0" dependencies = [ - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -407,6 +407,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -464,34 +492,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/sha-extend/Cargo.toml b/tests/sha-extend/Cargo.toml index 387b110e5..9cb968bc0 100644 --- a/tests/sha-extend/Cargo.toml +++ b/tests/sha-extend/Cargo.toml @@ -5,4 +5,4 @@ name = "sha-extend-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file +sphinx-zkvm = { path = "../../zkvm/entrypoint" } \ No newline at end of file diff --git a/tests/sha-extend/elf/riscv32im-succinct-zkvm-elf b/tests/sha-extend/elf/riscv32im-succinct-zkvm-elf index f51d27833..8c1a8e8b5 100755 Binary files a/tests/sha-extend/elf/riscv32im-succinct-zkvm-elf and b/tests/sha-extend/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/sha-extend/src/main.rs b/tests/sha-extend/src/main.rs index 4c4a74440..0cb5b58ec 100644 --- a/tests/sha-extend/src/main.rs +++ b/tests/sha-extend/src/main.rs @@ -1,7 +1,7 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); -use wp1_zkvm::syscalls::syscall_sha256_extend; +use sphinx_zkvm::syscalls::syscall_sha256_extend; pub fn main() { let mut w = [1u32; 64]; diff --git a/tests/sha2/Cargo.lock b/tests/sha2/Cargo.lock index f37fa9afb..ccda44ef5 100644 --- a/tests/sha2/Cargo.lock +++ b/tests/sha2/Cargo.lock @@ -419,7 +419,7 @@ dependencies = [ "hex", "hex-literal", "sha2 0.10.6", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -432,6 +432,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2 0.10.8", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -489,34 +517,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2 0.10.8", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/sha2/Cargo.toml b/tests/sha2/Cargo.toml index e33f6d695..2d09825df 100644 --- a/tests/sha2/Cargo.toml +++ b/tests/sha2/Cargo.toml @@ -5,7 +5,7 @@ name = "sha2-test" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } hex-literal = "0.4.1" sha2 = { git = "https://github.com/succinctbot/RustCrypto-hashes.git" } hex = "0.4.3" \ No newline at end of file diff --git a/tests/sha2/elf/riscv32im-succinct-zkvm-elf b/tests/sha2/elf/riscv32im-succinct-zkvm-elf index 544d9e04b..48cd1eb7f 100755 Binary files a/tests/sha2/elf/riscv32im-succinct-zkvm-elf and b/tests/sha2/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/sha2/src/main.rs b/tests/sha2/src/main.rs index 42c3a0b51..531d68101 100644 --- a/tests/sha2/src/main.rs +++ b/tests/sha2/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use hex_literal::hex; use sha2::{Digest, Sha256}; diff --git a/tests/tendermint-benchmark/Cargo.lock b/tests/tendermint-benchmark/Cargo.lock index 831a9749e..f07595a0a 100644 --- a/tests/tendermint-benchmark/Cargo.lock +++ b/tests/tendermint-benchmark/Cargo.lock @@ -727,6 +727,34 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "rand", + "sha2 0.10.8", + "sphinx-precompiles", +] + [[package]] name = "spki" version = "0.7.3" @@ -821,9 +849,9 @@ version = "0.1.0" dependencies = [ "serde", "serde_json", + "sphinx-zkvm", "tendermint", "tendermint-light-client-verifier", - "wp1-zkvm", ] [[package]] @@ -910,34 +938,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "rand", - "sha2 0.10.8", - "wp1-precompiles", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/tendermint-benchmark/Cargo.toml b/tests/tendermint-benchmark/Cargo.toml index e73547537..05a63ad11 100644 --- a/tests/tendermint-benchmark/Cargo.toml +++ b/tests/tendermint-benchmark/Cargo.toml @@ -5,7 +5,7 @@ name = "tendermint-benchmark-program" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint" } +sphinx-zkvm = { path = "../../zkvm/entrypoint" } serde_json = { version = "1.0", default-features = false, features = ["alloc"] } serde = { version = "1.0", default-features = false, features = ["derive"] } tendermint = { version = "0.34.0", default-features = false } diff --git a/tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf b/tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf index b1eb170af..32f7ab7c2 100755 Binary files a/tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf and b/tests/tendermint-benchmark/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/tendermint-benchmark/src/main.rs b/tests/tendermint-benchmark/src/main.rs index 0b6131a98..4db25b4df 100644 --- a/tests/tendermint-benchmark/src/main.rs +++ b/tests/tendermint-benchmark/src/main.rs @@ -1,5 +1,5 @@ #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use core::time::Duration; use serde::Deserialize; diff --git a/tests/verify-proof/Cargo.lock b/tests/verify-proof/Cargo.lock index 6cf9bab12..a20d1998b 100644 --- a/tests/verify-proof/Cargo.lock +++ b/tests/verify-proof/Cargo.lock @@ -581,6 +581,49 @@ dependencies = [ "rand_core", ] +[[package]] +name = "sphinx-precompiles" +version = "0.1.0" +dependencies = [ + "anyhow", + "bincode", + "bls12_381", + "cfg-if", + "getrandom", + "hybrid-array", + "k256", + "serde", +] + +[[package]] +name = "sphinx-primitives" +version = "0.1.0" +dependencies = [ + "itertools", + "lazy_static", + "p3-baby-bear", + "p3-field", + "p3-poseidon2", + "p3-symmetric", +] + +[[package]] +name = "sphinx-zkvm" +version = "0.1.0" +dependencies = [ + "bincode", + "cfg-if", + "getrandom", + "k256", + "once_cell", + "p3-baby-bear", + "p3-field", + "rand", + "sha2", + "sphinx-precompiles", + "sphinx-primitives", +] + [[package]] name = "spki" version = "0.7.3" @@ -664,7 +707,7 @@ dependencies = [ "hex", "hex-literal", "sha2", - "wp1-zkvm", + "sphinx-zkvm", ] [[package]] @@ -679,49 +722,6 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" -[[package]] -name = "wp1-precompiles" -version = "0.1.0" -dependencies = [ - "anyhow", - "bincode", - "bls12_381", - "cfg-if", - "getrandom", - "hybrid-array", - "k256", - "serde", -] - -[[package]] -name = "wp1-primitives" -version = "0.1.0" -dependencies = [ - "itertools", - "lazy_static", - "p3-baby-bear", - "p3-field", - "p3-poseidon2", - "p3-symmetric", -] - -[[package]] -name = "wp1-zkvm" -version = "0.1.0" -dependencies = [ - "bincode", - "cfg-if", - "getrandom", - "k256", - "once_cell", - "p3-baby-bear", - "p3-field", - "rand", - "sha2", - "wp1-precompiles", - "wp1-primitives", -] - [[package]] name = "wyz" version = "0.5.1" diff --git a/tests/verify-proof/Cargo.toml b/tests/verify-proof/Cargo.toml index 94b77ba5e..ea9d7e245 100644 --- a/tests/verify-proof/Cargo.toml +++ b/tests/verify-proof/Cargo.toml @@ -5,7 +5,7 @@ name = "verify-proof" edition = "2021" [dependencies] -wp1-zkvm = { path = "../../zkvm/entrypoint", features = ["verify"] } +sphinx-zkvm = { path = "../../zkvm/entrypoint", features = ["verify"] } hex-literal = "0.4.1" hex = "0.4.3" sha2 = "0.10.8" diff --git a/tests/verify-proof/elf/riscv32im-succinct-zkvm-elf b/tests/verify-proof/elf/riscv32im-succinct-zkvm-elf index ad0379d28..955f6acb7 100755 Binary files a/tests/verify-proof/elf/riscv32im-succinct-zkvm-elf and b/tests/verify-proof/elf/riscv32im-succinct-zkvm-elf differ diff --git a/tests/verify-proof/src/main.rs b/tests/verify-proof/src/main.rs index 81415aaac..345ad0020 100644 --- a/tests/verify-proof/src/main.rs +++ b/tests/verify-proof/src/main.rs @@ -2,10 +2,10 @@ //! SP1 proof for each input. #![no_main] -wp1_zkvm::entrypoint!(main); +sphinx_zkvm::entrypoint!(main); use sha2::{Digest, Sha256}; -use wp1_zkvm::precompiles::verify::verify_wp1_proof; +use sphinx_zkvm::precompiles::verify::verify_sphinx_proof; fn words_to_bytes(words: &[u32; 8]) -> [u8; 32] { let mut bytes = [0u8; 32]; @@ -17,13 +17,13 @@ fn words_to_bytes(words: &[u32; 8]) -> [u8; 32] { } pub fn main() { - let vkey = wp1_zkvm::io::read::<[u32; 8]>(); + let vkey = sphinx_zkvm::io::read::<[u32; 8]>(); println!("Read vkey: {:?}", hex::encode(words_to_bytes(&vkey))); - let inputs = wp1_zkvm::io::read::>>(); + let inputs = sphinx_zkvm::io::read::>>(); inputs.iter().for_each(|input| { // Get expected pv_digest hash: sha256(input) let pv_digest = Sha256::digest(input); - verify_wp1_proof(&vkey, &pv_digest.into()); + verify_sphinx_proof(&vkey, &pv_digest.into()); println!("Verified proof for digest: {:?}", hex::encode(pv_digest)); println!("Verified input: {:?}", hex::encode(input)); diff --git a/tutorials/Cargo.toml b/tutorials/Cargo.toml index 515f8f478..f33647b9f 100644 --- a/tutorials/Cargo.toml +++ b/tutorials/Cargo.toml @@ -12,6 +12,6 @@ p3-air = { workspace = true } p3-matrix = { workspace = true } p3-maybe-rayon = { workspace = true } p3-uni-stark = { workspace = true } -wp1-derive = { path = "../derive" } -wp1-core = { path = "../core" } +sphinx-derive = { path = "../derive" } +sphinx-core = { path = "../core" } itertools = { workspace = true } diff --git a/tutorials/src/public_values.rs b/tutorials/src/public_values.rs index 71e2be61c..9a66c7938 100644 --- a/tutorials/src/public_values.rs +++ b/tutorials/src/public_values.rs @@ -3,8 +3,8 @@ use std::{borrow::Borrow, mem::size_of}; use p3_air::{Air, AirBuilder, AirBuilderWithPublicValues, BaseAir}; use p3_field::{AbstractField, Field}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use wp1_core::air::BaseAirBuilder; -use wp1_derive::AlignedBorrow; +use sphinx_core::air::BaseAirBuilder; +use sphinx_derive::AlignedBorrow; #[derive(AlignedBorrow, Default)] struct Cols { @@ -117,7 +117,7 @@ mod tests { use p3_field::AbstractField; use p3_matrix::dense::RowMajorMatrix; use p3_uni_stark::{prove, verify}; - use wp1_core::{ + use sphinx_core::{ stark::{StarkGenericConfig, UniConfig}, utils::BabyBearPoseidon2, }; diff --git a/tutorials/src/simple_calc.rs b/tutorials/src/simple_calc.rs index cefccdf1d..a8d53933b 100644 --- a/tutorials/src/simple_calc.rs +++ b/tutorials/src/simple_calc.rs @@ -5,8 +5,8 @@ use itertools::Itertools; use p3_air::{Air, AirBuilder, BaseAir}; use p3_field::{AbstractField, Field}; use p3_matrix::{dense::RowMajorMatrix, Matrix}; -use wp1_core::air::AluAirBuilder; -use wp1_derive::AlignedBorrow; +use sphinx_core::air::AluAirBuilder; +use sphinx_derive::AlignedBorrow; #[derive(AlignedBorrow, Default)] struct OpCols { @@ -202,7 +202,7 @@ mod tests { use p3_baby_bear::BabyBear; use p3_field::{AbstractField, Field}; use p3_matrix::dense::RowMajorMatrix; - use wp1_core::{ + use sphinx_core::{ stark::StarkGenericConfig, utils::{uni_stark_prove as prove, uni_stark_verify as verify, BabyBearPoseidon2}, }; diff --git a/zkvm/entrypoint/Cargo.toml b/zkvm/entrypoint/Cargo.toml index bfff6865e..f9ea757a0 100644 --- a/zkvm/entrypoint/Cargo.toml +++ b/zkvm/entrypoint/Cargo.toml @@ -1,13 +1,13 @@ [package] -name = "wp1-zkvm" +name = "sphinx-zkvm" version = "0.1.0" edition.workspace = true repository.workspace = true license.workspace = true [dependencies] -wp1-precompiles = { path = "../precompiles" } -wp1-primitives = { path = "../../primitives", optional = true } +sphinx-precompiles = { path = "../precompiles" } +sphinx-primitives = { path = "../../primitives", optional = true } p3-baby-bear = { workspace = true, optional = true } p3-field = { workspace = true, optional = true } bincode = { workspace = true } @@ -20,13 +20,13 @@ sha2 = { workspace = true } [features] default = [] -verify = ["dep:wp1-primitives", "dep:p3-baby-bear", "dep:p3-field", "wp1-precompiles/verify"] +verify = ["dep:sphinx-primitives", "dep:p3-baby-bear", "dep:p3-field", "sphinx-precompiles/verify"] [package.metadata.cargo-udeps.ignore] # used w/ verify feature & some examples normal = [ "p3-baby-bear", "p3-field", - "wp1-primitives", + "sphinx-primitives", "rand" ] \ No newline at end of file diff --git a/zkvm/entrypoint/src/lib.rs b/zkvm/entrypoint/src/lib.rs index fd871c4d1..f2f91830a 100644 --- a/zkvm/entrypoint/src/lib.rs +++ b/zkvm/entrypoint/src/lib.rs @@ -1,10 +1,10 @@ pub mod heap; pub mod syscalls; pub mod io { - pub use wp1_precompiles::io::*; + pub use sphinx_precompiles::io::*; } pub mod precompiles { - pub use wp1_precompiles::*; + pub use sphinx_precompiles::*; } #[allow(unused_extern_crates)] diff --git a/zkvm/entrypoint/src/syscalls/io.rs b/zkvm/entrypoint/src/syscalls/io.rs index c504764a5..4ef5875df 100644 --- a/zkvm/entrypoint/src/syscalls/io.rs +++ b/zkvm/entrypoint/src/syscalls/io.rs @@ -3,7 +3,7 @@ cfg_if::cfg_if! { use core::arch::asm; use crate::zkvm; use sha2::digest::Update; - use wp1_precompiles::io::FD_PUBLIC_VALUES; + use sphinx_precompiles::io::FD_PUBLIC_VALUES; } } diff --git a/zkvm/entrypoint/src/syscalls/mod.rs b/zkvm/entrypoint/src/syscalls/mod.rs index 181fced68..b21a59f2b 100644 --- a/zkvm/entrypoint/src/syscalls/mod.rs +++ b/zkvm/entrypoint/src/syscalls/mod.rs @@ -93,8 +93,8 @@ pub const COMMIT: u32 = 0x00_00_00_10; /// Executes the `COMMIT_DEFERRED_PROOFS` precompile. pub const COMMIT_DEFERRED_PROOFS: u32 = 0x00_00_00_1A; -/// Executes the `VERIFY_SP1_PROOF` precompile. -pub const VERIFY_SP1_PROOF: u32 = 0x00_00_00_1B; +/// Executes the `VERIFY_SPHINX_PROOF` precompile. +pub const VERIFY_SPHINX_PROOF: u32 = 0x00_00_00_1B; /// Executes `HINT_LEN`. pub const HINT_LEN: u32 = 0x00_00_00_F0; diff --git a/zkvm/entrypoint/src/syscalls/verify.rs b/zkvm/entrypoint/src/syscalls/verify.rs index 6589afbd8..f95df8c73 100644 --- a/zkvm/entrypoint/src/syscalls/verify.rs +++ b/zkvm/entrypoint/src/syscalls/verify.rs @@ -6,20 +6,20 @@ cfg_if::cfg_if! { use crate::zkvm::DEFERRED_PROOFS_DIGEST; use p3_baby_bear::BabyBear; use p3_field::AbstractField; - use wp1_primitives::hash_deferred_proof; + use sphinx_primitives::hash_deferred_proof; } } #[no_mangle] #[allow(unused_variables)] -pub fn syscall_verify_wp1_proof(vk_digest: &[u32; 8], pv_digest: &[u8; 32]) { +pub fn syscall_verify_sphinx_proof(vk_digest: &[u32; 8], pv_digest: &[u8; 32]) { #[cfg(target_os = "zkvm")] { // Call syscall to verify the next proof at runtime unsafe { asm!( "ecall", - in("t0") crate::syscalls::VERIFY_SP1_PROOF, + in("t0") crate::syscalls::VERIFY_SPHINX_PROOF, in("a0") vk_digest.as_ptr(), in("a1") pv_digest.as_ptr(), ); diff --git a/zkvm/precompiles/Cargo.toml b/zkvm/precompiles/Cargo.toml index 2f87c0585..3f3c3c028 100644 --- a/zkvm/precompiles/Cargo.toml +++ b/zkvm/precompiles/Cargo.toml @@ -1,5 +1,5 @@ [package] -name = "wp1-precompiles" +name = "sphinx-precompiles" version = "0.1.0" edition.workspace = true repository.workspace = true diff --git a/zkvm/precompiles/src/lib.rs b/zkvm/precompiles/src/lib.rs index 21453b1a7..2b9af2446 100644 --- a/zkvm/precompiles/src/lib.rs +++ b/zkvm/precompiles/src/lib.rs @@ -33,7 +33,7 @@ extern "C" { pub fn syscall_bls12381_fp2_mul(p: *mut u32, q: *const u32); pub fn syscall_enter_unconstrained() -> bool; pub fn syscall_exit_unconstrained(); - pub fn syscall_verify_wp1_proof(vkey: &[u32; 8], pv_digest: &[u8; 32]); + pub fn syscall_verify_sphinx_proof(vkey: &[u32; 8], pv_digest: &[u8; 32]); pub fn syscall_hint_len() -> usize; pub fn syscall_hint_read(ptr: *mut u8, len: usize); pub fn sys_alloc_aligned(bytes: usize, align: usize) -> *mut u8; diff --git a/zkvm/precompiles/src/verify.rs b/zkvm/precompiles/src/verify.rs index 1f0b41fae..187164542 100644 --- a/zkvm/precompiles/src/verify.rs +++ b/zkvm/precompiles/src/verify.rs @@ -1,10 +1,10 @@ -use crate::syscall_verify_wp1_proof; +use crate::syscall_verify_sphinx_proof; /// Verifies the next proof in the proof input stream given a pkey digest and public values digest. /// /// Note: sp1_zkvm must also have feature `verify` enabled for this function to work. -pub fn verify_wp1_proof(pkey_digest: &[u32; 8], pv_digest: &[u8; 32]) { +pub fn verify_sphinx_proof(pkey_digest: &[u32; 8], pv_digest: &[u8; 32]) { unsafe { - syscall_verify_wp1_proof(pkey_digest, pv_digest); + syscall_verify_sphinx_proof(pkey_digest, pv_digest); } }