diff --git a/.env.sample b/.env.sample new file mode 100644 index 000000000..01f969f8b --- /dev/null +++ b/.env.sample @@ -0,0 +1,27 @@ +export BRIDGE_DATA_STORE_CLIENT_DATA_SUFFIX=-"bridge-client-data.json" + +export BRIDGE_AWS_ACCESS_KEY_ID="" +export BRIDGE_AWS_SECRET_ACCESS_KEY="" +export BRIDGE_AWS_REGION="" +export BRIDGE_AWS_BUCKET="" +export KEY_DIR="" +export VERIFIERS="" +export ENVIRONMENT="" + +# export BRIDGE_SFTP_HOST="" +# export BRIDGE_SFTP_PORT="22" +# export BRIDGE_SFTP_USERNAME="" +# export BRIDGE_SFTP_KEYFILE_PATH="" +# export BRIDGE_SFTP_BASE_PATH="/bitvm" + +# export BRIDGE_FTP_HOST="" +# export BRIDGE_FTP_PORT="21" +# export BRIDGE_FTP_USERNAME="" +# export BRIDGE_FTP_PASSWORD="" +# export BRIDGE_FTP_BASE_PATH="/bitvm" + +# export BRIDGE_FTPS_HOST="" +# export BRIDGE_FTPS_PORT="21" +# export BRIDGE_FTPS_USERNAME="" +# export BRIDGE_FTPS_PASSWORD="" +# export BRIDGE_FTPS_BASE_PATH="/bitvm" \ No newline at end of file diff --git a/.env.test.sample b/.env.test.sample new file mode 100644 index 000000000..1fc62ab18 --- /dev/null +++ b/.env.test.sample @@ -0,0 +1,4 @@ +# Desired block time in seconds for the regtest network +REGTEST_BLOCK_TIME=5 +# Use local file to store remote data in test +BRIDGE_USE_LOCAL_FILE_DATA_STORE=true \ No newline at end of file diff --git a/.github/workflows/CI.yml b/.github/workflows/CI.yml new file mode 100644 index 000000000..a7a692c41 --- /dev/null +++ b/.github/workflows/CI.yml @@ -0,0 +1,141 @@ +name: BitVM CI + +on: + push: + branches: [ "main" ] + pull_request: + types: [opened, synchronize, reopened, ready_for_review] + branches: ["*"] + +env: + CARGO_TERM_COLOR: always + +jobs: + rustfmt: + timeout-minutes: 60 + runs-on: self-hosted + steps: + - uses: actions/checkout@v5 + - name: Run rustfmt + run: cargo fmt --all -- --check + + clippy: + if: github.event.pull_request.draft == false + timeout-minutes: 60 + runs-on: self-hosted + steps: + - uses: actions/checkout@v5 + - name: Run clippy (no guests) + run: cargo clippy --workspace --exclude header-chain-circuit --exclude final-spv-circuit + + guest: + if: github.event.pull_request.draft == false + needs: rustfmt + timeout-minutes: 60 + runs-on: self-hosted + steps: + - uses: actions/checkout@v5 + - name: Build guests + run: | + REPR_GUEST_BUILD=1 BITCOIN_NETWORK=mainnet cargo build -p header-chain-circuit --release + REPR_GUEST_BUILD=1 BITCOIN_NETWORK=mainnet cargo build -p final-spv-circuit --release + + build: + if: github.event.pull_request.draft == false + needs: rustfmt + timeout-minutes: 60 + runs-on: self-hosted + steps: + - uses: actions/checkout@v5 + + - name: Cache Build Artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Build + run: cargo build + + test_script: + if: github.event.pull_request.draft == false + timeout-minutes: 120 + needs: build + runs-on: self-hosted + env: + LARGE_TESTS: >- + bn254::pairing::test::test_hinted_quad_miller_loop_with_c_wi + chunk::api::test::full_e2e_execution + chunk::api_runtime_utils::test::test_runtime_execution_looped + chunk::g16_runner_core::test::test_groth16 + chunk::g16_runner_core::test::test_verify_pairing + groth16::test::test_hinted_groth16_verifier + groth16::test::test_hinted_groth16_verifier_small_public + hash::blake3::tests::test_blake3_randominputs + hash::blake3::tests::test_blake3_randominputs_multipleof64bytes + steps: + - uses: actions/checkout@v5 + + - name: Cache Build Artifacts + uses: actions/cache@v4 + with: + path: | + ~/.cargo/bin/ + ~/.cargo/registry/index/ + ~/.cargo/registry/cache/ + ~/.cargo/git/db/ + target/ + key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} + + - name: Build + run: cargo build + + - name: Run tests + run: | + SKIP_ARGS="" + for test in $LARGE_TESTS; do + SKIP_ARGS="$SKIP_ARGS --skip $test" + done + cargo test -- --skip bridge:: --skip tests::test_final_circuit $SKIP_ARGS + cargo test -- --test-threads=1 $LARGE_TESTS + +# test_bridge: +# if: github.event.pull_request.draft == false +# timeout-minutes: 200 +# needs: build +# runs-on: self-hosted +# steps: +# - uses: actions/checkout@v5 +# +# - name: Cache Build Artifacts +# uses: actions/cache@v4 +# with: +# path: | +# ~/.cargo/bin/ +# ~/.cargo/registry/index/ +# ~/.cargo/registry/cache/ +# ~/.cargo/git/db/ +# target/ +# key: ${{ runner.os }}-cargo-${{ hashFiles('**/Cargo.lock') }} +# +# - name: Build +# run: cargo build +# +# - name: Run bridge tests +# env: +# BRIDGE_DATA_STORE_CLIENT_DATA_SUFFIX: bridge-client-data.json +# BRIDGE_AWS_ACCESS_KEY_ID: ${{ secrets.BRIDGE_AWS_ACCESS_KEY_ID }} +# BRIDGE_AWS_SECRET_ACCESS_KEY: ${{ secrets.BRIDGE_AWS_SECRET_ACCESS_KEY }} +# BRIDGE_AWS_REGION: ap-southeast-1 +# BRIDGE_AWS_BUCKET: bitvm +# run: | +# cp .env.test.sample .env.test +# cd regtest +# ./install.sh <<< "." +# ./start.sh +# cargo test -- --test bridge:: diff --git a/.gitignore b/.gitignore index b37f3a3fa..caf295d29 100644 --- a/.gitignore +++ b/.gitignore @@ -15,6 +15,7 @@ target/ # Ignore .env files .env +.env.test # Added by cargo @@ -29,3 +30,11 @@ tmp # Bridge public and private files bridge_data/ + +# Esplora regtest data +nohup.out +data_path +esplora-bitcoin-regtest-data + +# test cache +test_data/ diff --git a/.rustfmt.toml b/.rustfmt.toml deleted file mode 100644 index 2e02686d2..000000000 --- a/.rustfmt.toml +++ /dev/null @@ -1,6 +0,0 @@ -fn_single_line = true -ignore = [ - "src/utils/merkle.rs", -] - - diff --git a/Cargo.lock b/Cargo.lock index 1262707cd..cb5f49bb3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1,6 +1,32 @@ # This file is automatically @generated by Cargo. # It is not intended for manual editing. -version = 3 +version = 4 + +[[package]] +name = "addchain" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3b2e69442aa5628ea6951fa33e24efe8313f4321a91bd729fc2f75bdfc858570" +dependencies = [ + "num-bigint 0.3.3", + "num-integer", + "num-traits", +] + +[[package]] +name = "addr2line" +version = "0.22.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6e4503c46a5c0c7844e948c9a4d6acd9f50cccb4de1c48eb9e291ea17470c678" +dependencies = [ + "cpp_demangle", + "fallible-iterator", + "gimli 0.29.0", + "memmap2", + "object 0.35.0", + "rustc-demangle", + "smallvec", +] [[package]] name = "addr2line" @@ -8,7 +34,7 @@ version = "0.24.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dfbe277e56a376000877090da837660b4427aad530e3028d44e0bffe4f89a1c1" dependencies = [ - "gimli", + "gimli 0.31.1", ] [[package]] @@ -19,9 +45,9 @@ checksum = "512761e0bb2578dd7380c6baaa0f4ce03e84f95e960231d1dec8bf4d7d6e2627" [[package]] name = "ahash" -version = "0.8.11" +version = "0.8.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e89da841a80418a9b391ebaea17f5c112ffaaa96f621d2c285b5174da76b9011" +checksum = "5a15f179cd60c4584b8a8c596927aadc462e27f2ca70c04e0071964a73ba7a75" dependencies = [ "cfg-if", "once_cell", @@ -71,13 +97,13 @@ dependencies = [ [[package]] name = "alloy-chains" -version = "0.1.47" +version = "0.1.69" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "18c5c520273946ecf715c0010b4e3503d7eba9893cd9ce6b7fff5654c4a3c470" +checksum = "28e2652684758b0d9b389d248b209ed9fd9989ef489a550265fe4bb8454fe7eb" dependencies = [ - "alloy-primitives 0.8.14", + "alloy-primitives 0.8.25", "num_enum", - "strum", + "strum 0.27.1", ] [[package]] @@ -141,7 +167,7 @@ dependencies = [ "itoa", "serde", "serde_json", - "winnow", + "winnow 0.6.26", ] [[package]] @@ -154,7 +180,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "c-kzg", - "derive_more 0.99.18", + "derive_more 0.99.20", "k256", "once_cell", "serde", @@ -240,13 +266,13 @@ dependencies = [ "bytes", "cfg-if", "const-hex", - "derive_more 0.99.18", + "derive_more 0.99.20", "hex-literal", "itoa", "k256", "keccak-asm", "proptest", - "rand", + "rand 0.8.5", "ruint", "serde", "tiny-keccak", @@ -254,15 +280,14 @@ dependencies = [ [[package]] name = "alloy-primitives" -version = "0.8.14" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9db948902dfbae96a73c2fbf1f7abec62af034ab883e4c777c3fd29702bd6e2c" +checksum = "8c77490fe91a0ce933a1f219029521f20fc28c2c0ca95d53fa4da9c00b8d9d4e" dependencies = [ "bytes", "cfg-if", "const-hex", - "derive_more 1.0.0", - "hex-literal", + "derive_more 2.0.1", "itoa", "paste", "ruint", @@ -295,9 +320,9 @@ dependencies = [ "dashmap", "futures", "futures-utils-wasm", - "lru", + "lru 0.12.5", "pin-project", - "reqwest 0.12.9", + "reqwest 0.12.15", "serde", "serde_json", "tokio", @@ -320,15 +345,15 @@ dependencies = [ "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", ] [[package]] name = "alloy-rlp" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "da0822426598f95e45dd1ea32a738dac057529a709ee645fcc516ffa4cbde08f" +checksum = "5f70d83b765fdc080dbcd4f4db70d8d23fe4761f2f02ebfa9146b833900634b4" dependencies = [ "alloy-rlp-derive", "arrayvec", @@ -337,13 +362,13 @@ dependencies = [ [[package]] name = "alloy-rlp-derive" -version = "0.3.9" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2b09cae092c27b6f1bde952653a22708691802e57bfef4a2973b80bea21efd3f" +checksum = "64b728d511962dda67c1bc7ea7c03736ec275ed2cf4c35d9585298ac9ccf3b73" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -361,12 +386,12 @@ dependencies = [ "alloy-transport-ws", "futures", "pin-project", - "reqwest 0.12.9", + "reqwest 0.12.15", "serde", "serde_json", "tokio", "tokio-stream", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -396,7 +421,7 @@ dependencies = [ "alloy-rpc-types-eth", "alloy-serde", "jsonwebtoken", - "rand", + "rand 0.8.5", "serde", "thiserror 1.0.69", ] @@ -414,7 +439,7 @@ dependencies = [ "alloy-rlp", "alloy-serde", "alloy-sol-types", - "itertools", + "itertools 0.13.0", "serde", "serde_json", "thiserror 1.0.69", @@ -457,7 +482,7 @@ dependencies = [ "alloy-signer", "async-trait", "k256", - "rand", + "rand 0.8.5", "thiserror 1.0.69", ] @@ -472,7 +497,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -489,7 +514,7 @@ dependencies = [ "proc-macro-error", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "syn-solidity", "tiny-keccak", ] @@ -507,7 +532,7 @@ dependencies = [ "proc-macro2", "quote", "serde_json", - "syn 2.0.90", + "syn 2.0.101", "syn-solidity", ] @@ -518,7 +543,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cbcba3ca07cf7975f15d871b721fb18031eec8bce51103907f6dcce00b255d98" dependencies = [ "serde", - "winnow", + "winnow 0.6.26", ] [[package]] @@ -548,7 +573,7 @@ dependencies = [ "serde_json", "thiserror 1.0.69", "tokio", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -561,9 +586,9 @@ checksum = "2437d145d80ea1aecde8574d2058cceb8b3c9cba05f6aea8e67907c660d46698" dependencies = [ "alloy-json-rpc", "alloy-transport", - "reqwest 0.12.9", + "reqwest 0.12.15", "serde_json", - "tower", + "tower 0.4.13", "tracing", "url", ] @@ -596,8 +621,8 @@ dependencies = [ "alloy-pubsub", "alloy-transport", "futures", - "http 1.1.0", - "rustls 0.23.19", + "http 1.3.1", + "rustls 0.23.27", "serde_json", "tokio", "tokio-tungstenite", @@ -661,19 +686,32 @@ dependencies = [ [[package]] name = "anstyle-wincon" -version = "3.0.6" +version = "3.0.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2109dbce0e72be3ec00bed26e6a7479ca384ad226efdd66db8fa2e3a38c83125" +checksum = "ca3534e77181a9cc07539ad51f2141fe32f6c3ffd4df76db8ad92346b003ae4e" dependencies = [ "anstyle", + "once_cell", "windows-sys 0.59.0", ] [[package]] name = "anyhow" -version = "1.0.93" +version = "1.0.98" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e16d2d3311acee920a9eb8d33b8cbc1787ce4a264e85f964c2404b969bdcd487" +dependencies = [ + "backtrace", +] + +[[package]] +name = "arbitrary" +version = "1.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4c95c10ba0b00a02636238b814946408b1322d5ac4760326e6fb8ec956d85775" +checksum = "dde20b3d026af13f561bdd0f15edf01fc734f0dafcedbaf42bba506a9517f223" +dependencies = [ + "derive_arbitrary", +] [[package]] name = "arc-swap" @@ -684,29 +722,61 @@ checksum = "69f7f8c3906b62b754cd5326047894316021dcfe5a194c8ea52bdd94934a3457" [[package]] name = "ark-bn254" version = "0.4.0" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a22f4561524cd949590d78d7d4c5df8f592430d221f7f3c9497bbafd8972120f" dependencies = [ - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", "ark-std 0.4.0", ] +[[package]] +name = "ark-bn254" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d69eab57e8d2663efa5c63135b2af4f396d66424f88954c21104125ab6b3e6bc" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-r1cs-std", + "ark-std 0.5.0", +] + [[package]] name = "ark-crypto-primitives" version = "0.4.0" -source = "git+https://github.com/arkworks-rs/crypto-primitives#b13983815e5b3a0fbeed0e7da0edec751beac270" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1f3a13b34da09176a8baba701233fdffbaa7c1b1192ce031a3da4e55ce1f1a56" dependencies = [ - "ahash", - "ark-crypto-primitives-macros", - "ark-ec", + "ark-ec 0.4.2", "ark-ff 0.4.2", - "ark-relations", + "ark-relations 0.4.0", "ark-serialize 0.4.2", - "ark-snark", + "ark-snark 0.4.0", "ark-std 0.4.0", "blake2", "derivative", "digest 0.10.7", + "sha2", +] + +[[package]] +name = "ark-crypto-primitives" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1e0c292754729c8a190e50414fd1a37093c786c709899f29c9f7daccecfa855e" +dependencies = [ + "ahash", + "ark-crypto-primitives-macros", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-snark 0.5.1", + "ark-std 0.5.0", + "blake2", + "derivative", + "digest 0.10.7", "fnv", "merlin", "rayon", @@ -715,29 +785,48 @@ dependencies = [ [[package]] name = "ark-crypto-primitives-macros" -version = "0.4.0" -source = "git+https://github.com/arkworks-rs/crypto-primitives#b13983815e5b3a0fbeed0e7da0edec751beac270" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7e89fe77d1f0f4fe5b96dfc940923d88d17b6a773808124f21e764dfb063c6a" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "ark-ec" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "defd9a439d56ac24968cca0571f598a61bc8c55f71d50a89cda591cb750670ba" dependencies = [ - "ahash", "ark-ff 0.4.2", - "ark-poly", + "ark-poly 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", + "itertools 0.10.5", + "num-traits", + "zeroize", +] + +[[package]] +name = "ark-ec" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43d68f2d516162846c1238e755a7c4d131b892b70cc70c471a8e3ca3ed818fce" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "educe", "fnv", - "hashbrown 0.15.2", - "itertools", - "num-bigint", + "hashbrown 0.15.3", + "itertools 0.13.0", + "num-bigint 0.4.6", "num-integer", "num-traits", "rayon", @@ -755,7 +844,7 @@ dependencies = [ "ark-serialize 0.3.0", "ark-std 0.3.0", "derivative", - "num-bigint", + "num-bigint 0.4.6", "num-traits", "paste", "rustc_version 0.3.3", @@ -765,17 +854,38 @@ dependencies = [ [[package]] name = "ark-ff" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec847af850f44ad29048935519032c33da8aa03340876d351dfab5660d2966ba" dependencies = [ "ark-ff-asm 0.4.2", "ark-ff-macros 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", + "derivative", + "digest 0.10.7", + "itertools 0.10.5", + "num-bigint 0.4.6", + "num-traits", + "paste", + "rustc_version 0.4.1", + "zeroize", +] + +[[package]] +name = "ark-ff" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a177aba0ed1e0fbb62aa9f6d0502e9b46dad8c2eab04c14258a1212d2557ea70" +dependencies = [ + "ark-ff-asm 0.5.0", + "ark-ff-macros 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "arrayvec", "digest 0.10.7", "educe", - "itertools", - "num-bigint", + "itertools 0.13.0", + "num-bigint 0.4.6", "num-traits", "paste", "rayon", @@ -795,10 +905,21 @@ dependencies = [ [[package]] name = "ark-ff-asm" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3ed4aa4fe255d0bc6d79373f7e31d2ea147bcf486cba1be5ba7ea85abdb92348" +dependencies = [ + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-asm" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62945a2f7e6de02a31fe400aa489f0e0f5b2502e69f95f853adb82a96c7a6b60" dependencies = [ "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -807,7 +928,7 @@ version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "db2fd794a08ccb318058009eefdf15bcaaaaf6f8161eb3345f907222bac38b20" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "quote", "syn 1.0.109", @@ -816,49 +937,111 @@ dependencies = [ [[package]] name = "ark-ff-macros" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7abe79b0e4288889c4574159ab790824d0033b9fdcb2a112a3182fac2e514565" +dependencies = [ + "num-bigint 0.4.6", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-ff-macros" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09be120733ee33f7693ceaa202ca41accd5653b779563608f1234f78ae07c4b3" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "ark-groth16" version = "0.4.0" -source = "git+https://github.com/arkworks-rs/groth16#16ac1dd387fe5dc89b6fc1a1cf87c9fdcfd8493f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "20ceafa83848c3e390f1cbf124bc3193b3e639b3f02009e0e290809a501b95fc" dependencies = [ - "ark-crypto-primitives", - "ark-ec", + "ark-crypto-primitives 0.4.0", + "ark-ec 0.4.2", "ark-ff 0.4.2", - "ark-poly", - "ark-relations", + "ark-poly 0.4.2", + "ark-relations 0.4.0", "ark-serialize 0.4.2", "ark-std 0.4.0", +] + +[[package]] +name = "ark-groth16" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "88f1d0f3a534bb54188b8dcc104307db6c56cdae574ddc3212aec0625740fc7e" +dependencies = [ + "ark-crypto-primitives 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-poly 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "rayon", ] [[package]] name = "ark-poly" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d320bfc44ee185d899ccbadfa8bc31aab923ce1558716e1997a1e74057fe86bf" dependencies = [ - "ahash", "ark-ff 0.4.2", "ark-serialize 0.4.2", "ark-std 0.4.0", + "derivative", + "hashbrown 0.13.2", +] + +[[package]] +name = "ark-poly" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "579305839da207f02b89cd1679e50e67b4331e2f9294a57693e5051b7703fe27" +dependencies = [ + "ahash", + "ark-ff 0.5.0", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "educe", "fnv", - "hashbrown 0.15.2", + "hashbrown 0.15.3", "rayon", ] +[[package]] +name = "ark-r1cs-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "941551ef1df4c7a401de7068758db6503598e6f01850bdb2cfdb614a1f9dbea1" +dependencies = [ + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-relations 0.5.1", + "ark-std 0.5.0", + "educe", + "num-bigint 0.4.6", + "num-integer", + "num-traits", + "tracing", +] + [[package]] name = "ark-relations" version = "0.4.0" -source = "git+https://github.com/arkworks-rs/snark/#202b9e02b808d1d15823298b8ac16f5c54ae4ef6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "00796b6efc05a3f48225e59cb6a2cda78881e7c390872d5786aaf112f31fb4f0" dependencies = [ "ark-ff 0.4.2", "ark-std 0.4.0", @@ -866,6 +1049,18 @@ dependencies = [ "tracing-subscriber", ] +[[package]] +name = "ark-relations" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec46ddc93e7af44bcab5230937635b06fb5744464dd6a7e7b083e80ebd274384" +dependencies = [ + "ark-ff 0.5.0", + "ark-std 0.5.0", + "tracing", + "tracing-subscriber", +] + [[package]] name = "ark-serialize" version = "0.3.0" @@ -879,37 +1074,75 @@ dependencies = [ [[package]] name = "ark-serialize" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "adb7b85a02b83d2f22f89bd5cac66c9c89474240cb6207cb1efc16d098e822a5" dependencies = [ - "ark-serialize-derive", + "ark-serialize-derive 0.4.2", "ark-std 0.4.0", + "digest 0.10.7", + "num-bigint 0.4.6", +] + +[[package]] +name = "ark-serialize" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3f4d068aaf107ebcd7dfb52bc748f8030e0fc930ac8e360146ca54c1203088f7" +dependencies = [ + "ark-serialize-derive 0.5.0", + "ark-std 0.5.0", "arrayvec", "digest 0.10.7", - "num-bigint", + "num-bigint 0.4.6", "rayon", ] [[package]] name = "ark-serialize-derive" version = "0.4.2" -source = "git+https://github.com/chainwayxyz/algebra/?branch=new-ate-loop#ac23fde284ca4d7ede298018f7866ce8ce64467f" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ae3281bc6d0fd7e549af32b52511e1302185bd688fd3359fa36423346ff682ea" +dependencies = [ + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "ark-serialize-derive" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "213888f660fddcca0d257e88e54ac05bca01885f258ccdf695bafd77031bb69d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "ark-snark" version = "0.4.0" -source = "git+https://github.com/arkworks-rs/snark/#202b9e02b808d1d15823298b8ac16f5c54ae4ef6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "84d3cc6833a335bb8a600241889ead68ee89a3cf8448081fb7694c0fe503da63" dependencies = [ "ark-ff 0.4.2", - "ark-relations", + "ark-relations 0.4.0", "ark-serialize 0.4.2", "ark-std 0.4.0", ] +[[package]] +name = "ark-snark" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d368e2848c2d4c129ce7679a7d0d2d612b6a274d3ea6a13bad4445d61b381b88" +dependencies = [ + "ark-ff 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-std 0.5.0", +] + [[package]] name = "ark-std" version = "0.3.0" @@ -917,7 +1150,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1df2c09229cbc5a028b1d70e00fdb2acee28b1055dfb5ca73eea49c5a25c4e7c" dependencies = [ "num-traits", - "rand", + "rand 0.8.5", ] [[package]] @@ -925,13 +1158,29 @@ name = "ark-std" version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "94893f1e0c6eeab764ade8dc4c0db24caf4fe7cbbaafc0eba0a9030f447b5185" +dependencies = [ + "num-traits", + "rand 0.8.5", +] + +[[package]] +name = "ark-std" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "246a225cc6131e9ee4f24619af0f19d67761fff15d7ccc22e42b80846e69449a" dependencies = [ "colored", "num-traits", - "rand", + "rand 0.8.5", "rayon", ] +[[package]] +name = "arraydeque" +version = "0.5.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7d902e3d592a523def97af8f317b08ce16b7ab854c1985a0c671e6f15cebc236" + [[package]] name = "arrayref" version = "0.3.9" @@ -969,14 +1218,15 @@ dependencies = [ [[package]] name = "async-executor" -version = "1.13.1" +version = "1.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30ca9a001c1e8ba5149f91a74362376cc6bc5b919d92d988668657bd570bdcec" +checksum = "bb812ffb58524bdd10860d7d974e2f01cc0950c2438a74ee5ec2e2280c6c4ffa" dependencies = [ "async-task", "concurrent-queue", "fastrand", "futures-lite", + "pin-project-lite", "slab", ] @@ -1008,7 +1258,7 @@ dependencies = [ "futures-lite", "parking", "polling", - "rustix", + "rustix 0.38.44", "slab", "tracing", "windows-sys 0.59.0", @@ -1020,7 +1270,7 @@ version = "3.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ff6e472cdea888a4bd64f342f09b3f50e1886d32afe8df3d663c01140b811b18" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "event-listener-strategy", "pin-project-lite", ] @@ -1039,9 +1289,9 @@ dependencies = [ [[package]] name = "async-std" -version = "1.13.0" +version = "1.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c634475f29802fde2b8f0b505b1bd00dfe4df7d4a000f0b36f7671197d5c3615" +checksum = "730294c1c08c2e0f85759590518f6333f0d5a0a766a27d519c1b244c3dfd8a24" dependencies = [ "async-channel 1.9.0", "async-global-executor", @@ -1082,7 +1332,7 @@ checksum = "c7c24de15d275a1ecfd47a380fb4d5ec9bfe0933f309ed5e705b775596a3574d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -1093,13 +1343,13 @@ checksum = "8b75356056920673b02621b35afd0f7dda9306d03c79a30f5c56c44cf256e3de" [[package]] name = "async-trait" -version = "0.1.83" +version = "0.1.88" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "721cae7de5c34fbb2acd27e21e6d2cf7b886dce0c27388d46c4e6c47ea4318dd" +checksum = "e539d3fca749fcee5236ab05e93a52867dd549cc157c8cb7f99595f3cedffdb5" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -1113,6 +1363,15 @@ dependencies = [ "rustc_version 0.4.1", ] +[[package]] +name = "atomic-polyfill" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8cf2bce30dfe09ef0bfaef228b9d414faaf7e563035494d7fe092dba54b300f4" +dependencies = [ + "critical-section", +] + [[package]] name = "atomic-waker" version = "1.1.2" @@ -1121,15 +1380,21 @@ checksum = "1505bd5d3d116872e7271a6d4e16d81d0c8570876c8de68093a09ac269d8aac0" [[package]] name = "auto_impl" -version = "1.2.0" +version = "1.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c87f3f15e7794432337fc718554eaa4dc8f04c9677a950ffe366f20a162ae42" +checksum = "ffdcb70bdbc4d478427380519163274ac86e52916e10f0a8889adf0f96d3fee7" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] +[[package]] +name = "auto_ops" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7460f7dd8e100147b82a63afca1a20eb6c231ee36b90ba7272e14951cb58af59" + [[package]] name = "autocfg" version = "1.4.0" @@ -1154,9 +1419,9 @@ checksum = "d5b3469636cdf8543cceab175efca534471f36eee12fb8374aba00eb5e7e7f8a" [[package]] name = "aws-credential-types" -version = "1.2.1" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60e8f6b615cb5fc60a98132268508ad104310f0cfb25a1c22eee76efdf9154da" +checksum = "687bc16bc431a8533fe0097c7f0182874767f920989d7260950172ae8e3c4465" dependencies = [ "aws-smithy-async", "aws-smithy-runtime-api", @@ -1164,11 +1429,34 @@ dependencies = [ "zeroize", ] +[[package]] +name = "aws-lc-rs" +version = "1.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "93fcc8f365936c834db5514fc45aee5b1202d677e6b40e48468aaaa8183ca8c7" +dependencies = [ + "aws-lc-sys", + "zeroize", +] + +[[package]] +name = "aws-lc-sys" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "61b1d86e7705efe1be1b569bab41d4fa1e14e220b60a160f78de2db687add079" +dependencies = [ + "bindgen", + "cc", + "cmake", + "dunce", + "fs_extra", +] + [[package]] name = "aws-runtime" -version = "1.4.3" +version = "1.5.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a10d5c055aa540164d9561a0e2e74ad30f0dcf7393c3a92f6733ddf9c5762468" +checksum = "6c4063282c69991e57faab9e5cb21ae557e59f5b0fb285c196335243df8dc25c" dependencies = [ "aws-credential-types", "aws-sigv4", @@ -1183,7 +1471,6 @@ dependencies = [ "fastrand", "http 0.2.12", "http-body 0.4.6", - "once_cell", "percent-encoding", "pin-project-lite", "tracing", @@ -1192,9 +1479,9 @@ dependencies = [ [[package]] name = "aws-sdk-s3" -version = "1.63.0" +version = "1.86.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f43850204a109a5eea1ea93951cf0440268cef98b0d27dfef4534949e23735f7" +checksum = "0303d28521eae1dbf1bf29e772029204cf9e126da7aa763e5391ff2131bcc2ac" dependencies = [ "aws-credential-types", "aws-runtime", @@ -1214,9 +1501,9 @@ dependencies = [ "hex", "hmac", "http 0.2.12", + "http 1.3.1", "http-body 0.4.6", - "lru", - "once_cell", + "lru 0.12.5", "percent-encoding", "regex-lite", "sha2", @@ -1226,9 +1513,9 @@ dependencies = [ [[package]] name = "aws-sigv4" -version = "1.2.5" +version = "1.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5619742a0d8f253be760bfbb8e8e8368c69e3587e4637af5754e488a611499b1" +checksum = "3734aecf9ff79aa401a6ca099d076535ab465ff76b46440cf567c8e70b65dc13" dependencies = [ "aws-credential-types", "aws-smithy-eventstream", @@ -1241,8 +1528,7 @@ dependencies = [ "hex", "hmac", "http 0.2.12", - "http 1.1.0", - "once_cell", + "http 1.3.1", "p256", "percent-encoding", "ring", @@ -1255,9 +1541,9 @@ dependencies = [ [[package]] name = "aws-smithy-async" -version = "1.2.1" +version = "1.2.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62220bc6e97f946ddd51b5f1361f78996e704677afc518a4ff66b7a72ea1378c" +checksum = "1e190749ea56f8c42bf15dd76c65e14f8f765233e6df9b0506d9d934ebef867c" dependencies = [ "futures-util", "pin-project-lite", @@ -1266,15 +1552,14 @@ dependencies = [ [[package]] name = "aws-smithy-checksums" -version = "0.60.13" +version = "0.63.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ba1a71073fca26775c8b5189175ea8863afb1c9ea2cceb02a5de5ad9dfbaa795" +checksum = "d2f77a921dbd2c78ebe70726799787c1d110a2245dd65e39b20923dfdfb2deee" dependencies = [ "aws-smithy-http", "aws-smithy-types", "bytes", - "crc32c", - "crc32fast", + "crc-fast", "hex", "http 0.2.12", "http-body 0.4.6", @@ -1287,9 +1572,9 @@ dependencies = [ [[package]] name = "aws-smithy-eventstream" -version = "0.60.5" +version = "0.60.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef7d0a272725f87e51ba2bf89f8c21e4df61b9e49ae1ac367a6d69916ef7c90" +checksum = "7c45d3dddac16c5c59d553ece225a88870cf81b7b813c9cc17b78cf4685eac7a" dependencies = [ "aws-smithy-types", "bytes", @@ -1298,9 +1583,9 @@ dependencies = [ [[package]] name = "aws-smithy-http" -version = "0.60.11" +version = "0.62.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5c8bc3e8fdc6b8d07d976e301c02fe553f72a39b7a9fea820e023268467d7ab6" +checksum = "99335bec6cdc50a346fda1437f9fefe33abf8c99060739a546a16457f2862ca9" dependencies = [ "aws-smithy-eventstream", "aws-smithy-runtime-api", @@ -1309,61 +1594,95 @@ dependencies = [ "bytes-utils", "futures-core", "http 0.2.12", + "http 1.3.1", "http-body 0.4.6", - "once_cell", "percent-encoding", "pin-project-lite", "pin-utils", "tracing", ] +[[package]] +name = "aws-smithy-http-client" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7e44697a9bded898dcd0b1cb997430d949b87f4f8940d91023ae9062bf218250" +dependencies = [ + "aws-smithy-async", + "aws-smithy-runtime-api", + "aws-smithy-types", + "h2 0.4.10", + "http 0.2.12", + "http 1.3.1", + "http-body 0.4.6", + "hyper 0.14.32", + "hyper 1.6.0", + "hyper-rustls 0.24.2", + "hyper-rustls 0.27.5", + "hyper-util", + "pin-project-lite", + "rustls 0.21.12", + "rustls 0.23.27", + "rustls-native-certs 0.8.1", + "rustls-pki-types", + "tokio", + "tower 0.5.2", + "tracing", +] + [[package]] name = "aws-smithy-json" -version = "0.60.7" +version = "0.61.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4683df9469ef09468dad3473d129960119a0d3593617542b7d52086c8486f2d6" +checksum = "92144e45819cae7dc62af23eac5a038a58aa544432d2102609654376a900bd07" dependencies = [ "aws-smithy-types", ] +[[package]] +name = "aws-smithy-observability" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9364d5989ac4dd918e5cc4c4bdcc61c9be17dcd2586ea7f69e348fc7c6cab393" +dependencies = [ + "aws-smithy-runtime-api", +] + [[package]] name = "aws-smithy-runtime" -version = "1.7.3" +version = "1.8.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be28bd063fa91fd871d131fc8b68d7cd4c5fa0869bea68daca50dcb1cbd76be2" +checksum = "14302f06d1d5b7d333fd819943075b13d27c7700b414f574c3c35859bfb55d5e" dependencies = [ "aws-smithy-async", "aws-smithy-http", + "aws-smithy-http-client", + "aws-smithy-observability", "aws-smithy-runtime-api", "aws-smithy-types", "bytes", "fastrand", - "h2", "http 0.2.12", + "http 1.3.1", "http-body 0.4.6", "http-body 1.0.1", - "httparse", - "hyper 0.14.31", - "hyper-rustls", - "once_cell", "pin-project-lite", "pin-utils", - "rustls 0.21.12", "tokio", "tracing", ] [[package]] name = "aws-smithy-runtime-api" -version = "1.7.3" +version = "1.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "92165296a47a812b267b4f41032ff8069ab7ff783696d217f0994a0d7ab585cd" +checksum = "a1e5d9e3a80a18afa109391fb5ad09c3daf887b516c6fd805a157c6ea7994a57" dependencies = [ "aws-smithy-async", "aws-smithy-types", "bytes", "http 0.2.12", - "http 1.1.0", + "http 1.3.1", "pin-project-lite", "tokio", "tracing", @@ -1372,16 +1691,16 @@ dependencies = [ [[package]] name = "aws-smithy-types" -version = "1.2.9" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4fbd94a32b3a7d55d3806fe27d98d3ad393050439dd05eb53ece36ec5e3d3510" +checksum = "40076bd09fadbc12d5e026ae080d0930defa606856186e31d83ccc6a255eeaf3" dependencies = [ "base64-simd", "bytes", "bytes-utils", "futures-core", "http 0.2.12", - "http 1.1.0", + "http 1.3.1", "http-body 0.4.6", "http-body 1.0.1", "http-body-util", @@ -1407,9 +1726,9 @@ dependencies = [ [[package]] name = "aws-types" -version = "1.3.3" +version = "1.3.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5221b91b3e441e6675310829fd8984801b772cb1546ef6c0e54dec9f1ac13fef" +checksum = "8a322fec39e4df22777ed3ad8ea868ac2f94cd15e1a55f6ee8d8d6305057689a" dependencies = [ "aws-credential-types", "aws-smithy-async", @@ -1421,15 +1740,15 @@ dependencies = [ [[package]] name = "backtrace" -version = "0.3.74" +version = "0.3.75" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d82cb332cdfaed17ae235a638438ac4d4839913cc2af585c3c6746e8f8bee1a" +checksum = "6806a6321ec58106fea15becdad98371e28d92ccbc7c8f1b3b6dd724fe8f1002" dependencies = [ - "addr2line", + "addr2line 0.24.2", "cfg-if", "libc", "miniz_oxide", - "object", + "object 0.36.7", "rustc-demangle", "windows-targets 0.52.6", ] @@ -1447,20 +1766,15 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "4c7f02d4ea65f2c1853089ffd8d2787bdbc63de2f0d29dedbcf8ccdfa0ccd4cf" [[package]] -name = "base58check" +name = "base58ck" version = "0.1.0" -source = "git+https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda928ae569a8fdee4ff5cc951646ab280205" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2c8d66485a3a2ea485c1913c4572ce0256067a5377ac8c75c4960e1cda98605f" dependencies = [ "bitcoin-internals", "bitcoin_hashes", ] -[[package]] -name = "base64" -version = "0.12.3" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3441f0f7b02788e948e47f457ca01f1d7e6d92c693bc132c22b087d3141c03ff" - [[package]] name = "base64" version = "0.21.7" @@ -1485,9 +1799,9 @@ dependencies = [ [[package]] name = "base64ct" -version = "1.6.0" +version = "1.7.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c3c1a368f70d6cf7302d78f8f7093da241fb8e8807c05cc9e51a125895a6d5b" +checksum = "89e25b6adfb930f02d1981565a6e5d9c547ac15a96606256d3b59040e5cd4ca3" [[package]] name = "bech32" @@ -1501,27 +1815,84 @@ version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "230c5f1ca6a325a32553f8640d31ac9b49f2411e901e427570154868b46da4f7" +[[package]] +name = "bincode" +version = "1.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1f45e9417d87227c7a56d22e471c6206462cba514c7590c09aff4cf6d1ddcad" +dependencies = [ + "serde", +] + +[[package]] +name = "bindgen" +version = "0.69.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271383c67ccabffb7381723dea0672a673f292304fcb45c01cc648c7a8d58088" +dependencies = [ + "bitflags 2.9.1", + "cexpr", + "clang-sys", + "itertools 0.12.1", + "lazy_static", + "lazycell", + "log", + "prettyplease", + "proc-macro2", + "quote", + "regex", + "rustc-hash 1.1.0", + "shlex", + "syn 2.0.101", + "which", +] + [[package]] name = "bit-set" -version = "0.5.3" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0700ddab506f33b20a03b13996eccd309a48e5ff77d0d95926aa0210fb4e95f1" +checksum = "08807e080ed7f9d5433fa9b275196cfc35414f66a0c79d864dc51a0d825231a3" dependencies = [ "bit-vec", ] [[package]] name = "bit-vec" -version = "0.6.3" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5e764a1d40d510daf35e07be9eb06e75770908c27d411ee6c92109c9840eaaf7" + +[[package]] +name = "bitcode" +version = "0.6.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf300f4aa6e66f3bdff11f1236a88c622fe47ea814524792240b4d554d9858ee" +dependencies = [ + "arrayvec", + "bitcode_derive", + "bytemuck", + "glam", + "serde", +] + +[[package]] +name = "bitcode_derive" +version = "0.6.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "349f9b6a179ed607305526ca489b34ad0a41aed5f7980fa90eb03160b69598fb" +checksum = "42b6b4cb608b8282dc3b53d0f4c9ab404655d562674c682db7e6c0458cc83c23" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] [[package]] name = "bitcoin" -version = "0.31.0" -source = "git+https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda928ae569a8fdee4ff5cc951646ab280205" +version = "0.32.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8929a18b8e33ea6b3c09297b687baaa71fb1b97353243a3f1029fad5c59c5b" dependencies = [ - "base58check", + "base58ck", "bech32", "bitcoin-internals", "bitcoin-io", @@ -1535,24 +1906,25 @@ dependencies = [ [[package]] name = "bitcoin-internals" -version = "0.2.0" -source = "git+https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda928ae569a8fdee4ff5cc951646ab280205" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30bdbe14aa07b06e6cfeffc529a1f099e5fbe249524f8125358604df99a4bed2" dependencies = [ "serde", ] [[package]] name = "bitcoin-io" -version = "0.1.2" -source = "git+https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda928ae569a8fdee4ff5cc951646ab280205" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b47c4ab7a93edb0c7198c5535ed9b52b63095f4e9b45279c6736cec4b856baf" [[package]] name = "bitcoin-script" -version = "0.3.0" -source = "git+https://github.com/BitVM/rust-bitcoin-script?branch=StructuredScript#226956315350b52df0d8a1608530e0a965f405e1" +version = "0.4.0" +source = "git+https://github.com/BitVM/rust-bitcoin-script#519088c7e5e89769910dabcb1b663fa48a21a645" dependencies = [ "bitcoin", - "lazy_static", "script-macro", "stdext", ] @@ -1560,23 +1932,22 @@ dependencies = [ [[package]] name = "bitcoin-script-stack" version = "0.0.1" -source = "git+https://github.com/BitVM/rust-bitcoin-script-stack?branch=bitvm#ac312c4d02dd65b6fe54e96b4c450fa33ef10b6f" +source = "git+https://github.com/BitVM/rust-bitcoin-script-stack#643c5f1a44af448274849c01a5ae7fbdd54d8213" dependencies = [ "bitcoin", "bitcoin-script", "bitcoin-scriptexec", - "hex", ] [[package]] name = "bitcoin-scriptexec" version = "0.0.0" -source = "git+https://github.com/BitVM/rust-bitcoin-scriptexec/#5c88966fa6ed718cd5a8a8b4a0722dd1f4fad5fb" +source = "git+https://github.com/BitVM/rust-bitcoin-scriptexec#b24608bff855ea8932ae236c7a04f13f730ab9f8" dependencies = [ "bitcoin", "clap", "console_error_panic_hook", - "getrandom", + "getrandom 0.2.16", "lazy_static", "serde", "serde-wasm-bindgen", @@ -1586,8 +1957,9 @@ dependencies = [ [[package]] name = "bitcoin-units" -version = "0.1.0" -source = "git+https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda928ae569a8fdee4ff5cc951646ab280205" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5285c8bcaa25876d07f37e3d30c303f2609179716e11d688f51e8f1fe70063e2" dependencies = [ "bitcoin-internals", "serde", @@ -1595,8 +1967,9 @@ dependencies = [ [[package]] name = "bitcoin_hashes" -version = "0.13.0" -source = "git+https://github.com/rust-bitcoin/rust-bitcoin?branch=bitvm#48efda928ae569a8fdee4ff5cc951646ab280205" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bb18c03d0db0247e147a21a6faafd5a7eb851c743db062de72018b6b7e8e4d16" dependencies = [ "bitcoin-io", "hex-conservative", @@ -1611,9 +1984,9 @@ checksum = "bef38d45163c2f1dde094a7dfd33ccf595c92905c8f8f4fdc18d06fb1037718a" [[package]] name = "bitflags" -version = "2.6.0" +version = "2.9.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b048fb63fd8b5923fc5aa7b340d8e156aec7ec02f0c78fa8a6ddc2613f6f71de" +checksum = "1b8e56985ec62d17e9c1001dc89c88ecd7dc08e47eba5ec7c29c7b5eeecde967" [[package]] name = "bitvec" @@ -1631,50 +2004,46 @@ dependencies = [ name = "bitvm" version = "0.1.0" dependencies = [ - "alloy", - "ark-bn254", - "ark-crypto-primitives", - "ark-ec", - "ark-ff 0.4.2", - "ark-groth16", - "ark-relations", - "ark-std 0.4.0", - "async-trait", - "aws-sdk-s3", + "ark-bn254 0.5.0", + "ark-crypto-primitives 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-groth16 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-std 0.5.0", "bitcoin", "bitcoin-script", "bitcoin-script-stack", "bitcoin-scriptexec", "blake3", - "clap", "colored", - "dotenv", - "esplora-client", - "futures", - "hex", - "lazy_static", - "musig2", - "num-bigint", + "itertools 0.13.0", + "num-bigint 0.4.6", "num-traits", - "once_cell", - "openssh", - "openssh-sftp-client", "paste", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "regex", "serde", "serde_json", - "serial_test", "sha2", - "strum", - "strum_macros", - "suppaftp", - "tokio", - "toml", "tqdm", ] +[[package]] +name = "bitvm-fuzz" +version = "0.0.0" +dependencies = [ + "arbitrary", + "bitcoin", + "bitcoin-script", + "bitcoin-script-stack", + "bitvm", + "blake3", + "libfuzzer-sys", +] + [[package]] name = "blake2" version = "0.10.6" @@ -1686,9 +2055,9 @@ dependencies = [ [[package]] name = "blake3" -version = "1.5.1" +version = "1.8.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "30cca6d3674597c30ddf2c587bf8d9d65c9a84d2326d941cc79c9842dfe0ef52" +checksum = "3888aaa89e4b2a40fca9848e400f6a658a5a3978de7be858e209cafa8be9a4a0" dependencies = [ "arrayref", "arrayvec", @@ -1697,6 +2066,12 @@ dependencies = [ "constant_time_eq", ] +[[package]] +name = "block" +version = "0.1.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d8c1fef690941d3e7788d328517591fecc684c084084702d6ff1641e993699a" + [[package]] name = "block-buffer" version = "0.10.4" @@ -1721,9 +2096,9 @@ dependencies = [ [[package]] name = "blst" -version = "0.3.13" +version = "0.3.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4378725facc195f1a538864863f6de233b500a8862747e7f165078a419d5e874" +checksum = "47c79a94619fade3c0b887670333513a67ac28a6a7e653eb260bf0d4103db38d" dependencies = [ "cc", "glob", @@ -1731,17 +2106,108 @@ dependencies = [ "zeroize", ] +[[package]] +name = "borsh" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad8646f98db542e39fc66e68a20b2144f6a732636df7c2354e74645faaa433ce" +dependencies = [ + "borsh-derive", + "cfg_aliases", +] + +[[package]] +name = "borsh-derive" +version = "1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fdd1d3c0c2f5833f22386f252fe8ed005c7f59fdcddeef025c01b4c3b9fd9ac3" +dependencies = [ + "once_cell", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "bridge" +version = "0.1.0" +dependencies = [ + "alloy", + "ark-bn254 0.5.0", + "ark-crypto-primitives 0.5.0", + "ark-ec 0.5.0", + "ark-ff 0.5.0", + "ark-groth16 0.5.0", + "ark-relations 0.5.1", + "ark-serialize 0.5.0", + "ark-std 0.5.0", + "async-trait", + "aws-sdk-s3", + "bitcode", + "bitcoin", + "bitcoin-script", + "bitcoin-scriptexec", + "bitvm", + "clap", + "colored", + "derive_more 2.0.1", + "dotenv", + "esplora-client", + "futures", + "human_bytes", + "itertools 0.13.0", + "lru 0.13.0", + "musig2", + "num-traits", + "openssh", + "openssh-sftp-client", + "rand 0.8.5", + "regex", + "secp256k1", + "serde", + "serde_json", + "serial_test", + "sha2", + "strum 0.27.1", + "strum_macros 0.27.1", + "suppaftp", + "tokio", + "toml 0.5.11", + "zstd", +] + [[package]] name = "bumpalo" -version = "3.16.0" +version = "3.17.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "79296716171880943b8470b5f8d03aa55eb2e645a4874bdbb28adb49162e012c" +checksum = "1628fb46dfa0b37568d12e5edd512553eccf6a22a78e8bde00bb4aed84d5bdbf" [[package]] name = "byte-slice-cast" -version = "1.2.2" +version = "1.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7575182f7272186991736b70173b0ea045398f984bf5ebbb3804736ce1330c9d" + +[[package]] +name = "bytemuck" +version = "1.23.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9134a6ef01ce4b366b50689c94f82c14bc72bc5d0386829828a2e2752ef7958c" +dependencies = [ + "bytemuck_derive", +] + +[[package]] +name = "bytemuck_derive" +version = "1.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c3ac9f8b63eca6fd385229b3675f6cc0dc5c8a5c8a54a59d4f52ffd670d87b0c" +checksum = "3fa76293b4f7bb636ab88fd78228235b5248b4d05cc589aed610f954af5d7c7a" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] [[package]] name = "byteorder" @@ -1751,9 +2217,9 @@ checksum = "1fd0f2584146f6f2ef48085050886acf353beff7305ebd1ae69500e27c67f64b" [[package]] name = "bytes" -version = "1.9.0" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "325918d6fe32f23b19878fe4b34794ae41fc19ddbe53b10571a4874d44ffd39b" +checksum = "d71b6127be86fdcfddb610f7182ac57211d4b18a3e9c82eb2d17662f2227ad6a" dependencies = [ "serde", ] @@ -1783,38 +2249,98 @@ dependencies = [ "serde", ] +[[package]] +name = "camino" +version = "1.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8b96ec4966b5813e2c0507c1f86115c8c5abaadc3980879c3424042a02fd1ad3" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo-platform" +version = "0.1.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e35af189006b9c0f00a064685c727031e3ed2d8020f7ba284d78cc2671bd36ea" +dependencies = [ + "serde", +] + +[[package]] +name = "cargo_metadata" +version = "0.19.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dd5eb614ed4c27c5d706420e4320fbe3216ab31fa1c33cd8246ac36dae4479ba" +dependencies = [ + "camino", + "cargo-platform", + "semver 1.0.26", + "serde", + "serde_json", + "thiserror 2.0.12", +] + [[package]] name = "cc" -version = "1.2.2" +version = "1.2.23" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f34d93e62b03caf570cccc334cbc6c2fceca82f39211051345108adcba3eebdc" +checksum = "5f4ac86a9e5bc1e2b3449ab9d7d3a6a405e3d1bb28d7b9be8614f55846ae3766" dependencies = [ + "jobserver", + "libc", "shlex", ] +[[package]] +name = "cexpr" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6fac387a98bb7c37292057cffc56d62ecb629900026402633ae9160df93a8766" +dependencies = [ + "nom", +] + [[package]] name = "cfg-if" version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "baf1de4339761588bc0619e3cbc0120ee582ebb74b53b4efbf79117bd2da40fd" +[[package]] +name = "cfg_aliases" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "613afe47fcd5fac7ccf1db93babcb082c5994d996f20b8b159f2ad1658eb5724" + [[package]] name = "chrono" -version = "0.4.38" +version = "0.4.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a21f936df1771bf62b77f047b726c4625ff2e8aa607c01ec06e5a05bd8463401" +checksum = "c469d952047f47f91b68d1cba3f10d63c11d73e4636f24f08daf0278abf01c4d" dependencies = [ "android-tzdata", "iana-time-zone", "num-traits", - "windows-targets 0.52.6", + "windows-link", +] + +[[package]] +name = "clang-sys" +version = "1.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b023947811758c97c59bf9d1c188fd619ad4718dcaa767947df1cadb14f39f4" +dependencies = [ + "glob", + "libc", + "libloading", ] [[package]] name = "clap" -version = "4.5.21" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fb3b4b9e5a7c7514dfa52869339ee98b3156b0bfb4e8a77c4ff4babb64b1604f" +checksum = "ed93b9805f8ba930df42c2590f05453d5ec36cbb85d018868a5b24d31f6ac000" dependencies = [ "clap_builder", "clap_derive", @@ -1822,9 +2348,9 @@ dependencies = [ [[package]] name = "clap_builder" -version = "4.5.21" +version = "4.5.38" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b17a95aa67cc7b5ebd32aa5370189aa0d79069ef1c64ce893bd30fb24bff20ec" +checksum = "379026ff283facf611b0ea629334361c4211d1b12ee01024eec1591133b04120" dependencies = [ "anstream", "anstyle", @@ -1834,21 +2360,36 @@ dependencies = [ [[package]] name = "clap_derive" -version = "4.5.18" +version = "4.5.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ac6a0c7b1a9e9a5186361f67dfa1b88213572f427fb9ab038efb2bd8c582dab" +checksum = "09176aae279615badda0765c0c0b3f6ed53f4709118af73cf4655d85d1530cd7" dependencies = [ "heck", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "clap_lex" -version = "0.7.3" +version = "0.7.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f46ad14479a25103f283c0f10005961cf086d8dc42205bb44c46ac563475dca6" + +[[package]] +name = "cmake" +version = "0.1.54" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e7caa3f9de89ddbe2c607f4101924c5abec803763ae9534e4f4d7d8f84aa81f0" +dependencies = [ + "cc", +] + +[[package]] +name = "cobs" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "afb84c814227b90d6895e01398aee0d8033c00e7466aca416fb6a8e0eb19d8a7" +checksum = "67ba02a97a2bd10f4b59b25c7973101c79642302776489e030cd13cdab09ed15" [[package]] name = "colorchoice" @@ -1858,12 +2399,12 @@ checksum = "5b63caa9aa9397e2d9480a9b13673856c78d8ac123288526c37d7839f2a86990" [[package]] name = "colored" -version = "2.1.0" +version = "2.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cbf2150cce219b664a8a70df7a1f933836724b503f8a413af9365b4dcc4d90b8" +checksum = "117725a109d387c937a1533ce01b450cbde6b88abceea8473c4d7a85853cda3c" dependencies = [ "lazy_static", - "windows-sys 0.48.0", + "windows-sys 0.59.0", ] [[package]] @@ -1898,9 +2439,9 @@ dependencies = [ [[package]] name = "const-hex" -version = "1.14.0" +version = "1.14.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4b0485bab839b018a8f1723fc5391819fea5f8f0f32288ef8a735fd096b6160c" +checksum = "83e22e0ed40b96a48d3db274f72fd365bd78f67af39b6bbd47e8a15e1c6207ff" dependencies = [ "cfg-if", "cpufeatures", @@ -1915,6 +2456,26 @@ version = "0.9.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "c2459377285ad874054d797f3ccebf984978aa39129f6eafde5cdc8315b612f8" +[[package]] +name = "const_format" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "126f97965c8ad46d6d9163268ff28432e8f6a1196a55578867832e3049df63dd" +dependencies = [ + "const_format_proc_macros", +] + +[[package]] +name = "const_format_proc_macros" +version = "0.2.34" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d57c2eccfb16dbac1f4e61e206105db5820c9d26c3c472bc17c774259ef7744" +dependencies = [ + "proc-macro2", + "quote", + "unicode-xid", +] + [[package]] name = "constant_time_eq" version = "0.3.1" @@ -1937,6 +2498,16 @@ dependencies = [ "libc", ] +[[package]] +name = "core-foundation" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b55271e5c8c478ad3f38ad24ef34923091e0548492a266d19b3c0b4d82574c63" +dependencies = [ + "core-foundation-sys", + "libc", +] + [[package]] name = "core-foundation-sys" version = "0.8.7" @@ -1944,60 +2515,106 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "773648b94d0e5d620f64f280777445740e61fe701025087ec8b57f45c791888b" [[package]] -name = "cpufeatures" -version = "0.2.16" +name = "core-graphics-types" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16b80225097f2e5ae4e7179dd2266824648f3e2f49d9134d584b76389d31c4c3" +checksum = "45390e6114f68f718cc7a830514a96f903cccd70d02a8f6d9f643ac4ba45afaf" dependencies = [ + "bitflags 1.3.2", + "core-foundation 0.9.4", "libc", ] [[package]] -name = "crc32c" -version = "0.6.8" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3a47af21622d091a8f0fb295b88bc886ac74efcc613efc19f5d0b21de5c89e47" -dependencies = [ - "rustc_version 0.4.1", -] - -[[package]] -name = "crc32fast" -version = "1.4.2" +name = "cpp_demangle" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +checksum = "96e58d342ad113c2b878f16d5d034c03be492ae460cdbc02b7f0f2284d310c7d" dependencies = [ "cfg-if", ] [[package]] -name = "crossbeam-deque" -version = "0.8.5" +name = "cpufeatures" +version = "0.2.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "613f8cc01fe9cf1a3eb3d7f488fd2fa8388403e97039e2f73692932e291a770d" +checksum = "59ed5838eebb26a2bb2e58f6d5b5316989ae9d08bab10e0e6d103e656d1b0280" dependencies = [ - "crossbeam-epoch", - "crossbeam-utils", + "libc", ] [[package]] -name = "crossbeam-epoch" -version = "0.9.18" +name = "crc" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +checksum = "9710d3b3739c2e349eb44fe848ad0b7c8cb1e42bd87ee49371df2f7acaf3e675" dependencies = [ - "crossbeam-utils", + "crc-catalog", ] [[package]] -name = "crossbeam-utils" -version = "0.8.20" +name = "crc-catalog" +version = "2.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22ec99545bb0ed0ea7bb9b8e1e9122ea386ff8a48c0922e43f36d45ab09e0e80" +checksum = "19d374276b40fb8bbdee95aef7c7fa6b5316ec764510eb64b8dd0e2ed0d7e7f5" [[package]] -name = "crossterm" -version = "0.25.0" +name = "crc-fast" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "add8d3a4c789d77eeb0f0e3c1035f73610d017f9047e87db94f89c02a56d8fef" +dependencies = [ + "cc", + "crc", + "digest 0.10.7", + "libc", + "rand 0.9.1", + "regex", +] + +[[package]] +name = "crc32fast" +version = "1.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a97769d94ddab943e4510d138150169a2758b5ef3eb191a9ee688de3e23ef7b3" +dependencies = [ + "cfg-if", +] + +[[package]] +name = "critical-section" +version = "1.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "790eea4361631c5e7d22598ecd5723ff611904e3344ce8720784c93e3d83d40b" + +[[package]] +name = "crossbeam-deque" +version = "0.8.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9dd111b7b7f7d55b72c0a6ae361660ee5853c9af73f70c3c2ef6858b950e2e51" +dependencies = [ + "crossbeam-epoch", + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-epoch" +version = "0.9.18" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5b82ac4a3c2ca9c3460964f020e1402edd5753411d7737aa39c3714ad1b5420e" +dependencies = [ + "crossbeam-utils", +] + +[[package]] +name = "crossbeam-utils" +version = "0.8.21" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d0a5c400df2834b80a4c3327b3aad3a4c4cd4de0629063962b03235697506a28" + +[[package]] +name = "crossterm" +version = "0.25.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e64e6c0fbe2c17357405f7c758c1ef960fce08bdfb2c03d88d2a18d7e09c4b67" dependencies = [ @@ -2022,9 +2639,9 @@ dependencies = [ [[package]] name = "crunchy" -version = "0.2.2" +version = "0.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7a81dae078cea95a014a339291cec439d2f232ebe854a9d672b796c6afafa9b7" +checksum = "43da5946c66ffcc7745f48db692ffbb10a83bfe0afd96235c5c2a4fb23994929" [[package]] name = "crypto-bigint" @@ -2033,11 +2650,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ef2b4b23cddf68b89b8f8069890e8c270d54e2d5fe1b143820234805e4cb17ef" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] +[[package]] +name = "crypto-bigint" +version = "0.5.2" +source = "git+https://github.com/risc0/RustCrypto-crypto-bigint?tag=v0.5.2-risczero.0#8b30304277cfe553b51a78a0e693f48bbb059eb3" +dependencies = [ + "getrandom 0.2.16", + "subtle", +] + [[package]] name = "crypto-bigint" version = "0.5.5" @@ -2045,7 +2671,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0dc92fb57ca44df6db8059111ab3af99a63d5d0f8375d9972e319a379c6bab76" dependencies = [ "generic-array", - "rand_core", + "rand_core 0.6.4", "subtle", "zeroize", ] @@ -2060,6 +2686,41 @@ dependencies = [ "typenum", ] +[[package]] +name = "darling" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc7f46116c46ff9ab3eb1597a45688b6715c6e628b5c133e288e709a29bcb4ee" +dependencies = [ + "darling_core", + "darling_macro", +] + +[[package]] +name = "darling_core" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0d00b9596d185e565c2207a0b01f8bd1a135483d02d9b7b0a54b11da8d53412e" +dependencies = [ + "fnv", + "ident_case", + "proc-macro2", + "quote", + "strsim", + "syn 2.0.101", +] + +[[package]] +name = "darling_macro" +version = "0.20.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fc34b93ccb385b40dc71c6fceac4b2ad23662c7eeb248cf10d529b7e055b6ead" +dependencies = [ + "darling_core", + "quote", + "syn 2.0.101", +] + [[package]] name = "dashmap" version = "5.5.3" @@ -2075,9 +2736,9 @@ dependencies = [ [[package]] name = "data-encoding" -version = "2.6.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e8566979429cf69b49a5c740c60791108e86440e8be149bbea4fe54d2c32d6e2" +checksum = "2a2330da5de22e8a3cb63252ce2abb30116bf5265e89c0e01bc17015ce30a476" [[package]] name = "der" @@ -2091,9 +2752,9 @@ dependencies = [ [[package]] name = "der" -version = "0.7.9" +version = "0.7.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f55bf8e7b65898637379c1b74eb1551107c8294ed26d855ceb9fd1a09cfc9bc0" +checksum = "e7c1832837b905bbfb5101e07cc24c8deddf52f93225eee6ead5f4d63d53ddcb" dependencies = [ "const-oid", "zeroize", @@ -2101,9 +2762,9 @@ dependencies = [ [[package]] name = "deranged" -version = "0.3.11" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b42b6fa04a440b495c8b04d0e71b707c585f83cb9cb28cf8cd0d976c315e31b4" +checksum = "9c9e6a11ca8224451684bc0d7d5a7adbf8f2fd6887261a1cfc3c0432f9d4068e" dependencies = [ "powerfmt", ] @@ -2119,6 +2780,48 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_arbitrary" +version = "1.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "30542c1ad912e0e3d22a1935c290e12e8a29d704a420177a31faad4a601a0800" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "derive_builder" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "507dfb09ea8b7fa618fcf76e953f4f5e192547945816d5358edffe39f6f94947" +dependencies = [ + "derive_builder_macro", +] + +[[package]] +name = "derive_builder_core" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d5bcf7b024d6835cfb3d473887cd966994907effbe9227e8c8219824d06c4e8" +dependencies = [ + "darling", + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "derive_builder_macro" +version = "0.20.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab63b0e2bf4d5928aff72e83a7dace85d7bba5fe12dcc3c5a572d78caffd3f3c" +dependencies = [ + "derive_builder_core", + "syn 2.0.101", +] + [[package]] name = "derive_destructure2" version = "0.1.3" @@ -2127,40 +2830,40 @@ checksum = "64b697ac90ff296f0fc031ee5a61c7ac31fb9fff50e3fb32873b09223613fc0c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "derive_more" -version = "0.99.18" +version = "0.99.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5f33878137e4dafd7fa914ad4e259e18a4e8e532b9617a2d0150262bf53abfce" +checksum = "6edb4b64a43d977b8e99788fe3a04d483834fba1215a7e02caa415b626497f7f" dependencies = [ "convert_case", "proc-macro2", "quote", "rustc_version 0.4.1", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "derive_more" -version = "1.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4a9b99b9cbbe49445b21764dc0625032a89b145a2642e67603e1c936f5458d05" +checksum = "093242cf7570c207c83073cf82f79706fe7b8317e98620a47d5be7c3d8497678" dependencies = [ "derive_more-impl", ] [[package]] name = "derive_more-impl" -version = "1.0.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cb7330aeadfbe296029522e6c40f315320aba36fc43a5b3632f3795348f3bd22" +checksum = "bda628edc44c4bb645fbe0f758797143e4e07926f7ebf4e9bdfbd3d2ce621df3" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "unicode-xid", ] @@ -2185,6 +2888,36 @@ dependencies = [ "subtle", ] +[[package]] +name = "directories" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9a49173b84e034382284f27f1af4dcbbd231ffa358c0fe316541a7337f376a35" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs" +version = "5.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "44c45a9d03d6676652bcb5e724c7e988de1acad23a711b5217ab9cbecbec2225" +dependencies = [ + "dirs-sys", +] + +[[package]] +name = "dirs-sys" +version = "0.4.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "520f05a5cbd335fae5a99ff7a6ab8627577660ee5cfd6a94a6a929b52ff0321c" +dependencies = [ + "libc", + "option-ext", + "redox_users", + "windows-sys 0.48.0", +] + [[package]] name = "displaydoc" version = "0.2.5" @@ -2193,9 +2926,15 @@ checksum = "97369cbbc041bc366949bc74d34658d6cda5621039731c6310521892a3a20ae0" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] +[[package]] +name = "docker-generate" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ccf673e0848ef09fa4aeeba78e681cf651c0c7d35f76ee38cec8e55bc32fa111" + [[package]] name = "doctest-file" version = "1.0.0" @@ -2208,6 +2947,26 @@ version = "0.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77c90badedccf4105eca100756a0b1289e191f6fcbdadd3cee1d2f614f97da8f" +[[package]] +name = "downcast-rs" +version = "1.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "75b325c5dbd37f80359721ad39aca5a29fb04c89279657cffdda8736d0c0b9d2" + +[[package]] +name = "downloader" +version = "0.2.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ac1e888d6830712d565b2f3a974be3200be9296bc1b03db8251a4cbf18a4a34" +dependencies = [ + "digest 0.10.7", + "futures", + "rand 0.8.5", + "reqwest 0.12.15", + "thiserror 1.0.69", + "tokio", +] + [[package]] name = "dunce" version = "1.0.5" @@ -2232,7 +2991,7 @@ version = "0.16.9" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ee27f32b5c5292967d2d4a9d7f1e0b0aed2c15daded5a60300e4abb9d8020bca" dependencies = [ - "der 0.7.9", + "der 0.7.10", "digest 0.10.7", "elliptic-curve 0.13.8", "rfc6979 0.4.0", @@ -2249,14 +3008,20 @@ dependencies = [ "enum-ordinalize", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "either" -version = "1.13.0" +version = "1.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "48c757948c5ede0e46177b7add2e67155f70e33c07fea8284df6576da70b3719" + +[[package]] +name = "elf" +version = "0.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "60b1af1c220855b6ceac025d3f6ecdd2b7c4894bfe9cd9bda4fbb4bc7c0d4cf0" +checksum = "4445909572dbd556c457c849c4ca58623d84b27c8fff1e74b0b4227d8b90d17b" [[package]] name = "elliptic-curve" @@ -2272,7 +3037,7 @@ dependencies = [ "generic-array", "group 0.12.1", "pkcs8 0.9.0", - "rand_core", + "rand_core 0.6.4", "sec1 0.3.0", "subtle", "zeroize", @@ -2287,16 +3052,28 @@ dependencies = [ "base16ct 0.2.0", "crypto-bigint 0.5.5", "digest 0.10.7", - "ff 0.13.0", + "ff 0.13.1", "generic-array", "group 0.13.0", "pkcs8 0.10.2", - "rand_core", + "rand_core 0.6.4", "sec1 0.7.3", "subtle", "zeroize", ] +[[package]] +name = "embedded-io" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ef1a6892d9eef45c8fa6b9e0086428a2cca8491aca8f787c534a3d6d0bcb3ced" + +[[package]] +name = "embedded-io" +version = "0.6.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edd0f118536f44f5ccd48bcb8b111bdc3de888b58c74639dfb034a357d0f206d" + [[package]] name = "encoding_rs" version = "0.8.35" @@ -2306,6 +3083,26 @@ dependencies = [ "cfg-if", ] +[[package]] +name = "enum-map" +version = "2.7.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6866f3bfdf8207509a033af1a75a7b08abda06bbaaeae6669323fd5a097df2e9" +dependencies = [ + "enum-map-derive", +] + +[[package]] +name = "enum-map-derive" +version = "0.17.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f282cfdfe92516eb26c2af8589c274c7c17681f5ecc03c18255fe741c6aa64eb" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + [[package]] name = "enum-ordinalize" version = "4.3.0" @@ -2323,20 +3120,30 @@ checksum = "0d28318a75d4aead5c4db25382e8ef717932d0346600cacae6357eb5941bc5ff" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "equivalent" -version = "1.0.1" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + +[[package]] +name = "erased-serde" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5443807d6dff69373d433ab9ef5378ad8df50ca6298caf15de6e52e24aaf54d5" +checksum = "e004d887f51fcb9fef17317a2f3525c887d8aa3f4f50fed920816a688284a5b7" +dependencies = [ + "serde", + "typeid", +] [[package]] name = "errno" -version = "0.3.10" +version = "0.3.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33d852cb9b869c2a9b3df2f71a3074817f01e1844f839a144f5fcef059a4eb5d" +checksum = "cea14ef9355e3beab063703aa9dab15afd25f0667c341310c1e5274bb1d0da18" dependencies = [ "libc", "windows-sys 0.59.0", @@ -2344,8 +3151,8 @@ dependencies = [ [[package]] name = "esplora-client" -version = "0.7.0" -source = "git+https://github.com/BitVM/rust-esplora-client#3d61a8bf75fd4cac7eab454243a7daefe27230f9" +version = "0.11.0" +source = "git+https://github.com/BitVM/rust-esplora-client#7befb9147b69126edaad8b9dbd0b13259f2e9ea0" dependencies = [ "bitcoin", "hex-conservative", @@ -2353,6 +3160,7 @@ dependencies = [ "minreq", "reqwest 0.11.27", "serde", + "tokio", ] [[package]] @@ -2363,9 +3171,9 @@ checksum = "0206175f82b8d6bf6652ff7d71a1e27fd2e4efde587fd368662814d6ec1d9ce0" [[package]] name = "event-listener" -version = "5.3.1" +version = "5.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6032be9bd27023a771701cc49f9f053c751055f71efb2e0ae5c15809093675ba" +checksum = "3492acde4c3fc54c845eaab3eed8bd00c7a7d881f78bfc801e43a93dec1331ae" dependencies = [ "concurrent-queue", "parking", @@ -2374,19 +3182,25 @@ dependencies = [ [[package]] name = "event-listener-strategy" -version = "0.5.3" +version = "0.5.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c3e4e0dd3673c1139bf041f3008816d9cf2946bbfac2945c09e523b8d7b05b2" +checksum = "8be9f3dfaaffdae2972880079a491a1a8bb7cbed0b8dd7a347f668b4150a3b93" dependencies = [ - "event-listener 5.3.1", + "event-listener 5.4.0", "pin-project-lite", ] +[[package]] +name = "fallible-iterator" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2acce4a10f12dc2fb14a218589d4f1f62ef011b2d0cc4b3cb1bba8e94da14649" + [[package]] name = "fastrand" -version = "2.2.0" +version = "2.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "486f806e73c5707928240ddc295403b1b93c96a02038563881c4a2fd84b81ac4" +checksum = "37909eebbb50d72f9059c3b6d82c0463f2ff062c9e95845c43a6c9c0355411be" [[package]] name = "fastrlp" @@ -2399,26 +3213,78 @@ dependencies = [ "bytes", ] +[[package]] +name = "fastrlp" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ce8dba4714ef14b8274c371879b175aa55b16b30f269663f19d576f380018dc4" +dependencies = [ + "arrayvec", + "auto_impl", + "bytes", +] + [[package]] name = "ff" version = "0.12.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d013fc25338cc558c5c2cfbad646908fb23591e2404481826742b651c9af7160" dependencies = [ - "rand_core", + "rand_core 0.6.4", "subtle", ] [[package]] name = "ff" -version = "0.13.0" +version = "0.13.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ded41244b729663b1e574f1b4fb731469f69f79c17667b5d776b16cda0479449" +checksum = "c0b50bfb653653f9ca9095b427bed08ab8d75a137839d9ad64eb11810d5b6393" dependencies = [ - "rand_core", + "bitvec", + "byteorder", + "ff_derive", + "rand_core 0.6.4", "subtle", ] +[[package]] +name = "ff_derive" +version = "0.13.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f10d12652036b0e99197587c6ba87a8fc3031986499973c030d8b44fcc151b60" +dependencies = [ + "addchain", + "num-bigint 0.3.3", + "num-integer", + "num-traits", + "proc-macro2", + "quote", + "syn 1.0.109", +] + +[[package]] +name = "final-spv" +version = "0.1.0" +dependencies = [ + "bitcoin", + "blake3", + "borsh", + "crypto-bigint 0.5.5", + "header-chain", + "hex-literal", + "risc0-zkvm", + "serde", + "sha2", +] + +[[package]] +name = "final-spv-circuit" +version = "0.1.0" +dependencies = [ + "risc0-binfmt 2.0.1", + "risc0-build", +] + [[package]] name = "fixed-hash" version = "0.8.0" @@ -2426,11 +3292,21 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" dependencies = [ "byteorder", - "rand", + "rand 0.8.5", "rustc-hex", "static_assertions", ] +[[package]] +name = "flate2" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ced92e76e966ca2fd84c8f7aa01a4aea65b0eb6648d72f7c8f3e2764a67fece" +dependencies = [ + "crc32fast", + "miniz_oxide", +] + [[package]] name = "fnv" version = "1.0.7" @@ -2439,9 +3315,9 @@ checksum = "3f9eec918d3f24069decb9af1554cad7c880e2da24a9afd88aca000531ab82c1" [[package]] name = "foldhash" -version = "0.1.3" +version = "0.1.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f81ec6369c545a7d40e4589b5597581fa1c441fe1cce96dd1de43159910a36a2" +checksum = "d9c4f5dac5e15c24eb999c26181a6ca40b39fe946cbe4c263c7209467bc83af2" [[package]] name = "foreign-types" @@ -2449,7 +3325,28 @@ version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f6f339eb8adc052cd2ca78910fda869aefa38d22d5cb648e6485e4d3fc06f3b1" dependencies = [ - "foreign-types-shared", + "foreign-types-shared 0.1.1", +] + +[[package]] +name = "foreign-types" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d737d9aa519fb7b749cbc3b962edcf310a8dd1f4b67c91c4f83975dbdd17d965" +dependencies = [ + "foreign-types-macros", + "foreign-types-shared 0.3.1", +] + +[[package]] +name = "foreign-types-macros" +version = "0.2.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1a5c6c585bc94aaf2c7b51dd4c2ba22680844aba4c687be581871a6f518c5742" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] @@ -2458,6 +3355,12 @@ version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "00b0228411908ca8685dba7fc2cdd70ec9990a6e753e89b6ac91a84c40fbaf4b" +[[package]] +name = "foreign-types-shared" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "aa9a19cbb55df58761df49b23516a86d432839add4af60fc256da840f66ed35b" + [[package]] name = "form_urlencoded" version = "1.2.1" @@ -2467,6 +3370,12 @@ dependencies = [ "percent-encoding", ] +[[package]] +name = "fs_extra" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "42703706b716c37f96a77aea830392ad231f44c9e9a67872fa5548707e11b11c" + [[package]] name = "funty" version = "2.0.0" @@ -2523,9 +3432,9 @@ checksum = "9e5c1b78ca4aae1ac06c48a526a655760685149f0d465d21f37abfe57ce075c6" [[package]] name = "futures-lite" -version = "2.5.0" +version = "2.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cef40d21ae2c515b51041df9ed313ed21e572df340ea58a922a0aefe7e8891a1" +checksum = "f5edaec856126859abb19ed65f39e90fea3a9574b9707f13539acf4abf7eb532" dependencies = [ "fastrand", "futures-core", @@ -2542,7 +3451,7 @@ checksum = "162ee34ebcb7c64a8abebc059ce0fee27c2262618d7b60ed8faf72fef13c3650" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -2594,28 +3503,58 @@ dependencies = [ [[package]] name = "getrandom" -version = "0.2.15" +version = "0.2.16" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "335ff9f135e4384c8150d6f27c6daed433577f86b4750418338c01a1a2528592" +dependencies = [ + "cfg-if", + "js-sys", + "libc", + "wasi 0.11.0+wasi-snapshot-preview1", + "wasm-bindgen", +] + +[[package]] +name = "getrandom" +version = "0.3.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c4567c8db10ae91089c99af84c68c38da3ec2f087c3f82960bcdbf3656b6f4d7" +checksum = "26145e563e54f2cadc477553f1ec5ee650b00862f0a58bcd12cbdc5f0ea2d2f4" dependencies = [ "cfg-if", "js-sys", "libc", - "wasi", + "r-efi", + "wasi 0.14.2+wasi-0.2.4", "wasm-bindgen", ] +[[package]] +name = "gimli" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "40ecd4077b5ae9fd2e9e169b102c6c330d0605168eb0e8bf79952b256dbefffd" +dependencies = [ + "fallible-iterator", + "stable_deref_trait", +] + [[package]] name = "gimli" version = "0.31.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "07e28edb80900c19c28f1072f2e8aeca7fa06b23cd4169cefe1af5aa3260783f" +[[package]] +name = "glam" +version = "0.30.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6b46b9ca4690308844c644e7c634d68792467260e051c8543e0c7871662b3ba7" + [[package]] name = "glob" -version = "0.3.1" +version = "0.3.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d2fabcfbdc87f4758337ca535fb41a6d701b65693ce38287d856d1674551ec9b" +checksum = "a8d1add55171497b4705a648c6b583acafb01d58050a51727785f0b2c8e0a2b2" [[package]] name = "gloo-timers" @@ -2636,7 +3575,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "5dfbfb3a6cfbd390d5c9564ab283a0349b9b9fcd46a706c1eb10e0db70bfbac7" dependencies = [ "ff 0.12.1", - "rand_core", + "rand_core 0.6.4", "subtle", ] @@ -2646,8 +3585,8 @@ version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f0f9ef7462f7c099f518d754361858f86d8a07af53ba9af0fe635bbccb151a63" dependencies = [ - "ff 0.13.0", - "rand_core", + "ff 0.13.1", + "rand_core 0.6.4", "subtle", ] @@ -2670,23 +3609,107 @@ dependencies = [ "tracing", ] +[[package]] +name = "h2" +version = "0.4.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a9421a676d1b147b16b82c9225157dc629087ef8ec4d5e2960f9437a90dac0a5" +dependencies = [ + "atomic-waker", + "bytes", + "fnv", + "futures-core", + "futures-sink", + "http 1.3.1", + "indexmap", + "slab", + "tokio", + "tokio-util", + "tracing", +] + +[[package]] +name = "hash32" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0c35f58762feb77d74ebe43bdbc3210f09be9fe6742234d573bacc26ed92b67" +dependencies = [ + "byteorder", +] + +[[package]] +name = "hashbrown" +version = "0.13.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "43a3c133739dddd0d2990f9a4bdf8eb4b21ef50e4851ca85ab661199821d510e" +dependencies = [ + "ahash", +] + [[package]] name = "hashbrown" version = "0.14.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "e5274423e17b7c9fc20b6e7e208532f9b19825d82dfd615708b70edd83df41f1" +dependencies = [ + "ahash", +] [[package]] name = "hashbrown" -version = "0.15.2" +version = "0.15.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bf151400ff0baff5465007dd2f3e717f3fe502074ca563069ce3a6629d07b289" +checksum = "84b26c544d002229e640969970a2e74021aadf6e2f96372b9c58eff97de08eb3" dependencies = [ "allocator-api2", "equivalent", "foldhash", ] +[[package]] +name = "hashlink" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6ba4ff7128dee98c7dc9794b6a411377e1404dba1c97deb8d1a55297bd25d8af" +dependencies = [ + "hashbrown 0.14.5", +] + +[[package]] +name = "header-chain" +version = "0.1.0" +dependencies = [ + "bitcoin", + "borsh", + "crypto-bigint 0.5.5", + "hex-literal", + "risc0-zkvm", + "serde", + "sha2", +] + +[[package]] +name = "header-chain-circuit" +version = "0.1.0" +dependencies = [ + "risc0-binfmt 2.0.1", + "risc0-build", +] + +[[package]] +name = "heapless" +version = "0.7.17" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cdc6457c0eb62c71aac4bc17216026d8410337c4126773b9c5daba343f17964f" +dependencies = [ + "atomic-polyfill", + "hash32", + "rustc_version 0.4.1", + "serde", + "spin", + "stable_deref_trait", +] + [[package]] name = "heck" version = "0.5.0" @@ -2744,6 +3767,15 @@ dependencies = [ "digest 0.10.7", ] +[[package]] +name = "home" +version = "0.5.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "589533453244b0995c858700322199b2becb13b627df2851f64a2775d024abcf" +dependencies = [ + "windows-sys 0.59.0", +] + [[package]] name = "http" version = "0.2.12" @@ -2757,9 +3789,9 @@ dependencies = [ [[package]] name = "http" -version = "1.1.0" +version = "1.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "21b9ddb458710bc376481b842f5da65cdf31522de232c1ca8146abce2a358258" +checksum = "f4a85d31aea989eead29a3aaf9e1115a180df8282431156e533de47660892565" dependencies = [ "bytes", "fnv", @@ -2784,27 +3816,27 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "1efedce1fb8e6913f23e0c92de8e62cd5b772a67e7b3946df930a62566c93184" dependencies = [ "bytes", - "http 1.1.0", + "http 1.3.1", ] [[package]] name = "http-body-util" -version = "0.1.2" +version = "0.1.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793429d76616a256bcb62c2a2ec2bed781c8307e797e2598c50010f2bee2544f" +checksum = "b021d93e26becf5dc7e1b75b1bed1fd93124b374ceb73f43d4d4eafec896a64a" dependencies = [ "bytes", - "futures-util", - "http 1.1.0", + "futures-core", + "http 1.3.1", "http-body 1.0.1", "pin-project-lite", ] [[package]] name = "httparse" -version = "1.9.5" +version = "1.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7d71d3574edd2771538b901e6549113b4006ece66150fb69c0fb6d9a2adae946" +checksum = "6dbf3de79e51f3d586ab4cb9d5c3e2c14aa28ed23d180cf89b4df0454a69cc87" [[package]] name = "httpdate" @@ -2812,17 +3844,26 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" +[[package]] +name = "human_bytes" +version = "0.4.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "91f255a4535024abf7640cb288260811fc14794f62b063652ed349f9a6c2348e" +dependencies = [ + "ryu", +] + [[package]] name = "hyper" -version = "0.14.31" +version = "0.14.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8c08302e8fa335b151b788c775ff56e7a03ae64ff85c548ee820fecb70356e85" +checksum = "41dfc780fdec9373c01bae43289ea34c972e40ee3c9f6b3c8801a35f35586ce7" dependencies = [ "bytes", "futures-channel", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", "httparse", @@ -2838,14 +3879,15 @@ dependencies = [ [[package]] name = "hyper" -version = "1.5.1" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "97818827ef4f364230e16705d4706e2897df2bb60617d6ca15d598025a3c481f" +checksum = "cc2b571658e38e0c01b1fdca3bbbe93c00d3d71693ff2770043f8c29bc7d6f80" dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "h2 0.4.10", + "http 1.3.1", "http-body 1.0.1", "httparse", "itoa", @@ -2863,14 +3905,33 @@ checksum = "ec3efd23720e2049821a693cbc7e65ea87c72f1c58ff2f9522ff332b1491e590" dependencies = [ "futures-util", "http 0.2.12", - "hyper 0.14.31", + "hyper 0.14.32", "log", "rustls 0.21.12", - "rustls-native-certs", + "rustls-native-certs 0.6.3", "tokio", "tokio-rustls 0.24.1", ] +[[package]] +name = "hyper-rustls" +version = "0.27.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d191583f3da1305256f22463b9bb0471acad48a4e534a5218b9963e9c1f59b2" +dependencies = [ + "futures-util", + "http 1.3.1", + "hyper 1.6.0", + "hyper-util", + "rustls 0.23.27", + "rustls-native-certs 0.8.1", + "rustls-pki-types", + "tokio", + "tokio-rustls 0.26.2", + "tower-service", + "webpki-roots 0.26.11", +] + [[package]] name = "hyper-tls" version = "0.5.0" @@ -2878,7 +3939,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d6183ddfa99b85da61a140bea0efc93fdf56ceaa041b37d553518030827f9905" dependencies = [ "bytes", - "hyper 0.14.31", + "hyper 0.14.32", "native-tls", "tokio", "tokio-native-tls", @@ -2892,7 +3953,7 @@ checksum = "70206fc6890eaca9fde8a0bf71caa2ddfc9fe045ac9e5c70df101a7dbde866e0" dependencies = [ "bytes", "http-body-util", - "hyper 1.5.1", + "hyper 1.6.0", "hyper-util", "native-tls", "tokio", @@ -2902,16 +3963,17 @@ dependencies = [ [[package]] name = "hyper-util" -version = "0.1.10" +version = "0.1.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "df2dcfbe0677734ab2f3ffa7fa7bfd4706bfdc1ef393f2ee30184aed67e631b4" +checksum = "cf9f1e950e0d9d1d3c47184416723cf29c0d1f93bd8cccf37e4beb6b44f31710" dependencies = [ "bytes", "futures-channel", "futures-util", - "http 1.1.0", + "http 1.3.1", "http-body 1.0.1", - "hyper 1.5.1", + "hyper 1.6.0", + "libc", "pin-project-lite", "socket2", "tokio", @@ -2921,14 +3983,15 @@ dependencies = [ [[package]] name = "iana-time-zone" -version = "0.1.61" +version = "0.1.63" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "235e081f3925a06703c2d0117ea8b91f042756fd6e7a6e5d901e8ca1a996b220" +checksum = "b0c919e5debc312ad217002b8048a17b7d83f80703865bbfcfebb0458b0b27d8" dependencies = [ "android_system_properties", "core-foundation-sys", "iana-time-zone-haiku", "js-sys", + "log", "wasm-bindgen", "windows-core", ] @@ -2944,21 +4007,22 @@ dependencies = [ [[package]] name = "icu_collections" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "db2fa452206ebee18c4b5c2274dbf1de17008e874b4dc4f0aea9d01ca79e4526" +checksum = "200072f5d0e3614556f94a9930d5dc3e0662a652823904c3a75dc3b0af7fee47" dependencies = [ "displaydoc", + "potential_utf", "yoke", "zerofrom", "zerovec", ] [[package]] -name = "icu_locid" -version = "1.5.0" +name = "icu_locale_core" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "13acbb8371917fc971be86fc8057c41a64b521c184808a698c02acc242dbf637" +checksum = "0cde2700ccaed3872079a65fb1a78f6c0a36c91570f28755dda67bc8f7d9f00a" dependencies = [ "displaydoc", "litemap", @@ -2967,31 +4031,11 @@ dependencies = [ "zerovec", ] -[[package]] -name = "icu_locid_transform" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "01d11ac35de8e40fdeda00d9e1e9d92525f3f9d887cdd7aa81d727596788b54e" -dependencies = [ - "displaydoc", - "icu_locid", - "icu_locid_transform_data", - "icu_provider", - "tinystr", - "zerovec", -] - -[[package]] -name = "icu_locid_transform_data" -version = "1.5.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fdc8ff3388f852bede6b579ad4e978ab004f139284d7b28715f773507b946f6e" - [[package]] name = "icu_normalizer" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "19ce3e0da2ec68599d193c93d088142efd7f9c5d6fc9b803774855747dc6a84f" +checksum = "436880e8e18df4d7bbc06d58432329d6458cc84531f7ac5f024e93deadb37979" dependencies = [ "displaydoc", "icu_collections", @@ -2999,66 +4043,59 @@ dependencies = [ "icu_properties", "icu_provider", "smallvec", - "utf16_iter", - "utf8_iter", - "write16", "zerovec", ] [[package]] name = "icu_normalizer_data" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8cafbf7aa791e9b22bec55a167906f9e1215fd475cd22adfcf660e03e989516" +checksum = "00210d6893afc98edb752b664b8890f0ef174c8adbb8d0be9710fa66fbbf72d3" [[package]] name = "icu_properties" -version = "1.5.1" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "93d6020766cfc6302c15dbbc9c8778c37e62c14427cb7f6e601d849e092aeef5" +checksum = "016c619c1eeb94efb86809b015c58f479963de65bdb6253345c1a1276f22e32b" dependencies = [ "displaydoc", "icu_collections", - "icu_locid_transform", + "icu_locale_core", "icu_properties_data", "icu_provider", - "tinystr", + "potential_utf", + "zerotrie", "zerovec", ] [[package]] name = "icu_properties_data" -version = "1.5.0" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "67a8effbc3dd3e4ba1afa8ad918d5684b8868b3b26500753effea8d2eed19569" +checksum = "298459143998310acd25ffe6810ed544932242d3f07083eee1084d83a71bd632" [[package]] name = "icu_provider" -version = "1.5.0" +version = "2.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ed421c8a8ef78d3e2dbc98a973be2f3770cb42b606e3ab18d6237c4dfde68d9" +checksum = "03c80da27b5f4187909049ee2d72f276f0d9f99a42c306bd0131ecfe04d8e5af" dependencies = [ "displaydoc", - "icu_locid", - "icu_provider_macros", + "icu_locale_core", "stable_deref_trait", "tinystr", "writeable", "yoke", "zerofrom", + "zerotrie", "zerovec", ] [[package]] -name = "icu_provider_macros" -version = "1.5.0" +name = "ident_case" +version = "1.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1ec89e9337638ecdc08744df490b221a7399bf8d164eb52a665454e60e075ad6" -dependencies = [ - "proc-macro2", - "quote", - "syn 2.0.90", -] +checksum = "b9e0384b61958566e926dc50660321d12159025e767c18e043daf26b70104c39" [[package]] name = "idna" @@ -3073,9 +4110,9 @@ dependencies = [ [[package]] name = "idna_adapter" -version = "1.2.0" +version = "1.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "daca1df1c957320b2cf139ac61e7bd64fed304c5040df000a745aa1de3b4ef71" +checksum = "3acae9609540aa318d1bc588455225fb2085b9ed0c4f6bd0d9d5bcd86f1a0344" dependencies = [ "icu_normalizer", "icu_properties", @@ -3098,24 +4135,30 @@ checksum = "a0eb5a3343abf848c0984fe4604b2b105da9539376e24fc0a3b0007411ae4fd9" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] +[[package]] +name = "include_bytes_aligned" +version = "0.1.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4ee796ad498c8d9a1d68e477df8f754ed784ef875de1414ebdaf169f70a6a784" + [[package]] name = "indexmap" -version = "2.7.0" +version = "2.9.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "62f822373a4fe84d4bb149bf54e584a7f4abec90e072ed49cda0edea5b95471f" +checksum = "cea70ddb795996207ad57735b50c5982d8844f38ba9ee5f1aedcfb708a2aa11e" dependencies = [ "equivalent", - "hashbrown 0.15.2", + "hashbrown 0.15.3", ] [[package]] name = "interprocess" -version = "2.2.2" +version = "2.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "894148491d817cb36b6f778017b8ac46b17408d522dd90f539d677ea938362eb" +checksum = "d941b405bd2322993887859a8ee6ac9134945a24ec5ec763a8a962fc64dfec2d" dependencies = [ "doctest-file", "futures-core", @@ -3126,11 +4169,20 @@ dependencies = [ "windows-sys 0.52.0", ] +[[package]] +name = "inventory" +version = "0.3.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ab08d7cd2c5897f2c949e5383ea7c7db03fb19130ffcfbf7eda795137ae3cb83" +dependencies = [ + "rustversion", +] + [[package]] name = "ipnet" -version = "2.10.1" +version = "2.11.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ddc24109865250148c2e0f3d25d4f0f479571723792d3802153c60922a4fb708" +checksum = "469fb0b9cefa57e3ef31275ee7cacb78f2fdca44e4765491884a2b119d4eb130" [[package]] name = "is_terminal_polyfill" @@ -3138,6 +4190,33 @@ version = "1.70.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7943c866cc5cd64cbc25b2e01621d07fa8eb2a1a23160ee81ce38704e97b8ecf" +[[package]] +name = "itertools" +version = "0.10.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b0fd2260e829bddf4cb6ea802289de2f86d6a7a690192fbe91b3f46e0f2c8473" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1c173a5686ce8bfa551b3563d0c2170bf24ca44da99c7ca4bfdab5418c3fe57" +dependencies = [ + "either", +] + +[[package]] +name = "itertools" +version = "0.12.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ba291022dbbd398a455acf126c1e341954079855bc60dfdda641363bd6922569" +dependencies = [ + "either", +] + [[package]] name = "itertools" version = "0.13.0" @@ -3147,17 +4226,36 @@ dependencies = [ "either", ] +[[package]] +name = "itertools" +version = "0.14.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2b192c782037fadd9cfa75548310488aabdbf3d2da73885b31bd0abd03351285" +dependencies = [ + "either", +] + [[package]] name = "itoa" -version = "1.0.14" +version = "1.0.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4a5f13b858c8d314ee3e8f639011f7ccefe71f97f96e50151fb991f267928e2c" + +[[package]] +name = "jobserver" +version = "0.1.33" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d75a2a4b1b190afb6f5425f10f6a8f959d2ea0b9c2b1d79553551850539e4674" +checksum = "38f262f097c174adebe41eb73d66ae9c06b2844fb0da69969647bbddd9b0538a" +dependencies = [ + "getrandom 0.3.3", + "libc", +] [[package]] name = "js-sys" -version = "0.3.74" +version = "0.3.77" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a865e038f7f6ed956f788f0d7d60c541fff74c7bd74272c5d4cf15c63743e705" +checksum = "1cfaf33c695fc6e08064efbc1f72ec937429614f25eef83af942d0e227c3a28f" dependencies = [ "once_cell", "wasm-bindgen", @@ -3165,11 +4263,11 @@ dependencies = [ [[package]] name = "jsonwebtoken" -version = "9.3.0" +version = "9.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b9ae10193d25051e74945f1ea2d0b42e03cc3b890f7e4cc5faa44997d808193f" +checksum = "5a87cc7a48537badeae96744432de36f4be2b4a34a05a5ef32e9dd8a1c169dde" dependencies = [ - "base64 0.21.7", + "base64 0.22.1", "js-sys", "pem", "ring", @@ -3221,9 +4319,9 @@ dependencies = [ [[package]] name = "lazy-regex" -version = "3.3.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d8e41c97e6bc7ecb552016274b99fbb5d035e8de288c582d9b933af6677bfda" +checksum = "60c7310b93682b36b98fa7ea4de998d3463ccbebd94d935d6b48ba5b6ffa7126" dependencies = [ "lazy-regex-proc_macros", "once_cell", @@ -3232,14 +4330,14 @@ dependencies = [ [[package]] name = "lazy-regex-proc_macros" -version = "3.3.0" +version = "3.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "76e1d8b05d672c53cb9c7b920bbba8783845ae4f0b076e02a3db1d02c81b4163" +checksum = "4ba01db5ef81e17eb10a5e0f2109d1b3a3e29bac3070fdbd7d156bf7dbd206a1" dependencies = [ "proc-macro2", "quote", "regex", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3247,30 +4345,75 @@ name = "lazy_static" version = "1.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bbd2bcb4c963f2ddae06a2efc7e9f3591312473c50c6685e1f298068316e66fe" +dependencies = [ + "spin", +] + +[[package]] +name = "lazycell" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "830d08ce1d1d941e6b30645f1a0eb5643013d835ce3779a5fc208261dbe10f55" [[package]] name = "libc" -version = "0.2.167" +version = "0.2.172" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d750af042f7ef4f724306de029d18836c26c1765a54a6a3f094cbd23a7267ffa" + +[[package]] +name = "libfuzzer-sys" +version = "0.4.9" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "cf78f52d400cf2d84a3a973a78a592b4adc535739e0a5597a0da6f0c357adc75" +dependencies = [ + "arbitrary", + "cc", +] + +[[package]] +name = "libloading" +version = "0.8.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "09d6582e104315a817dff97f75133544b2e094ee22447d2acf4a74e189ba06fc" +checksum = "6a793df0d7afeac54f95b471d3af7f0d4fb975699f972341a4b76988d49cdf0c" +dependencies = [ + "cfg-if", + "windows-targets 0.53.0", +] [[package]] name = "libm" -version = "0.2.11" +version = "0.2.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f9fbbcab51052fe104eb5e5d351cf728d30a5be1fe14d9be8a3b097481fb97de" + +[[package]] +name = "libredox" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c0ff37bd590ca25063e35af745c343cb7a0271906fb7b37e4813e8f79f00268d" +dependencies = [ + "bitflags 2.9.1", + "libc", +] + +[[package]] +name = "linux-raw-sys" +version = "0.4.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8355be11b20d696c8f18f6cc018c4e372165b1fa8126cef092399c9951984ffa" +checksum = "d26c52dbd32dccf2d10cac7725f8eae5296885fb5703b261f7d0a0739ec807ab" [[package]] name = "linux-raw-sys" -version = "0.4.14" +version = "0.9.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "78b3ae25bc7c8c38cec158d1f2757ee79e9b3740fbc7ccf0e59e4b08d793fa89" +checksum = "cd945864f07fe9f5371a27ad7b52a172b4b499999f1d97574c9fa68373937e12" [[package]] name = "litemap" -version = "0.7.4" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ee93343901ab17bd981295f2cf0026d4ad018c7c31ba84549a4ddbb47a45104" +checksum = "241eaef5fd12c88705a01fc1066c48c4b36e0dd4377dcdc7ec3942cea7a69956" [[package]] name = "lock_api" @@ -3284,9 +4427,9 @@ dependencies = [ [[package]] name = "log" -version = "0.4.22" +version = "0.4.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a7a70ba024b9dc04c27ea2f0c0548feb474ec5c54bba33a7f72f873a39d07b24" +checksum = "13dc2df351e3202783a1fe0d44375f7295ffb4049267b0f3018346dc122a1d94" dependencies = [ "value-bag", ] @@ -3297,17 +4440,120 @@ version = "0.12.5" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "234cf4f4a04dc1f57e24b96cc0cd600cf2af460d4161ac5ecdd0af8e1f3b2a38" dependencies = [ - "hashbrown 0.15.2", + "hashbrown 0.15.3", ] [[package]] -name = "md-5" -version = "0.10.6" +name = "lru" +version = "0.13.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +checksum = "227748d55f2f0ab4735d87fd623798cb6b664512fe979705f829c9f81c934465" dependencies = [ - "cfg-if", - "digest 0.10.7", + "hashbrown 0.15.3", +] + +[[package]] +name = "lru-slab" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "112b39cec0b298b6c1999fee3e31427f74f676e4cb9879ed1a121b43661a4154" + +[[package]] +name = "lzma-sys" +version = "0.1.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5fda04ab3764e6cde78b9974eec4f779acaba7c4e84b36eca3cf77c581b85d27" +dependencies = [ + "cc", + "libc", + "pkg-config", +] + +[[package]] +name = "malachite" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2fbdf9cb251732db30a7200ebb6ae5d22fe8e11397364416617d2c2cf0c51cb5" +dependencies = [ + "malachite-base", + "malachite-float", + "malachite-nz", + "malachite-q", +] + +[[package]] +name = "malachite-base" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5ea0ed76adf7defc1a92240b5c36d5368cfe9251640dcce5bd2d0b7c1fd87aeb" +dependencies = [ + "hashbrown 0.14.5", + "itertools 0.11.0", + "libm", + "ryu", +] + +[[package]] +name = "malachite-float" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "af9d20db1c73759c1377db7b27575df6f2eab7368809dd62c0a715dc1bcc39f7" +dependencies = [ + "itertools 0.11.0", + "malachite-base", + "malachite-nz", + "malachite-q", +] + +[[package]] +name = "malachite-nz" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34a79feebb2bc9aa7762047c8e5495269a367da6b5a90a99882a0aeeac1841f7" +dependencies = [ + "itertools 0.11.0", + "libm", + "malachite-base", +] + +[[package]] +name = "malachite-q" +version = "0.4.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "50f235d5747b1256b47620f5640c2a17a88c7569eebdf27cd9cb130e1a619191" +dependencies = [ + "itertools 0.11.0", + "malachite-base", + "malachite-nz", +] + +[[package]] +name = "malloc_buf" +version = "0.0.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "62bb907fe88d54d8d9ce32a3cceab4218ed2f6b7d35617cafe9adf84e43919cb" +dependencies = [ + "libc", +] + +[[package]] +name = "matrixmultiply" +version = "0.3.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a06de3016e9fae57a36fd14dba131fccf49f74b40b7fbdb472f96e361ec71a08" +dependencies = [ + "autocfg", + "rawpointer", +] + +[[package]] +name = "md-5" +version = "0.10.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d89e7ee0cfbedfc4da3340218492196241d89eefb6dab27de5df917a6d2e78cf" +dependencies = [ + "cfg-if", + "digest 0.10.7", ] [[package]] @@ -3316,6 +4562,15 @@ version = "2.7.4" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "78ca9ab1a0babb1e7d5695e3530886289c18cf2f87ec19a575a0abdce112e3a3" +[[package]] +name = "memmap2" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fd3f7eed9d3848f8b98834af67102b720745c4ec028fcd0aa0239277e7de374f" +dependencies = [ + "libc", +] + [[package]] name = "merlin" version = "3.0.0" @@ -3324,32 +4579,53 @@ checksum = "58c38e2799fc0978b65dfff8023ec7843e2330bb462f19198840b34b6582397d" dependencies = [ "byteorder", "keccak", - "rand_core", + "rand_core 0.6.4", "zeroize", ] +[[package]] +name = "metal" +version = "0.29.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7ecfd3296f8c56b7c1f6fbac3c71cefa9d78ce009850c45000015f206dc7fa21" +dependencies = [ + "bitflags 2.9.1", + "block", + "core-graphics-types", + "foreign-types 0.5.0", + "log", + "objc", + "paste", +] + [[package]] name = "mime" version = "0.3.17" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6877bb514081ee2a7ff5ef9de3281f14a4dd4bceac4c09388074a6b5df8a139a" +[[package]] +name = "minimal-lexical" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "68354c5c6bd36d73ff3feceb05efa59b6acb7626617f4962be322a825e61f79a" + [[package]] name = "miniz_oxide" -version = "0.8.0" +version = "0.8.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e2d80299ef12ff69b16a84bb182e3b9df68b5a91574d3d4fa6e41b65deec4df1" +checksum = "3be647b768db090acb35d5ec5db2b0e1f1de11133ca123b9eacf5137868f892a" dependencies = [ "adler2", ] [[package]] name = "minreq" -version = "2.12.0" +version = "2.13.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "763d142cdff44aaadd9268bebddb156ef6c65a0e13486bb81673cf2d8739f9b0" +checksum = "f0d2aaba477837b46ec1289588180fabfccf0c3b1d1a0c6b1866240cd6cd5ce9" dependencies = [ - "base64 0.12.3", + "base64 0.22.1", "log", "serde", "serde_json", @@ -3363,7 +4639,7 @@ checksum = "a4a650543ca06a924e8b371db273b2756685faae30f8487da1b56505a8f78b0c" dependencies = [ "libc", "log", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.48.0", ] @@ -3374,20 +4650,20 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "2886843bf800fba2e3377cff24abf6379b4c4d5c6681eaf9ea5b0d15090450bd" dependencies = [ "libc", - "wasi", + "wasi 0.11.0+wasi-snapshot-preview1", "windows-sys 0.52.0", ] [[package]] name = "musig2" -version = "0.0.11" +version = "0.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "bed08befaac75bfb31ca5e87678c4e8490bcd21d0c98ccb4f12f4065a7567e83" +checksum = "c89bee285da6010ad76c3467c4de8265bb4fa46fba0017df95ae55cad4436528" dependencies = [ "base16ct 0.2.0", "hmac", "once_cell", - "rand", + "rand 0.8.5", "secp", "secp256k1", "serde", @@ -3398,9 +4674,9 @@ dependencies = [ [[package]] name = "native-tls" -version = "0.2.12" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a8614eb2c83d59d1c8cc974dd3f920198647674a0a035e1af1fa58707e317466" +checksum = "87de3442987e9dbec73158d5c715e7ad9072fda936bb03d19d7fa10e00520f0e" dependencies = [ "libc", "log", @@ -3408,11 +4684,43 @@ dependencies = [ "openssl-probe", "openssl-sys", "schannel", - "security-framework", + "security-framework 2.11.1", "security-framework-sys", "tempfile", ] +[[package]] +name = "ndarray" +version = "0.16.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "882ed72dce9365842bf196bdeedf5055305f11fc8c03dee7bb0194a6cad34841" +dependencies = [ + "matrixmultiply", + "num-complex", + "num-integer", + "num-traits", + "portable-atomic", + "portable-atomic-util", + "rawpointer", + "rayon", +] + +[[package]] +name = "no_std_strings" +version = "0.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a5b0c77c1b780822bc749a33e39aeb2c07584ab93332303babeabb645298a76e" + +[[package]] +name = "nom" +version = "7.1.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d273983c5a657a70a3e8f2a01329822f3b8c8172b73826411a55751e404a0a4a" +dependencies = [ + "memchr", + "minimal-lexical", +] + [[package]] name = "non-zero-byte-slice" version = "0.1.0" @@ -3422,6 +4730,17 @@ dependencies = [ "serde", ] +[[package]] +name = "num-bigint" +version = "0.3.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5f6f7833f2cbf2360a6cfd58cd41a53aa7a90bd4c202f5b1c7dd2ed73c57b2c3" +dependencies = [ + "autocfg", + "num-integer", + "num-traits", +] + [[package]] name = "num-bigint" version = "0.4.6" @@ -3430,7 +4749,16 @@ checksum = "a5e44f723f1133c9deac646763579fdb3ac745e418f2a7af9cd0c431da1f20b9" dependencies = [ "num-integer", "num-traits", - "rand", + "rand 0.8.5", +] + +[[package]] +name = "num-complex" +version = "0.4.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f88a1307638156682bada9d7604135552957b7818057dcef22705b4d509495" +dependencies = [ + "num-traits", ] [[package]] @@ -3447,7 +4775,7 @@ checksum = "ed3955f1a9c7c0c15e092f9c887db08b1fc683305fdf6eb6684f22555355e202" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3496,23 +4824,52 @@ checksum = "af1844ef2428cc3e1cb900be36181049ef3d3193c63e43026cfe202983b27a56" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "nvtx" +version = "1.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ad2e855e8019f99e4b94ac33670eb4e4f570a2e044f3749a0b2c7f83b841e52c" +dependencies = [ + "cc", +] + +[[package]] +name = "objc" +version = "0.2.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "915b1b472bc21c53464d6c8461c9d3af805ba1ef837e1cac254428f4a77177b1" +dependencies = [ + "malloc_buf", +] + +[[package]] +name = "object" +version = "0.35.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b8ec7ab813848ba4522158d5517a6093db1ded27575b070f4177b8d12b41db5e" +dependencies = [ + "flate2", + "memchr", + "ruzstd", ] [[package]] name = "object" -version = "0.36.5" +version = "0.36.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aedf0a2d09c573ed1d8d85b30c119153926a2b36dce0ab28322c09a117a4683e" +checksum = "62948e14d923ea95ea2c7c86c71013138b66525b86bdc08d2dcc262bdb497b87" dependencies = [ "memchr", ] [[package]] name = "once_cell" -version = "1.20.2" +version = "1.21.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1261fe7e33c73b354eab43b1273a57c8f967d0391e80353e51f764ac02cf6775" +checksum = "42f5e15c9953c5e4ccceeb2e7382a716482c34515315f7b03532b8b4e8393d2d" [[package]] name = "openssh" @@ -3532,9 +4889,9 @@ dependencies = [ [[package]] name = "openssh-mux-client" -version = "0.17.6" +version = "0.17.7" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d091692d0a7d9035a3cdc5f8c3572abe401e64e30eac5404e517fb54e554c9bc" +checksum = "d83f349e6427c6159fee16ec3dd8fa995cc25d4f5498855836d8666b9c6a8b75" dependencies = [ "cfg-if", "non-zero-byte-slice", @@ -3555,7 +4912,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9879168afb48a235200e30d93df320b7191568cda8621df02f145c1c0f1af95a" dependencies = [ "ssh_format_error", - "thiserror 2.0.3", + "thiserror 2.0.12", ] [[package]] @@ -3615,7 +4972,7 @@ version = "0.24.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "a9c862e0c56553146306507f55958c11ff554e02c46de287e6976e50d815b350" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "num-derive", "num-traits", "openssh-sftp-protocol-error", @@ -3631,19 +4988,19 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "42b54df62ccfd9a7708a83a9d60c46293837e478f9f4c0829360dcfa60ede8d2" dependencies = [ "serde", - "thiserror 2.0.3", + "thiserror 2.0.12", "vec-strings", ] [[package]] name = "openssl" -version = "0.10.68" +version = "0.10.72" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6174bc48f102d208783c2c84bf931bb75927a617866870de8a4ea85597f871f5" +checksum = "fedfea7d58a1f73118430a55da6a286e7b044961736ce96a16a17068ea25e5da" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "cfg-if", - "foreign-types", + "foreign-types 0.3.2", "libc", "once_cell", "openssl-macros", @@ -3658,20 +5015,20 @@ checksum = "a948666b637a0f465e8564c73e89d4dde00d72d4d473cc972f390fc3dcee7d9c" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "openssl-probe" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ff011a302c396a5197692431fc1948019154afc178baf7d8e37367442a4601cf" +checksum = "d05e27ee213611ffe7d6348b942e8f942b37114c00cc03cec254295a4a17852e" [[package]] name = "openssl-sys" -version = "0.9.104" +version = "0.9.108" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "45abf306cbf99debc8195b66b7346498d7b10c210de50418b5ccd7ceba08c741" +checksum = "e145e1651e858e820e4860f7b9c5e169bc1d8ce1c86043be79fa7b7634821847" dependencies = [ "cc", "libc", @@ -3679,11 +5036,17 @@ dependencies = [ "vcpkg", ] +[[package]] +name = "option-ext" +version = "0.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "04744f49eae99ab78e0d5c0b603ab218f515ea8cfe5a456d7629ad883a3b6e7d" + [[package]] name = "outref" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4030760ffd992bef45b0ae3f10ce1aba99e33464c90d14dd7c039884963ddc7a" +checksum = "1a80800c0488c3a21695ea981a54918fbb37abf04f4d0720c453632255e2ff0e" [[package]] name = "p256" @@ -3698,13 +5061,14 @@ dependencies = [ [[package]] name = "parity-scale-codec" -version = "3.7.0" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8be4817d39f3272f69c59fe05d0535ae6456c2dc2fa1ba02910296c7e0a5c590" +checksum = "799781ae679d79a948e13d4824a40970bfa500058d245760dd857301059810fa" dependencies = [ "arrayvec", "bitvec", "byte-slice-cast", + "const_format", "impl-trait-for-tuples", "parity-scale-codec-derive", "rustversion", @@ -3713,14 +5077,14 @@ dependencies = [ [[package]] name = "parity-scale-codec-derive" -version = "3.7.0" +version = "3.7.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8781a75c6205af67215f382092b6e0a4ff3734798523e69073d4bcd294ec767b" +checksum = "34b4653168b563151153c9e4c08ebed57fb8262bebfa79711552fa983c623e7a" dependencies = [ "proc-macro-crate", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -3760,9 +5124,9 @@ checksum = "57c0d7b74b563b49d38dae00a0c37d4d6de9b432382b2892f0574ddcae73fd0a" [[package]] name = "pem" -version = "3.0.4" +version = "3.0.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8e459365e590736a54c3fa561947c84837534b8e9af6fc5bf781307e82658fae" +checksum = "38af38e8470ac9dee3ce1bae1af9c1671fffc44ddfd8bd1d0a3445bf349a8ef3" dependencies = [ "base64 0.22.1", "serde", @@ -3776,12 +5140,12 @@ checksum = "e3148f5046208a5d56bcfc03053e3ca6334e51da8dfb19b6cdc8b306fae3283e" [[package]] name = "pest" -version = "2.7.14" +version = "2.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "879952a81a83930934cbf1786752d6dedc3b1f29e8f8fb2ad1d0a36f377cf442" +checksum = "198db74531d58c70a361c42201efde7e2591e976d518caf7662a47dc5720e7b6" dependencies = [ "memchr", - "thiserror 1.0.69", + "thiserror 2.0.12", "ucd-trie", ] @@ -3797,29 +5161,29 @@ dependencies = [ [[package]] name = "pin-project" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "be57f64e946e500c8ee36ef6331845d40a93055567ec57e8fae13efd33759b95" +checksum = "677f1add503faace112b9f1373e43e9e054bfdd22ff1a63c1bc485eaec6a6a8a" dependencies = [ "pin-project-internal", ] [[package]] name = "pin-project-internal" -version = "1.1.7" +version = "1.1.10" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c0f5fad0874fc7abcd4d750e76917eaebbecaa2c20bde22e1dbeeba8beb758c" +checksum = "6e918e4ff8c4549eb882f14b3a4bc8c8bc93de829416eacf579f1207a8fbf861" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "pin-project-lite" -version = "0.2.15" +version = "0.2.16" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "915a1e146535de9163f3987b8944ed8cf49a18bb0056bcebcdcece385cece4ff" +checksum = "3b3cff922bd51709b605d9ead9aa71031d81447142d828eb4a6eba76fe619f9b" [[package]] name = "pin-utils" @@ -3854,15 +5218,15 @@ version = "0.10.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "f950b2377845cebe5cf8b5165cb3cc1a5e0fa5cfa3e1f7f55707d8fd82e0a7b7" dependencies = [ - "der 0.7.9", + "der 0.7.10", "spki 0.7.3", ] [[package]] name = "pkg-config" -version = "0.3.31" +version = "0.3.32" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "953ec861398dccce10c670dfeaf3ec4911ca479e9c02154b3a215178c5f566f2" +checksum = "7edddbd0b52d732b21ad9a5fab5c704c14cd949e5e9a1ec5929a24fded1b904c" [[package]] name = "polling" @@ -3874,11 +5238,48 @@ dependencies = [ "concurrent-queue", "hermit-abi 0.4.0", "pin-project-lite", - "rustix", + "rustix 0.38.44", "tracing", "windows-sys 0.59.0", ] +[[package]] +name = "portable-atomic" +version = "1.11.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "350e9b48cbc6b0e028b0473b114454c6316e57336ee184ceab6e53f72c178b3e" + +[[package]] +name = "portable-atomic-util" +version = "0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d8a2f0d8d040d7848a709caf78912debcc3f33ee4b3cac47d73d1e1069e83507" +dependencies = [ + "portable-atomic", +] + +[[package]] +name = "postcard" +version = "1.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "170a2601f67cc9dba8edd8c4870b15f71a6a2dc196daec8c83f72b59dff628a8" +dependencies = [ + "cobs", + "embedded-io 0.4.0", + "embedded-io 0.6.1", + "heapless", + "serde", +] + +[[package]] +name = "potential_utf" +version = "0.1.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e5a7c30837279ca13e7c867e9e40053bc68740f988cb07f7ca6df43cc734b585" +dependencies = [ + "zerovec", +] + [[package]] name = "powerfmt" version = "0.2.0" @@ -3887,13 +5288,23 @@ checksum = "439ee305def115ba05938db6eb1644ff94165c5ab5e9420d1c1bcedbba909391" [[package]] name = "ppv-lite86" -version = "0.2.20" +version = "0.2.21" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "77957b295656769bb8ad2b6a6b09d897d94f05c41b069aede1fcdaa675eaea04" +checksum = "85eae3c4ed2f50dcfe72643da4befc30deadb458a9b590d720cde2f2b1e97da9" dependencies = [ "zerocopy", ] +[[package]] +name = "prettyplease" +version = "0.2.32" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "664ec5419c51e34154eec046ebcba56312d5a2fc3b09a06da188e1ad21afadf6" +dependencies = [ + "proc-macro2", + "syn 2.0.101", +] + [[package]] name = "primitive-types" version = "0.12.2" @@ -3907,9 +5318,9 @@ dependencies = [ [[package]] name = "proc-macro-crate" -version = "3.2.0" +version = "3.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8ecf48c7ca261d60b74ab1a7b20da18bede46776b2e55535cb958eb595c5fa7b" +checksum = "edce586971a4dfaa28950c6f18ed55e0406c1ab88bbce2c6f6293a7aaba73d35" dependencies = [ "toml_edit", ] @@ -3940,26 +5351,26 @@ dependencies = [ [[package]] name = "proc-macro2" -version = "1.0.92" +version = "1.0.95" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "37d3544b3f2748c54e147655edb5025752e2303145b5aefb3c3ea2c78b973bb0" +checksum = "02b3e5e68a3a1a02aad3ec490a98007cbc13c37cbe84a3cd7b8e406d76e7f778" dependencies = [ "unicode-ident", ] [[package]] name = "proptest" -version = "1.5.0" +version = "1.6.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b4c2511913b88df1637da85cc8d96ec8e43a3f8bb8ccb71ee1ac240d6f3df58d" +checksum = "14cae93065090804185d3b75f0bf93b8eeda30c7a9b4a33d3bdb3988d6229e50" dependencies = [ "bit-set", "bit-vec", - "bitflags 2.6.0", + "bitflags 2.9.1", "lazy_static", "num-traits", - "rand", - "rand_chacha", + "rand 0.8.5", + "rand_chacha 0.3.1", "rand_xorshift", "regex-syntax", "rusty-fork", @@ -3968,73 +5379,230 @@ dependencies = [ ] [[package]] -name = "quick-error" -version = "1.2.3" +name = "prost" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" +checksum = "2796faa41db3ec313a31f7624d9286acf277b52de526150b7e69f3debf891ee5" +dependencies = [ + "bytes", + "prost-derive", +] [[package]] -name = "quote" -version = "1.0.37" +name = "prost-derive" +version = "0.13.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5b9d34b8991d19d98081b46eacdd8eb58c6f2b201139f7c5f643cc155a633af" +checksum = "8a56d757972c98b346a9b766e3f02746cde6dd1cd1d1d563472929fdd74bec4d" dependencies = [ + "anyhow", + "itertools 0.14.0", "proc-macro2", + "quote", + "syn 2.0.101", ] [[package]] -name = "radium" -version = "0.7.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" - -[[package]] -name = "rand" -version = "0.8.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +name = "prover" +version = "0.1.0" dependencies = [ - "libc", - "rand_chacha", - "rand_core", + "bitcoin", + "blake3", + "borsh", + "crypto-bigint 0.5.2", + "final-spv", + "header-chain", + "hex-conservative", + "hex-literal", + "num-bigint 0.4.6", + "num-traits", + "risc0-binfmt 2.0.1", + "risc0-circuit-recursion", + "risc0-groth16 1.2.6", + "risc0-zkp 2.0.1", + "risc0-zkvm", + "serde_json", + "sha2", + "tempfile", ] [[package]] -name = "rand_chacha" -version = "0.3.1" +name = "puffin" +version = "0.19.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +checksum = "fa9dae7b05c02ec1a6bc9bcf20d8bc64a7dcbf57934107902a872014899b741f" dependencies = [ - "ppv-lite86", - "rand_core", + "anyhow", + "byteorder", + "cfg-if", + "itertools 0.10.5", + "once_cell", + "parking_lot", ] [[package]] -name = "rand_core" -version = "0.6.4" +name = "quick-error" +version = "1.2.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" -dependencies = [ - "getrandom", -] +checksum = "a1d01941d82fa2ab50be1e79e6714289dd7cde78eba4c074bc5a4374f650dfe0" [[package]] -name = "rand_xorshift" -version = "0.3.0" +name = "quinn" +version = "0.11.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +checksum = "626214629cda6781b6dc1d316ba307189c85ba657213ce642d9c77670f8202c8" dependencies = [ - "rand_core", + "bytes", + "cfg_aliases", + "pin-project-lite", + "quinn-proto", + "quinn-udp", + "rustc-hash 2.1.1", + "rustls 0.23.27", + "socket2", + "thiserror 2.0.12", + "tokio", + "tracing", + "web-time", ] [[package]] -name = "rayon" -version = "1.10.0" +name = "quinn-proto" +version = "0.11.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +checksum = "49df843a9161c85bb8aae55f101bc0bac8bcafd637a620d9122fd7e0b2f7422e" dependencies = [ - "either", - "rayon-core", + "bytes", + "getrandom 0.3.3", + "lru-slab", + "rand 0.9.1", + "ring", + "rustc-hash 2.1.1", + "rustls 0.23.27", + "rustls-pki-types", + "slab", + "thiserror 2.0.12", + "tinyvec", + "tracing", + "web-time", +] + +[[package]] +name = "quinn-udp" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ee4e529991f949c5e25755532370b8af5d114acae52326361d68d47af64aa842" +dependencies = [ + "cfg_aliases", + "libc", + "once_cell", + "socket2", + "tracing", + "windows-sys 0.59.0", +] + +[[package]] +name = "quote" +version = "1.0.40" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1885c039570dc00dcb4ff087a89e185fd56bae234ddc7f056a945bf36467248d" +dependencies = [ + "proc-macro2", +] + +[[package]] +name = "r-efi" +version = "5.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "74765f6d916ee2faa39bc8e68e4f3ed8949b48cccdac59983d287a7cb71ce9c5" + +[[package]] +name = "radium" +version = "0.7.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" + +[[package]] +name = "rand" +version = "0.8.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "34af8d1a0e25924bc5b7c43c079c942339d8f0a8b57c39049bef581b46327404" +dependencies = [ + "libc", + "rand_chacha 0.3.1", + "rand_core 0.6.4", +] + +[[package]] +name = "rand" +version = "0.9.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9fbfd9d094a40bf3ae768db9361049ace4c0e04a4fd6b359518bd7b73a73dd97" +dependencies = [ + "rand_chacha 0.9.0", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_chacha" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e6c10a63a0fa32252be49d21e7709d4d4baf8d231c2dbce1eaa8141b9b127d88" +dependencies = [ + "ppv-lite86", + "rand_core 0.6.4", +] + +[[package]] +name = "rand_chacha" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d3022b5f1df60f26e1ffddd6c66e8aa15de382ae63b3a0c1bfc0e4d3e3f325cb" +dependencies = [ + "ppv-lite86", + "rand_core 0.9.3", +] + +[[package]] +name = "rand_core" +version = "0.6.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ec0be4795e2f6a28069bec0b5ff3e2ac9bafc99e6a9a7dc3547996c5c816922c" +dependencies = [ + "getrandom 0.2.16", +] + +[[package]] +name = "rand_core" +version = "0.9.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "99d9a13982dcf210057a8a78572b2217b667c3beacbf3a0d8b454f6f82837d38" +dependencies = [ + "getrandom 0.3.3", +] + +[[package]] +name = "rand_xorshift" +version = "0.3.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d25bf25ec5ae4a3f1b92f929810509a2f53d7dca2f50b794ff57e3face536c8f" +dependencies = [ + "rand_core 0.6.4", +] + +[[package]] +name = "rawpointer" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "60a357793950651c4ed0f3f52338f53b2f809f32d83a07f72909fa13e4c6c1e3" + +[[package]] +name = "rayon" +version = "1.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b418a60154510ca1a002a752ca9714984e21e4241e804d32555251faf8b78ffa" +dependencies = [ + "either", + "rayon-core", ] [[package]] @@ -4055,11 +5623,22 @@ checksum = "d3edd4d5d42c92f0a659926464d4cce56b562761267ecf0f469d85b7de384175" [[package]] name = "redox_syscall" -version = "0.5.7" +version = "0.5.12" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "928fca9cf2aa042393a8325b9ead81d2f0df4cb12e1e24cef072922ccd99c5af" +dependencies = [ + "bitflags 2.9.1", +] + +[[package]] +name = "redox_users" +version = "0.4.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9b6dfecf2c74bce2466cabf93f6664d6998a69eb21e39f4207930065b27b771f" +checksum = "ba009ff324d1fc1b900bd1fdb31564febe58a8ccc8a6fdbb93b543d33b13ca43" dependencies = [ - "bitflags 2.6.0", + "getrandom 0.2.16", + "libredox", + "thiserror 1.0.69", ] [[package]] @@ -4108,10 +5687,10 @@ dependencies = [ "encoding_rs", "futures-core", "futures-util", - "h2", + "h2 0.3.26", "http 0.2.12", "http-body 0.4.6", - "hyper 0.14.31", + "hyper 0.14.32", "hyper-tls 0.5.0", "ipnet", "js-sys", @@ -4123,94 +5702,524 @@ dependencies = [ "pin-project-lite", "rustls-pemfile 1.0.4", "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 0.1.2", - "system-configuration", - "tokio", - "tokio-native-tls", - "tokio-socks", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "winreg", + "serde_json", + "serde_urlencoded", + "sync_wrapper 0.1.2", + "system-configuration", + "tokio", + "tokio-native-tls", + "tokio-socks", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "winreg", +] + +[[package]] +name = "reqwest" +version = "0.12.15" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d19c46a6fdd48bc4dab94b6103fccc55d34c67cc0ad04653aad4ea2a07cd7bbb" +dependencies = [ + "base64 0.22.1", + "bytes", + "futures-core", + "futures-util", + "http 1.3.1", + "http-body 1.0.1", + "http-body-util", + "hyper 1.6.0", + "hyper-rustls 0.27.5", + "hyper-tls 0.6.0", + "hyper-util", + "ipnet", + "js-sys", + "log", + "mime", + "native-tls", + "once_cell", + "percent-encoding", + "pin-project-lite", + "quinn", + "rustls 0.23.27", + "rustls-pemfile 2.2.0", + "rustls-pki-types", + "serde", + "serde_json", + "serde_urlencoded", + "sync_wrapper 1.0.2", + "tokio", + "tokio-native-tls", + "tokio-rustls 0.26.2", + "tower 0.5.2", + "tower-service", + "url", + "wasm-bindgen", + "wasm-bindgen-futures", + "web-sys", + "webpki-roots 0.26.11", + "windows-registry", +] + +[[package]] +name = "rfc6979" +version = "0.3.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +dependencies = [ + "crypto-bigint 0.4.9", + "hmac", + "zeroize", +] + +[[package]] +name = "rfc6979" +version = "0.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +dependencies = [ + "hmac", + "subtle", +] + +[[package]] +name = "ring" +version = "0.17.14" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a4689e6c2294d81e88dc6261c768b63bc4fcdb852be6d1352498b114f61383b7" +dependencies = [ + "cc", + "cfg-if", + "getrandom 0.2.16", + "libc", + "untrusted", + "windows-sys 0.52.0", +] + +[[package]] +name = "ringbuffer" +version = "0.15.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3df6368f71f205ff9c33c076d170dd56ebf68e8161c733c0caa07a7a5509ed53" + +[[package]] +name = "risc0-binfmt" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05c37f3babf129daf199c4368030f3592365654b827eaf758d525b2e08f07765" +dependencies = [ + "anyhow", + "borsh", + "elf", + "risc0-zkp 1.2.6", + "risc0-zkvm-platform 1.2.6", + "serde", + "tracing", +] + +[[package]] +name = "risc0-binfmt" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f4fe7599ac55ad77515608ec42a9727001559fe4f579c533cb7c973b54800c05" +dependencies = [ + "anyhow", + "borsh", + "derive_more 2.0.1", + "elf", + "lazy_static", + "postcard", + "risc0-zkp 2.0.1", + "risc0-zkvm-platform 2.0.2", + "semver 1.0.26", + "serde", + "tracing", +] + +[[package]] +name = "risc0-build" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "31d104165340cba919a3dac26c4be7da04b20b941601a7ad50c04834c4d26de5" +dependencies = [ + "anyhow", + "cargo_metadata", + "derive_builder", + "dirs", + "docker-generate", + "hex", + "risc0-binfmt 2.0.1", + "risc0-zkos-v1compat", + "risc0-zkp 2.0.1", + "risc0-zkvm-platform 2.0.2", + "rzup", + "semver 1.0.26", + "serde", + "serde_json", + "stability", + "tempfile", +] + +[[package]] +name = "risc0-build-kernel" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2cc3029ee7a4103aa176346f85431f1aa5193ea4025844417fcf1591f66299d4" +dependencies = [ + "cc", + "directories", + "glob", + "hex", + "rayon", + "sha2", + "tempfile", +] + +[[package]] +name = "risc0-circuit-keccak" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7cd8acfc84307ed1be64cf9fefc390963fc22b2865d027f03405977a0cfa9747" +dependencies = [ + "anyhow", + "bytemuck", + "cfg-if", + "keccak", + "paste", + "rayon", + "risc0-binfmt 2.0.1", + "risc0-circuit-keccak-sys", + "risc0-circuit-recursion", + "risc0-core 2.0.0", + "risc0-sys", + "risc0-zkp 2.0.1", + "tracing", + "xz2", +] + +[[package]] +name = "risc0-circuit-keccak-sys" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a25d00769a0f855d4973e8a85dbffe6e13889ca6a4703cf98d0a2976bdc2be17" +dependencies = [ + "cc", + "derive_more 2.0.1", + "glob", + "risc0-build-kernel", + "risc0-core 2.0.0", + "risc0-sys", +] + +[[package]] +name = "risc0-circuit-recursion" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3fdd1514e94440e2da301f48d345e1937b315147f58c5dc4992feb045324651d" +dependencies = [ + "anyhow", + "bytemuck", + "cfg-if", + "downloader", + "hex", + "lazy-regex", + "metal", + "rand 0.8.5", + "rayon", + "risc0-circuit-recursion-sys", + "risc0-core 2.0.0", + "risc0-sys", + "risc0-zkp 2.0.1", + "serde", + "sha2", + "tracing", + "zip", +] + +[[package]] +name = "risc0-circuit-recursion-sys" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a7f8aee9b6b299fc5c3259a1a6e00a49a17dfd55811e90070840a887b113645" +dependencies = [ + "glob", + "risc0-build-kernel", + "risc0-core 2.0.0", + "risc0-sys", +] + +[[package]] +name = "risc0-circuit-rv32im" +version = "2.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23f6ed144d8b8f93c4a6096e3dd90f9dcbd91eff83eae690a72fd6e640760b94" +dependencies = [ + "anyhow", + "auto_ops", + "bit-vec", + "bytemuck", + "byteorder", + "cfg-if", + "derive_more 2.0.1", + "enum-map", + "malachite", + "num-derive", + "num-traits", + "paste", + "postcard", + "rand 0.8.5", + "rayon", + "ringbuffer", + "risc0-binfmt 2.0.1", + "risc0-circuit-rv32im-sys", + "risc0-core 2.0.0", + "risc0-sys", + "risc0-zkp 2.0.1", + "serde", + "smallvec", + "tracing", +] + +[[package]] +name = "risc0-circuit-rv32im-sys" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c3904bb2fb2d26f96dd8dea5c5fcd7b86efd7e6f3e6dc56ef33e3e7fee51c4de" +dependencies = [ + "cc", + "derive_more 2.0.1", + "glob", + "risc0-build-kernel", + "risc0-core 2.0.0", + "risc0-sys", +] + +[[package]] +name = "risc0-core" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2be3e5c922ccf8a61adc3ebfbf9aadc168dec765c8bc5bf7cb28d9c46bfa5b9b" +dependencies = [ + "bytemuck", + "nvtx", + "puffin", + "rand_core 0.6.4", +] + +[[package]] +name = "risc0-core" +version = "2.0.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "317bbf70a8750b64d4fd7a2bdc9d7d5f30d8bb305cae486962c797ef35c8d08e" +dependencies = [ + "bytemuck", + "bytemuck_derive", + "nvtx", + "puffin", + "rand_core 0.6.4", +] + +[[package]] +name = "risc0-groth16" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73a946f8e6db205107668379e3058f0091d7f9aef63d8e4956dff5dc7dfac486" +dependencies = [ + "anyhow", + "ark-bn254 0.4.0", + "ark-ec 0.4.2", + "ark-groth16 0.4.0", + "ark-serialize 0.4.2", + "bytemuck", + "hex", + "num-bigint 0.4.6", + "num-traits", + "risc0-binfmt 1.2.6", + "risc0-core 1.2.6", + "risc0-zkp 1.2.6", + "serde", + "serde_json", + "stability", + "tempfile", + "tracing", +] + +[[package]] +name = "risc0-groth16" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b31cb7b2a46f0cdaf71803ea7e0389af9f5bc1aea2531106f2972b241f26e98" +dependencies = [ + "anyhow", + "ark-bn254 0.5.0", + "ark-ec 0.5.0", + "ark-groth16 0.5.0", + "ark-serialize 0.5.0", + "bytemuck", + "hex", + "num-bigint 0.4.6", + "num-traits", + "risc0-binfmt 2.0.1", + "risc0-core 2.0.0", + "risc0-zkp 2.0.1", + "serde", + "serde_json", + "stability", + "tempfile", + "tracing", +] + +[[package]] +name = "risc0-sys" +version = "1.4.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "11abd6064c039f24b58676419cd13c92cbf4858e66948dd55b188b03511db44c" +dependencies = [ + "anyhow", + "risc0-build-kernel", +] + +[[package]] +name = "risc0-zkos-v1compat" +version = "2.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f76c479b69d1987cb54ac72dcc017197296fdcd6daf78fafc10cbbd3a167a7de" +dependencies = [ + "include_bytes_aligned", + "no_std_strings", +] + +[[package]] +name = "risc0-zkp" +version = "1.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "373d06becf7bd3a8e46af6f8cb81509aa363cdddb1ec67a588ac69ad9f968127" +dependencies = [ + "anyhow", + "blake2", + "borsh", + "bytemuck", + "cfg-if", + "digest 0.10.7", + "ff 0.13.1", + "hex", + "hex-literal", + "metal", + "ndarray", + "parking_lot", + "paste", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "risc0-core 1.2.6", + "risc0-sys", + "risc0-zkvm-platform 1.2.6", + "serde", + "sha2", + "tracing", ] [[package]] -name = "reqwest" -version = "0.12.9" +name = "risc0-zkp" +version = "2.0.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a77c62af46e79de0a562e1a9849205ffcb7fc1238876e9bd743357570e04046f" +checksum = "fa210a232361fd671b30918469856b64d715f2564956d0a5df97ab6cb116d28b" dependencies = [ - "base64 0.22.1", - "bytes", - "futures-core", - "futures-util", - "http 1.1.0", - "http-body 1.0.1", - "http-body-util", - "hyper 1.5.1", - "hyper-tls 0.6.0", - "hyper-util", - "ipnet", - "js-sys", - "log", - "mime", - "native-tls", - "once_cell", - "percent-encoding", - "pin-project-lite", - "rustls-pemfile 2.2.0", + "anyhow", + "blake2", + "borsh", + "bytemuck", + "cfg-if", + "digest 0.10.7", + "ff 0.13.1", + "hex", + "hex-literal", + "metal", + "ndarray", + "parking_lot", + "paste", + "rand 0.8.5", + "rand_core 0.6.4", + "rayon", + "risc0-core 2.0.0", + "risc0-sys", + "risc0-zkvm-platform 2.0.2", "serde", - "serde_json", - "serde_urlencoded", - "sync_wrapper 1.0.2", - "tokio", - "tokio-native-tls", - "tower-service", - "url", - "wasm-bindgen", - "wasm-bindgen-futures", - "web-sys", - "windows-registry", + "sha2", + "stability", + "tracing", ] [[package]] -name = "rfc6979" -version = "0.3.1" +name = "risc0-zkvm" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7743f17af12fa0b03b803ba12cd6a8d9483a587e89c69445e3909655c0b9fabb" +checksum = "6a049319790277845335445b549d49e66341f4a7ffba7f7aaa1e77e2fc4a9c19" dependencies = [ - "crypto-bigint 0.4.9", - "hmac", - "zeroize", + "addr2line 0.22.0", + "anyhow", + "bincode", + "borsh", + "bytemuck", + "bytes", + "derive_more 2.0.1", + "elf", + "enum-map", + "getrandom 0.2.16", + "hex", + "keccak", + "lazy-regex", + "num-bigint 0.4.6", + "num-traits", + "prost", + "rand 0.8.5", + "rayon", + "risc0-binfmt 2.0.1", + "risc0-build", + "risc0-circuit-keccak", + "risc0-circuit-recursion", + "risc0-circuit-rv32im", + "risc0-core 2.0.0", + "risc0-groth16 2.0.1", + "risc0-zkos-v1compat", + "risc0-zkp 2.0.1", + "risc0-zkvm-platform 2.0.2", + "rrs-lib", + "rustc-demangle", + "rzup", + "semver 1.0.26", + "serde", + "sha2", + "stability", + "tempfile", + "tracing", + "typetag", ] [[package]] -name = "rfc6979" -version = "0.4.0" +name = "risc0-zkvm-platform" +version = "1.2.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8dd2a808d456c4a54e300a23e9f5a67e122c3024119acbfd73e3bf664491cb2" +checksum = "8187245809fe15d389dcdc1ca09ed5f5a1227b15e2fd48860c808aaf02e6996f" dependencies = [ - "hmac", - "subtle", + "cfg-if", + "stability", ] [[package]] -name = "ring" -version = "0.17.8" +name = "risc0-zkvm-platform" +version = "2.0.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c17fa4cb658e3583423e915b9f3acc01cceaee1860e33d59ebae66adc3a2dc0d" +checksum = "2e4de2938eaf24892ef927d9cef6e4acb6a19ce01c017cd498533896f633f332" dependencies = [ - "cc", + "bytemuck", "cfg-if", - "getrandom", - "libc", - "spin", - "untrusted", - "windows-sys 0.52.0", + "getrandom 0.2.16", + "getrandom 0.3.3", + "libm", + "stability", ] [[package]] @@ -4223,23 +6232,36 @@ dependencies = [ "rustc-hex", ] +[[package]] +name = "rrs-lib" +version = "0.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b4382d3af3a4ebdae7f64ba6edd9114fff92c89808004c4943b393377a25d001" +dependencies = [ + "downcast-rs", + "paste", +] + [[package]] name = "ruint" -version = "1.12.3" +version = "1.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2c3cc4c2511671f327125da14133d0c5c5d137f006a1017a16f557bc85b16286" +checksum = "78a46eb779843b2c4f21fac5773e25d6d5b7c8f0922876c91541790d2ca27eef" dependencies = [ "alloy-rlp", "ark-ff 0.3.0", "ark-ff 0.4.2", "bytes", - "fastrlp", - "num-bigint", + "fastrlp 0.3.1", + "fastrlp 0.4.0", + "num-bigint 0.4.6", + "num-integer", "num-traits", "parity-scale-codec", "primitive-types", "proptest", - "rand", + "rand 0.8.5", + "rand 0.9.1", "rlp", "ruint-macro", "serde", @@ -4259,6 +6281,18 @@ version = "0.1.24" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "719b953e2095829ee67db738b3bfa9fa368c94900df327b3f07fe6e794d2fe1f" +[[package]] +name = "rustc-hash" +version = "1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "08d43f7aa6b08d49f382cde6a7982047c3426db949b1424bc4b7ec9ae12c6ce2" + +[[package]] +name = "rustc-hash" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "357703d41365b4b27c590e3ed91eabb1b663f07c4c084095e60cbed4362dff0d" + [[package]] name = "rustc-hex" version = "2.1.0" @@ -4280,20 +6314,33 @@ version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "cfcb3a22ef46e85b45de6ee7e79d063319ebb6594faafcf1c225ea92ab6e9b92" dependencies = [ - "semver 1.0.23", + "semver 1.0.26", ] [[package]] name = "rustix" -version = "0.38.41" +version = "0.38.44" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d7f649912bc1495e167a6edee79151c84b1bad49748cb4f1f1167f459f6224f6" +checksum = "fdb5bc1ae2baa591800df16c9ca78619bf65c0488b41b96ccec5d11220d8c154" dependencies = [ - "bitflags 2.6.0", + "bitflags 2.9.1", "errno", "libc", - "linux-raw-sys", - "windows-sys 0.52.0", + "linux-raw-sys 0.4.15", + "windows-sys 0.59.0", +] + +[[package]] +name = "rustix" +version = "1.0.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c71e83d6afe7ff64890ec6b71d6a69bb8a610ab78ce364b3352876bb4c801266" +dependencies = [ + "bitflags 2.9.1", + "errno", + "libc", + "linux-raw-sys 0.9.4", + "windows-sys 0.59.0", ] [[package]] @@ -4310,14 +6357,15 @@ dependencies = [ [[package]] name = "rustls" -version = "0.23.19" +version = "0.23.27" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "934b404430bb06b3fae2cba809eb45a1ab1aecd64491213d7c3301b88393f8d1" +checksum = "730944ca083c1c233a75c09f199e973ca499344a2b7ba9e755c457e86fb4a321" dependencies = [ + "aws-lc-rs", "once_cell", "ring", "rustls-pki-types", - "rustls-webpki 0.102.8", + "rustls-webpki 0.103.3", "subtle", "zeroize", ] @@ -4331,7 +6379,19 @@ dependencies = [ "openssl-probe", "rustls-pemfile 1.0.4", "schannel", - "security-framework", + "security-framework 2.11.1", +] + +[[package]] +name = "rustls-native-certs" +version = "0.8.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "7fcff2dd52b58a8d98a70243663a0d234c4e2b79235637849d15913394a247d3" +dependencies = [ + "openssl-probe", + "rustls-pki-types", + "schannel", + "security-framework 3.2.0", ] [[package]] @@ -4354,9 +6414,13 @@ dependencies = [ [[package]] name = "rustls-pki-types" -version = "1.10.0" +version = "1.12.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "16f1201b3c9a7ee8039bcadc17b7e605e2945b27eee7631788c1bd2b0643674b" +checksum = "229a4a4c221013e7e1f1a043678c5cc39fe5171437c88fb47151a21e6f5b5c79" +dependencies = [ + "web-time", + "zeroize", +] [[package]] name = "rustls-webpki" @@ -4370,10 +6434,11 @@ dependencies = [ [[package]] name = "rustls-webpki" -version = "0.102.8" +version = "0.103.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "64ca1bc8749bd4cf37b5ce386cc146580777b4e8572c7b97baf22c83f444bee9" +checksum = "e4a72fe2bcf7a6ac6fd7d0b9e5cb68aeb7d4c0a0271730218b3e92d43b4eb435" dependencies = [ + "aws-lc-rs", "ring", "rustls-pki-types", "untrusted", @@ -4381,9 +6446,9 @@ dependencies = [ [[package]] name = "rustversion" -version = "1.0.18" +version = "1.0.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0e819f2bc632f285be6d7cd36e25940d45b2391dd6d9b939e79de557f7014248" +checksum = "eded382c5f5f786b989652c49544c4877d9f015cc22e145a5ea8ea66c2921cd2" [[package]] name = "rusty-fork" @@ -4397,17 +6462,43 @@ dependencies = [ "wait-timeout", ] +[[package]] +name = "ruzstd" +version = "0.6.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "5174a470eeb535a721ae9fdd6e291c2411a906b96592182d05217591d5c5cf7b" +dependencies = [ + "byteorder", + "derive_more 0.99.20", + "twox-hash", +] + [[package]] name = "ryu" -version = "1.0.18" +version = "1.0.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "28d3b2b1366ec20994f1fd18c3c594f05c5dd4bc44d8bb0c1c632c8d6829481f" + +[[package]] +name = "rzup" +version = "0.4.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f3cb5ba0dc43242ce17de99c180e96db90b235b8a9fdc9543c96d2209116bd9f" +checksum = "400558bf12d4292a7804093b60a437ba8b0219ea7d53716b2c010a0d31e5f4a8" +dependencies = [ + "semver 1.0.26", + "serde", + "strum 0.26.3", + "tempfile", + "thiserror 2.0.12", + "toml 0.8.22", + "yaml-rust2", +] [[package]] name = "scc" -version = "2.2.5" +version = "2.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "66b202022bb57c049555430e11fc22fea12909276a80a4c3d368da36ac1d88ed" +checksum = "22b2d775fb28f245817589471dd49c5edf64237f4a19d10ce9a92ff4651a27f4" dependencies = [ "sdd", ] @@ -4429,12 +6520,10 @@ checksum = "94143f37725109f92c262ed2cf5e59bce7498c01bcc1502d7b9afe439a4e9f49" [[package]] name = "script-macro" -version = "0.3.0" -source = "git+https://github.com/BitVM/rust-bitcoin-script?branch=StructuredScript#226956315350b52df0d8a1608530e0a965f405e1" +version = "0.4.0" +source = "git+https://github.com/BitVM/rust-bitcoin-script#519088c7e5e89769910dabcb1b663fa48a21a645" dependencies = [ "bitcoin", - "hex", - "lazy_static", "proc-macro-error", "proc-macro2", "quote", @@ -4452,9 +6541,9 @@ dependencies = [ [[package]] name = "sdd" -version = "3.0.4" +version = "3.0.8" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "49c1eeaf4b6a87c7479688c6d52b9f1153cedd3c489300564f932b065c6eab95" +checksum = "584e070911c7017da6cb2eb0788d09f43d789029b5877d3e5ecc8acf86ceee21" [[package]] name = "sec1" @@ -4477,7 +6566,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d3e97a565f76233a6003f9f5c54be1d9c5bdfa3eccfb189469f11ec4901c47dc" dependencies = [ "base16ct 0.2.0", - "der 0.7.9", + "der 0.7.10", "generic-array", "pkcs8 0.10.2", "subtle", @@ -4486,13 +6575,13 @@ dependencies = [ [[package]] name = "secp" -version = "0.2.4" +version = "0.3.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1c4754628ff9006f80c6abd1cd1e88c5ca6f5a60eab151ad2e16268aab3514d0" +checksum = "dd426921f62c7e334ca27173743cd90a7263566a3be76ef0b47773d631633cf9" dependencies = [ "base16ct 0.2.0", "once_cell", - "rand", + "rand 0.8.5", "secp256k1", "serde", "serdect", @@ -4501,21 +6590,21 @@ dependencies = [ [[package]] name = "secp256k1" -version = "0.28.2" +version = "0.29.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d24b59d129cdadea20aea4fb2352fa053712e5d713eee47d700cd4b2bc002f10" +checksum = "9465315bc9d4566e1724f0fffcbcc446268cb522e60f9a27bcded6b19c108113" dependencies = [ "bitcoin_hashes", - "rand", + "rand 0.8.5", "secp256k1-sys", "serde", ] [[package]] name = "secp256k1-sys" -version = "0.9.2" +version = "0.10.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e5d1746aae42c19d583c3c1a8c646bfad910498e2051c551a7f2e3c0c9fbb7eb" +checksum = "d4387882333d3aa8cb20530a17c69a3752e97837832f34f6dccc760e715001d9" dependencies = [ "cc", ] @@ -4526,8 +6615,21 @@ version = "2.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "897b2245f0b511c87893af39b033e5ca9cce68824c4d7e7630b5a1d339658d02" dependencies = [ - "bitflags 2.6.0", - "core-foundation", + "bitflags 2.9.1", + "core-foundation 0.9.4", + "core-foundation-sys", + "libc", + "security-framework-sys", +] + +[[package]] +name = "security-framework" +version = "3.2.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271720403f46ca04f7ba6f55d438f8bd878d6b8ca0a1046e8228c4145bcbb316" +dependencies = [ + "bitflags 2.9.1", + "core-foundation 0.10.0", "core-foundation-sys", "libc", "security-framework-sys", @@ -4535,9 +6637,9 @@ dependencies = [ [[package]] name = "security-framework-sys" -version = "2.12.1" +version = "2.14.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa39c7303dc58b5543c94d22c1766b0d31f2ee58306363ea622b10bbc075eaa2" +checksum = "49db231d56a190491cb4aeda9527f1ad45345af50b0851622a7adb8c03b01c32" dependencies = [ "core-foundation-sys", "libc", @@ -4554,9 +6656,12 @@ dependencies = [ [[package]] name = "semver" -version = "1.0.23" +version = "1.0.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61697e0a1c7e512e84a621326239844a24d8207b4669b41bc18b32ea5cbf988b" +checksum = "56e6fa9c48d24d85fb3de5ad847117517440f6beceb7798af16b4a87d616b8d0" +dependencies = [ + "serde", +] [[package]] name = "semver-parser" @@ -4575,9 +6680,9 @@ checksum = "cd0b0ec5f1c1ca621c432a25813d8d60c88abe6d3e08a3eb9cf37d97a0fe3d73" [[package]] name = "sendfd" -version = "0.4.3" +version = "0.4.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "604b71b8fc267e13bb3023a2c901126c8f349393666a6d98ac1ae5729b701798" +checksum = "b183bfd5b1bc64ab0c1ef3ee06b008a9ef1b68a7d3a99ba566fbfe7a7c6d745b" dependencies = [ "libc", "tokio", @@ -4585,9 +6690,9 @@ dependencies = [ [[package]] name = "serde" -version = "1.0.215" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6513c1ad0b11a9376da888e3e0baa0077f1aed55c17f50e7b2397136129fb88f" +checksum = "5f0e2c6ed6606019b4e29e69dbaba95b11854410e5347d525002456dbbb786b6" dependencies = [ "serde_derive", ] @@ -4605,20 +6710,20 @@ dependencies = [ [[package]] name = "serde_derive" -version = "1.0.215" +version = "1.0.219" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ad1e866f866923f252f05c889987993144fb74e722403468a4ebd70c3cd756c0" +checksum = "5b0276cf7f2c73365f7157c8123c21cd9a50fbbd844757af28ca1f5925fc2a00" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "serde_json" -version = "1.0.133" +version = "1.0.140" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c7fceb2473b9166b2294ef05efcb65a3db80803f0b03ef86a5fc88a2b85ee377" +checksum = "20068b6e96dc6c9bd23e01df8827e6c7e1f2fddd43c21810382803c136b99373" dependencies = [ "itoa", "memchr", @@ -4626,6 +6731,15 @@ dependencies = [ "serde", ] +[[package]] +name = "serde_spanned" +version = "0.6.8" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87607cb1398ed59d48732e575a4c28a7a8ebf2454b964fe3f224f2afc07909e1" +dependencies = [ + "serde", +] + [[package]] name = "serde_urlencoded" version = "0.7.1" @@ -4670,7 +6784,7 @@ checksum = "5d69265a08751de7844521fd15003ae0a888e035773ba05695c5c759a6f89eef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -4686,9 +6800,9 @@ dependencies = [ [[package]] name = "sha2" -version = "0.10.8" +version = "0.10.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "793db75ad2bcafc3ffa7c68b215fee268f537982cd901d132f89c6343f3a3dc8" +checksum = "a7507d819769d01a365ab707794a4084392c824f54a7a6a7862f8c3d0892b283" dependencies = [ "cfg-if", "cpufeatures", @@ -4719,9 +6833,9 @@ checksum = "0fda2ff0d084019ba4d7c6f371c95d8fd75ce3524c3cb8fb653a3023f6323e64" [[package]] name = "signal-hook" -version = "0.3.17" +version = "0.3.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8621587d4798caf8eb44879d42e56b9a93ea5dcd315a6487c357130095b62801" +checksum = "d881a16cf4426aa584979d30bd82cb33429027e42122b169753d6ef1085ed6e2" dependencies = [ "libc", "signal-hook-registry", @@ -4740,9 +6854,9 @@ dependencies = [ [[package]] name = "signal-hook-registry" -version = "1.4.2" +version = "1.4.5" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a9e9e0b4211b72e7b8b6e85c807d36c212bdb33ea8587f7569562a84df5465b1" +checksum = "9203b8055f63a2a00e2f593bb0510367fe707d7ff1e5c872de2f537b339e5410" dependencies = [ "libc", ] @@ -4754,7 +6868,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "74233d3b3b2f6d4b006dc19dee745e73e2a6bfb6f93607cd3b02bd5b00797d7c" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] [[package]] @@ -4764,18 +6878,24 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "77549399552de45a898a580c1b41d445bf730df867cc44e6c0233bbc4b8329de" dependencies = [ "digest 0.10.7", - "rand_core", + "rand_core 0.6.4", ] +[[package]] +name = "simd-adler32" +version = "0.3.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d66dc143e6b11c1eddc06d5c423cfc97062865baf299914ab64caa38182078fe" + [[package]] name = "simple_asn1" -version = "0.6.2" +version = "0.6.3" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adc4e5204eb1910f40f9cfa375f6f05b68c3abac4b6fd879c8ff5e7ae8a0a085" +checksum = "297f631f50729c8c99b84667867963997ec0b50f32b2a7dbcab828ef0541e8bb" dependencies = [ - "num-bigint", + "num-bigint 0.4.6", "num-traits", - "thiserror 1.0.69", + "thiserror 2.0.12", "time", ] @@ -4790,15 +6910,15 @@ dependencies = [ [[package]] name = "smallvec" -version = "1.13.2" +version = "1.15.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3c5e1a9a646d36c3599cd173a41282daf47c44583ad367b8e6837255952e5c67" +checksum = "8917285742e9f3e1683f0a9c4e6b57960b7314d0b08d30d1ecd426713ee2eee9" [[package]] name = "socket2" -version = "0.5.8" +version = "0.5.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c970269d99b64e60ec3bd6ad27270092a5394c4e309314b18ae3fe575695fbe8" +checksum = "4f5fd57c80058a56cf5c777ab8a126398ece8e442983605d280a44ce79d0edef" dependencies = [ "libc", "windows-sys 0.52.0", @@ -4809,6 +6929,9 @@ name = "spin" version = "0.9.8" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "6980e8d7511241f8acf4aebddbb1ff938df5eebe98691418c4468d0b72a96a67" +dependencies = [ + "lock_api", +] [[package]] name = "spki" @@ -4827,7 +6950,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "d91ed6c858b01f942cd56b37a94b3e0a1798290327d1236e4d9cf4eaca44d29d" dependencies = [ "base64ct", - "der 0.7.9", + "der 0.7.10", ] [[package]] @@ -4850,6 +6973,16 @@ dependencies = [ "serde", ] +[[package]] +name = "stability" +version = "0.2.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d904e7009df136af5297832a3ace3370cd14ff1546a232f4f185036c2736fcac" +dependencies = [ + "quote", + "syn 2.0.101", +] + [[package]] name = "stable_deref_trait" version = "1.2.0" @@ -4880,7 +7013,16 @@ version = "0.26.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8fec0f0aef304996cf250b31b5a10dee7980c85da9d759361292b8bca5a18f06" dependencies = [ - "strum_macros", + "strum_macros 0.26.4", +] + +[[package]] +name = "strum" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f64def088c51c9510a8579e3c5d67c65349dcf755e5479ad3d010aa6454e2c32" +dependencies = [ + "strum_macros 0.27.1", ] [[package]] @@ -4893,7 +7035,20 @@ dependencies = [ "proc-macro2", "quote", "rustversion", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "strum_macros" +version = "0.27.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c77a8c5abcaf0f9ce05d62342b7d298c346515365c36b673df4ebe3ced01fde8" +dependencies = [ + "heck", + "proc-macro2", + "quote", + "rustversion", + "syn 2.0.101", ] [[package]] @@ -4904,9 +7059,9 @@ checksum = "13c2bddecc57b384dee18652358fb23172facb8a2c51ccc10d74c157bdea3292" [[package]] name = "suppaftp" -version = "6.0.5" +version = "6.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a593e8bdcd2aff8369ccddf7fd42ae7ccaa0f8b6b343c16ed763c99c20926a29" +checksum = "a05110ce6c2cb19fc8040c2115a6a8c6d1ef59820ebca1fd81e22183ca525197" dependencies = [ "async-native-tls", "async-std", @@ -4916,7 +7071,7 @@ dependencies = [ "lazy-regex", "log", "pin-project", - "thiserror 2.0.3", + "thiserror 2.0.12", ] [[package]] @@ -4932,9 +7087,9 @@ dependencies = [ [[package]] name = "syn" -version = "2.0.90" +version = "2.0.101" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "919d3b74a5dd0ccd15aeb8f93e7006bd9e14c295087c9896a110f490752bcf31" +checksum = "8ce2b7fc941b3a24138a0a7cf8e858bfc6a992e7978a068a5c760deb0ed43caf" dependencies = [ "proc-macro2", "quote", @@ -4950,7 +7105,7 @@ dependencies = [ "paste", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -4970,13 +7125,13 @@ dependencies = [ [[package]] name = "synstructure" -version = "0.13.1" +version = "0.13.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8af7666ab7b6390ab78131fb5b0fce11d6b7a6951602017c35fa82800708971" +checksum = "728a70f3dbaf5bab7f0c4b1ac8d7ae5ea60a4b5549c8a5914361c99147a709d2" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -4986,7 +7141,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "ba3a3adc5c275d719af8cb4272ea1c4a6d668a777f37e115f6d11ddbc1c8e0e7" dependencies = [ "bitflags 1.3.2", - "core-foundation", + "core-foundation 0.9.4", "system-configuration-sys", ] @@ -5008,22 +7163,22 @@ checksum = "55937e1799185b12863d447f42597ed69d9928686b8d88a1df17376a097d8369" [[package]] name = "tempfile" -version = "3.14.0" +version = "3.20.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "28cce251fcbc87fac86a866eeb0d6c2d536fc16d06f184bb61aeae11aa4cee0c" +checksum = "e8a64e3985349f2441a1a9ef0b853f869006c3855f2cda6862a94d26ebb9d6a1" dependencies = [ - "cfg-if", "fastrand", + "getrandom 0.3.3", "once_cell", - "rustix", + "rustix 1.0.7", "windows-sys 0.59.0", ] [[package]] name = "thin-vec" -version = "0.2.13" +version = "0.2.14" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a38c90d48152c236a3ab59271da4f4ae63d678c5d7ad6b7714d7cb9760be5e4b" +checksum = "144f754d318415ac792f9d69fc87abbbfc043ce2ef041c60f16ad828f638717d" [[package]] name = "thiserror" @@ -5036,11 +7191,11 @@ dependencies = [ [[package]] name = "thiserror" -version = "2.0.3" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c006c85c7651b3cf2ada4584faa36773bd07bac24acfb39f3c431b36d7e667aa" +checksum = "567b8a2dae586314f7be2a752ec7474332959c6460e02bde30d702a66d488708" dependencies = [ - "thiserror-impl 2.0.3", + "thiserror-impl 2.0.12", ] [[package]] @@ -5051,18 +7206,18 @@ checksum = "4fee6c4efc90059e10f81e6d42c60a18f76588c3d74cb83a0b242a2b6c7504c1" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "thiserror-impl" -version = "2.0.3" +version = "2.0.12" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f077553d607adc1caf65430528a576c757a71ed73944b66ebb58ef2bbd243568" +checksum = "7f7cf42b4507d8ea322120659672cf1b9dbb93f8f2d4ecfd6e51350ff5b17a1d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5076,9 +7231,9 @@ dependencies = [ [[package]] name = "time" -version = "0.3.36" +version = "0.3.41" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5dfd88e563464686c916c7e46e623e520ddc6d79fa6641390f2e3fa86e83e885" +checksum = "8a7619e19bc266e0f9c5e6686659d394bc57973859340060a69221e57dbc0c40" dependencies = [ "deranged", "itoa", @@ -5091,15 +7246,15 @@ dependencies = [ [[package]] name = "time-core" -version = "0.1.2" +version = "0.1.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "ef927ca75afb808a4d64dd374f00a2adf8d0fcff8e7b184af886c3c87ec4a3f3" +checksum = "c9e9a38711f559d9e3ce1cdb06dd7c5b8ea546bc90052da6d06bb76da74bb07c" [[package]] name = "time-macros" -version = "0.2.18" +version = "0.2.22" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3f252a68540fde3a3877aeea552b832b40ab9a69e318efd078774a01ddee1ccf" +checksum = "3526739392ec93fd8b359c8e98514cb3e8e021beb4e5f597b00a0221f8ed8a49" dependencies = [ "num-conv", "time-core", @@ -5116,19 +7271,34 @@ dependencies = [ [[package]] name = "tinystr" -version = "0.7.6" +version = "0.8.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9117f5d4db391c1cf6927e7bea3db74b9a1c1add8f7eda9ffd5364f40f57b82f" +checksum = "5d4f6d1145dcb577acf783d4e601bc1d76a13337bb54e6233add580b07344c8b" dependencies = [ "displaydoc", "zerovec", ] +[[package]] +name = "tinyvec" +version = "1.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "09b3661f17e86524eccd4371ab0429194e0d7c008abb45f7a7495b1719463c71" +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.41.1" +version = "1.45.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "22cfb5bee7a6a52939ca9224d6ac897bb669134078daa8735560897f69de4d33" +checksum = "2513ca694ef9ede0fb23fe71a4ee4107cb102b9dc1930f6d0fd77aae068ae165" dependencies = [ "backtrace", "bytes", @@ -5154,13 +7324,13 @@ dependencies = [ [[package]] name = "tokio-macros" -version = "2.4.0" +version = "2.5.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "693d596312e88961bc67d7f1f97af8a70227d9f90c31bba5806eec004978d752" +checksum = "6e06d43f1345a3bcd39f6a56dbb7dcab2ba47e68e8ac134855e7e2bdbaf8cab8" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5195,12 +7365,11 @@ dependencies = [ [[package]] name = "tokio-rustls" -version = "0.26.0" +version = "0.26.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0c7bc40d0e5a97695bb96e27995cd3a08538541b0a846f65bba7a359f36700d4" +checksum = "8e727b36a1a0e8b74c376ac2211e40c2c8af09fb4013c60d910495810f008e9b" dependencies = [ - "rustls 0.23.19", - "rustls-pki-types", + "rustls 0.23.27", "tokio", ] @@ -5218,9 +7387,9 @@ dependencies = [ [[package]] name = "tokio-stream" -version = "0.1.16" +version = "0.1.17" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4f4e6ce100d0eb49a2734f8c0812bcd324cf357d21810932c5df6b96ef2b86f1" +checksum = "eca58d7bba4a75707817a2c44174253f9236b2d5fbd055602e9d5c07c139a047" dependencies = [ "futures-core", "pin-project-lite", @@ -5236,19 +7405,19 @@ checksum = "c6989540ced10490aaf14e6bad2e3d33728a2813310a0c71d1574304c49631cd" dependencies = [ "futures-util", "log", - "rustls 0.23.19", + "rustls 0.23.27", "rustls-pki-types", "tokio", - "tokio-rustls 0.26.0", + "tokio-rustls 0.26.2", "tungstenite", - "webpki-roots", + "webpki-roots 0.26.11", ] [[package]] name = "tokio-util" -version = "0.7.12" +version = "0.7.15" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "61e7c3654c13bcd040d4a03abee2c75b1d14a37b423cf5a813ceae1cc903ec6a" +checksum = "66a539a9ad6d5d281510d5bd368c973d636c02dbf8a67300bfb6b950696ad7df" dependencies = [ "bytes", "futures-core", @@ -5261,28 +7430,52 @@ dependencies = [ name = "toml" version = "0.5.11" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +checksum = "f4f7f0dd8d50a853a531c426359045b1998f04219d88799810762cd4ad314234" +dependencies = [ + "serde", +] + +[[package]] +name = "toml" +version = "0.8.22" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "05ae329d1f08c4d17a59bed7ff5b5a769d062e64a62d34a3261b219e62cd5aae" dependencies = [ "serde", + "serde_spanned", + "toml_datetime", + "toml_edit", ] [[package]] name = "toml_datetime" -version = "0.6.8" +version = "0.6.9" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0dd7358ecb8fc2f8d014bf86f6f638ce72ba252a2c3a2572f2a795f1d23efb41" +checksum = "3da5db5a963e24bc68be8b17b6fa82814bb22ee8660f192bb182771d498f09a3" +dependencies = [ + "serde", +] [[package]] name = "toml_edit" -version = "0.22.22" +version = "0.22.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4ae48d6208a266e853d946088ed816055e556cc6028c5e8e2b84d9fa5dd7c7f5" +checksum = "310068873db2c5b3e7659d2cc35d21855dbafa50d1ce336397c666e3cb08137e" dependencies = [ "indexmap", + "serde", + "serde_spanned", "toml_datetime", - "winnow", + "toml_write", + "winnow 0.7.10", ] +[[package]] +name = "toml_write" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bfb942dfe1d8e29a7ee7fcbde5bd2b9a25fb89aa70caea2eba3bee836ff41076" + [[package]] name = "tower" version = "0.4.13" @@ -5298,6 +7491,21 @@ dependencies = [ "tracing", ] +[[package]] +name = "tower" +version = "0.5.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d039ad9159c98b70ecfd540b2573b97f7f52c3e8d9f8ad57a24b916a536975f9" +dependencies = [ + "futures-core", + "futures-util", + "pin-project-lite", + "sync_wrapper 1.0.2", + "tokio", + "tower-layer", + "tower-service", +] + [[package]] name = "tower-layer" version = "0.3.3" @@ -5341,7 +7549,7 @@ checksum = "395ae124c09f9e6918a2310af6038fba074bcf474ac352496d5910dd59a2226d" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] @@ -5389,42 +7597,82 @@ dependencies = [ "byteorder", "bytes", "data-encoding", - "http 1.1.0", + "http 1.3.1", "httparse", "log", - "rand", - "rustls 0.23.19", + "rand 0.8.5", + "rustls 0.23.27", "rustls-pki-types", "sha1", "thiserror 1.0.69", "utf-8", ] +[[package]] +name = "twox-hash" +version = "1.6.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "97fee6b57c6a41524a810daee9286c02d7752c4253064d0b05472833a438f675" +dependencies = [ + "cfg-if", + "static_assertions", +] + [[package]] name = "typed-builder" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7e14ed59dc8b7b26cacb2a92bad2e8b1f098806063898ab42a3bd121d7d45e75" +checksum = "ce63bcaf7e9806c206f7d7b9c1f38e0dce8bb165a80af0898161058b19248534" dependencies = [ "typed-builder-macro", ] [[package]] name = "typed-builder-macro" -version = "0.20.0" +version = "0.21.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "560b82d656506509d43abe30e0ba64c56b1953ab3d4fe7ba5902747a7a3cedd5" +checksum = "60d8d828da2a3d759d3519cdf29a5bac49c77d039ad36d0782edadbf9cd5415b" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] +[[package]] +name = "typeid" +version = "1.0.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bc7d623258602320d5c55d1bc22793b57daff0ec7efc270ea7d55ce1d5f5471c" + [[package]] name = "typenum" -version = "1.17.0" +version = "1.18.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1dccffe3ce07af9386bfd29e80c0ab1a8205a2fc34e4bcd40364df902cfa8f3f" + +[[package]] +name = "typetag" +version = "0.2.20" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "73f22b40dd7bfe8c14230cf9702081366421890435b2d625fa92b4acc4c3de6f" +dependencies = [ + "erased-serde", + "inventory", + "once_cell", + "serde", + "typetag-impl", +] + +[[package]] +name = "typetag-impl" +version = "0.2.20" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "42ff0bf0c66b8238c6f3b578df37d0b7848e55df8577b3f74f92a69acceeb825" +checksum = "35f5380909ffc31b4de4f4bdf96b877175a016aa2ca98cee39fcfd8c4d53d952" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] [[package]] name = "ucd-trie" @@ -5452,9 +7700,9 @@ checksum = "eaea85b334db583fe3274d12b4cd1880032beab409c0d774be044d4480ab9a94" [[package]] name = "unicode-ident" -version = "1.0.14" +version = "1.0.18" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "adb9e6ca4f869e1180728b7950e35922a7fc6397f7b641499e8f3ef06e50dc83" +checksum = "5a5f39404a5da50712a4c1eecf25e90dd62b613502b7e925fd4e4d19b5c96512" [[package]] name = "unicode-xid" @@ -5485,12 +7733,6 @@ version = "0.7.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09cc8ee72d2a9becf2f2febe0205bbed8fc6615b7cb429ad062dc7b7ddd036a9" -[[package]] -name = "utf16_iter" -version = "1.0.5" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "c8232dd3cdaed5356e0f716d285e4b40b932ac434100fe9b7e0e8e935b9e6246" - [[package]] name = "utf8_iter" version = "1.0.4" @@ -5505,21 +7747,21 @@ checksum = "06abde3611657adf66d383f00b093d7faecc7fa57071cce2578660c9f1010821" [[package]] name = "uuid" -version = "1.11.0" +version = "1.16.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "f8c5f0a0af699448548ad1a2fbf920fb4bee257eae39953ba95cb84891a0446a" +checksum = "458f7a779bf54acc9f347480ac654f68407d3aab21269a6e3c9f922acd9e2da9" [[package]] name = "valuable" -version = "0.1.0" +version = "0.1.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "830b7e5d4d90034032940e4ace0d9a9a057e7a45cd94e6c007832e39edb82f6d" +checksum = "ba73ea9cf16a25df0c8caa16c51acb937d5712a8429db78a3ee29d5dcacd3a65" [[package]] name = "value-bag" -version = "1.10.0" +version = "1.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "3ef4c4aa54d5d05a279399bfa921ec387b7aba77caf7a682ae8d86785b8fdad2" +checksum = "943ce29a8a743eb10d6082545d861b24f9d1b160b7d741e0f2cdf726bec909c5" [[package]] name = "vcpkg" @@ -5551,9 +7793,9 @@ checksum = "5c3082ca00d5a5ef149bb8b555a72ae84c9c59f7250f013ac822ac2e49b19c64" [[package]] name = "wait-timeout" -version = "0.2.0" +version = "0.2.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9f200f5b12eb75f8c1ed65abd4b2db8a6e1b138a20de009dacee265a2498f3f6" +checksum = "09ac3b126d3914f9849036f826e054cbabdc8519970b8998ddaf3b5bd3c65f11" dependencies = [ "libc", ] @@ -5573,37 +7815,46 @@ version = "0.11.0+wasi-snapshot-preview1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "9c8d87e72b64a3b4db28d11ce29237c246188f4f51057d65a7eab63b7987e423" +[[package]] +name = "wasi" +version = "0.14.2+wasi-0.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9683f9a5a998d873c0d21fcbe3c083009670149a8fab228644b8bd36b2c48cb3" +dependencies = [ + "wit-bindgen-rt", +] + [[package]] name = "wasm-bindgen" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d15e63b4482863c109d70a7b8706c1e364eb6ea449b201a76c5b89cedcec2d5c" +checksum = "1edc8929d7499fc4e8f0be2262a241556cfc54a0bea223790e71446f2aab1ef5" dependencies = [ "cfg-if", "once_cell", + "rustversion", "wasm-bindgen-macro", ] [[package]] name = "wasm-bindgen-backend" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "8d36ef12e3aaca16ddd3f67922bc63e48e953f126de60bd33ccc0101ef9998cd" +checksum = "2f0a0651a5c2bc21487bde11ee802ccaf4c51935d0d3d42a6101f98161700bc6" dependencies = [ "bumpalo", "log", - "once_cell", "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-futures" -version = "0.4.47" +version = "0.4.50" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "9dfaf8f50e5f293737ee323940c7d8b08a66a95a419223d9f41610ca08b0833d" +checksum = "555d470ec0bc3bb57890405e5d4322cc9ea83cebb085523ced7be4144dac1e61" dependencies = [ "cfg-if", "js-sys", @@ -5614,9 +7865,9 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "705440e08b42d3e4b36de7d66c944be628d579796b8090bfa3471478a2260051" +checksum = "7fe63fc6d09ed3792bd0897b314f53de8e16568c2b3f7982f468c0bf9bd0b407" dependencies = [ "quote", "wasm-bindgen-macro-support", @@ -5624,28 +7875,41 @@ dependencies = [ [[package]] name = "wasm-bindgen-macro-support" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "98c9ae5a76e46f4deecd0f0255cc223cfa18dc9b261213b8aa0c7b36f61b3f1d" +checksum = "8ae87ea40c9f689fc23f209965b6fb8a99ad69aeeb0231408be24920604395de" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "wasm-bindgen-backend", "wasm-bindgen-shared", ] [[package]] name = "wasm-bindgen-shared" -version = "0.2.97" +version = "0.2.100" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6ee99da9c5ba11bd675621338ef6fa52296b76b83305e9b6e5c77d4c286d6d49" +checksum = "1a05d73b933a847d6cccdda8f838a22ff101ad9bf93e33684f39c1f5f0eece3d" +dependencies = [ + "unicode-ident", +] [[package]] name = "web-sys" -version = "0.3.74" +version = "0.3.77" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "33b6dd2ef9186f1f2072e409e99cd22a975331a6b3591b12c764e0e55c60d5d2" +dependencies = [ + "js-sys", + "wasm-bindgen", +] + +[[package]] +name = "web-time" +version = "1.1.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "a98bc3c33f0fe7e59ad7cd041b89034fa82a7c2d4365ca538dda6cdaf513863c" +checksum = "5a6580f308b1fad9207618087a65c04e7a10bc77e02c8e84e9b00dd4b12fa0bb" dependencies = [ "js-sys", "wasm-bindgen", @@ -5653,18 +7917,39 @@ dependencies = [ [[package]] name = "webpki-roots" -version = "0.26.7" +version = "0.26.11" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "521bc38abb08001b01866da9f51eb7c5d647a19260e00054a8c7fd5f9e57f7a9" +dependencies = [ + "webpki-roots 1.0.0", +] + +[[package]] +name = "webpki-roots" +version = "1.0.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5d642ff16b7e79272ae451b7322067cdc17cadf68c23264be9d94a32319efe7e" +checksum = "2853738d1cc4f2da3a225c18ec6c3721abb31961096e9dbf5ab35fa88b19cfdb" dependencies = [ "rustls-pki-types", ] +[[package]] +name = "which" +version = "4.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "87ba24419a2078cd2b0f2ede2691b6c66d8e47836da3b6db8265ebad47afbfc7" +dependencies = [ + "either", + "home", + "once_cell", + "rustix 0.38.44", +] + [[package]] name = "widestring" -version = "1.1.0" +version = "1.2.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "7219d36b6eac893fa81e84ebe06485e7dcbb616177469b142df14f1f4deb1311" +checksum = "dd7cf3379ca1aac9eea11fba24fd7e315d621f8dfe35c8d7d2be8b793726e07d" [[package]] name = "winapi" @@ -5690,41 +7975,81 @@ checksum = "712e227841d057c1ee1cd2fb22fa7e5a5461ae8e48fa2ca79ec42cfc1931183f" [[package]] name = "windows-core" -version = "0.52.0" +version = "0.61.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "33ab640c8d7e35bf8ba19b884ba838ceb4fba93a4e8c65a9059d08afcfc683d9" +checksum = "c0fdd3ddb90610c7638aa2b3a3ab2904fb9e5cdbecc643ddb3647212781c4ae3" dependencies = [ - "windows-targets 0.52.6", + "windows-implement", + "windows-interface", + "windows-link", + "windows-result", + "windows-strings 0.4.2", +] + +[[package]] +name = "windows-implement" +version = "0.60.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "a47fddd13af08290e67f4acabf4b459f647552718f683a7b415d290ac744a836" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", +] + +[[package]] +name = "windows-interface" +version = "0.59.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "bd9211b69f8dcdfa817bfd14bf1c97c9188afa36f4750130fcdf3f400eca9fa8" +dependencies = [ + "proc-macro2", + "quote", + "syn 2.0.101", ] +[[package]] +name = "windows-link" +version = "0.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76840935b766e1b0a05c0066835fb9ec80071d4c09a16f6bd5f7e655e3c14c38" + [[package]] name = "windows-registry" -version = "0.2.0" +version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "e400001bb720a623c1c69032f8e3e4cf09984deec740f007dd2b03ec864804b0" +checksum = "4286ad90ddb45071efd1a66dfa43eb02dd0dfbae1545ad6cc3c51cf34d7e8ba3" dependencies = [ "windows-result", - "windows-strings", - "windows-targets 0.52.6", + "windows-strings 0.3.1", + "windows-targets 0.53.0", ] [[package]] name = "windows-result" -version = "0.2.0" +version = "0.3.4" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1d1043d8214f791817bab27572aaa8af63732e11bf84aa21a45a78d6c317ae0e" +checksum = "56f42bd332cc6c8eac5af113fc0c1fd6a8fd2aa08a0119358686e5160d0586c6" dependencies = [ - "windows-targets 0.52.6", + "windows-link", ] [[package]] name = "windows-strings" -version = "0.1.0" +version = "0.3.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "4cd9b125c486025df0eabcb585e62173c6c9eddcec5d117d3b6e8c30e2ee4d10" +checksum = "87fa48cc5d406560701792be122a10132491cff9d0aeb23583cc2dcafc847319" dependencies = [ - "windows-result", - "windows-targets 0.52.6", + "windows-link", +] + +[[package]] +name = "windows-strings" +version = "0.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "56e6c93f3a0c3b36176cb1327a4958a0353d5d166c2a35cb268ace15e91d3b57" +dependencies = [ + "windows-link", ] [[package]] @@ -5778,13 +8103,29 @@ dependencies = [ "windows_aarch64_gnullvm 0.52.6", "windows_aarch64_msvc 0.52.6", "windows_i686_gnu 0.52.6", - "windows_i686_gnullvm", + "windows_i686_gnullvm 0.52.6", "windows_i686_msvc 0.52.6", "windows_x86_64_gnu 0.52.6", "windows_x86_64_gnullvm 0.52.6", "windows_x86_64_msvc 0.52.6", ] +[[package]] +name = "windows-targets" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b1e4c7e8ceaaf9cb7d7507c974735728ab453b67ef8f18febdd7c11fe59dca8b" +dependencies = [ + "windows_aarch64_gnullvm 0.53.0", + "windows_aarch64_msvc 0.53.0", + "windows_i686_gnu 0.53.0", + "windows_i686_gnullvm 0.53.0", + "windows_i686_msvc 0.53.0", + "windows_x86_64_gnu 0.53.0", + "windows_x86_64_gnullvm 0.53.0", + "windows_x86_64_msvc 0.53.0", +] + [[package]] name = "windows_aarch64_gnullvm" version = "0.48.5" @@ -5797,6 +8138,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "32a4622180e7a0ec044bb555404c800bc9fd9ec262ec147edd5989ccd0c02cd3" +[[package]] +name = "windows_aarch64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "86b8d5f90ddd19cb4a147a5fa63ca848db3df085e25fee3cc10b39b6eebae764" + [[package]] name = "windows_aarch64_msvc" version = "0.48.5" @@ -5809,6 +8156,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "09ec2a7bb152e2252b53fa7803150007879548bc709c039df7627cabbd05d469" +[[package]] +name = "windows_aarch64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c7651a1f62a11b8cbd5e0d42526e55f2c99886c77e007179efff86c2b137e66c" + [[package]] name = "windows_i686_gnu" version = "0.48.5" @@ -5821,12 +8174,24 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8e9b5ad5ab802e97eb8e295ac6720e509ee4c243f69d781394014ebfe8bbfa0b" +[[package]] +name = "windows_i686_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c1dc67659d35f387f5f6c479dc4e28f1d4bb90ddd1a5d3da2e5d97b42d6272c3" + [[package]] name = "windows_i686_gnullvm" version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "0eee52d38c090b3caa76c563b86c3a4bd71ef1a819287c19d586d7334ae8ed66" +[[package]] +name = "windows_i686_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "9ce6ccbdedbf6d6354471319e781c0dfef054c81fbc7cf83f338a4296c0cae11" + [[package]] name = "windows_i686_msvc" version = "0.48.5" @@ -5839,6 +8204,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "240948bc05c5e7c6dabba28bf89d89ffce3e303022809e73deaefe4f6ec56c66" +[[package]] +name = "windows_i686_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "581fee95406bb13382d2f65cd4a908ca7b1e4c2f1917f143ba16efe98a589b5d" + [[package]] name = "windows_x86_64_gnu" version = "0.48.5" @@ -5851,6 +8222,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "147a5c80aabfbf0c7d901cb5895d1de30ef2907eb21fbbab29ca94c5b08b1a78" +[[package]] +name = "windows_x86_64_gnu" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2e55b5ac9ea33f2fc1716d1742db15574fd6fc8dadc51caab1c16a3d3b4190ba" + [[package]] name = "windows_x86_64_gnullvm" version = "0.48.5" @@ -5863,6 +8240,12 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "24d5b23dc417412679681396f2b49f3de8c1473deb516bd34410872eff51ed0d" +[[package]] +name = "windows_x86_64_gnullvm" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0a6e035dd0599267ce1ee132e51c27dd29437f63325753051e71dd9e42406c57" + [[package]] name = "windows_x86_64_msvc" version = "0.48.5" @@ -5875,11 +8258,26 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "windows_x86_64_msvc" +version = "0.53.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "271414315aff87387382ec3d271b52d7ae78726f5d44ac98b4f4030c91880486" + [[package]] name = "winnow" -version = "0.6.20" +version = "0.6.26" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "36c1fec1a2bb5866f07c25f68c26e565c4c200aebb96d7e55710c19d3e8ac49b" +checksum = "1e90edd2ac1aa278a5c4599b1d89cf03074b610800f866d4026dc199d7929a28" +dependencies = [ + "memchr", +] + +[[package]] +name = "winnow" +version = "0.7.10" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c06928c8748d81b05c9be96aad92e1b6ff01833332f281e8cfca3be4b35fc9ec" dependencies = [ "memchr", ] @@ -5895,16 +8293,19 @@ dependencies = [ ] [[package]] -name = "write16" -version = "1.0.0" +name = "wit-bindgen-rt" +version = "0.39.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "d1890f4022759daae28ed4fe62859b1236caebfc61ede2f63ed4e695f3f6d936" +checksum = "6f42320e61fe2cfd34354ecb597f86f413484a798ba44a8ca1165c58d42da6c1" +dependencies = [ + "bitflags 2.9.1", +] [[package]] name = "writeable" -version = "0.5.5" +version = "0.6.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1e9df38ee2d2c3c5948ea468a8406ff0db0b29ae1ffde1bcf20ef305bcc95c51" +checksum = "ea2f10b9bb0928dfb1b42b65e1f9e36f7f54dbdf08457afefb38afcdec4fa2bb" [[package]] name = "ws_stream_wasm" @@ -5940,11 +8341,31 @@ version = "0.13.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "66fee0b777b0f5ac1c69bb06d361268faafa61cd4682ae064a171c16c433e9e4" +[[package]] +name = "xz2" +version = "0.1.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "388c44dc09d76f1536602ead6d325eb532f5c122f17782bd57fb47baeeb767e2" +dependencies = [ + "lzma-sys", +] + +[[package]] +name = "yaml-rust2" +version = "0.9.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2a1a1c0bc9823338a3bdf8c61f994f23ac004c6fa32c08cd152984499b445e8d" +dependencies = [ + "arraydeque", + "encoding_rs", + "hashlink", +] + [[package]] name = "yoke" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "120e6aef9aa629e3d4f52dc8cc43a015c7724194c97dfaf45180d2daf2b77f40" +checksum = "5f41bb01b8226ef4bfd589436a297c53d118f65921786300e427be8d487695cc" dependencies = [ "serde", "stable_deref_trait", @@ -5954,55 +8375,54 @@ dependencies = [ [[package]] name = "yoke-derive" -version = "0.7.5" +version = "0.8.0" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "2380878cad4ac9aac1e2435f3eb4020e8374b5f13c296cb75b4620ff8e229154" +checksum = "38da3c9736e16c5d3c8c597a9aaa5d1fa565d0532ae05e27c24aa62fb32c0ab6" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "synstructure", ] [[package]] name = "zerocopy" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "1b9b4fd18abc82b8136838da5d50bae7bdea537c574d8dc1a34ed098d6c166f0" +checksum = "a1702d9583232ddb9174e01bb7c15a2ab8fb1bc6f227aa1233858c351a3ba0cb" dependencies = [ - "byteorder", "zerocopy-derive", ] [[package]] name = "zerocopy-derive" -version = "0.7.35" +version = "0.8.25" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "fa4f8080344d4671fb4e831a13ad1e68092748387dfc4f55e356242fae12ce3e" +checksum = "28a6e20d751156648aa063f3800b706ee209a32c0b4d9f24be3d980b01be55ef" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] [[package]] name = "zerofrom" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "cff3ee08c995dee1859d998dea82f7374f2826091dd9cd47def953cae446cd2e" +checksum = "50cc42e0333e05660c3587f3bf9d0478688e15d870fab3346451ce7f8c9fbea5" dependencies = [ "zerofrom-derive", ] [[package]] name = "zerofrom-derive" -version = "0.1.5" +version = "0.1.6" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "595eed982f7d355beb85837f651fa22e90b3c044842dc7f2c2842c086f295808" +checksum = "d71e5d6e06ab090c67b5e44993ec16b72dcbaabc526db883a360057678b48502" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", "synstructure", ] @@ -6023,14 +8443,25 @@ checksum = "ce36e65b0d2999d2aafac989fb249189a141aee1f53c612c1f37d72631959f69" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", +] + +[[package]] +name = "zerotrie" +version = "0.2.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "36f0bbd478583f79edad978b407914f61b2972f5af6fa089686016be8f9af595" +dependencies = [ + "displaydoc", + "yoke", + "zerofrom", ] [[package]] name = "zerovec" -version = "0.10.4" +version = "0.11.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "aa2b893d79df23bfb12d5461018d408ea19dfafe76c2c7ef6d4eba614f8ff079" +checksum = "4a05eb080e015ba39cc9e23bbe5e7fb04d5fb040350f99f34e338d5fdd294428" dependencies = [ "yoke", "zerofrom", @@ -6039,16 +8470,68 @@ dependencies = [ [[package]] name = "zerovec-derive" -version = "0.10.3" +version = "0.11.1" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "6eafa6dfb17584ea3e2bd6e76e0cc15ad7af12b09abdd1ca55961bed9b1063c6" +checksum = "5b96237efa0c878c64bd89c436f661be4e46b2f3eff1ebb976f7ef2321d2f58f" dependencies = [ "proc-macro2", "quote", - "syn 2.0.90", + "syn 2.0.101", ] -[[patch.unused]] -name = "ark-r1cs-std" -version = "0.4.0" -source = "git+https://github.com/arkworks-rs/r1cs-std/#dfdad2b729ebc7e8104931b683f3799246252adc" +[[package]] +name = "zip" +version = "2.4.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "fabe6324e908f85a1c52063ce7aa26b68dcb7eb6dbc83a2d148403c9bc3eba50" +dependencies = [ + "arbitrary", + "crc32fast", + "crossbeam-utils", + "displaydoc", + "flate2", + "indexmap", + "memchr", + "thiserror 2.0.12", + "zopfli", +] + +[[package]] +name = "zopfli" +version = "0.8.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "edfc5ee405f504cd4984ecc6f14d02d55cfda60fa4b689434ef4102aae150cd7" +dependencies = [ + "bumpalo", + "crc32fast", + "log", + "simd-adler32", +] + +[[package]] +name = "zstd" +version = "0.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e91ee311a569c327171651566e07972200e76fcfe2242a4fa446149a3881c08a" +dependencies = [ + "zstd-safe", +] + +[[package]] +name = "zstd-safe" +version = "7.2.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8f49c4d5f0abb602a93fb8736af2a4f4dd9512e36f7f570d66e65ff867ed3b9d" +dependencies = [ + "zstd-sys", +] + +[[package]] +name = "zstd-sys" +version = "2.0.15+zstd.1.5.7" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "eb81183ddd97d0c74cedf1d50d85c8d08c1b8b68ee863bdee9e706eedba1a237" +dependencies = [ + "cc", + "pkg-config", +] diff --git a/Cargo.toml b/Cargo.toml index b58ceb959..6f9c528b6 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -1,88 +1,70 @@ -[package] -name = "bitvm" -version = "0.1.0" -edition = "2021" -exclude = ["tests"] +[workspace] +resolver = "2" +members = [ + "bitvm", + "bridge", + "fuzz", + "header-chain", + "header-chain/header-chain-guest", + "final-spv", + "final-spv/final-spv-guest", + "prover", +] -[dependencies] -#bitcoin-script = { path = "../rust-bitcoin-script"} -#bitcoin-scriptexec = { path = "../rust-bitcoin-scriptexec"} -bitcoin-script = { git = "https://github.com/BitVM/rust-bitcoin-script", branch= "StructuredScript" } -bitcoin = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm", features = ["rand-std"]} -strum = "0.26" -strum_macros = "0.26" -hex = "0.4.3" -bitcoin-scriptexec = { git = "https://github.com/BitVM/rust-bitcoin-scriptexec/"} +default-members = [ + "bitvm", + "bridge", + "fuzz", +] + +[workspace.dependencies] +bitcoin-script = { git = "https://github.com/BitVM/rust-bitcoin-script" } +bitcoin = { version = "0.32.5", features = ["rand-std"] } +strum = "0.27" +strum_macros = "0.27" +bitcoin-scriptexec = { git = "https://github.com/BitVM/rust-bitcoin-scriptexec" } serde = { version = "1.0.197", features = ["derive"] } -num-bigint = "0.4.4" num-traits = "0.2.18" -ark-bn254 = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop", features = ["curve"], default-features = false } -ark-ff = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop" } -ark-ec = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop" } -ark-groth16 = { git = "https://github.com/arkworks-rs/groth16" } +ark-bn254 = { version = "0.5.0", features = ["curve", "scalar_field"], default-features = false } +ark-ff = "0.5.0" +ark-ec = "0.5.0" +ark-groth16 = "0.5.0" +ark-serialize = "0.5.0" sha2 = "0.10.8" tokio = { version = "1.37.0", features = ["full"] } esplora-client = { git = "https://github.com/BitVM/rust-esplora-client" } serde_json = "1.0.116" -lazy_static = "1.4.0" -bitcoin-script-stack = { git = "https://github.com/BitVM/rust-bitcoin-script-stack", branch = "bitvm" } +bitcoin-script-stack = { git = "https://github.com/BitVM/rust-bitcoin-script-stack" } rand = "0.8.5" rand_chacha = "0.3.1" -once_cell = "1.19.0" dotenv = "0.15.0" aws-sdk-s3 = "1.40.0" regex = "1.10.5" -blake3 = "=1.5.1" +blake3 = "1.6.1" paste = "1.0.15" -musig2 = { version = "0.0.11", features = ["serde", "rand"] } +musig2 = { version = "0.1.0", features = ["serde", "rand"] } futures = "0.3.30" async-trait = "0.1.81" suppaftp = { version = "6.0.1", features = ["async", "async-native-tls"] } openssh-sftp-client = { version = "0.14.6", features = ["openssh"] } openssh = { version = "0.10.4", features = ["native-mux"] } alloy = { version = "0.2.1", features = ["full"] } -clap = { version = "4.5.16", features = ["derive", "cargo", "env"] } +clap = { version = "4.5.23", features = ["derive", "cargo", "env"] } toml = "0.5.11" colored = "2.0.0" - -[dev-dependencies] +itertools = "0.13.0" +serde-big-array = "0.5.1" num-bigint = { version = "0.4.4", features = ["rand"] } -ark-std = { version = "0.4.0", default-features = false, features = ["print-trace"] } -ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitives", features = ["snark", "sponge"] } -ark-relations = { git = "https://github.com/arkworks-rs/snark/" } +ark-std = { version = "0.5.0", default-features = false, features = ["print-trace"] } +ark-crypto-primitives = { version = "0.5.0", features = ["snark", "sponge"] } +ark-relations = "0.5.0" serial_test = "*" tqdm = "0.7" +secp256k1 = { version = "0.29.1", features = ["global-context"]} +derive_more = "2.0" [profile.dev] opt-level = 3 [profile.release] lto = true - -[patch.crates-io] -base58check = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm"} -bitcoin = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm"} -bitcoin_hashes = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm"} -bitcoin-internals = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm"} -bitcoin-io = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm"} -bitcoin-units = { git = "https://github.com/rust-bitcoin/rust-bitcoin", branch = "bitvm"} - -ark-ff = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop" } -ark-ec = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop" } -ark-poly = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop" } -ark-serialize = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop" } -ark-bn254 = { git = "https://github.com/chainwayxyz/algebra/", branch = "new-ate-loop", features = ["curve"], default-features = false } - -ark-r1cs-std = { git = "https://github.com/arkworks-rs/r1cs-std/" } -ark-crypto-primitives = { git = "https://github.com/arkworks-rs/crypto-primitives/" } - -ark-relations = { git = "https://github.com/arkworks-rs/snark/" } -ark-snark = { git = "https://github.com/arkworks-rs/snark/" } -ark-groth16 = { git = "https://github.com/arkworks-rs/groth16" } - -[[bin]] -name = "cli" - -[[bin]] -name = "cli-query" -path = "src/bin/cli_query/main.rs" diff --git a/DEMO_INSTRUCTIONS.md b/DEMO_INSTRUCTIONS.md new file mode 100644 index 000000000..23217e7e9 --- /dev/null +++ b/DEMO_INSTRUCTIONS.md @@ -0,0 +1,263 @@ +Before running the demo for the first time, see [Environment Setup](#environment-setup) section below. + +# Demo Prep: Funding UTXOs +The bridge peg-in and peg-out execution consumes three funding UTXOs. For convenience, prepare them before running the demo. This process remains the same across all scenarios. + +The minimum required UTXO amounts may change in the future, so please use the **get-funding-amounts** CLI command to get up-to-date information. The list below is provided for reference only: + +1. Peg-in graph - 'peg-in deposit' tx input: **2097447 SAT** - will be spent by [DEPOSITOR] (use `-d` to get their address) +2. Peg-out graph - 'peg-out confirm' tx input: **3607030 SAT** - will be spent by [OPERATOR] (use `-o` to get their address) +3. Withdrawer peg-out - 'peg-out' tx input: **2097274 SAT** - will be spent by [OPERATOR] (use `-o` to get their address) + +# Demo Steps +The following is the list of command line arguments that are passed to the CLI tool in sequence by the respective actors. The arguments can be used either with `cargo run --bin bridge --` or when running the CLI binary directly. + +## Rejected Disprove Scenario (a.k.a. 'happy peg-out' execution path). +#### [DEPOSITOR] Initiate peg-in +`:` = Bridge deposit UTXO that includes the expected peg-in amount. It must be spendable by the depositor private key. Suggested test amount: `2097447 sats`. It is the UTXO #1 in [Demo Prep](#demo-prep-funding-utxos). +``` +-n -u : -d +``` +#### [OPERATOR] Create peg-out graph +`:` = UTXO funding the peg-out confirm tx. Must be spendable by the operator private key. Suggested test amount: `3562670 sats`. It is the UTXO #2 in [Demo Prep](#demo-prep-funding-utxos). +``` +-t -u : -i +``` +#### [VERIFIER_0] Push verifier_0 nonces for peg-in graph +``` +-c -i +``` +#### [VERIFIER_1] Push verifier_1 nonces for peg-in graph +``` +-c -i +``` +#### [VERIFIER_0] Push verifier_0 signatures for peg-in graph +``` +-g -i +``` +#### [VERIFIER_1] Push verifier_1 signatures for peg-in graph +``` +-g -i +``` +#### [OPERATOR] or [VERIFIER_0] or [VERIFIER_1] Broadcast peg-in confirm +``` +-b pegin -g confirm +``` +Record the peg-in confirm txid. +#### [VERIFIER_0] Push verifier_0 nonces for peg-out graph +``` +-c -i +``` +#### [VERIFIER_1] Push verifier_1 nonces for peg-out graph +``` +-c -i +``` +#### [VERIFIER_0] Push verifier_0 signatures for peg-out graph +``` +-g -i +``` +#### [VERIFIER_1] Push verifier_1 signatures for peg-out graph +``` +-g -i +``` +#### [OPERATOR] Mock L2 peg-out event (requires peg-in confirm txid mined earlier) +> [!IMPORTANT] +> Start the CLI in interactive mode here. + +`:` = The peg-in confirm txid recorded above and output index 0. +``` +-x -u : +``` +#### [OPERATOR] Broadcast peg-out +`:` = UTXO funding the payout to the withdrawer. Must be spendable by the operator private key. Suggested test amount: `2097274 sats`. It is the UTXO #3 in [Demo Prep](#demo-prep-funding-utxos). +``` +-b tx -g -u : peg_out +``` +#### [OPERATOR] Broadcast peg-out confirm +``` +-b tx -g peg_out_confirm +``` +#### [OPERATOR] Broadcast kick-off 1 +``` +-b tx -g kick_off_1 +``` +#### [OPERATOR] Broadcast kick-off 2 +``` +-b tx -g kick_off_2 +``` +#### [OPERATOR] Broadcast assert-initial +``` +-b tx -g assert_initial +``` +#### [OPERATOR] Broadcast assert-commit 1 +``` +-b tx -g assert_commit_1 +``` +#### [OPERATOR] Broadcast assert-commit 2 +``` +-b tx -g assert_commit_2 +``` +#### [OPERATOR] Broadcast assert-final +``` +-b tx -g assert_final +``` +#### [VERIFIER_1] Broadcast disprove (should fail) +`` = Receiver of the disprove reward. +``` +-b tx -g -a disprove +``` +#### [OPERATOR] Broadcast take 2 +``` +-b tx -g take_2 +``` + +## Successful Disprove Scenario (a.k.a. 'unhappy peg-out' execution path). +#### [DEPOSITOR] Initiate peg-in +`:` = Bridge deposit UTXO that includes the expected peg-in amount. It must be spendable by the depositor private key. Suggested test amount: `2097447 sats`. +``` +-n -u : -d +``` +#### [OPERATOR] Create peg-out graph +`:` = UTXO funding the peg-out confirm tx. Must be spendable by the operator private key. Suggested test amount: `3562670 sats`. +``` +-t -u : -i +``` +#### [VERIFIER_0] Push verifier_0 nonces for peg-in graph +``` +-c -i +``` +#### [VERIFIER_1] Push verifier_1 nonces for peg-in graph +``` +-c -i +``` +#### [VERIFIER_0] Push verifier_0 signatures for peg-in graph +``` +-g -i +``` +#### [VERIFIER_0] Push verifier_1 signatures for peg-in graph +``` +-g -i +``` +#### [OPERATOR] or [VERIFIER_0] or [VERIFIER_1] Broadcast peg-in confirm +``` +-b pegin -g confirm +``` +Record the peg-in confirm txid. +#### [VERIFIER_0] Push verifier_0 nonces for peg-out graph +``` +-c -i +``` +#### [VERIFIER_1] Push verifier_1 nonces for peg-out graph +``` +-c -i +``` +#### [VERIFIER_0] Push verifier_0 signatures for peg-out graph +``` +-g -i +``` +#### [VERIFIER_1] Push verifier_1 signatures for peg-out graph +``` +-g -i +``` +#### [OPERATOR] Mock L2 peg-out event (requires peg-in confirm txid mined earlier) +> [!IMPORTANT] +> Start the CLI in interactive mode here. + +`:` = The peg-in confirm txid recorded above and output index 0. +``` +-x -u : +``` +#### [OPERATOR] Broadcast peg-out +`:` = UTXO funding the payout to the withdrawer. Must be spendable by the operator private key. Suggested test amount: `2097274 sats`. +``` +-b tx -g -u : peg_out +``` +#### [OPERATOR] Broadcast peg-out confirm +``` +-b tx -g peg_out_confirm +``` +#### [OPERATOR] Broadcast kick-off 1 +``` +-b tx -g kick_off_1 +``` +#### [OPERATOR] Broadcast kick-off 2 +``` +-b tx -g kick_off_2 +``` +#### [OPERATOR] Broadcast assert-initial +``` +-b tx -g assert_initial +``` +#### [OPERATOR] Broadcast assert-commit 1 with invalid proof +``` +-b tx -g assert_commit_1_invalid +``` +#### [OPERATOR] Broadcast assert-commit 2 with invalid proof +``` +-b tx -g assert_commit_2_invalid +``` +#### [OPERATOR] Broadcast assert-final +``` +-b tx -g assert_final +``` +#### [VERIFIER_1] Broadcast disprove +`` = Receiver of the disprove reward. +``` +-b tx -g -a disprove +``` + +# Environment Setup +Clone and build this repository. The CLI executable is called `bridge`. + +## [DEPOSITOR] and [OPERATOR] and [VERIFIER_0] +All the above users can execute commands using a single setup (from the same directory). + +#### `bridge.toml` +Sample `bridge.toml` file that contains private keys of protocol participants and the ZK proof verifying key: +```toml +[keys] +depositor = "b8f17ea979be24199e7c3fec71ee88914d92fd4ca508443f765d56ce024ef1d7" +operator = "3076ca1dfc1e383be26d5dd3c0c427340f96139fa8c2520862cf551ec2d670ac" +verifier = "ee0817eac0c13aa8ee2dd3256304041f09f0499d1089b56495310ae8093583e2" +verifying_key = "9c3815c2ec66950b63e60c86dc9a2a658e0224d55ea45efe1f633be052dc7d867aff76a9e983210318f1b808aacbbba1dc04b6ac4e6845fa0cc887aeacaf5a068ab9aeaf8142740612ff2f3377ce7bfa7433936aaa23e3f3749691afaa06301fd03f043c097556e7efdf6862007edf3eb868c736d917896c014c54754f65182ae0c198157f92e667b6572ba60e6a52d58cb70dbeb3791206e928ea5e65c6199d25780cedb51796a8a43e40e192d1b23d0cfaf2ddd03e4ade7c327dbc427999244bf4b47b560cf65d672c86ef448eb5061870d3f617bd3658ad6917d0d32d9296020000000000000008f167c3f26c93dbfb91f3077b66bc0092473a15ef21c30f43d3aa96776f352a33622830e9cfcb48bdf8d3145aa0cf364bd19bbabfb3c73e44f56794ee65dc8a" +``` +Place the file in `.bitvm-bridge` directory in the user home directory. + +#### `.env` +Sample `.env` file that must be present in the same directory as the CLI tool or any of its parent directories (if you clone this repository, you can put it in the root directory). +``` +export BRIDGE_DATA_STORE_CLIENT_DATA_SUFFIX=-"bridge-client-data-demo-feb-2025.json" + +export BRIDGE_AWS_ACCESS_KEY_ID="" +export BRIDGE_AWS_SECRET_ACCESS_KEY="" +export BRIDGE_AWS_REGION="" +export BRIDGE_AWS_BUCKET="" + +# All verifier public keys +export VERIFIERS="026cc14f56ad7e8fdb323378287895c6c0bcdbb37714c74fba175a0c5f0cd0d56f,02452556ed6dbac394cbb7441fbaf06c446d1321467fa5a138895c6c9e246793dd" +``` + +## [VERIFIER_1] +Install the CLI tool in a different directory and make sure it doesn't share the `.env` file with the setup above. You can either clone this repository at another location or just copy the binary along with the .env. + +#### `bridge.toml` +Create a 'bitvm-bridge-verifier-1' directory there and put the following `bridge.toml` file there: +```toml +[keys] +verifier = "fc294c70faf210d4d0807ea7a3dba8f7e41700d90c119e1ae82a0687d89d297f" +verifying_key = "9c3815c2ec66950b63e60c86dc9a2a658e0224d55ea45efe1f633be052dc7d867aff76a9e983210318f1b808aacbbba1dc04b6ac4e6845fa0cc887aeacaf5a068ab9aeaf8142740612ff2f3377ce7bfa7433936aaa23e3f3749691afaa06301fd03f043c097556e7efdf6862007edf3eb868c736d917896c014c54754f65182ae0c198157f92e667b6572ba60e6a52d58cb70dbeb3791206e928ea5e65c6199d25780cedb51796a8a43e40e192d1b23d0cfaf2ddd03e4ade7c327dbc427999244bf4b47b560cf65d672c86ef448eb5061870d3f617bd3658ad6917d0d32d9296020000000000000008f167c3f26c93dbfb91f3077b66bc0092473a15ef21c30f43d3aa96776f352a33622830e9cfcb48bdf8d3145aa0cf364bd19bbabfb3c73e44f56794ee65dc8a" +``` +#### `.env` +``` +export BRIDGE_DATA_STORE_CLIENT_DATA_SUFFIX=-"bridge-client-data-demo-feb-2025.json" + +export BRIDGE_AWS_ACCESS_KEY_ID="" +export BRIDGE_AWS_SECRET_ACCESS_KEY="" +export BRIDGE_AWS_REGION="" +export BRIDGE_AWS_BUCKET="" + +export KEY_DIR="bitvm-bridge-verifier-1" + +# All verifier public keys +export VERIFIERS="026cc14f56ad7e8fdb323378287895c6c0bcdbb37714c74fba175a0c5f0cd0d56f,02452556ed6dbac394cbb7441fbaf06c446d1321467fa5a138895c6c9e246793dd" +``` diff --git a/README.md b/README.md index c8053323d..da35154ab 100644 --- a/README.md +++ b/README.md @@ -1,22 +1,277 @@ -# BitVM: Smarter Bitcoin Contracts +# BitVM Bridge: A Trust-minimized Bitcoin Bridge -The official implementation of [BitVM2](https://bitvm.org/bitvm2), running a [SNARK verifier](https://bitvm.org/snark). Work in progress. +[![License: MIT](https://img.shields.io/badge/License-MIT-blue.svg)](https://opensource.org/licenses/MIT) -We are following the implementation of [Arkworks](https://github.com/arkworks-rs) +> [!WARNING] +> DO NOT USE IN PRODUCTION! +The official implementation of [BitVM2](https://bitvm.org/bitvm2), +running a [SNARK verifier](https://bitvm.org/snark). -## Overview +The code follows the implementation of [Arkworks](https://github.com/arkworks-rs) -- Winternitz signatures -- BigInt arithmetic -- Bn254 - - Field operations - - Extension fields - - Curve operations - - Pairings -- Fflonk verifier -- Groth16 verifier +## Overview +The repository contains the implementation of a groth16 SNARK verifier that is executable via the optimistic BitVM paradigm on Bitcoin without any soft forks. -[BitVM1](https://github.com/BitVM/BitVM/tree/1dce989d1963b90c35391b77b451c6823302d503) +It is designed to be modular, allowing developers to reuse bitcoin scripts for u32 data types, hashes and curve operations. + +## Components + +BitVM is composed of several components. +Below is a list of the components and their purpose. + +- [**`u32` Operations**](bitvm/src/u32/): + Basic arithmetic operations of `u32` for hash functions, + including `add`, `sub`, `or`, `xor`, `rotation`, `shift`. + +- [**`u4` Operations**](bitvm/src/u4): + `u4` version arithmetic operations, + providing a more efficient way to construct hashes. + +- [**Hash Functions**](bitvm/src/hash/): + Two types of hash functions: + + - `SHA256`: comparing block headers and measuring Bitcoin difficulty. + - `BLAKE3`: compressing intermediate states in the chunker. + +- [**Big Integer**](bitvm/src/bigint/): + Variable-length big integer operations, + including of `add`, `sub`, `mul`, `div`, `inverse` and other operations. + +- [**BN254**](bitvm/src/bn254/): + Point expression of BN254 elliptic curves and operations based on BN254, + including addition, multiplication, pairing. + The pairing part is related to the "Algorithm 9" in the paper "On Proving Pairings" + +- [**Groth16**](bitvm/src/groth16/): + Groth16 uses BN254 to verify proof, the script is currently around 1 GB. + Some hints are precomputed in this part, which is related to the paper "On Proving Pairings". + +- [**Chunk**](bitvm/src/chunk/): + Splits Groth16 into chunks. + These chunks make sure two principles: + + 1. Any chunks shouldn't be success with a right proof. + 2. There are always some successful chunks with a wrong proof. + +- [**Signatures**](bitvm/src/signatures/): + Bit commitment using + [Winternitz signature](https://en.wikipedia.org/wiki/Lamport_signature#Short_keys_and_signature). + +- [**Bridge**](bridge/): + Definitions for the context (roles), connectors, Bitcoin transaction construction, + Bitcoin client wrapper, etc. + +## BitVM1 + +If you are looking for the deprectated BitVM1 implementation, please check out +[BitVM1](https://github.com/BitVM/BitVM/tree/1dce989d1963b90c35391b77b451c6823302d503). + + +## BitVM CLI + +### Overview + +The **BitVM CLI** is a command-line interface for interacting with the BitVM protocol, enabling users to manage Bitcoin keys, initiate peg-ins, retrieve addresses and UTXOs, and monitor the status of transactions within the BitVM network. + +This CLI supports multiple Bitcoin network environments, including `mainnet` and `testnet`. + +### Features + +- **Manage Bitcoin Keys**: Easily manage keys for different roles (depositor, operator, verifier, withdrawer). +- **Retrieve Depositor Address**: Get the address associated with the registered depositor key. +- **Retrieve Depositor UTXOs**: List unspent transaction outputs (UTXOs) for the depositor. +- **Initiate Peg-Ins**: Start the process of peg-ins by creating peg-in graphs. +- **Broadcast Transactions**: Send various types of transactions related to peg-ins and peg-outs. +- **Interactive Mode**: Use an interactive command-line interface for manual command issuance and management. + +## Requirements + +- Rust programming language (latest stable version) +- Cargo (Rust package manager) + +## Installation + +1. **Clone the Repository**: + ```bash + git clone + cd + ``` +2. **Build the Project**: + ```bash + cargo build --release + ``` +3. **Run the Application**: + ```bash + ./target/release/bridge + ``` + +## Usage + +The BitVM CLI application can be invoked with various commands. The general syntax is: + +``` +./target/release/bridge [OPTIONS] +``` + +### Global Options + +- -r, --verifiers : Comma-separated list of public keys for verifiers (max: 1000). Can also be set via the VERIFIERS environment variable. +- -e, --environment : Optional; Specify the Bitcoin network environment (mainnet, testnet, regtest). Defaults to testnet. Can also be set via the ENVIRONMENT environment variable. +- --key-dir : Optional; Directory containing the private keys. Can also be set via the KEY_DIR environment variable. +- -p, --user-profile : Optional; An arbitrary name of the user running the client (e.g. 'operator_one', 'verifier_0'). Used as a namespace separator in the local file path for storing private and public client data. Can also be set by the USER_PROFILE environment variable. + +### Available Commands + +#### Keys Management: + +1. Description: Manage secret keys for different contexts (depositor, operator, verifier, withdrawer). +2. Usage: +```bash +./target/release/bridge keys [OPTIONS] +``` + +3. Options: +- -d, --depositor : Secret key for the depositor. +- -o, --operator : Secret key for the operator. +- -v, --verifier : Secret key for the verifier. +- -w, --withdrawer : Secret key for the withdrawer. +- -k, --vk : Zero-knowledge proof verifying key. + +#### Get Funding Amounts (useful in testing): +1. Description: Get minimum required amounts for the funding UTXOs (to be used in testing). +2. Usage: +```bash +./target/release/bridge get-funding-amounts +``` + +#### Get Operator Address: +1. Description: Retrieve the address spendable by the registered operator key. +2. Usage: +```bash +./target/release/bridge get-operator-address +``` + +#### Get Operator UTXOs: +1. Description: Retrieve a list of the operator's UTXOs. +2. Usage: +```bash +./target/release/bridge get-operator-utxos +``` + +#### Get Depositor Address: +1. Description: Retrieve the address spendable by the registered depositor key. +2. Usage: +```bash +./target/release/bridge get-depositor-address +``` + +#### Get Depositor UTXOs: +1. Description: Retrieve a list of the depositor's UTXOs. +2. Usage: +```bash +./target/release/bridge get-depositor-utxos +``` + +#### Initiate Peg-In: +1. Description: Start the peg-in process by creating a peg-in graph. +2. Usage: +```bash +./target/release/bridge initiate-peg-in --utxo : --destination_address +``` + +#### Create Peg-Out graph: +1. Description: Create the peg-out graph for the corresponding peg-in graph. +2. Usage: +```bash +./target/release/bridge create-peg-out --utxo : --peg_in_id +``` + +#### Push nonces (MuSig2 signing process): +1. Description: Push nonces for the corresponding peg-out or peg-in graph. +2. Usage: +```bash +./target/release/bridge push-nonces --id +``` + +#### Push signatures (MuSig2 signing process): +1. Description: Push signatures for the corresponding peg-out or peg-in graph. +2. Usage: +```bash +./target/release/bridge push-signatures --id +``` + +#### Mock L2 peg-out event: +1. Description: FOR TEST PURPOSES ONLY! Mocks L2 chain service with specified peg-in-confirm txid. +2. Usage: +```bash +./target/release/bridge mock-l2-pegout-event --utxo : +``` + +#### Broadcast Transactions: +1. Description: Send various types of transactions related to peg-ins and peg-outs. +2. Usage: +```bash +./target/release/bridge broadcast [COMMAND] [OPTIONS] +``` + +#### Automatic Mode: +1. Description: Enable automatic mode to poll for status updates and handle transactions. +2. Usage: +```bash +./target/release/bridge automatic +``` + +#### Interactive Mode: +1. Description: Enter into an interactive command prompt for manual command execution. +2. Usage: +```bash +./target/release/bridge interactive +``` + +#### Show Status: +1. Description: Display the current status of the BitVM client. +2. Usage: +```bash +./target/release/bridge status +``` + +### Environment Variables + +You can set the following environment variables to configure the CLI: + +#### General Environment Variables + +- BRIDGE_DATA_STORE_CLIENT_DATA_SUFFIX : Specifies the suffix for the bridge client data file. Default value is "bridge-client-data.json". +- BRIDGE_AWS_ACCESS_KEY_ID : Your AWS access key ID for authenticating with AWS services. Required if using AWS for storage. +- BRIDGE_AWS_SECRET_ACCESS_KEY : Your AWS secret access key for authenticating with AWS services. Required if using AWS for storage. +- BRIDGE_AWS_REGION : The AWS region where your storage bucket is located. Required if using AWS for storage. +- BRIDGE_AWS_BUCKET : The name of the S3 bucket where files will be stored. Required if using AWS for storage. + +- KEY_DIR: Optional; Directory containing private keys. +- VERIFIERS: Comma-separated list of public keys for verifiers. +- ENVIRONMENT: Optional; Bitcoin network environment (default: testnet). +- USER_PROFILE: Optional; An arbitrary name of the user running the client (e.g. 'operator_one', 'verifier_0'). Used as a namespace separator in the local file path for storing private and public client data. + +#### FTP/SFTP Environment Variables + +- BRIDGE_SFTP_HOST : Hostname or IP address of the SFTP server for secure file transfers. +- BRIDGE_SFTP_PORT : Port number for the SFTP connection. Default is 22. +- BRIDGE_SFTP_USERNAME : Username for authenticating to the SFTP server. +- BRIDGE_SFTP_KEYFILE_PATH : Path to the private key file used for authenticating to the SFTP server. +BRIDGE_SFTP_BASE_PATH : Base path on the SFTP server where BitVM data will be stored. Default is /bitvm. +- BRIDGE_FTP_HOST : Hostname or IP address of the FTP server for file transfers. +- BRIDGE_FTP_PORT : Port number for the FTP connection. Default is 21. +- BRIDGE_FTP_USERNAME : Username for authenticating to the FTP server. +- BRIDGE_FTP_PASSWORD : Password for authenticating to the FTP server. +- BRIDGE_FTP_BASE_PATH : Base path on the FTP server where BitVM data will be stored. Default is /bitvm. +- BRIDGE_FTPS_HOST : Hostname or IP address of the FTPS server for secure file transfers over FTP. +- BRIDGE_FTPS_PORT : Port number for the FTPS connection. Default is 21. +- BRIDGE_FTPS_USERNAME : Username for authenticating to the FTPS server. +- BRIDGE_FTPS_PASSWORD : Password for authenticating to the FTPS server. +- BRIDGE_FTPS_BASE_PATH : Base path on the FTPS server where BitVM data will be stored. Default is /bitvm. + +### Configuration File +The BitVM Bridge CLI uses a configuration file (bridge.toml) located in the specified key directory (default: `~/.bitvm-bridge/`). This file is used to store the keys for the depositor, operator, verifier, and withdrawer. diff --git a/audits/BitVM - Zellic Audit Report.pdf b/audits/BitVM - Zellic Audit Report.pdf new file mode 100644 index 000000000..49b5e764d Binary files /dev/null and b/audits/BitVM - Zellic Audit Report.pdf differ diff --git a/bitvm/Cargo.toml b/bitvm/Cargo.toml new file mode 100644 index 000000000..1ea6f8de8 --- /dev/null +++ b/bitvm/Cargo.toml @@ -0,0 +1,44 @@ +[package] +name = "bitvm" +version = "0.1.0" +edition = "2021" +exclude = ["tests"] + + +[dependencies] +bitcoin-script.workspace = true +bitcoin.workspace = true +bitcoin-scriptexec.workspace = true +serde.workspace = true +num-traits.workspace = true +ark-bn254.workspace = true +ark-ff.workspace = true +ark-ec.workspace = true +ark-groth16.workspace = true +ark-serialize.workspace = true +sha2.workspace = true +bitcoin-script-stack.workspace = true +rand.workspace = true +rand_chacha.workspace = true +blake3.workspace = true +paste.workspace = true +colored.workspace = true +itertools.workspace = true +num-bigint.workspace = true +ark-std.workspace = true +ark-crypto-primitives.workspace = true +ark-relations.workspace = true +tqdm.workspace = true +regex.workspace = true + +[features] +fuzzing = [] + +[dev-dependencies] +serde_json.workspace = true + +[profile.dev] +opt-level = 3 + +[profile.release] +lto = true diff --git a/src/bigint/add.rs b/bitvm/src/bigint/add.rs similarity index 88% rename from src/bigint/add.rs rename to bitvm/src/bigint/add.rs index 34d542d04..07a88f6d9 100644 --- a/src/bigint/add.rs +++ b/bitvm/src/bigint/add.rs @@ -63,24 +63,27 @@ impl BigIntImpl { } } + /// add one pub fn add1() -> Script { script! { - 1 - { 1 << LIMB_SIZE } - - // A0 + 1 - limb_add_carry OP_TOALTSTACK - - // from A1 + carry_0 - // to A{N-2} + carry_{N-3} - for _ in 0..Self::N_LIMBS - 2 { - OP_SWAP - limb_add_carry OP_TOALTSTACK + OP_1ADD // a0 ... an + { 1 << LIMB_SIZE } // a0 ... an x + OP_SWAP // a0 ... x an + for _ in 0..Self::N_LIMBS-1 { // ... x a + OP_2DUP // ... x a x a + OP_EQUAL // ... x a 0/1 + OP_TUCK // ... x 0/1 a 0/1 + OP_IF OP_NOT OP_ENDIF // ... x 0/1 a/0 + OP_TOALTSTACK // ... x 0/1 + OP_ROT // .. x 0/1 a_{i-1} + OP_ADD // .. x a' } - - // A{N-1} + carry_{N-2} - OP_NIP - { limb_add_nocarry(Self::HEAD_OFFSET) } + // x a0 + OP_NIP // a0 + { Self::HEAD_OFFSET } // a0 y + OP_OVER // a0 y a0 + OP_EQUAL // a0 0/1 + OP_IF OP_NOT OP_ENDIF // a/0 for _ in 0..Self::N_LIMBS - 1 { OP_FROMALTSTACK @@ -89,7 +92,7 @@ impl BigIntImpl { } /// Double the BigInt on top of the stack - /// + /// /// # Note /// /// This function allows overflow of the underlying integer types during @@ -123,15 +126,15 @@ impl BigIntImpl { { 1 << LIMB_SIZE } // Double the limb, take the result to the alt stack, and add initial carry - { n + 1 } OP_PICK limb_double_without_carry OP_TOALTSTACK + { n * Self::N_LIMBS + 1 } OP_PICK limb_double_without_carry OP_TOALTSTACK for i in 0..Self::N_LIMBS - 2 { - { n + i + 3 } OP_PICK limb_double_with_carry OP_TOALTSTACK + { n * Self::N_LIMBS + i + 3 } OP_PICK limb_double_with_carry OP_TOALTSTACK } // When we got {limb} {base} {carry} on the stack, we drop the base OP_NIP // {limb} {carry} - { n + 9 } OP_PICK { limb_double_with_carry_allow_overflow(Self::HEAD_OFFSET) } + { n * Self::N_LIMBS + Self::N_LIMBS } OP_PICK { limb_double_with_carry_allow_overflow(Self::HEAD_OFFSET) } // Take all limbs from the alt stack to the main stack for _ in 0..Self::N_LIMBS - 1 { @@ -141,7 +144,7 @@ impl BigIntImpl { } /// Double the BigInt on top of the stack - /// + /// /// # Note /// /// This function prevents overflow of the underlying integer types during @@ -169,8 +172,27 @@ impl BigIntImpl { } } + /// Double the referenced BigInt but keep the original element in its position + /// This function prevents overflow of the underlying integer types during + /// doubling operation. + pub fn double_prevent_overflow_keep_element(n: u32) -> Script { + script! { + { 1 << LIMB_SIZE } + { n * Self::N_LIMBS + 1 } OP_PICK limb_double_without_carry OP_TOALTSTACK + for i in 0..Self::N_LIMBS - 2 { + { n * Self::N_LIMBS + i + 3 } OP_PICK limb_double_with_carry OP_TOALTSTACK + } + OP_NIP + { n * Self::N_LIMBS + Self::N_LIMBS } OP_PICK OP_SWAP + { limb_double_with_carry_prevent_overflow(Self::HEAD_OFFSET) } + for _ in 0..Self::N_LIMBS - 1 { + OP_FROMALTSTACK + } + } + } + /// Left shift the BigInt on top of the stack by `bits` - /// + /// /// # Note /// /// This function prevents overflow of the underlying integer types during @@ -204,11 +226,11 @@ impl BigIntImpl { OP_OVER OP_ADD - // OP_DEPTH OP_1SUB OP_PICK + // OP_DEPTH OP_1SUB OP_PICK { 1 << LIMB_SIZE } OP_SWAP - { limb_add_create_carry() } + { limb_add_create_carry() } OP_TOALTSTACK for i in 0..Self::N_LIMBS - 2 { @@ -230,8 +252,6 @@ impl BigIntImpl { } } - - /// Add BigInt on top of the stack to a BigInt at `b` depth in the stack /// /// # Note @@ -245,11 +265,11 @@ impl BigIntImpl { { b_depth } OP_PICK OP_ADD - // OP_DEPTH OP_1SUB OP_PICK + // OP_DEPTH OP_1SUB OP_PICK { 1 << LIMB_SIZE } OP_SWAP - { limb_add_create_carry() } + { limb_add_create_carry() } OP_TOALTSTACK for _ in 0..Self::N_LIMBS - 2 { @@ -261,7 +281,7 @@ impl BigIntImpl { OP_NIP { b_depth + 1 } OP_PICK - OP_ROT + OP_SWAP { limb_add_with_carry_prevent_overflow(Self::HEAD_OFFSET) } for _ in 0..Self::N_LIMBS - 1 { @@ -371,7 +391,7 @@ pub fn limb_add_nocarry(head_offset: u32) -> Script { } fn limb_add_with_carry_prevent_overflow(head_offset: u32) -> Script { - script!{ + script! { // {a} {b} {c:carry} OP_3DUP OP_ADD OP_ADD OP_NIP // {a} {b} {a+b+c} { head_offset >> 1 } // {a} {b} {a+b+c} {x} @@ -388,7 +408,7 @@ fn limb_add_with_carry_prevent_overflow(head_offset: u32) -> Script { OP_2SWAP // {a+b+c_nlo} {x} {a} {sign_b} {a+b+c_nlo} {x} OP_GREATERTHANOREQUAL // {a+b+c_nlo} {x} {a} {sign_b} {I:0/1} OP_2SWAP // {a+b+c_nlo} {sign_b} {I:0/1} {x} {a} - OP_GREATERTHANOREQUAL // {a+b+c_nlo} {sign_b} {I:0/1} {sign_a} + OP_GREATERTHAN // {a+b+c_nlo} {sign_b} {I:0/1} {sign_a} OP_ADD OP_ADD 1 3 OP_WITHIN OP_VERIFY // verify (sign_a, sign_b, I) is not (0, 0, 0) or (1, 1, 1) which would mean overflow } } @@ -444,7 +464,7 @@ fn limb_double_with_carry_prevent_overflow(head_offset: u32) -> Script { OP_TUCK OP_DUP OP_ADD // {a} {x} {2a+c} {2x} OP_2DUP OP_GREATERTHANOREQUAL // {a} {x} {2a+c} {2x} {L:0/1} OP_NOTIF OP_NOT OP_ENDIF OP_SUB // {a} {x} {2a+c_nlo} - OP_2DUP OP_LESSTHAN // {a} {x} {2a+c_nlo} {I:0/1} + OP_2DUP OP_LESSTHANOREQUAL // {a} {x} {2a+c_nlo} {I:0/1} OP_2SWAP // {2a+c_nlo} {I:0/1} {a} {x} OP_LESSTHAN // {2a+c_nlo} {I:0/1} {sign_a} @@ -505,7 +525,7 @@ fn limb_lshift_with_carry_prevent_overflow(bits: u32, head: u32) -> Script { } OP_ADD } // {result_signed} | {x} - + OP_FROMALTSTACK // {result_signed} {x} OP_OVER // {result_signed} {x} {result_signed} OP_2DUP OP_SWAP // {result_signed} {x} {result_signed} {result_signed} {x} @@ -521,7 +541,7 @@ fn limb_lshift_with_carry_prevent_overflow(bits: u32, head: u32) -> Script { mod test { use crate::bigint::{U254, U64}; use crate::treepp::*; - use core::ops::{Add, Rem, Shl}; + use core::ops::{Rem, Shl}; use num_bigint::{BigUint, RandomBits}; use num_traits::One; use rand::{Rng, SeedableRng}; @@ -565,49 +585,35 @@ mod test { } #[test] - fn test_double() { - println!("U254.double: {} bytes", U254::double(0).len()); + fn test_add1() { + println!("U254.add1: {} bytes", U254::add1().len()); let mut prng = ChaCha20Rng::seed_from_u64(0); for _ in 0..100 { let a: BigUint = prng.sample(RandomBits::new(254)); - let c: BigUint = (a.clone() + a.clone()).rem(BigUint::one().shl(254)); + let c: BigUint = (a.clone() + BigUint::one()).rem(BigUint::one().shl(254)); let script = script! { { U254::push_u32_le(&a.to_u32_digits()) } - { U254::double(0) } + { U254::add1() } { U254::push_u32_le(&c.to_u32_digits()) } { U254::equalverify(1, 0) } OP_TRUE }; run(script); } - - for _ in 0..100 { - let a: u64 = prng.gen(); - let c = a.wrapping_add(a); - - let script = script! { - { U64::push_u64_le(&[a]) } - { U64::double(0) } - { U64::push_u64_le(&[c]) } - { U64::equalverify(1, 0) } - OP_TRUE - }; - run(script); - } } #[test] - fn test_1add() { - println!("U254.add1: {} bytes", U254::add1().len()); + fn test_double() { + println!("U254.double: {} bytes", U254::double(0).len()); let mut prng = ChaCha20Rng::seed_from_u64(0); for _ in 0..100 { let a: BigUint = prng.sample(RandomBits::new(254)); - let c: BigUint = (a.clone().add(BigUint::one())).rem(BigUint::one().shl(254)); + let c: BigUint = (a.clone() + a.clone()).rem(BigUint::one().shl(254)); let script = script! { { U254::push_u32_le(&a.to_u32_digits()) } - { U254::add1() } + { U254::double(0) } { U254::push_u32_le(&c.to_u32_digits()) } { U254::equalverify(1, 0) } OP_TRUE @@ -617,11 +623,11 @@ mod test { for _ in 0..100 { let a: u64 = prng.gen(); - let c = a.wrapping_add(1u64); + let c = a.wrapping_add(a); let script = script! { { U64::push_u64_le(&[a]) } - { U64::add1() } + { U64::double(0) } { U64::push_u64_le(&[c]) } { U64::equalverify(1, 0) } OP_TRUE diff --git a/src/bigint/bits.rs b/bitvm/src/bigint/bits.rs similarity index 83% rename from src/bigint/bits.rs rename to bitvm/src/bigint/bits.rs index 9b29524c1..7f7868fe3 100644 --- a/src/bigint/bits.rs +++ b/bitvm/src/bigint/bits.rs @@ -45,44 +45,6 @@ impl BigIntImpl { { limb_to_le_bits_toaltstack(N_BITS - LIMB_SIZE * (Self::N_LIMBS - 1)) } } } - - pub fn limb_from_bytes() -> Script { - let bytes_per_limb = (LIMB_SIZE + 7) / 8; - - assert!(LIMB_SIZE > 0, "LIMB_SIZE must not be 0"); - assert!(LIMB_SIZE < 33, "LIMB_SIZE must be less than 33"); - - script! { - // This will be our sum on the stack - OP_0 - for i in 0..bytes_per_limb { - // Check that the number is a u8 - OP_SWAP - OP_DUP - { 256 } - OP_LESSTHAN - OP_VERIFY - // lshift - for _ in 0..8*i { - OP_DUP - OP_ADD - } - OP_ADD - } - } - } - - pub fn from_bytes() -> Script { - script! { - for _ in 0..Self::N_LIMBS { - { Self::limb_from_bytes() } - OP_TOALTSTACK - } - for _ in 0..Self::N_LIMBS { - OP_FROMALTSTACK - } - } - } } fn limb_to_be_bits_common(num_bits: u32) -> Script { @@ -171,16 +133,19 @@ fn limb_to_le_bits_common(num_bits: u32) -> Script { } pub fn limb_to_le_bits(num_bits: u32) -> Script { + assert!(num_bits > 0); if num_bits >= 2 { script! { { limb_to_le_bits_common(num_bits) } } } else { + // if num_bits == 1 script! {} } } pub fn limb_to_le_bits_toaltstack(num_bits: u32) -> Script { + assert!(num_bits > 0); if num_bits >= 2 { script! { { limb_to_le_bits_common(num_bits) } @@ -189,11 +154,15 @@ pub fn limb_to_le_bits_toaltstack(num_bits: u32) -> Script { } } } else { - script! {} + // if num_bits == 1 + script! { + OP_TOALTSTACK + } } } pub fn limb_to_be_bits(num_bits: u32) -> Script { + assert!(num_bits > 0); if num_bits >= 2 { script! { { limb_to_be_bits_common(num_bits) } @@ -202,11 +171,13 @@ pub fn limb_to_be_bits(num_bits: u32) -> Script { } } } else { + // if num_bits == 1 script! {} } } pub fn limb_to_be_bits_toaltstack(num_bits: u32) -> Script { + assert!(num_bits > 0); if num_bits >= 2 { script! { { limb_to_be_bits_common(num_bits) } @@ -214,6 +185,7 @@ pub fn limb_to_be_bits_toaltstack(num_bits: u32) -> Script { OP_TOALTSTACK } } else { + // if num_bits == 1 script! { OP_TOALTSTACK } @@ -304,11 +276,6 @@ mod test { }; run(script); } - - let script = script! { - 0 { limb_to_be_bits(0) } 0 OP_EQUAL - }; - run(script); } #[test] @@ -385,11 +352,6 @@ mod test { }; run(script); } - - let script = script! { - 0 { limb_to_le_bits(0) } 0 OP_EQUAL - }; - run(script); } #[test] @@ -598,93 +560,4 @@ mod test { run(script); } } - - #[test] - fn test_u29_limb_from_bytes() { - assert_eq!(U254::N_LIMBS, 9); - let script = script! { - { 0x01 } - { 0x12 } - { 0x13 } - { 0x14 } - { U254::limb_from_bytes() } - { 0x01121314 } - OP_EQUAL - }; - run(script); - - let script = script! { - { 0x00 } - { 0x01 } - { 0x13 } - { 0x14 } - { U254::limb_from_bytes() } - { 0x00011314 } - OP_EQUAL - }; - run(script); - } - #[test] - fn test_u254_from_bytes() { - assert_eq!(U254::N_LIMBS, 9); - let script = script! { - { 0x00 } - { 0x01 } - { 0x13 } - { 0x14 } - - { 0x01 } - { 0x22 } - { 0x23 } - { 0x24 } - - { 0x01 } - { 0x32 } - { 0x33 } - { 0x34 } - - { 0x01 } - { 0x42 } - { 0x43 } - { 0x44 } - - { 0x01 } - { 0x52 } - { 0x53 } - { 0x54 } - - { 0x01 } - { 0x62 } - { 0x63 } - { 0x64 } - - { 0x01 } - { 0x72 } - { 0x73 } - { 0x74 } - - { 0x01 } - { 0x82 } - { 0x83 } - { 0x84 } - - { 0x01 } - { 0x92 } - { 0x93 } - { 0x94 } - - { U254::from_bytes() } - { 0x00011314 } - { 0x01222324 } - { 0x01323334 } - { 0x01424344 } - { 0x01525354 } - { 0x01626364 } - { 0x01727374 } - { 0x01828384 } - { 0x01929394 } - { U254::equal(0, 1) } - }; - run(script); - } } diff --git a/src/bigint/cmp.rs b/bitvm/src/bigint/cmp.rs similarity index 95% rename from src/bigint/cmp.rs rename to bitvm/src/bigint/cmp.rs index 72e6243c2..ec1df1780 100644 --- a/src/bigint/cmp.rs +++ b/bitvm/src/bigint/cmp.rs @@ -27,6 +27,22 @@ impl BigIntImpl { } } + pub fn equal_keep_elements(a: u32, b: u32) -> Script { + script! { + { Self::copy_zip(a, b) } + for _ in 0..Self::N_LIMBS { + OP_EQUAL + OP_TOALTSTACK + } + for _ in 0..Self::N_LIMBS { + OP_FROMALTSTACK + } + for _ in 0..Self::N_LIMBS - 1 { + OP_BOOLAND + } + } + } + pub fn notequal(a: u32, b: u32) -> Script { script! { { Self::equal(a, b) } @@ -69,7 +85,9 @@ impl BigIntImpl { } // return if a <= b - pub fn lessthanorequal(a: u32, b: u32) -> Script { Self::greaterthanorequal(b, a) } + pub fn lessthanorequal(a: u32, b: u32) -> Script { + Self::greaterthanorequal(b, a) + } // return if a > b pub fn greaterthan(a: u32, b: u32) -> Script { diff --git a/bitvm/src/bigint/inv.rs b/bitvm/src/bigint/inv.rs new file mode 100644 index 000000000..abfd1b59a --- /dev/null +++ b/bitvm/src/bigint/inv.rs @@ -0,0 +1,293 @@ +use crate::bigint::BigIntImpl; +use crate::treepp::*; + +impl BigIntImpl { + pub fn div2() -> Script { + script! { + { Self::div2rem() } + OP_DROP + } + } + + pub fn div2rem() -> Script { + script! { + { Self::N_LIMBS - 1 } OP_ROLL + 0 + { limb_shr1_carry(Self::HEAD) } + + for _ in 1..Self::N_LIMBS { + { Self::N_LIMBS } OP_ROLL + OP_SWAP + { limb_shr1_carry(LIMB_SIZE) } + } + } + } + + pub fn div3() -> Script { + script! { + { Self::div3rem() } + OP_DROP + } + } + + pub fn div3rem() -> Script { + script! { + { Self::N_LIMBS - 1 } OP_ROLL + 0 + { limb_div3_carry(Self::HEAD) } + + for _ in 1..Self::N_LIMBS { + { Self::N_LIMBS } OP_ROLL + OP_SWAP + { limb_div3_carry(LIMB_SIZE) } + } + } + } +} + +pub fn limb_shr1_carry(num_bits: u32) -> Script { + let powers_of_2_script = if num_bits < 7 { + script! { + for i in 1..num_bits { + { 2_u32.pow(i) } + } + } + } else { + script! { + 2 4 8 16 32 64 // 2^1 to 2^6 + for _ in 0..num_bits - 7 { + OP_DUP OP_DUP OP_ADD + } // 2^7 to 2^{num_bits - 1} + } + }; + + script! { + { powers_of_2_script } + { num_bits - 1 } OP_ROLL + OP_IF + OP_DUP + OP_ELSE + 0 + OP_ENDIF + OP_TOALTSTACK + + { num_bits - 1 } OP_ROLL + + for _ in 0..num_bits - 2 { + OP_2DUP OP_LESSTHANOREQUAL + OP_IF + OP_SWAP OP_SUB OP_SWAP OP_DUP OP_FROMALTSTACK OP_ADD OP_TOALTSTACK OP_SWAP + OP_ELSE + OP_NIP + OP_ENDIF + } + + OP_2DUP OP_LESSTHANOREQUAL + OP_IF + OP_SWAP OP_SUB OP_FROMALTSTACK OP_1ADD + OP_ELSE + OP_NIP OP_FROMALTSTACK + OP_ENDIF + OP_SWAP + } +} + +// divide limb by 3, also remainder +pub fn limb_div3_carry(limb_size: u32) -> Script { + let max_limb = (1 << limb_size) as i64; + + let x_quotient = max_limb / 3; + let x_remainder = max_limb % 3; + + let y_quotient = max_limb * 2 / 3; + let y_remainder = max_limb * 2 % 3; + + let mut k = 0; + let mut cur = 1; + while cur < max_limb { + k += 1; + cur *= 3; + } + + script! { + 1 2 3 6 9 18 27 54 + for _ in 0..k - 4 { + OP_2DUP OP_ADD + OP_DUP OP_DUP OP_ADD + } + + { 2 * k } OP_ROLL OP_DUP + 0 OP_GREATERTHAN + OP_IF + OP_1SUB + OP_IF + { y_remainder } { y_quotient } + OP_ELSE + { x_remainder } { x_quotient } + OP_ENDIF + OP_ELSE + 0 + OP_ENDIF + OP_TOALTSTACK + + { 2 * k + 1 } OP_ROLL OP_ADD + + for _ in 0..2 * k - 2 { + OP_2DUP OP_LESSTHANOREQUAL + OP_IF + OP_SWAP OP_SUB 2 OP_PICK OP_FROMALTSTACK OP_ADD OP_TOALTSTACK + OP_ELSE + OP_NIP + OP_ENDIF + } + + OP_NIP OP_NIP OP_FROMALTSTACK OP_SWAP + } +} + +#[cfg(test)] +mod test { + use crate::bigint::inv::{limb_div3_carry, limb_shr1_carry}; + use crate::bigint::{U254, U64}; + use crate::treepp::*; + + use core::ops::{Div, Shr}; + use num_bigint::{BigUint, RandomBits}; + use rand::{Rng, SeedableRng}; + use rand_chacha::ChaCha20Rng; + + #[test] + fn test_limb_shr1_carry() { + for shift in 2..30 { + println!( + "limb_shr1_carry({:?}): {} bytes", + shift, + limb_shr1_carry(shift).len() + ); + let mut prng = ChaCha20Rng::seed_from_u64(0); + + for _ in 0..100 { + let mut a: u32 = prng.gen(); + a %= 1 << shift; + + let script = script! { + { a } + { 0 } + { limb_shr1_carry(shift) } + { a & 1 } OP_EQUALVERIFY + { a >> 1 } OP_EQUAL + }; + + run(script); + } + + for _ in 0..100 { + let mut a: u32 = prng.gen(); + a %= 1 << shift; + + let script = script! { + { a } + { 1 } + { limb_shr1_carry(shift) } + { a & 1 } OP_EQUALVERIFY + { (1 << (shift - 1)) | (a >> 1) } OP_EQUAL + }; + + run(script); + } + } + } + + #[test] + fn test_limb_div3_carry() { + println!("limb_div3_carry: {} bytes", limb_div3_carry(29).len()); + let mut prng = ChaCha20Rng::seed_from_u64(0); + + for _ in 0..100 { + let mut a: u32 = prng.gen(); + a %= 1 << 29; + let k = 2_u32.pow(29); + + for r in 0..3 { + let a2 = a + r * k; + let b = a2 % 3; + let c = a2 / 3; + let script = script! { + { a } + { r } + { limb_div3_carry(29) } + { b } OP_EQUALVERIFY + { c } OP_EQUAL + }; + + run(script); + } + } + } + + #[test] + fn test_div2() { + println!("U254.div2: {} bytes", U254::div2().len()); + let mut prng = ChaCha20Rng::seed_from_u64(0); + for _ in 0..100 { + let a: BigUint = prng.sample(RandomBits::new(254)); + let c: BigUint = a.clone().shr(1); + + let script = script! { + { U254::push_u32_le(&a.to_u32_digits()) } + { U254::div2() } + { U254::push_u32_le(&c.to_u32_digits()) } + { U254::equalverify(1, 0) } + OP_TRUE + }; + run(script); + } + + for _ in 0..100 { + let a: BigUint = prng.sample(RandomBits::new(64)); + let c: BigUint = a.clone().shr(1); + + let script = script! { + { U64::push_u32_le(&a.to_u32_digits()) } + { U64::div2() } + { U64::push_u32_le(&c.to_u32_digits()) } + { U64::equalverify(1, 0) } + OP_TRUE + }; + run(script); + } + } + + #[test] + fn test_div3() { + println!("U254.div3: {} bytes", U254::div3().len()); + let mut prng = ChaCha20Rng::seed_from_u64(0); + for _ in 0..100 { + let a: BigUint = prng.sample(RandomBits::new(254)); + let c: BigUint = a.clone().div(BigUint::from(3_u32)); + + let script = script! { + { U254::push_u32_le(&a.to_u32_digits()) } + { U254::div3() } + { U254::push_u32_le(&c.to_u32_digits()) } + { U254::equalverify(1, 0) } + OP_TRUE + }; + run(script); + } + + for _ in 0..100 { + let a: BigUint = prng.sample(RandomBits::new(64)); + let c: BigUint = a.clone().div(BigUint::from(3_u32)); + + let script = script! { + { U64::push_u32_le(&a.to_u32_digits()) } + { U64::div3() } + { U64::push_u32_le(&c.to_u32_digits()) } + { U64::equalverify(1, 0) } + OP_TRUE + }; + run(script); + } + } +} diff --git a/src/bigint/mod.rs b/bitvm/src/bigint/mod.rs similarity index 71% rename from src/bigint/mod.rs rename to bitvm/src/bigint/mod.rs index 6679f65d8..441296fa4 100644 --- a/src/bigint/mod.rs +++ b/bitvm/src/bigint/mod.rs @@ -5,17 +5,20 @@ pub mod inv; pub mod mul; pub mod std; pub mod sub; -pub mod u29x9; -pub mod u32x8; +#[derive(Debug)] pub struct BigIntImpl {} impl BigIntImpl { pub const N_BITS: u32 = N_BITS; + pub const LIMB_SIZE: u32 = LIMB_SIZE; pub const N_LIMBS: u32 = N_BITS.div_ceil(LIMB_SIZE); pub const HEAD: u32 = N_BITS - (Self::N_LIMBS - 1) * LIMB_SIZE; pub const HEAD_OFFSET: u32 = 1u32 << Self::HEAD; + const _ASSERTION1: () = assert!(Self::N_LIMBS > 1); + const _ASSERTION2: () = assert!(Self::LIMB_SIZE < 31); } pub type U254 = BigIntImpl<254, 29>; pub type U64 = BigIntImpl<64, 16>; +pub type U256 = BigIntImpl<256, 29>; diff --git a/src/bigint/mul.rs b/bitvm/src/bigint/mul.rs similarity index 89% rename from src/bigint/mul.rs rename to bitvm/src/bigint/mul.rs index 6a7a3d544..51f2cde03 100644 --- a/src/bigint/mul.rs +++ b/bitvm/src/bigint/mul.rs @@ -7,18 +7,15 @@ impl BigIntImpl { script! { { Self::convert_to_be_bits_toaltstack() } - { push_to_stack(0,Self::N_LIMBS as usize) } - - OP_FROMALTSTACK OP_IF - { Self::copy(1) } - { Self::add(1, 0) } + { Self::copy(0) } + OP_ELSE + { push_to_stack(0, Self::N_LIMBS as usize)} OP_ENDIF for _ in 1..N_BITS - 1 { - { Self::roll(1) } - { Self::double(0) } + { Self::double(1) } { Self::roll(1) } OP_FROMALTSTACK OP_IF @@ -27,8 +24,7 @@ impl BigIntImpl { OP_ENDIF } - { Self::roll(1) } - { Self::double(0) } + { Self::double(1) } OP_FROMALTSTACK OP_IF { Self::add(1, 0) } diff --git a/bitvm/src/bigint/std.rs b/bitvm/src/bigint/std.rs new file mode 100644 index 000000000..b2fbef1b6 --- /dev/null +++ b/bitvm/src/bigint/std.rs @@ -0,0 +1,1260 @@ +use bitcoin::script::read_scriptint; +use num_bigint::BigUint; +use num_traits::Num; +use std::cmp::Ordering; +use std::str::FromStr; + +use crate::bigint::BigIntImpl; +use crate::pseudo::{push_to_stack, NMUL}; +use crate::treepp::*; + +/// Struct to store the information of each step in `transform_limbsize` function. +/// ## Fields: +/// - current_limb_remaining_bits: the number of bits left in the current source limb that is being processed. +/// - extract_window: the number of bits to extract from the current limb. +/// - drop_currentlimb: signals to drop the current limb and bring another from altstack. +/// - initiate_targetlimb: signals to start a new target limb. +#[derive(Debug)] +struct TransformStep { + current_limb_remaining_bits: u32, + extract_window: u32, + drop_currentlimb: bool, + initiate_targetlimb: bool, +} + +impl BigIntImpl { + pub fn biguint_to_limbs(x: BigUint) -> Vec { + let mut limbs = vec![]; + let bits: Vec = (0..N_BITS).map(|i| x.bit(i as u64)).collect(); + for chunk in bits.chunks(LIMB_SIZE as usize) { + let mut limb_value = 0u32; + for (i, bit_value) in chunk.into_iter().enumerate() { + limb_value += (*bit_value as u32) << i; + } + limbs.push(limb_value); + } + limbs + } + + pub fn push_biguint(x: BigUint) -> Script { + script! { + for limb in Self::biguint_to_limbs(x).iter().rev() { + { *limb } + } + } + } + + pub fn push_u32_le(v: &[u32]) -> Script { + let mut bits = vec![]; + for elem in v.iter() { + for i in 0..32 { + bits.push((elem & (1 << i)) != 0); + } + } + // make sure most significant 1 lies inside the limits + let ms_one = if bits.len() > 0 { + let mut ms_one = bits.len() - 1; + while !bits[ms_one] { + if ms_one != 0 { + ms_one -= 1; + } else { + break; + } + } + ms_one + } else { + 0 + }; + assert!(ms_one < Self::N_BITS as usize); + bits.resize(N_BITS as usize, false); + + let mut limbs = vec![]; + for chunk in bits.chunks(LIMB_SIZE as usize) { + let mut chunk_vec = chunk.to_vec(); + chunk_vec.resize(LIMB_SIZE as usize, false); + + let mut elem = 0u32; + for (i, chunk_i) in chunk_vec.into_iter().enumerate() { + if chunk_i { + elem += 1 << i; + } + } + + limbs.push(elem); + } + + limbs.reverse(); + + script! { + for limb in &limbs { + { *limb } + } + { push_to_stack(0,Self::N_LIMBS as usize - limbs.len()) } + } + } + + pub fn read_u32_le(mut witness: Vec>) -> Vec { + assert_eq!(witness.len() as u32, Self::N_LIMBS); + + witness.reverse(); + + let mut bits: Vec = vec![]; + for element in witness.iter() { + let limb = read_scriptint(element).unwrap(); + for i in 0..LIMB_SIZE { + bits.push((limb & (1 << i)) != 0); + } + } + + bits.resize(N_BITS as usize, false); + + let mut u32s = vec![]; + + for chunk in bits.chunks(32) { + let mut chunk_vec = chunk.to_vec(); + chunk_vec.resize(32, false); + + let mut elem = 0u32; + for (i, chunk_i) in chunk_vec.into_iter().enumerate() { + if chunk_i { + elem += 1 << i; + } + } + + u32s.push(elem); + } + + u32s + } + + pub fn push_u64_le(v: &[u64]) -> Script { + let v = v + .iter() + .flat_map(|v| { + [ + (v & 0xffffffffu64) as u32, + ((v >> 32) & 0xffffffffu64) as u32, + ] + }) + .collect::>(); + + Self::push_u32_le(&v) + } + + /// Zip the top two u{16N} elements + /// input: a0 ... a{N-1} b0 ... b{N-1} + /// output: a0 b0 ... ... a{N-1} b{N-1} + pub fn zip(mut a: u32, mut b: u32) -> Script { + a = (a + 1) * Self::N_LIMBS - 1; + b = (b + 1) * Self::N_LIMBS - 1; + + assert_ne!(a, b); + if a < b { + script! { + for i in 0..Self::N_LIMBS { + { a + i } + OP_ROLL + { b } + OP_ROLL + } + } + } else { + script! { + for i in 0..Self::N_LIMBS { + { a } + OP_ROLL + { b + i + 1 } + OP_ROLL + } + } + } + } + + pub fn copy_zip(mut a: u32, mut b: u32) -> Script { + a = (a + 1) * Self::N_LIMBS - 1; + b = (b + 1) * Self::N_LIMBS - 1; + + script! { + for i in 0..Self::N_LIMBS { + { a + i } OP_PICK { b + 1 + i } OP_PICK + } + } + } + + pub fn dup_zip(mut a: u32) -> Script { + a = (a + 1) * Self::N_LIMBS - 1; + + script! { + for i in 0..Self::N_LIMBS { + { a + i } OP_ROLL OP_DUP + } + } + } + + pub fn copy(mut a: u32) -> Script { + a = (a + 1) * Self::N_LIMBS - 1; + + script! { + if a < 128 { + for _ in 0..Self::N_LIMBS { + { a } OP_PICK + } + } else { + { a + 1 } + for _ in 0..Self::N_LIMBS - 1 { + OP_DUP OP_PICK OP_SWAP + } + OP_1SUB OP_PICK + } + } + } + + pub fn roll(mut a: u32) -> Script { + if a == 0 { + return script! {}; + } + a = (a + 1) * Self::N_LIMBS - 1; + + script! { + for _ in 0..Self::N_LIMBS { + { a } OP_ROLL + } + } + } + + pub fn drop() -> Script { + script! { + for _ in 0..Self::N_LIMBS / 2 { + OP_2DROP + } + if Self::N_LIMBS & 1 == 1 { + OP_DROP + } + } + } + + pub fn push_dec(dec_string: &str) -> Script { + Self::push_u32_le(&BigUint::from_str(dec_string).unwrap().to_u32_digits()) + } + + pub fn push_hex(hex_string: &str) -> Script { + Self::push_u32_le( + &BigUint::from_str_radix(hex_string, 16) + .unwrap() + .to_u32_digits(), + ) + } + + #[inline] + pub fn push_zero() -> Script { + push_to_stack(0, Self::N_LIMBS as usize) + } + + #[inline] + pub fn push_one() -> Script { + script! { + { push_to_stack(0,(Self::N_LIMBS - 1) as usize) } + 1 + } + } + + pub fn is_zero_keep_element(a: u32) -> Script { + let a = Self::N_LIMBS * a; + script! { + 1 + for i in 0..Self::N_LIMBS { + { a + i+1 } OP_PICK + OP_NOT + OP_BOOLAND + } + } + } + + pub fn is_zero(a: u32) -> Script { + let a = Self::N_LIMBS * a; + script! { + 1 + for _ in 0..Self::N_LIMBS { + { a +1 } OP_ROLL + OP_NOT + OP_BOOLAND + } + } + } + + pub fn is_one_keep_element(a: u32) -> Script { + let a = Self::N_LIMBS * a; + script! { + 1 + { a + 1 } OP_PICK + 1 OP_EQUAL OP_BOOLAND + for i in 1..Self::N_LIMBS { + { a + i + 1 } OP_PICK + OP_NOT + OP_BOOLAND + } + } + } + + pub fn is_one(a: u32) -> Script { + let a = Self::N_LIMBS * a; + script! { + 1 + { a + 1 } OP_ROLL + 1 OP_EQUAL OP_BOOLAND + for _ in 1..Self::N_LIMBS { + { a + 1 } OP_ROLL + OP_NOT + OP_BOOLAND + } + } + } + + pub fn toaltstack() -> Script { + script! { + for _ in 0..Self::N_LIMBS { + OP_TOALTSTACK + } + } + } + + pub fn fromaltstack() -> Script { + script! { + for _ in 0..Self::N_LIMBS { + OP_FROMALTSTACK + } + } + } + + pub fn is_negative(depth: u32) -> Script { + script! { + { (1 + depth) * Self::N_LIMBS - 1 } OP_PICK + { Self::HEAD_OFFSET >> 1 } + OP_GREATERTHANOREQUAL + } + } + + pub fn is_positive(depth: u32) -> Script { + script! { + { Self::is_zero_keep_element(depth) } OP_NOT + { (1 + depth) * Self::N_LIMBS } OP_PICK + { Self::HEAD_OFFSET >> 1 } + OP_LESSTHAN OP_BOOLAND + } + } + + pub fn check_validity() -> Script { + script! { // a0 a1 ... an + { 1 << LIMB_SIZE } // a0 a1 ... an x + for _ in 0..Self::N_LIMBS-2 { // a x + OP_TUCK // x a x + 0 OP_SWAP // x a 0 x + OP_WITHIN OP_VERIFY // x + } // a0 a1 x + 0 OP_SWAP // a0 a1 0 x + OP_WITHIN OP_VERIFY // a0 + 0 { Self::HEAD_OFFSET } // a0 0 y + OP_WITHIN OP_VERIFY + } + } + + /// Resize positive numbers + /// + /// # Note + /// + /// Does not work for negative numbers + pub fn resize() -> Script { + let n_limbs_self = N_BITS.div_ceil(LIMB_SIZE); + let n_limbs_target = T_BITS.div_ceil(LIMB_SIZE); + + match n_limbs_target.cmp(&n_limbs_self) { + Ordering::Equal => script! {}, + Ordering::Greater => { + let n_limbs_to_add = n_limbs_target - n_limbs_self; + script! { + if n_limbs_to_add > 0 { + {0} {crate::pseudo::OP_NDUP((n_limbs_to_add - 1) as usize)} // Pushing zeros to the stack + } + for _ in 0..n_limbs_self { + { n_limbs_target - 1 } OP_ROLL + } + } + } + Ordering::Less => { + let n_limbs_to_remove = n_limbs_self - n_limbs_target; + script! { + for _ in 0..n_limbs_to_remove { + { n_limbs_target } OP_ROLL OP_DROP + } + } + } + } + } + + /// Generates a vector of TransformStep struct that encodes all the information needed to + /// convert BigInt form one limbsize represention (source) to another (target). + /// used as a helper function for `transform_limbsize` + fn get_transform_steps(source_limb_size: u32, target_limb_size: u32) -> Vec { + //define an empty vector to store Transform steps + let mut transform_steps: Vec = Vec::new(); + + // compute the number of limbs for target and source + let target_n_limbs = N_BITS.div_ceil(target_limb_size); + let mut target_limb_remaining_bits = Self::N_BITS - (target_n_limbs - 1) * target_limb_size; + let source_n_limbs = N_BITS.div_ceil(source_limb_size); + let source_head = Self::N_BITS - (source_n_limbs - 1) * source_limb_size; + + // define a vector of limbsizes of source + let mut limb_sizes: Vec = Vec::with_capacity(source_n_limbs as usize); + let mut first_iter_flag = true; + for _ in 0..(source_n_limbs - 1) { + limb_sizes.push(source_limb_size); + } + limb_sizes.push(source_head); + + //iterate until all limbs of source are processed + while !limb_sizes.is_empty() { + //iterate until the target limb is filled completely + while target_limb_remaining_bits > 0 { + let source_limb_last_idx = limb_sizes.len() - 1; + let source_limb_remaining_bits = limb_sizes[source_limb_last_idx]; + + match source_limb_remaining_bits.cmp(&target_limb_remaining_bits) { + Ordering::Less => { + transform_steps.push(TransformStep { + current_limb_remaining_bits: source_limb_remaining_bits, + extract_window: source_limb_remaining_bits, + drop_currentlimb: true, + initiate_targetlimb: first_iter_flag, + }); + target_limb_remaining_bits -= source_limb_remaining_bits; + limb_sizes.pop(); + } + Ordering::Equal => { + transform_steps.push(TransformStep { + current_limb_remaining_bits: source_limb_remaining_bits, + extract_window: target_limb_remaining_bits, + drop_currentlimb: true, + initiate_targetlimb: first_iter_flag, + }); + target_limb_remaining_bits = 0; + limb_sizes.pop(); + } + Ordering::Greater => { + transform_steps.push(TransformStep { + current_limb_remaining_bits: source_limb_remaining_bits, + extract_window: target_limb_remaining_bits, + drop_currentlimb: false, + initiate_targetlimb: first_iter_flag, + }); + limb_sizes[source_limb_last_idx] = + source_limb_remaining_bits - target_limb_remaining_bits; + target_limb_remaining_bits = 0; + } + } + first_iter_flag = false; + } + target_limb_remaining_bits = target_limb_size; + first_iter_flag = true; + } + transform_steps + } + + /// Transform Limbsize for BigInt + /// This function changes the representation of BigInt present on stack as multiple limbs of source limbsize to + /// any another limbsize within 1 and 31 (inclusive). + /// Specifically, This can be used to transform limbs into nibbles, limbs into bits ans vice-versa to aid optimizetions. + /// + /// ## Assumptions: + /// - Does NOT do input validation. + /// - The message is placed such that LSB is on top of stack. (MSB pushed first) + /// + /// ## Stack Effects: + /// The original BigInt which that was in stack is dropped + /// The same BigInt with target_limbsize is left on stack + /// + /// ## Panics: + /// - If the source or target limb size lies outside of 0 to 31 (inclusive), fails with assertion error. + /// - If the source or target limb size is greater than number of bits, fails with assertion error. + /// - If the elements do not fit on the stack. (few satck elements are also used for intermediate computation). + /// - The number of bits in the BigInt must be 32 or larger. + pub fn transform_limbsize(source_limb_size: u32, target_limb_size: u32) -> Script { + // ensure that source and target limb sizes are between 0 and 31 inclusive + assert!( + source_limb_size < 32 && source_limb_size > 0, + "source limb size must lie between 1 and 31 inclusive" + ); + assert!( + target_limb_size < 32 && target_limb_size > 0, + "target limb size must lie between 1 and 31 inclusive" + ); + + //ensure that source and target limb size aren't greater than N_BITS + assert!( + source_limb_size <= Self::N_BITS, + "source limb size mustn't be greater than number of bits in bigInt" + ); + assert!( + target_limb_size <= Self::N_BITS, + "target limb size mustn't be greater than number of bits in bigInt" + ); + + //ensure that the N_BITS are larger than or equal to 32 + assert!( + Self::N_BITS >= 32, + "The number of bits in BigInt must be atleast 32" + ); + + // if both source and target limb size are same, do nothing + if source_limb_size == target_limb_size { + script!() + } else { + let steps = Self::get_transform_steps(source_limb_size, target_limb_size); + + let source_n_limbs = N_BITS.div_ceil(source_limb_size); + script!( + // send all limbs except the first to alt stack so that the MSB is handled first + for _ in 0..(source_n_limbs - 1){OP_TOALTSTACK} + + for (index, step) in steps.iter().enumerate() { + {extract_digits(step.current_limb_remaining_bits, step.extract_window)} + + if !step.initiate_targetlimb{ + // add + OP_ROT + for _ in 0..step.extract_window {OP_DUP OP_ADD} + OP_ROT + OP_ADD + OP_SWAP + } + + if step.drop_currentlimb{ + OP_DROP + //except when its the last limb, we pull a new limb from altstack + if index != (steps.len() - 1){ + OP_FROMALTSTACK + } + } + } + ) + } + } + + /// Validate that the BigInt on stack has valid limb values + /// + /// This function checks that each limb in the BigInt representation + /// does not exceed the maximum value allowed for the given LIMB_SIZE + /// and ensures no limb is negative. + /// + /// ## Stack Effects: + /// - Input: BigInt limbs (MSB first, LSB on top) + /// - Output: Same BigInt limbs + validation result (1 if valid, 0 if invalid) + /// + /// ## Validation Rules: + /// - Each limb must be >= 0 (no negative values) + /// - Each limb must be < (1 << LIMB_SIZE) + /// - The head limb must be < (1 << HEAD_OFFSET) where HEAD_OFFSET is the remaining bits + /// + /// ## Note: + /// This function is expensive in terms of script size and should be used carefully + pub fn is_valid_bigint_with_limb_size(limb_size: u32) -> Script { + let n_limbs = N_BITS.div_ceil(limb_size); + let head = N_BITS - (n_limbs - 1) * limb_size; + script! { + // Start with validation result = 1 (valid) + 1 + + // Validate each regular limb (except the head) + for i in 0..n_limbs - 1 { + // Pick the limb from stack (limbs are ordered MSB first, LSB on top) + { i + 1 } OP_PICK + + // Check if limb >= 0 (not negative) + OP_DUP + 0 OP_GREATERTHANOREQUAL + + // Check if limb < (1 << LIMB_SIZE) + OP_SWAP + { 1 << limb_size } + OP_LESSTHAN + + // AND the boolean results + OP_BOOLAND OP_BOOLAND + } + + // Validate the head limb (MSB) separately as it may have fewer bits + { n_limbs } OP_PICK + + // Check if head limb >= 0 (not negative) + OP_DUP + 0 OP_GREATERTHANOREQUAL + + // Check if head limb < (1 << HEAD) + OP_SWAP + { 1 << head } + OP_LESSTHAN + + // AND the boolean results + OP_BOOLAND OP_BOOLAND + } + } + + /// Validate BigInt and fail script if invalid + pub fn verify_bigint_on_stack_with_limb_size(limb_size: u32) -> Script { + script! { + { Self::is_valid_bigint_with_limb_size(limb_size) } + OP_VERIFY + } + } + + pub fn verify_bigint_on_stack() -> Script { + Self::verify_bigint_on_stack_with_limb_size(Self::LIMB_SIZE) + } + + pub fn is_valid_bigint() -> Script { + Self::is_valid_bigint_with_limb_size(Self::LIMB_SIZE) + } +} + +/// Extracts a window of bits from a u32 limb on top of stack +/// +/// ## Assumptions; +/// Doesn't do input validation +/// All the bits before start_index must be 0 for the extract to work properly +/// +/// ## Panics: +/// - If the start_index is not between the range 1 and 31 (inclusive), fails with assertion error +/// - If the window is larger than the start_index, fails with assertion error +/// +/// ## Stack behaviour: +/// - extracts the desired window as a stack element +/// - leaves the original limb with extracted bits set to zero on top of stack +pub fn extract_digits(start_index: u32, window: u32) -> Script { + // doesnot work if start_index is 32 + assert!( + start_index < 32 && start_index > 0, + "start_index must lie between 1 and 31 (inclusive)" + ); + + //panics if the window exceeds the number of bits on the left of start_index + assert!( + start_index >= window, + "not enough bits left of start_index to fill the window!" + ); + + script! { + 0 + OP_SWAP + for i in 0..window { + OP_TUCK + { 1 << (start_index - i - 1) } + OP_GREATERTHANOREQUAL + OP_TUCK + OP_ADD + if i < window - 1 { { NMUL(2) } } + OP_ROT OP_ROT + OP_IF + { 1 << (start_index - i - 1) } + OP_SUB + OP_ENDIF + } + } +} + +#[cfg(test)] +mod test { + use crate::bigint::std::extract_digits; + use crate::bigint::U256; + use crate::bigint::{BigIntImpl, U254}; + use crate::{execute_script, run}; + + use bitcoin_script::script; + use num_bigint::{BigUint, RandBigInt}; + use rand::{Rng, SeedableRng}; + use rand_chacha::ChaCha20Rng; + + #[test] + fn test_valid_bigint() { + let invalid_bigint = ( + script! { + {0} {0} {0} {0} {0} {0} {0} {0} {-1} + }, + false, + ); + + let invalid_bigint2 = ( + script! { + {1 << U256::HEAD} {0} {0} {0} {0} {0} {0} {0} {0} + }, + false, + ); + + let valid_bigint = ( + script! { + {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} {0x1234} + }, + true, + ); + + for (bigint, expected) in [invalid_bigint, invalid_bigint2, valid_bigint] { + let res = execute_script(script! { + {bigint.clone()} + { U256::is_valid_bigint() } + OP_TOALTSTACK + for _ in 0..9 { OP_DROP } + OP_FROMALTSTACK + }); + assert_eq!(res.success, expected); + } + } + + #[test] + fn test_zip() { + const N_BITS: u32 = 1450; + const N_U30_LIMBS: u32 = 50; + + let mut prng = ChaCha20Rng::seed_from_u64(0); + + for _ in 0..50 { + let mut v = vec![]; + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[i as usize]); + expected.push(v[(N_U30_LIMBS + i) as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { BigIntImpl::::zip(1, 0) } + for i in 0..N_U30_LIMBS * 2 { + { expected[(N_U30_LIMBS * 2 - 1 - i) as usize] } + OP_EQUALVERIFY + } + OP_TRUE + }; + run(script); + } + + for _ in 0..50 { + let mut v = vec![]; + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[(N_U30_LIMBS + i) as usize]); + expected.push(v[i as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { BigIntImpl::::zip(0, 1) } + for i in 0..N_U30_LIMBS * 2 { + { expected[(N_U30_LIMBS * 2 - 1 - i) as usize] } + OP_EQUALVERIFY + } + OP_TRUE + }; + run(script); + } + } + + #[test] + fn test_copy() { + println!("U254.copy(0): {} bytes", U254::copy(0).len()); + println!("U254.copy(13): {} bytes", U254::copy(13).len()); + println!("U254.copy(14): {} bytes", U254::copy(14).len()); + const N_U30_LIMBS: u32 = 9; + + let mut prng = ChaCha20Rng::seed_from_u64(0); + + for _ in 0..50 { + let mut v = vec![]; + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[i as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { U254::copy(1) } + for i in 0..N_U30_LIMBS { + { expected[(N_U30_LIMBS - 1 - i) as usize] } + OP_EQUALVERIFY + } + { U254::drop() } + { U254::drop() } + OP_TRUE + }; + run(script); + } + } + + #[test] + fn test_roll() { + const N_U30_LIMBS: u32 = 9; + + let mut prng = ChaCha20Rng::seed_from_u64(0); + + for _ in 0..50 { + let mut v = vec![]; + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[i as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { U254::roll(1) } + for i in 0..N_U30_LIMBS { + { expected[(N_U30_LIMBS - 1 - i) as usize] } + OP_EQUALVERIFY + } + { U254::drop() } + OP_TRUE + }; + run(script); + } + } + + #[test] + fn test_copy_zip() { + const N_U30_LIMBS: u32 = 9; + + let mut prng = ChaCha20Rng::seed_from_u64(0); + + for _ in 0..50 { + let mut v = vec![]; + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + for _ in 0..N_U30_LIMBS { + v.push(prng.gen::()); + } + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[i as usize]); + expected.push(v[(N_U30_LIMBS + i) as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { U254::copy_zip(1, 0) } + for i in 0..N_U30_LIMBS * 2 { + { expected[(N_U30_LIMBS * 2 - 1 - i) as usize] } + OP_EQUALVERIFY + } + { U254::drop() } + { U254::drop() } + OP_TRUE + }; + run(script); + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[(N_U30_LIMBS + i) as usize]); + expected.push(v[i as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { U254::copy_zip(0, 1) } + for i in 0..N_U30_LIMBS * 2 { + { expected[(N_U30_LIMBS * 2 - 1 - i) as usize] } + OP_EQUALVERIFY + } + { U254::drop() } + { U254::drop() } + OP_TRUE + }; + run(script); + + let mut expected = vec![]; + for i in 0..N_U30_LIMBS { + expected.push(v[i as usize]); + expected.push(v[i as usize]); + } + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { U254::copy_zip(1, 1) } + for i in 0..N_U30_LIMBS * 2 { + { expected[(N_U30_LIMBS * 2 - 1 - i) as usize] } + OP_EQUALVERIFY + } + { U254::drop() } + { U254::drop() } + OP_TRUE + }; + run(script); + + let script = script! { + for i in 0..N_U30_LIMBS * 2 { + { v[i as usize] } + } + { U254::dup_zip(1) } + for i in 0..N_U30_LIMBS * 2 { + { expected[(N_U30_LIMBS * 2 - 1 - i) as usize] } + OP_EQUALVERIFY + } + { U254::drop() } + OP_TRUE + }; + run(script); + } + } + + #[test] + fn push_hex() { + run(script! { + { U254::push_hex("30644e72e131a029b85045b68181585d97816a916871ca8d3c208c16d87cfd47") } + { 0x187cfd47 } OP_EQUALVERIFY // 410844487 + { 0x10460b6 } OP_EQUALVERIFY // 813838427 + { 0x1c72a34f } OP_EQUALVERIFY // 119318739 + { 0x2d522d0 } OP_EQUALVERIFY // 542811226 + { 0x1585d978 } OP_EQUALVERIFY // 22568343 + { 0x2db40c0 } OP_EQUALVERIFY // 18274822 + { 0xa6e141 } OP_EQUALVERIFY // 436378501 + { 0xe5c2634 } OP_EQUALVERIFY // 329037900 + { 0x30644e } OP_EQUAL // 12388 + }); + } + + // test the extract window fn + #[test] + fn test_extract_window() { + let mut prng = ChaCha20Rng::seed_from_u64(8); + + for _ in 0..100 { + // generate random start_index and window + let start_index = prng.gen_range(1..=31); + let window = prng.gen_range(1..=start_index); + + // generate a random u32 + let random_u32: u32 = prng.gen(); + + // compute the values by shifting + let initial_limb = random_u32 >> (32u32 - start_index); + let expected_window = initial_limb >> (start_index - window); + let modified_limb = if start_index == window { + 0 + } else { + (initial_limb << (32u32 - start_index + window)) >> (32u32 - start_index + window) + }; + + let script = script!( + {initial_limb} + + {extract_digits(start_index,window)} + + {modified_limb} + OP_EQUALVERIFY + + {expected_window} + OP_EQUAL + ); + + let res = crate::execute_script(script.clone()); + assert!(res.success); + } + } + + // manual test of transform to and from U256. + #[test] + fn test_transform_to_and_from_u256() { + type U256 = BigIntImpl<256, 29>; + let script = script!( + {0b010101010010101010100101} + {0b10000000100000011111111011111} + {0b00000101000000100000000000000} + {0b01010101001010101000000000000} + {0b11010101001010101001010111111} + {0b11111111111000000000000000000} + {0b01010010101001010010010101001} + {0b00000000000000000000000000000} + {0b11111111111111111111111111111} + {U256::transform_limbsize(29, 4)} + {U256::transform_limbsize(4, 1)} + {U256::transform_limbsize(1, 31)} + {U256::transform_limbsize(31, 2)} + {U256::transform_limbsize(2, 10)} + {U256::transform_limbsize(10, 31)} + {U256::transform_limbsize(31, 27)} + {U256::transform_limbsize(27, 8)} + {U256::transform_limbsize(8, 9)} + {U256::transform_limbsize(9, 9)} + {U256::transform_limbsize(9, 4)} + {U256::transform_limbsize(4, 4)} + {U256::transform_limbsize(4,29)} + {0b010101010010101010100101} + {0b10000000100000011111111011111} + {0b00000101000000100000000000000} + {0b01010101001010101000000000000} + {0b11010101001010101001010111111} + {0b11111111111000000000000000000} + {0b01010010101001010010010101001} + {0b00000000000000000000000000000} + {0b11111111111111111111111111111} + + + for i in (2..10).rev(){ + {i} + OP_ROLL + OP_EQUALVERIFY + } + OP_EQUAL + ); + let res = crate::execute_script(script.clone()); + assert!(res.success); + } + + // Testing all ones manually for U1773 + #[test] + fn test_transform_allones_to_and_from_u1773() { + type U1773 = BigIntImpl<1773, 21>; + let script = script!( + // push all ones in U1773 assuming limb size of 23 + {0b11} + for _ in 0..77{ + {0b11111111111111111111111} + } + + {U1773::transform_limbsize(23,21)} + {U1773::transform_limbsize(21,2)} + {U1773::transform_limbsize(2,3)} + {U1773::transform_limbsize(3,19)} + {U1773::transform_limbsize(19,23)} + + for _ in 0..77{ + {0b11111111111111111111111} + OP_EQUALVERIFY + } + {0b11} + OP_EQUAL + + ); + let res = crate::execute_script(script.clone()); + assert!(res.success); + } + + // Testing all ones manually for U1773 + #[test] + fn test_transform_allzeros_to_and_from_u1773() { + type U1773 = BigIntImpl<1773, 21>; + let script = script!( + // push all ones in U1773 assuming limb size of 23 + {0b11} + for _ in 0..77{ + {0b11111111111111111111111} + } + + {U1773::transform_limbsize(23,21)} + {U1773::transform_limbsize(21,2)} + {U1773::transform_limbsize(2,3)} + {U1773::transform_limbsize(3,19)} + {U1773::transform_limbsize(19,23)} + + // push the same input in reverse and verify + for _ in 0..77{ + {0b11111111111111111111111} + OP_EQUALVERIFY + } + {0b11} + OP_EQUAL + + ); + let res = crate::execute_script(script.clone()); + assert!(res.success); + } + + // Testing all ones manually for U1773 + #[test] + fn test_transform_allzeros_to_and_from_u876() { + type U876 = BigIntImpl<876, 14>; + let script = script!( + // push all zeros in U876 assuming limb size of 14 + {0b00000000} + for _ in 0..62{ + {0b00000000000000} + } + + {U876::transform_limbsize(14, 9)} + {U876::transform_limbsize(9, 10)} + {U876::transform_limbsize(10, 31)} + {U876::transform_limbsize(31, 1)} + {U876::transform_limbsize(1, 2)} + {U876::transform_limbsize(2, 4)} + {U876::transform_limbsize(4, 8)} + {U876::transform_limbsize(8, 19)} + {U876::transform_limbsize(19, 27)} + {U876::transform_limbsize(27, 14)} + + //push the same input in reverse and verify + for _ in 0..62{ + {0b00000000000000} + OP_EQUALVERIFY + } + {0b00000000} + OP_EQUAL + + ); + let res = crate::execute_script(script.clone()); + assert!(res.success); + } + + #[test] + #[should_panic(expected = "source limb size must lie between 1 and 31 inclusive")] + fn test_source_limbsize_too_high() { + script!({ U254::transform_limbsize(32, 3) }); + } + + #[test] + #[should_panic(expected = "source limb size must lie between 1 and 31 inclusive")] + fn test_source_limbsize_too_low() { + script!({ U254::transform_limbsize(0, 29) }); + } + + #[test] + #[should_panic(expected = "target limb size must lie between 1 and 31 inclusive")] + fn test_target_limbsize_too_high() { + script!({ U254::transform_limbsize(29, 32) }); + } + + #[test] + #[should_panic(expected = "target limb size must lie between 1 and 31 inclusive")] + fn test_target_limbsize_too_low() { + script!({ U254::transform_limbsize(29, 0) }); + } + + // test for properties that gen_transform_steps must satisfy + // sum of extracts window must be equal to the number of bits + // count of drop_current_limb must be equal to number of limbs in source representation + // count of initiate_targetlimb must be equal to number of limbs in target representation + #[test] + fn test_generate_steps_sum_of_extarct_windows() { + type U256 = BigIntImpl<256, 29>; + let mut prng = ChaCha20Rng::seed_from_u64(1); + for _ in 0..100 { + // generate random source and target limbsizes + let source = prng.gen_range(1..=31); + let target = prng.gen_range(1..=31); + + let steps = U256::get_transform_steps(source, target); + + let mut extract_windows_sum = 0; + let mut drop_currentlimb_count = 0; + let mut initiate_targetlimb_count = 0; + for step in steps { + extract_windows_sum += step.extract_window; + drop_currentlimb_count += if step.drop_currentlimb { 1 } else { 0 }; + initiate_targetlimb_count += if step.initiate_targetlimb { 1 } else { 0 }; + } + assert_eq!(extract_windows_sum, U256::N_BITS); + assert_eq!(drop_currentlimb_count, U256::N_BITS.div_ceil(source)); + assert_eq!(initiate_targetlimb_count, U256::N_BITS.div_ceil(target)); + } + } + + #[test] + fn test_transform_limbsize_u256_random_vals() { + type U256 = BigIntImpl<256, 29>; + let mut prng = ChaCha20Rng::seed_from_u64(1); + + for _ in 0..100 { + // create a vector to store the inputs + let mut input_vals: Vec = Vec::new(); + + // generate random u32 for input + for i in 0..9 { + let input_val: u32 = prng.gen(); + // ensure that the initial bits are zero as needed + if i == 0 { + input_vals.push(input_val >> 8); + } else { + input_vals.push(input_val >> 3); + } + } + + // generate random source and target limbsizes + let source = prng.gen_range(1..=31); + let target = prng.gen_range(1..=31); + + let script = script!( + + // insert the values + for val in input_vals.clone(){ + {val} + } + + // do random transforms + {U256::transform_limbsize(29,source)} + {U256::transform_limbsize(source,target)} + {U256::transform_limbsize(target,29)} + + // verify that the transformation and its inverse leaves the input unchanged + for val in input_vals.iter().rev(){ + {*val} + OP_EQUALVERIFY + } + OP_TRUE + ); + let res = crate::execute_script(script.clone()); + assert!(res.success); + } + } + + #[test] + fn test_biguint_to_limbs() { + const LIMB_SIZE: u32 = 29; + type U256 = BigIntImpl<256, LIMB_SIZE>; + let mut prng = ChaCha20Rng::seed_from_u64(37); + for _ in 0..100 { + let x: BigUint = prng.gen_biguint(256); + let mut sum = BigUint::from(0u32); + for limb in U256::biguint_to_limbs(x.clone()).iter().rev() { + sum = (sum * (1u32 << LIMB_SIZE)) + limb; + } + assert_eq!(sum, x); + } + } +} diff --git a/src/bigint/sub.rs b/bitvm/src/bigint/sub.rs similarity index 71% rename from src/bigint/sub.rs rename to bitvm/src/bigint/sub.rs index 537632aa2..92cb72c4f 100644 --- a/src/bigint/sub.rs +++ b/bitvm/src/bigint/sub.rs @@ -31,6 +31,32 @@ impl BigIntImpl { } } } + + pub fn neg() -> Script { + script! { // ... a_n + { (1 << LIMB_SIZE) - 1 } // ... a_n x + + for _ in 0..Self::N_LIMBS-2 { // ... a_{i-1} a_i x + OP_TUCK // ... a_{i-1} x a_i x + OP_SWAP // ... a_{i-1} x x a_i + OP_SUB // ... a_{i-1} x x-a_i + OP_TOALTSTACK // ... a_{i-1} x + } + // a_0 a_1 x + OP_SWAP // a_0 x a_1 + OP_SUB // a_0 x-a_1 + OP_TOALTSTACK // a_0 + + { Self::HEAD_OFFSET-1 } + OP_SWAP + OP_SUB + + for _ in 0..Self::N_LIMBS-1 { + OP_FROMALTSTACK + } + { Self::add1() } + } + } } /// Compute the difference of two limbs, including the carry bit @@ -134,4 +160,23 @@ mod test { run(script); } } + + #[test] + fn test_neg() { + println!("U254.neg: {} bytes", U254::neg().len()); + let mut prng = ChaCha20Rng::seed_from_u64(0); + + let a: BigUint = prng.sample(RandomBits::new(254)); + + let script = script! { + { U254::push_zero() } + { U254::push_u32_le(&a.to_u32_digits()) } + { U254::sub(1, 0) } + { U254::push_u32_le(&a.to_u32_digits()) } + { U254::neg() } + { U254::equalverify(1, 0) } + OP_TRUE + }; + run(script); + } } diff --git a/bitvm/src/bn254/ell_coeffs.rs b/bitvm/src/bn254/ell_coeffs.rs new file mode 100644 index 000000000..71599ec8e --- /dev/null +++ b/bitvm/src/bn254/ell_coeffs.rs @@ -0,0 +1,348 @@ +// Rephrased from https://github.com/arkworks-rs/algebra/blob/master/ec/src/models/bn/g2.rs#L185 +// Cannot directly obtain G2 because of visibility + +use ark_bn254::Config; +use ark_ec::bn::g2::G2Prepared as ark_G2Prepared; +use ark_ec::bn::{BnConfig, TwistType}; +use ark_ec::pairing::{MillerLoopOutput, Pairing, PairingOutput}; +use ark_ec::short_weierstrass::Affine; +use ark_ec::{AffineRepr, CurveGroup}; +use ark_ff::Field; +use ark_ff::{AdditiveGroup, CyclotomicMultSubgroup}; +use itertools::Itertools; +use num_traits::One; + +pub type G2Affine

= Affine<

::G2Config>; + +#[derive(Clone, Debug, PartialEq, Eq)] +pub struct G2Prepared { + /// Stores the coefficients of the line evaluations as calculated in + /// + pub ell_coeffs: Vec, + pub infinity: bool, +} + +// aka. line in miller loop. +pub type EllCoeff = (ark_bn254::Fq2, ark_bn254::Fq2, ark_bn254::Fq2); + +impl Default for G2Prepared { + fn default() -> Self { + Self::from(ark_bn254::G2Affine::generator()) + } +} + +impl G2Prepared { + fn affine_double_in_place( + t: &mut ark_bn254::G2Affine, + three_div_two: &ark_bn254::Fq, + ) -> EllCoeff { + // for affine coordinates + // slope: alpha = 3 * x^2 / 2 * y + // intercept: bias = y - alpha * x + let mut alpha = t.x.square(); + alpha /= t.y; + alpha.mul_assign_by_fp(three_div_two); + let bias = t.y - alpha * t.x; + + // update T + // T.x = alpha^2 - 2 * t.x + // T.y = -bias - alpha * T.x + let tx = alpha.square() - t.x.double(); + t.y = -bias - alpha * tx; + t.x = tx; + + (ark_bn254::Fq2::ONE, alpha, -bias) + } + + fn affine_add_in_place(t: &mut ark_bn254::G2Affine, q: &ark_bn254::G2Affine) -> EllCoeff { + // alpha = (t.y - q.y) / (t.x - q.x) + // bias = t.y - alpha * t.x + let alpha = (t.y - q.y) / (t.x - q.x); + let bias = t.y - alpha * t.x; + + // update T + // T.x = alpha^2 - t.x - q.x + // T.y = -bias - alpha * T.x + let tx = alpha.square() - t.x - q.x; + t.y = -bias - alpha * tx; + t.x = tx; + + (ark_bn254::Fq2::ONE, alpha, -bias) + } + + /// !!! this method cannot be used directly for users, so we need reuse the `from` trait already exists + pub fn from_affine(q: ark_bn254::G2Affine) -> Self { + if q.infinity { + G2Prepared { + ell_coeffs: vec![], + infinity: true, + } + } else { + let two_inv = ark_bn254::Fq::one().double().inverse().unwrap(); + let three_div_two = (ark_bn254::Fq::one().double() + ark_bn254::Fq::one()) * two_inv; + + let mut ell_coeffs = vec![]; + let mut r = q; + + let neg_q = -q; + + for bit in ark_bn254::Config::ATE_LOOP_COUNT.iter().rev().skip(1) { + ell_coeffs.push(Self::affine_double_in_place(&mut r, &three_div_two)); + + match bit { + 1 => ell_coeffs.push(Self::affine_add_in_place(&mut r, &q)), + -1 => ell_coeffs.push(Self::affine_add_in_place(&mut r, &neg_q)), + _ => continue, + } + } + + let q1 = mul_by_char(q); + let mut q2 = mul_by_char(q1); + + if ark_bn254::Config::X_IS_NEGATIVE { + r.y = -r.y; + } + + q2.y = -q2.y; + + ell_coeffs.push(Self::affine_add_in_place(&mut r, &q1)); + ell_coeffs.push(Self::affine_add_in_place(&mut r, &q2)); + + Self { + ell_coeffs, + infinity: false, + } + } + } +} + +impl From for G2Prepared { + // equal with line_function. + fn from(q: ark_bn254::G2Affine) -> Self { + if q.infinity { + G2Prepared { + ell_coeffs: vec![], + infinity: true, + } + } else { + Self::from_affine(q) + } + } +} + +impl From for G2Prepared { + fn from(q: ark_bn254::G2Projective) -> Self { + q.into_affine().into() + } +} + +impl From> for G2Prepared { + fn from(q: ark_G2Prepared) -> Self { + let ell_coeffs: Vec<(ark_bn254::Fq2, ark_bn254::Fq2, ark_bn254::Fq2)> = q + .ell_coeffs + .iter() + .map(|f| { + let f1: ark_bn254::Fq2 = f.0; + let f2: ark_bn254::Fq2 = f.1; + let f3: ark_bn254::Fq2 = f.2; + (f1, f2, f3) + }) + .collect(); + G2Prepared { + ell_coeffs, + infinity: false, + } + } +} + +impl<'a> From<&'a ark_bn254::G2Affine> for G2Prepared { + fn from(other: &'a ark_bn254::G2Affine) -> Self { + (*other).into() + } +} + +impl<'a> From<&'a ark_bn254::G2Projective> for G2Prepared { + fn from(q: &'a ark_bn254::G2Projective) -> Self { + q.into_affine().into() + } +} + +impl<'a> From<&'a ark_G2Prepared> for G2Prepared { + fn from(q: &'a ark_G2Prepared) -> Self { + q.to_owned().into() + } +} + +impl G2Prepared { + pub fn is_zero(&self) -> bool { + self.infinity + } +} + +pub fn mul_by_char(r: ark_bn254::G2Affine) -> ark_bn254::G2Affine { + // multiply by field characteristic + + let mut s = r; + s.x.frobenius_map_in_place(1); + s.x *= &ark_bn254::Config::TWIST_MUL_BY_Q_X; + s.y.frobenius_map_in_place(1); + s.y *= &ark_bn254::Config::TWIST_MUL_BY_Q_Y; + + s +} + +// Define the AffinePairing trait for our affine mode operations +pub trait AffinePairing { + /// Computes the product of Miller loops for some number of (G1, G2) pairs, where the line functions are in affine mode + fn multi_miller_loop_affine( + &self, + a: impl IntoIterator>>, + b: impl IntoIterator>, + ) -> MillerLoopOutput; + + /// Performs multiple pairing operations, where the line functions are in affine mode + fn multi_pairing_affine( + &self, + a: impl IntoIterator>>, + b: impl IntoIterator>, + ) -> PairingOutput; + + /// Performs a single pairing operation, where the line functions are in affine mode + fn pairing_affine( + &self, + p: impl Into>, + q: impl Into, + ) -> PairingOutput; +} + +// Create a struct to implement AffinePairing +pub struct BnAffinePairing; + +// Helper function to perform line function evaluation in affine coordinates +fn ell_affine(f: &mut ark_bn254::Fq12, coeffs: &EllCoeff, xx: &ark_bn254::Fq, yy: &ark_bn254::Fq) { + // c0 is a trivial value 1 + let c0 = coeffs.0; + let mut c1 = coeffs.1; + let mut c2 = coeffs.2; + + match Config::TWIST_TYPE { + TwistType::M => { + c1.mul_assign_by_fp(xx); + c2.mul_assign_by_fp(yy); + f.mul_by_014(&c0, &c1, &c2); + } + // line evaluation is y' * f_Q(P), coefficients are (1, x' * lambda, -y' * bias) + TwistType::D => { + c1.mul_assign_by_fp(xx); + c2.mul_assign_by_fp(yy); + f.mul_by_034(&c0, &c1, &(c2)); + } + } +} + +impl AffinePairing for BnAffinePairing { + fn multi_miller_loop_affine( + &self, + a: impl IntoIterator>>, + b: impl IntoIterator>, + ) -> MillerLoopOutput { + let mut pairs = a + .into_iter() + .zip_eq(b) + .filter_map(|(p, q)| { + // if input q is projective coordinates, then we will enter `into` computing pairing mode + // otherwise if input q is affine coordinates, then we will enter `into` verifying pairing mode + let (p, q) = (p.into(), q.into()); + match !p.is_zero() && !q.is_zero() { + true => Some(( + -p.0.x / p.0.y, + p.0.y.inverse().unwrap(), + q.ell_coeffs.into_iter(), + )), + false => None, + } + }) + .collect::>(); + + let mut f = pairs + .chunks_mut(4) + .map(|pairs| { + let mut f = ark_bn254::Fq12::one(); + for i in (1..Config::ATE_LOOP_COUNT.len()).rev() { + if i != Config::ATE_LOOP_COUNT.len() - 1 { + f.square_in_place(); + } + + for (coeff_1, coeff_2, coeffs) in pairs.iter_mut() { + ell_affine(&mut f, &coeffs.next().unwrap(), coeff_1, coeff_2); + } + + let bit = Config::ATE_LOOP_COUNT[i - 1]; + if bit == 1 || bit == -1 { + for (coeff_1, coeff_2, coeffs) in pairs.iter_mut() { + ell_affine(&mut f, &coeffs.next().unwrap(), coeff_1, coeff_2); + } + } + } + f + }) + .product::(); + + if Config::X_IS_NEGATIVE { + f.cyclotomic_inverse_in_place(); + } + + for (coeff_1, coeff_2, coeffs) in &mut pairs { + ell_affine(&mut f, &coeffs.next().unwrap(), coeff_1, coeff_2); + } + + for (coeff_1, coeff_2, coeffs) in &mut pairs { + ell_affine(&mut f, &coeffs.next().unwrap(), coeff_1, coeff_2); + } + + MillerLoopOutput(f) + } + + fn multi_pairing_affine( + &self, + a: impl IntoIterator>>, + b: impl IntoIterator>, + ) -> PairingOutput { + ark_bn254::Bn254::final_exponentiation(self.multi_miller_loop_affine(a, b)).unwrap() + } + + fn pairing_affine( + &self, + p: impl Into>, + q: impl Into, + ) -> PairingOutput { + self.multi_pairing_affine([p], [q]) + } +} + +#[cfg(test)] +mod tests { + use super::*; + use ark_ff::UniformRand; + use ark_std::test_rng; + + #[test] + fn test_affine_vs_projective() { + let mut rng = test_rng(); + + // Generate random points + let g1 = ark_bn254::G1Projective::rand(&mut rng).into_affine(); + let g2 = ark_bn254::G2Projective::rand(&mut rng).into_affine(); + + // Compute pairing using standard method + let result1 = ark_bn254::Bn254::pairing(g1, g2); + + // Compute pairing using our affine method + let affine_pairing = BnAffinePairing; + let g2_prepared = G2Prepared::from_affine(g2); + let result2 = affine_pairing.pairing_affine(g1, g2_prepared); + + // Results should be equal + assert_eq!(result1, result2); + } +} diff --git a/bitvm/src/bn254/fp254impl.rs b/bitvm/src/bn254/fp254impl.rs new file mode 100644 index 000000000..ac9abb346 --- /dev/null +++ b/bitvm/src/bn254/fp254impl.rs @@ -0,0 +1,604 @@ +use crate::bigint::add::limb_add_carry; +use crate::bigint::sub::limb_sub_borrow; +use crate::bigint::U254; +use crate::treepp::*; +use ark_ff::PrimeField; +use bitcoin_script::script; +use num_bigint::{BigInt, BigUint}; +use num_traits::Num; +use std::sync::OnceLock; + +#[allow(clippy::declare_interior_mutable_const)] +pub trait Fp254Impl { + const N_LIMBS: u32 = U254::N_LIMBS; + const N_BITS: u32 = U254::N_BITS; + + const MODULUS: &'static str; + const MODULUS_LIMBS: [u32; U254::N_LIMBS as usize]; + + const P_PLUS_ONE_DIV2: &'static str; + const TWO_P_PLUS_ONE_DIV3: &'static str; + const P_PLUS_TWO_DIV3: &'static str; + + const ADD_ONCELOCK: OnceLock