diff --git a/.github/workflows/ci.yml b/.github/workflows/ci.yml index 291dc2df..443e7a48 100644 --- a/.github/workflows/ci.yml +++ b/.github/workflows/ci.yml @@ -118,6 +118,7 @@ jobs: crates/redjubjub crates/sapling-crypto crates/sinsemilla + crates/zcash_history crates/zcash_keys crates/zcash_primitives crates/zcash_proofs @@ -167,7 +168,7 @@ jobs: crates/sinsemilla/*) sinsemilla=true ;; - crates/zcash_keys/*|crates/zcash_primitives/*|crates/zcash_proofs/*) + crates/zcash_history/*|crates/zcash_keys/*|crates/zcash_primitives/*|crates/zcash_proofs/*) librustzcash=true ;; Cargo.toml|Cargo.lock|rust-toolchain.toml|.cargo/*|.github/scripts/check_rust_group.sh|.github/scripts/workspace_packages.py|.github/workflows/ci.yml|.github/workflows/maintenance.yml) @@ -311,7 +312,7 @@ jobs: if: ${{ !cancelled() && needs.changes.outputs.librustzcash == 'true' }} run: >- bash .github/scripts/check_rust_group.sh - "zakura-keys zakura-primitives zakura-proofs" true false + "zakura-history zakura-keys zakura-primitives zakura-proofs" true false formatting: name: Formatting @@ -1136,11 +1137,16 @@ jobs: - name: Run tests run: >- cargo +1.91.0 test + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs --all-features -- --test-threads=2 + - name: Test NuTachyon history nodes + env: + RUSTFLAGS: '--cfg zcash_unstable="nutachyon"' + run: cargo +1.91.0 test -p zakura-history --all-features - name: Verify working directory is clean run: git diff --exit-code @@ -1160,6 +1166,7 @@ jobs: - name: Check no-default-features run: >- cargo +1.91.0 check + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1169,6 +1176,7 @@ jobs: if: ${{ !cancelled() }} run: >- cargo +1.91.0 check + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1179,6 +1187,7 @@ jobs: if: ${{ !cancelled() }} run: >- cargo +1.91.0 check + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1189,6 +1198,7 @@ jobs: if: ${{ !cancelled() }} run: >- cargo +1.91.0 check + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1199,6 +1209,7 @@ jobs: if: ${{ !cancelled() }} run: >- cargo +1.91.0 check + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1209,6 +1220,7 @@ jobs: if: ${{ !cancelled() }} run: >- cargo +1.91.0 check + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1218,7 +1230,7 @@ jobs: if: ${{ !cancelled() }} shell: bash run: | - for package in zakura-keys zakura-primitives zakura-proofs; do + for package in zakura-history zakura-keys zakura-primitives zakura-proofs; do cargo +1.91.0 metadata --no-deps --format-version 1 | jq -r --arg package "$package" \ '.packages[] | select(.name == $package) | .features | keys[]' | @@ -1240,6 +1252,7 @@ jobs: continue-on-error: true run: >- cargo +beta clippy + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs @@ -1262,7 +1275,7 @@ jobs: packages: -p zakura-proofs build-deps: gcc-multilib - target: thumbv7em-none-eabihf - packages: -p zakura-keys -p zakura-primitives + packages: -p zakura-history -p zakura-keys -p zakura-primitives build-deps: gcc-arm-none-eabi steps: - uses: actions/checkout@3d3c42e5aac5ba805825da76410c181273ba90b1 # v7.0.1 diff --git a/.github/workflows/maintenance.yml b/.github/workflows/maintenance.yml index bc00ee5d..e33319d8 100644 --- a/.github/workflows/maintenance.yml +++ b/.github/workflows/maintenance.yml @@ -86,6 +86,7 @@ jobs: - name: Build with latest dependencies run: >- cargo +stable build + -p zakura-history -p zakura-keys -p zakura-primitives -p zakura-proofs diff --git a/Cargo.lock b/Cargo.lock index ebe39ae9..67570536 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -493,7 +493,7 @@ dependencies = [ "bitflags 1.3.2", "clap_derive", "clap_lex 0.2.4", - "indexmap", + "indexmap 1.9.3", "once_cell", "strsim 0.10.0", "termcolor", @@ -574,6 +574,15 @@ version = "0.4.2" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "3d52eff69cd5e647efe296129160853a42795992097e8af39800e1060caeea9b" +[[package]] +name = "convert_case" +version = "0.10.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "633458d4ef8c78b72454de2d54fd6ab2e60f9e02be22f3c6104cdc8a4e0fceb9" +dependencies = [ + "unicode-segmentation", +] + [[package]] name = "core-foundation" version = "0.9.4" @@ -928,7 +937,7 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "907076dfda823b0b36d2a1bb5f90c96660a5bbcd7729e10727f07858f22c4edc" dependencies = [ "cfg-if", - "hashbrown", + "hashbrown 0.12.3", "lock_api", "once_cell", "parking_lot_core", @@ -994,6 +1003,29 @@ dependencies = [ "syn 1.0.109", ] +[[package]] +name = "derive_more" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "d751e9e49156b02b44f9c1815bcb94b984cdcc4396ecc32521c739452808b134" +dependencies = [ + "derive_more-impl", +] + +[[package]] +name = "derive_more-impl" +version = "2.1.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "799a97264921d8623a957f6c3b9011f3b5492f557bbb7a5a19b7fa6d06ba8dcb" +dependencies = [ + "convert_case", + "proc-macro2", + "quote", + "rustc_version", + "syn 2.0.119", + "unicode-xid", +] + [[package]] name = "digest" version = "0.10.7" @@ -1130,6 +1162,12 @@ dependencies = [ "corez", ] +[[package]] +name = "equivalent" +version = "1.0.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "877a4ace8713b0bcf2a4e7eec82529c029f1d0619886d18145fea96c3ffe5c0f" + [[package]] name = "errno" version = "0.3.14" @@ -1160,8 +1198,7 @@ dependencies = [ [[package]] name = "f4jumble" version = "0.1.1" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "0d42773cb15447644d170be20231a3268600e0c4cea8987d013b93ac973d3cf7" +source = "git+https://github.com/zcash/librustzcash.git?rev=c7235b1fc4b4296b8af2e26bf2f6adb24f873f56#c7235b1fc4b4296b8af2e26bf2f6adb24f873f56" dependencies = [ "blake2b_simd", ] @@ -1226,6 +1263,15 @@ dependencies = [ "winapi", ] +[[package]] +name = "fixed-hash" +version = "0.8.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "835c052cb0c08c1acf6ffd71c022172e18723949c8282f2b9f27efbc51e64534" +dependencies = [ + "static_assertions", +] + [[package]] name = "flate2" version = "1.1.9" @@ -1531,6 +1577,12 @@ version = "0.12.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "8a9ee70c43aaf417c914396645a0fa852624801b24ebb7ae78fe8272889ac888" +[[package]] +name = "hashbrown" +version = "0.17.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ed5909b6e89a2db4456e54cd5f673791d7eca6732202bbf2a9cc504fe2f9b84a" + [[package]] name = "heapless" version = "0.7.17" @@ -1695,7 +1747,17 @@ source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "bd070e393353796e801d209ad339e89596eb4c8d430d18ede6a1cced8fafbd99" dependencies = [ "autocfg", - "hashbrown", + "hashbrown 0.12.3", +] + +[[package]] +name = "indexmap" +version = "2.14.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "07aa2048142242915a31d35844fb311e0e53fcca590c3a0a40dcf1b841fa09eb" +dependencies = [ + "equivalent", + "hashbrown 0.17.1", ] [[package]] @@ -1711,7 +1773,7 @@ dependencies = [ "crossbeam-utils", "dashmap", "env_logger", - "indexmap", + "indexmap 1.9.3", "itoa 1.0.18", "lazy_static", "log", @@ -1899,6 +1961,15 @@ dependencies = [ "rayon", ] +[[package]] +name = "maybe-rayon" +version = "0.1.1" +source = "git+https://github.com/tachyon-zcash/maybe-rayon.git?rev=5c37ee0dd448e8c1edc4529d0b8897ecaff5aad1#5c37ee0dd448e8c1edc4529d0b8897ecaff5aad1" +dependencies = [ + "cfg-if", + "rayon", +] + [[package]] name = "memchr" version = "2.8.3" @@ -2336,6 +2407,25 @@ dependencies = [ "zerocopy", ] +[[package]] +name = "primitive-types" +version = "0.12.2" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "0b34d9fd68ae0b74a41b21c03c2f62847aa0ffea044eee893b4c140b37e244e2" +dependencies = [ + "fixed-hash", + "uint", +] + +[[package]] +name = "proc-macro-crate" +version = "3.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "e67ba7e9b2b56446f1d419b1d807906278ffa1a658a8a5d8a39dcb1f5a78614f" +dependencies = [ + "toml_edit", +] + [[package]] name = "proc-macro-error" version = "1.0.4" @@ -2459,6 +2549,100 @@ version = "0.7.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "dc33ff2d4973d518d823d61aa239014831e521c75da58e3df4840d3f47749d09" +[[package]] +name = "ragu" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "blake2b_simd", + "ragu_arithmetic", + "ragu_circuits", + "ragu_core", + "ragu_pasta", + "ragu_pcd", + "ragu_primitives", +] + +[[package]] +name = "ragu_arithmetic" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "ff", + "group", + "maybe-rayon 0.1.1 (git+https://github.com/tachyon-zcash/maybe-rayon.git?rev=5c37ee0dd448e8c1edc4529d0b8897ecaff5aad1)", + "ragu_macros", + "rand 0.10.2", + "zakura-pasta-curves 1.0.1", +] + +[[package]] +name = "ragu_circuits" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "blake2b_simd", + "maybe-rayon 0.1.1 (git+https://github.com/tachyon-zcash/maybe-rayon.git?rev=5c37ee0dd448e8c1edc4529d0b8897ecaff5aad1)", + "ragu_arithmetic", + "ragu_core", + "ragu_primitives", +] + +[[package]] +name = "ragu_core" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "ragu_arithmetic", + "ragu_macros", + "thiserror 2.0.20", +] + +[[package]] +name = "ragu_macros" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "num-bigint", + "num-traits", + "proc-macro-crate", + "proc-macro2", + "quote", + "syn 2.0.119", +] + +[[package]] +name = "ragu_pasta" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "lazy_static", + "ragu_arithmetic", +] + +[[package]] +name = "ragu_pcd" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "maybe-rayon 0.1.1 (git+https://github.com/tachyon-zcash/maybe-rayon.git?rev=5c37ee0dd448e8c1edc4529d0b8897ecaff5aad1)", + "ragu_arithmetic", + "ragu_circuits", + "ragu_core", + "ragu_primitives", +] + +[[package]] +name = "ragu_primitives" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/ragu?rev=f4f6315b10ed96944c40b2bbdbca0fe06af66ce0#f4f6315b10ed96944c40b2bbdbca0fe06af66ce0" +dependencies = [ + "ragu_arithmetic", + "ragu_core", + "ragu_macros", + "thiserror 2.0.20", +] + [[package]] name = "rand" version = "0.8.7" @@ -3253,6 +3437,36 @@ dependencies = [ "syn 3.0.3", ] +[[package]] +name = "toml_datetime" +version = "1.1.1+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "3165f65f62e28e0115a00b2ebdd37eb6f3b641855f9d636d3cd4103767159ad7" +dependencies = [ + "serde_core", +] + +[[package]] +name = "toml_edit" +version = "0.25.13+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6975367e4d2ef766d86af01ffad14b622fecc8d4357a998fbc4deb6e9bacaf9b" +dependencies = [ + "indexmap 2.14.1", + "toml_datetime", + "toml_parser", + "winnow", +] + +[[package]] +name = "toml_parser" +version = "1.1.3+spec-1.1.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "1d38ac1cf9b95face32296c0a3ede1fdc270627c9d9c02a7274dd6d960dc4d56" +dependencies = [ + "winnow", +] + [[package]] name = "tracing" version = "0.1.44" @@ -3296,6 +3510,18 @@ version = "1.20.1" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "b6f5e870be6c3b371b77fe0ee0bafb859fa4964b4404c27de1d380043c4dda20" +[[package]] +name = "uint" +version = "0.9.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "76f64bba2c53b04fcab63c01a7d7427eadc821e3bc48c34dc9ba29c501164b52" +dependencies = [ + "byteorder", + "crunchy", + "hex", + "static_assertions", +] + [[package]] name = "unarray" version = "0.1.4" @@ -3317,12 +3543,24 @@ dependencies = [ "tinyvec", ] +[[package]] +name = "unicode-segmentation" +version = "1.13.3" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "c6f5d3c3b1bf09027a88a6bc961fc00497d651009560b5463668dc81b0fa87a8" + [[package]] name = "unicode-width" version = "0.1.14" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "7dd6e30e90baa6f72411720665d41d89b9a3d039dc45b8faea1ddd07f617f6af" +[[package]] +name = "unicode-xid" +version = "0.2.6" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "ebc1c04c71510c7f702b52b7c350734c9ff1295c464a03335b00bb84fc54f853" + [[package]] name = "universal-hash" version = "0.5.1" @@ -3686,6 +3924,15 @@ version = "0.52.6" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "589f6da84c646204747d1270a2a5661ea66ed1cced2631d546fdfb155959f9ec" +[[package]] +name = "winnow" +version = "1.0.4" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "23b97319f7b8343df12cc98938e5c3eb436064524c8d2b4e30a1d3a36eecdf81" +dependencies = [ + "memchr", +] + [[package]] name = "wio" version = "0.2.2" @@ -3737,10 +3984,21 @@ dependencies = [ "rayon", "sha2 0.10.9", "subtle", - "zakura-bls12-381", + "zakura-bls12-381 1.2.0", "zakura-pairing", ] +[[package]] +name = "zakura-bls12-381" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "2d9c833a85b5ba3303a5f14ed760d613bee8a9769923da5a1e7f51851849e7f5" +dependencies = [ + "ff", + "rand_core 0.10.1", + "subtle", +] + [[package]] name = "zakura-bls12-381" version = "1.2.0" @@ -3777,7 +4035,7 @@ dependencies = [ "subtle", "zakura-halo2-poseidon", "zakura-halo2-proofs", - "zakura-pasta-curves", + "zakura-pasta-curves 1.2.0", "zakura-sinsemilla", ] @@ -3795,7 +4053,7 @@ dependencies = [ "bitvec", "ff", "group", - "zakura-pasta-curves", + "zakura-pasta-curves 1.2.0", ] [[package]] @@ -3812,7 +4070,7 @@ dependencies = [ "group", "gumdrop", "image", - "maybe-rayon", + "maybe-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "plotters", "proptest", "rand 0.10.2", @@ -3820,7 +4078,33 @@ dependencies = [ "tabbycat", "tracing", "zakura-halo2-legacy-pdqsort", - "zakura-pasta-curves", + "zakura-pasta-curves 1.2.0", +] + +[[package]] +name = "zakura-history" +version = "1.0.0" +dependencies = [ + "assert_matches", + "blake2b_simd", + "corez", + "primitive-types", + "proptest", + "zcash_encoding 0.5.0", +] + +[[package]] +name = "zakura-jubjub" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "4b10077e35b311a780366567771c4730245a4df7bd23b1f3414444b0e5c3a9cd" +dependencies = [ + "bitvec", + "ff", + "group", + "rand_core 0.10.1", + "subtle", + "zakura-bls12-381 1.0.1", ] [[package]] @@ -3835,7 +4119,7 @@ dependencies = [ "rand_core 0.10.1", "rand_xorshift 0.5.0", "subtle", - "zakura-bls12-381", + "zakura-bls12-381 1.2.0", ] [[package]] @@ -3863,11 +4147,11 @@ dependencies = [ "secp256k1", "secrecy", "subtle", - "zakura-jubjub", + "zakura-jubjub 1.2.0", "zakura-orchard", "zakura-sapling-crypto", "zcash_address", - "zcash_encoding", + "zcash_encoding 0.4.0", "zcash_protocol", "zcash_script", "zcash_transparent", @@ -3892,7 +4176,7 @@ dependencies = [ "image", "incrementalmerkletree", "inferno", - "maybe-rayon", + "maybe-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "memuse", "nonempty", "once_cell", @@ -3912,8 +4196,8 @@ dependencies = [ "zakura-halo2-gadgets", "zakura-halo2-poseidon", "zakura-halo2-proofs", - "zakura-pasta-curves", - "zakura-reddsa", + "zakura-pasta-curves 1.2.0", + "zakura-reddsa 1.2.0", "zakura-sinsemilla", "zcash_note_encryption", "zcash_spec", @@ -3927,6 +4211,21 @@ dependencies = [ "group", ] +[[package]] +name = "zakura-pasta-curves" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "6c906d3541e9e6b71aaa77af25c229a0c1ed38df58930fa75f2fd569632989dd" +dependencies = [ + "blake2b_simd", + "ff", + "group", + "once_cell", + "rand 0.10.2", + "static_assertions", + "subtle", +] + [[package]] name = "zakura-pasta-curves" version = "1.2.0" @@ -3939,7 +4238,7 @@ dependencies = [ "ff", "group", "hex", - "maybe-rayon", + "maybe-rayon 0.1.1 (registry+https://github.com/rust-lang/crates.io-index)", "once_cell", "proptest", "rand 0.10.2", @@ -3975,15 +4274,16 @@ dependencies = [ "rand_xorshift 0.5.0", "secp256k1", "sha2 0.10.9", - "zakura-bls12-381", - "zakura-jubjub", + "zakura-bls12-381 1.2.0", + "zakura-jubjub 1.2.0", "zakura-orchard", "zakura-redjubjub", "zakura-sapling-crypto", - "zcash_encoding", + "zcash_encoding 0.4.0", "zcash_note_encryption", "zcash_protocol", "zcash_script", + "zcash_tachyon", "zcash_transparent", "zip32", ] @@ -4004,13 +4304,31 @@ dependencies = [ "wagyu-zcash-parameters", "xdg", "zakura-bellman", - "zakura-bls12-381", - "zakura-jubjub", + "zakura-bls12-381 1.2.0", + "zakura-jubjub 1.2.0", "zakura-primitives", "zakura-redjubjub", "zakura-sapling-crypto", ] +[[package]] +name = "zakura-reddsa" +version = "1.0.1" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "8ecd8e46ef79bd3675733cee6741c432ccd259b9e060e4838d2cc311a654744f" +dependencies = [ + "blake2b_simd", + "frost-rerandomized", + "group", + "hex", + "rand_core 0.10.1", + "serde", + "thiserror 2.0.20", + "zakura-jubjub 1.0.1", + "zakura-pasta-curves 1.0.1", + "zeroize", +] + [[package]] name = "zakura-reddsa" version = "1.2.0" @@ -4032,8 +4350,8 @@ dependencies = [ "serde", "serde_json", "thiserror 2.0.20", - "zakura-jubjub", - "zakura-pasta-curves", + "zakura-jubjub 1.2.0", + "zakura-pasta-curves 1.2.0", "zeroize", ] @@ -4050,7 +4368,7 @@ dependencies = [ "serde", "serde_json", "thiserror 2.0.20", - "zakura-reddsa", + "zakura-reddsa 1.2.0", "zeroize", ] @@ -4083,8 +4401,8 @@ dependencies = [ "subtle", "tracing", "zakura-bellman", - "zakura-bls12-381", - "zakura-jubjub", + "zakura-bls12-381 1.2.0", + "zakura-jubjub 1.2.0", "zakura-redjubjub", "zcash_note_encryption", "zcash_spec", @@ -4099,21 +4417,20 @@ dependencies = [ "group", "once_cell", "subtle", - "zakura-pasta-curves", + "zakura-pasta-curves 1.2.0", ] [[package]] name = "zcash_address" version = "0.13.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "5a854b28c07dba372f4410ea8ad62b4bf7d5c2bf8be32fc4b31bc0db6521a975" +source = "git+https://github.com/zcash/librustzcash.git?rev=c7235b1fc4b4296b8af2e26bf2f6adb24f873f56#c7235b1fc4b4296b8af2e26bf2f6adb24f873f56" dependencies = [ "bech32", "bs58", "corez", "f4jumble", "proptest", - "zcash_encoding", + "zcash_encoding 0.4.0", "zcash_protocol", ] @@ -4128,6 +4445,17 @@ dependencies = [ "nonempty", ] +[[package]] +name = "zcash_encoding" +version = "0.5.0" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "b2871fd3c37eaeb635c815a9c97495553bf8237a481b9f8b37eba661764bf937" +dependencies = [ + "corez", + "hex", + "nonempty", +] + [[package]] name = "zcash_note_encryption" version = "0.4.2" @@ -4143,9 +4471,8 @@ dependencies = [ [[package]] name = "zcash_protocol" -version = "0.10.4" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "043686451284bcb72e40ffa18e2cdcea3108e8468e3d021062c0b32c4a060c98" +version = "0.10.5" +source = "git+https://github.com/zcash/librustzcash.git?rev=c7235b1fc4b4296b8af2e26bf2f6adb24f873f56#c7235b1fc4b4296b8af2e26bf2f6adb24f873f56" dependencies = [ "corez", "document-features", @@ -4154,7 +4481,7 @@ dependencies = [ "incrementalmerkletree-testing", "memuse", "proptest", - "zcash_encoding", + "zcash_encoding 0.4.0", ] [[package]] @@ -4183,11 +4510,27 @@ dependencies = [ "blake2b_simd", ] +[[package]] +name = "zcash_tachyon" +version = "0.0.0" +source = "git+https://github.com/tachyon-zcash/tachyon?rev=2dc7010c3e7771c539fd1c03a06bc6be1a7316c7#2dc7010c3e7771c539fd1c03a06bc6be1a7316c7" +dependencies = [ + "blake2b_simd", + "corez", + "derive_more", + "ff", + "group", + "lazy_static", + "ragu", + "rand_core 0.10.1", + "zakura-pasta-curves 1.0.1", + "zakura-reddsa 1.0.1", +] + [[package]] name = "zcash_transparent" version = "0.10.0" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "547c012778bae17f58007731af074d638aa146ab0ecfc120adebf23d049aff6c" +source = "git+https://github.com/zcash/librustzcash.git?rev=c7235b1fc4b4296b8af2e26bf2f6adb24f873f56#c7235b1fc4b4296b8af2e26bf2f6adb24f873f56" dependencies = [ "bip32", "bs58", @@ -4202,7 +4545,7 @@ dependencies = [ "sha2 0.10.9", "subtle", "zcash_address", - "zcash_encoding", + "zcash_encoding 0.4.0", "zcash_protocol", "zcash_script", "zcash_spec", diff --git a/Cargo.toml b/Cargo.toml index 79c26e2b..97bbabd5 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -29,6 +29,7 @@ # pasta_curves dependency that drags in the Sapling-side crates). # - zcash_primitives, zcash_keys: the librustzcash members Zakura consumes # that depend on the crates above. +# - zcash_history: the independent librustzcash history-tree fork Zakura consumes. [workspace] # Resolver 3 is resolver 2 plus MSRV-aware version selection: `cargo update` @@ -52,6 +53,7 @@ members = [ "crates/redjubjub", "crates/sapling-crypto", "crates/sinsemilla", + "crates/zcash_history", "crates/zcash_keys", "crates/zcash_primitives", "crates/zcash_proofs", @@ -97,6 +99,7 @@ reddsa = { package = "zakura-reddsa", version = "1.2.0", path = "crates/reddsa", redjubjub = { package = "zakura-redjubjub", version = "1.2.0", path = "crates/redjubjub", default-features = false } sapling = { package = "zakura-sapling-crypto", version = "1.2.0", path = "crates/sapling-crypto", default-features = false } sinsemilla = { package = "zakura-sinsemilla", version = "1.2.0", path = "crates/sinsemilla", default-features = false } +zcash_history = { package = "zakura-history", version = "1.0.0", path = "crates/zcash_history", default-features = false } zcash_keys = { package = "zakura-keys", version = "1.2.0", path = "crates/zcash_keys", default-features = false } zcash_primitives = { package = "zakura-primitives", version = "1.2.0", path = "crates/zcash_primitives", default-features = false } zcash_proofs = { package = "zakura-proofs", version = "1.2.0", path = "crates/zcash_proofs", default-features = false } diff --git a/README.md b/README.md index 81ebbb0d..180a8890 100644 --- a/README.md +++ b/README.md @@ -7,6 +7,10 @@ This repository contains the Zakura Common libraries: the foundational Rust crat - [`zakura-primitives`](crates/zcash_primitives) (forked from [`zcash_primitives 0.30.0`](https://github.com/zcash/librustzcash/tree/57b844dc00bf1f25254b5859b8d5faa8e5730f98/zcash_primitives)) - [`zakura-keys`](crates/zcash_keys) (forked from [`zcash_keys 0.16.1`](https://github.com/zcash/librustzcash/tree/cb356a7def26d0bd8e1f21709951aeea137f58fa/zcash_keys)) +## Chain history + +- [`zakura-history`](crates/zcash_history) (forked from [`zcash_history 0.6.0`](https://github.com/zcash/librustzcash/tree/b74429f9e4e3600c27492f1d936fb3b9c818c224/zcash_history)) + ## Shielded protocols - [`zakura-orchard`](crates/orchard) (forked from [`orchard 0.15.5`](https://github.com/zcash/orchard/tree/29d1d55db62153dcaeef8ef631c8991c53ed1248)) diff --git a/crates/zcash_history/CHANGELOG.md b/crates/zcash_history/CHANGELOG.md new file mode 100644 index 00000000..3f10c7ac --- /dev/null +++ b/crates/zcash_history/CHANGELOG.md @@ -0,0 +1,37 @@ +# Changelog + +All notable changes to this crate will be documented in this file. + +The format is based on [Keep a Changelog](https://keepachangelog.com/en/1.0.0/), +and this crate adheres to Rust's notion of +[Semantic Versioning](https://semver.org/spec/v2.0.0.html). Entries describe +the crate's public API and observable behavior from a consumer's perspective; +internal implementation details are not tracked here. + +## [Unreleased] + +### Added + +- Added experimental `zcash_history::{NodeDataV4, V4}` support behind + `zcash_unstable="nutachyon"`. V4 history nodes commit to the start and end + Tachyon anchors and the number of transactions containing Tachyon bundles. + +### Changed + +- Renamed the package from `zcash_history` to `zakura-history`; the library + target keeps its original name, so existing `use` paths compile unchanged. +- Raised the minimum supported Rust version from 1.88 to 1.91. + +## Record of Fork + +`zakura-history` began as a fork of the `zcash_history` crate and has been +developed independently in this repository since. This changelog starts at the +fork point: history up to that point is documented in the repository the code +was forked from, and this crate's version lineage restarted at `1.0.0` rather +than continuing the original `0.6.0` numbering. + +- Forked from: `zcash_history 0.6.0`, published from + [zcash/librustzcash](https://github.com/zcash/librustzcash) at commit + [`b74429f9`](https://github.com/zcash/librustzcash/commit/b74429f9e4e3600c27492f1d936fb3b9c818c224). +- Imported into this repository in commit + [`7ea249e8`](https://github.com/zakura-core/common/commit/7ea249e84c58ff1b56c82c27cd3050a5dc2be764). diff --git a/crates/zcash_history/COPYRIGHT b/crates/zcash_history/COPYRIGHT new file mode 100644 index 00000000..bb8c4e7d --- /dev/null +++ b/crates/zcash_history/COPYRIGHT @@ -0,0 +1,14 @@ +Copyrights in the "zcash_history" library are retained by their contributors. No +copyright assignment is required to contribute to the "zcash_history" library. + +The "zcash_history" library is licensed under either of + + * Apache License, Version 2.0, (see ./LICENSE-APACHE or http://www.apache.org/licenses/LICENSE-2.0) + * MIT license (see ./LICENSE-MIT or http://opensource.org/licenses/MIT) + +at your option. + +Unless you explicitly state otherwise, any contribution intentionally +submitted for inclusion in the work by you, as defined in the Apache-2.0 +license, shall be dual licensed as above, without any additional terms or +conditions. diff --git a/crates/zcash_history/Cargo.toml b/crates/zcash_history/Cargo.toml new file mode 100644 index 00000000..c378f61e --- /dev/null +++ b/crates/zcash_history/Cargo.toml @@ -0,0 +1,37 @@ +[package] +name = "zakura-history" +description = "Library for Zcash blockchain history tools" +keywords = ["blockchain", "history", "zcash"] +categories = ["cryptography::cryptocurrencies"] +version = "1.0.0" +authors.workspace = true +edition.workspace = true +rust-version.workspace = true +repository.workspace = true +license.workspace = true +readme.workspace = true + +[dev-dependencies] +assert_matches = "1.5" +proptest = ">=1,<1.7" + +[dependencies] +primitive-types = { version = "0.12", default-features = false } +blake2b_simd = { version = "1", default-features = false } +corez = { version = "0.1.1", features = ["alloc"], default-features = false } +zcash_encoding = { version = "0.5", default-features = false } +proptest = { version = ">=1,<1.7", optional = true } + +[features] +default = ["std"] +std = ["corez/std", "zcash_encoding/std"] +test-dependencies = ["dep:proptest"] + +[lib] +name = "zcash_history" +bench = false + +[lints.rust.unexpected_cfgs] +level = "warn" +priority = 0 +check-cfg = ['cfg(zcash_unstable, values("nutachyon"))'] diff --git a/crates/zcash_history/examples/lib/main.rs b/crates/zcash_history/examples/lib/main.rs new file mode 100644 index 00000000..980f0d6e --- /dev/null +++ b/crates/zcash_history/examples/lib/main.rs @@ -0,0 +1,2 @@ +// dummy example +pub fn main() {} diff --git a/crates/zcash_history/examples/lib/shared.rs b/crates/zcash_history/examples/lib/shared.rs new file mode 100644 index 00000000..c4f8eeca --- /dev/null +++ b/crates/zcash_history/examples/lib/shared.rs @@ -0,0 +1,86 @@ +use zcash_history::{Entry, EntryLink, NodeData, Tree, V1}; + +pub struct NodeDataIterator { + return_stack: Vec, + tree: Tree, + cursor: usize, + leaf_cursor: usize, +} + +impl Iterator for NodeDataIterator { + type Item = NodeData; + + fn next(&mut self) -> Option { + let result = if self.cursor == 1 { + self.leaf_cursor = 2; + Some(leaf(1)) + } else if self.cursor == 2 { + self.leaf_cursor = 3; + Some(leaf(2)) + } else if self.cursor == 3 { + Some(self.tree.root_node().expect("always exists").data().clone()) + } else if !self.return_stack.is_empty() { + self.return_stack.pop() + } else { + for n_append in self + .tree + .append_leaf(leaf(self.leaf_cursor as u32)) + .expect("full tree cannot fail") + .into_iter() + .rev() + { + self.return_stack.push( + self.tree + .resolve_link(n_append) + .expect("just pushed") + .data() + .clone(), + ) + } + self.leaf_cursor += 1; + self.return_stack.pop() + }; + + self.cursor += 1; + result + } +} + +impl NodeDataIterator { + pub fn new() -> Self { + let root = Entry::new( + NodeData::combine(&leaf(1), &leaf(2)), + EntryLink::Stored(0), + EntryLink::Stored(1), + ); + let tree = Tree::new( + 3, + vec![(2, root)], + vec![(0, Entry::new_leaf(leaf(1))), (1, Entry::new_leaf(leaf(2)))], + ); + + NodeDataIterator { + return_stack: Vec::new(), + tree, + cursor: 1, + leaf_cursor: 1, + } + } +} + +fn leaf(height: u32) -> NodeData { + NodeData { + consensus_branch_id: 0, + subtree_commitment: [0u8; 32], + start_time: height * 10 + 1, + end_time: (height + 1) * 10, + start_target: 100 + height * 10, + end_target: 100 + (height + 1) * 10, + start_sapling_root: [0u8; 32], + end_sapling_root: [0u8; 32], + subtree_total_work: 0.into(), + start_height: height as u64, + end_height: height as u64, + sapling_tx: 5 + height as u64, + } +} diff --git a/crates/zcash_history/examples/long.rs b/crates/zcash_history/examples/long.rs new file mode 100644 index 00000000..0a5599fc --- /dev/null +++ b/crates/zcash_history/examples/long.rs @@ -0,0 +1,113 @@ +use zcash_history::{Entry, EntryLink, NodeData, Tree, V1}; + +#[path = "lib/shared.rs"] +mod share; + +fn draft(into: &mut Vec<(u32, Entry)>, vec: &[NodeData], peak_pos: usize, h: u32) { + let node_data = vec[peak_pos - 1].clone(); + let peak = match h { + 0 => Entry::new_leaf(node_data), + _ => Entry::new( + node_data, + EntryLink::Stored((peak_pos - (1 << h) - 1) as u32), + EntryLink::Stored((peak_pos - 2) as u32), + ), + }; + + println!("Entry #{}: {}", into.len(), peak); + + into.push(((peak_pos - 1) as u32, peak)); +} + +fn prepare_tree(vec: &[NodeData]) -> Tree { + assert!(!vec.is_empty()); + + // integer log2 of (vec.len()+1), -1 + let mut h = (32 - ((vec.len() + 1) as u32).leading_zeros() - 1) - 1; + let mut peak_pos = (1 << (h + 1)) - 1; + let mut nodes = Vec::new(); + + // used later + let mut last_peak_pos = 0; + let mut last_peak_h = 0; + + loop { + if peak_pos > vec.len() { + // left child, -2^h + peak_pos -= 1 << h; + h -= 1; + } + + if peak_pos <= vec.len() { + draft(&mut nodes, vec, peak_pos, h); + + // save to be used in next loop + last_peak_pos = peak_pos; + last_peak_h = h; + + // right sibling + peak_pos = peak_pos + (1 << (h + 1)) - 1; + } + + if h == 0 { + break; + } + } + + // for deletion, everything on the right slope of the last peak should be pre-loaded + let mut extra = Vec::new(); + let mut h = last_peak_h; + let mut peak_pos = last_peak_pos; + + while h > 0 { + let left_pos = peak_pos - (1 << h); + let right_pos = peak_pos - 1; + h -= 1; + + // drafting left child + draft(&mut extra, vec, left_pos, h); + + // drafting right child + draft(&mut extra, vec, right_pos, h); + + // continuing on right slope + peak_pos = right_pos; + } + + println!("Total extra of {} required for deletion!", extra.len()); + + Tree::new(vec.len() as u32, nodes, extra) +} + +fn main() { + let number = match std::env::args().nth(1) { + None => { + eprintln!("writer []"); + std::process::exit(1); + } + Some(number) => number.parse::().expect("invalid number"), + }; + + let long_vec = share::NodeDataIterator::new() + .take(number) + .collect::>(); + + let now = std::time::Instant::now(); + + let tree = prepare_tree(&long_vec); + let elapsed = now.elapsed(); + + println!( + "Tree final root: {}-{}", + tree.root_node().expect("root").data().start_height, + tree.root_node().expect("root").data().end_height, + ); + + println!( + "Prepare tree of {} length: {} ns / {} mcs / {} ms", + number, + elapsed.as_nanos(), + elapsed.as_micros(), + elapsed.as_millis() + ); +} diff --git a/crates/zcash_history/examples/write.rs b/crates/zcash_history/examples/write.rs new file mode 100644 index 00000000..466ae18d --- /dev/null +++ b/crates/zcash_history/examples/write.rs @@ -0,0 +1,44 @@ +#[path = "lib/shared.rs"] +mod share; + +// Test data generator +// $ cargo run --example writer -- 16 nodes.dat +// or +// $ cargo run --example writer -- 16 +// to preview + +fn main() { + let mut args = std::env::args().skip(1); + + let (number, out_file) = match args.next() { + None => { + eprintln!("writer []"); + std::process::exit(1); + } + Some(number) => ( + number.parse::().expect("invalid number"), + args.next(), + ), + }; + + let iterator = share::NodeDataIterator::new().take(number); + + if let Some(out_file_path) = out_file { + use std::io::Write; + + let mut buf = Vec::new(); + + for node in iterator { + node.write(&mut buf).expect("Failed to write data"); + } + + let mut file = std::fs::File::create(out_file_path).expect("Failed to create output file"); + + file.write_all(&buf[..]) + .expect("Failed to write data to file"); + } else { + for n in iterator { + println!("{n:?}"); + } + } +} diff --git a/crates/zcash_history/src/entry.rs b/crates/zcash_history/src/entry.rs new file mode 100644 index 00000000..76980d46 --- /dev/null +++ b/crates/zcash_history/src/entry.rs @@ -0,0 +1,137 @@ +use crate::{EntryKind, EntryLink, Error, MAX_NODE_DATA_SIZE, Version}; + +/// Max serialized length of entry data. +pub const MAX_ENTRY_SIZE: usize = MAX_NODE_DATA_SIZE + 9; + +/// MMR Entry. +#[derive(Debug)] +pub struct Entry { + pub(crate) kind: EntryKind, + pub(crate) data: V::NodeData, +} + +impl Entry { + /// New entry of type node. + pub fn new(data: V::NodeData, left: EntryLink, right: EntryLink) -> Self { + Entry { + kind: EntryKind::Node(left, right), + data, + } + } + + /// Returns the data associated with this node. + pub fn data(&self) -> &V::NodeData { + &self.data + } + + /// Creates a new leaf. + pub fn new_leaf(data: V::NodeData) -> Self { + Entry { + kind: EntryKind::Leaf, + data, + } + } + + /// Returns if is this node complete (has total of 2^N leaves) + pub fn complete(&self) -> bool { + self.leaf_count().is_power_of_two() + } + + /// Number of leaves under this node. + /// + /// # Panics + /// + /// Panics if this entry was constructed with a descending height range or + /// a range containing more leaves than can be represented by a `u64`. + /// Entries produced by [`Self::read`] are validated against these cases. + pub fn leaf_count(&self) -> u64 { + V::end_height(&self.data) + .checked_sub(V::start_height(&self.data)) + .and_then(|height_diff| height_diff.checked_add(1)) + .expect("entry height range must contain a representable number of leaves") + } + + /// Is this node a leaf. + pub fn leaf(&self) -> bool { + matches!(self.kind, EntryKind::Leaf) + } + + /// Left child + pub fn left(&self) -> Result { + match self.kind { + EntryKind::Leaf => Err(Error::node_expected()), + EntryKind::Node(left, _) => Ok(left), + } + } + + /// Right child. + pub fn right(&self) -> Result { + match self.kind { + EntryKind::Leaf => Err(Error::node_expected()), + EntryKind::Node(_, right) => Ok(right), + } + } + + /// Read from byte representation. + pub fn read( + consensus_branch_id: u32, + r: &mut R, + ) -> corez::io::Result { + let kind = { + let mut byte = [0u8; 1]; + r.read_exact(&mut byte)?; + match byte[0] { + 0 => { + let mut buf = [0u8; 4]; + r.read_exact(&mut buf)?; + let left = u32::from_le_bytes(buf); + r.read_exact(&mut buf)?; + let right = u32::from_le_bytes(buf); + EntryKind::Node(EntryLink::Stored(left), EntryLink::Stored(right)) + } + 1 => EntryKind::Leaf, + _ => return Err(corez::io::Error::from(corez::io::ErrorKind::InvalidData)), + } + }; + + let data = V::read(consensus_branch_id, r)?; + + Ok(Entry { kind, data }) + } + + /// Write to byte representation. + pub fn write(&self, w: &mut W) -> corez::io::Result<()> { + match self.kind { + EntryKind::Node(EntryLink::Stored(left), EntryLink::Stored(right)) => { + w.write_all(&[0])?; + w.write_all(&left.to_le_bytes())?; + w.write_all(&right.to_le_bytes())?; + } + EntryKind::Leaf => { + w.write_all(&[1])?; + } + _ => { + return Err(corez::io::Error::from(corez::io::ErrorKind::InvalidData)); + } + } + + V::write(&self.data, w)?; + + Ok(()) + } + + /// Convert from byte representation. + pub fn from_bytes>(consensus_branch_id: u32, buf: T) -> corez::io::Result { + let mut cursor = corez::io::Cursor::new(buf); + Self::read(consensus_branch_id, &mut cursor) + } +} + +impl core::fmt::Display for Entry { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match self.kind { + EntryKind::Node(l, r) => write!(f, "node({l}, {r}, ..)"), + EntryKind::Leaf => write!(f, "leaf(..)"), + } + } +} diff --git a/crates/zcash_history/src/lib.rs b/crates/zcash_history/src/lib.rs new file mode 100644 index 00000000..3e86151d --- /dev/null +++ b/crates/zcash_history/src/lib.rs @@ -0,0 +1,92 @@ +//! To be used in Zebra. Originally also consumed by zcashd via FFI bindings, +//! which reached End-of-Support in July 2026. + +#![no_std] +// Catch documentation errors caused by code changes. +#![deny(rustdoc::broken_intra_doc_links)] +#![warn(missing_docs)] + +#[macro_use] +extern crate alloc; + +mod entry; +mod node_data; +mod tree; +mod version; + +#[cfg(test)] +mod test_vectors; + +pub use entry::{Entry, MAX_ENTRY_SIZE}; +#[cfg(zcash_unstable = "nutachyon")] +pub use node_data::V4 as NodeDataV4; +pub use node_data::{MAX_NODE_DATA_SIZE, NodeData, V2 as NodeDataV2, V3 as NodeDataV3}; +pub use tree::Tree; +#[cfg(zcash_unstable = "nutachyon")] +pub use version::V4; +pub use version::{V1, V2, V3, Version}; + +/// Crate-level error type +#[derive(Debug)] +pub enum Error { + /// Entry expected to be presented in the tree view while it was not. + ExpectedInMemory(EntryLink), + /// Entry expected to be a node (specifying for which link this is not true). + ExpectedNode(Option), +} + +impl core::fmt::Display for Error { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match *self { + Self::ExpectedInMemory(l) => write!(f, "Node/leaf expected to be in memory: {l}"), + Self::ExpectedNode(None) => write!(f, "Node expected"), + Self::ExpectedNode(Some(l)) => write!(f, "Node expected, not leaf: {l}"), + } + } +} + +/// Reference to the tree node. +#[derive(Clone, Copy, Debug)] +pub enum EntryLink { + /// Reference to the stored (in the array representation) leaf/node. + Stored(u32), + /// Reference to the generated leaf/node. + Generated(u32), +} + +impl core::fmt::Display for EntryLink { + fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result { + match *self { + Self::Stored(v) => write!(f, "stored({v})"), + Self::Generated(v) => write!(f, "generated({v})"), + } + } +} + +/// MMR Node. It is leaf when `left`, `right` are `None` and node when they are not. +#[derive(Debug)] +pub enum EntryKind { + /// Leaf entry. + Leaf, + /// Node entry with children links. + Node(EntryLink, EntryLink), +} + +impl Error { + /// Entry expected to be a node (specifying for which link this is not true). + pub fn link_node_expected(link: EntryLink) -> Self { + Self::ExpectedNode(Some(link)) + } + + /// Some entry is expected to be node + pub fn node_expected() -> Self { + Self::ExpectedNode(None) + } + + pub(crate) fn augment(self, link: EntryLink) -> Self { + match self { + Error::ExpectedNode(_) => Error::ExpectedNode(Some(link)), + val => val, + } + } +} diff --git a/crates/zcash_history/src/node_data.rs b/crates/zcash_history/src/node_data.rs new file mode 100644 index 00000000..eb05b90f --- /dev/null +++ b/crates/zcash_history/src/node_data.rs @@ -0,0 +1,856 @@ +use alloc::vec::Vec; + +use primitive_types::U256; +use zcash_encoding::CompactSize; + +use crate::Version; + +/// Maximum serialized size of the node metadata. +pub const MAX_NODE_DATA_SIZE: usize = 32 + // subtree commitment + 4 + // start time + 4 + // end time + 4 + // start target + 4 + // end target + 32 + // start sapling tree root + 32 + // end sapling tree root + 32 + // subtree total work + 9 + // start height (compact uint) + 9 + // end height (compact uint) + 9 + // Sapling tx count (compact uint) + 32 + // start Orchard tree root + 32 + // end Orchard tree root + 9 + // Orchard tx count (compact uint) + 32 + // start Ironwood tree root + 32 + // end Ironwood tree root + 9 + // Ironwood tx count (compact uint) + if cfg!(zcash_unstable = "nutachyon") { + 32 + // start Tachyon anchor + 32 + // end Tachyon anchor + 9 // Tachyon tx count (compact uint) + } else { + 0 + }; + +/// V1 node metadata. +#[repr(C)] +#[derive(Debug, Clone, Default)] +#[cfg_attr(test, derive(PartialEq, Eq))] +pub struct NodeData { + /// Consensus branch id, should be provided by deserializing node. + pub consensus_branch_id: u32, + /// Subtree commitment - either block hash for leaves or hashsum of children for nodes. + pub subtree_commitment: [u8; 32], + /// Start time. + pub start_time: u32, + /// End time. + pub end_time: u32, + /// Start target. + pub start_target: u32, + /// End target. + pub end_target: u32, + /// Start sapling tree root. + pub start_sapling_root: [u8; 32], + /// End sapling tree root. + pub end_sapling_root: [u8; 32], + /// Part of tree total work. + pub subtree_total_work: U256, + /// Start height. + pub start_height: u64, + /// End height + pub end_height: u64, + /// Number of Sapling transactions. + pub sapling_tx: u64, +} + +impl NodeData { + /// Combine two nodes metadata. + pub fn combine(left: &NodeData, right: &NodeData) -> NodeData { + crate::V1::combine(left, right) + } + + pub(crate) fn combine_inner( + subtree_commitment: [u8; 32], + left: &NodeData, + right: &NodeData, + ) -> NodeData { + NodeData { + consensus_branch_id: left.consensus_branch_id, + subtree_commitment, + start_time: left.start_time, + end_time: right.end_time, + start_target: left.start_target, + end_target: right.end_target, + start_sapling_root: left.start_sapling_root, + end_sapling_root: right.end_sapling_root, + subtree_total_work: left.subtree_total_work + right.subtree_total_work, + start_height: left.start_height, + end_height: right.end_height, + sapling_tx: left.sapling_tx + right.sapling_tx, + } + } + + /// Write to the byte representation. + pub fn write(&self, w: &mut W) -> corez::io::Result<()> { + w.write_all(&self.subtree_commitment)?; + w.write_all(&self.start_time.to_le_bytes())?; + w.write_all(&self.end_time.to_le_bytes())?; + w.write_all(&self.start_target.to_le_bytes())?; + w.write_all(&self.end_target.to_le_bytes())?; + w.write_all(&self.start_sapling_root)?; + w.write_all(&self.end_sapling_root)?; + + let mut work_buf = [0u8; 32]; + self.subtree_total_work.to_little_endian(&mut work_buf[..]); + w.write_all(&work_buf)?; + + CompactSize::write_unbounded(&mut *w, self.start_height)?; + CompactSize::write_unbounded(&mut *w, self.end_height)?; + CompactSize::write_unbounded(&mut *w, self.sapling_tx)?; + Ok(()) + } + + /// Read from the byte representation. + /// + /// # Errors + /// + /// Returns [`corez::io::ErrorKind::InvalidData`] if a compact-encoded field + /// uses a non-canonical encoding, or if the encoded height range is + /// descending or contains more blocks than can be represented by a `u64`. + pub fn read( + consensus_branch_id: u32, + r: &mut R, + ) -> corez::io::Result { + let mut data = NodeData { + consensus_branch_id, + ..Default::default() + }; + r.read_exact(&mut data.subtree_commitment)?; + let mut buf = [0u8; 4]; + r.read_exact(&mut buf)?; + data.start_time = u32::from_le_bytes(buf); + r.read_exact(&mut buf)?; + data.end_time = u32::from_le_bytes(buf); + r.read_exact(&mut buf)?; + data.start_target = u32::from_le_bytes(buf); + r.read_exact(&mut buf)?; + data.end_target = u32::from_le_bytes(buf); + r.read_exact(&mut data.start_sapling_root)?; + r.read_exact(&mut data.end_sapling_root)?; + + let mut work_buf = [0u8; 32]; + r.read_exact(&mut work_buf)?; + data.subtree_total_work = U256::from_little_endian(&work_buf); + + data.start_height = CompactSize::read_unbounded(&mut *r)?; + data.end_height = CompactSize::read_unbounded(&mut *r)?; + if data + .end_height + .checked_sub(data.start_height) + .and_then(|height_diff| height_diff.checked_add(1)) + .is_none() + { + return Err(corez::io::Error::new( + corez::io::ErrorKind::InvalidData, + "history node height range does not contain a representable number of blocks", + )); + } + data.sapling_tx = CompactSize::read_unbounded(&mut *r)?; + + Ok(data) + } + + /// Convert to byte representation. + pub fn to_bytes(&self) -> Vec { + crate::V1::to_bytes(self) + } + + /// Convert from byte representation. + /// + /// # Errors + /// + /// Returns [`corez::io::ErrorKind::InvalidData`] if a compact-encoded field + /// uses a non-canonical encoding, or if the encoded height range is + /// descending or contains more blocks than can be represented by a `u64`. + pub fn from_bytes>(consensus_branch_id: u32, buf: T) -> corez::io::Result { + crate::V1::from_bytes(consensus_branch_id, buf) + } + + /// Hash node metadata + pub fn hash(&self) -> [u8; 32] { + crate::V1::hash(self) + } +} + +/// V2 node metadata. +#[derive(Debug, Clone, Default)] +#[cfg_attr(test, derive(PartialEq, Eq))] +pub struct V2 { + /// The V1 node data retained in V2. + pub v1: NodeData, + /// Start Orchard tree root. + pub start_orchard_root: [u8; 32], + /// End Orchard tree root. + pub end_orchard_root: [u8; 32], + /// Number of Orchard transactions. + pub orchard_tx: u64, +} + +impl V2 { + pub(crate) fn combine_inner(subtree_commitment: [u8; 32], left: &V2, right: &V2) -> V2 { + V2 { + v1: NodeData::combine_inner(subtree_commitment, &left.v1, &right.v1), + start_orchard_root: left.start_orchard_root, + end_orchard_root: right.end_orchard_root, + orchard_tx: left.orchard_tx + right.orchard_tx, + } + } + + /// Write to the byte representation. + pub fn write(&self, w: &mut W) -> corez::io::Result<()> { + self.v1.write(w)?; + w.write_all(&self.start_orchard_root)?; + w.write_all(&self.end_orchard_root)?; + CompactSize::write_unbounded(&mut *w, self.orchard_tx)?; + Ok(()) + } + + /// Read from the byte representation. + pub fn read( + consensus_branch_id: u32, + r: &mut R, + ) -> corez::io::Result { + let mut data = V2 { + v1: NodeData::read(consensus_branch_id, r)?, + ..Default::default() + }; + r.read_exact(&mut data.start_orchard_root)?; + r.read_exact(&mut data.end_orchard_root)?; + data.orchard_tx = CompactSize::read_unbounded(&mut *r)?; + + Ok(data) + } +} + +/// V3 node metadata. +/// +/// This extends the NU5 history node format with metadata for the Ironwood shielded +/// pool. Ironwood uses an Orchard-shaped note commitment tree, but is represented as a +/// distinct pool in chain history. +#[derive(Debug, Clone, Default)] +#[cfg_attr(test, derive(PartialEq, Eq))] +pub struct V3 { + /// The V2 node data retained in V3. + pub v2: V2, + /// Ironwood tree root at the start of this node's interval. + /// + /// Leaf nodes represent a single block, so their start and end roots are both + /// the final Ironwood note commitment tree root after the corresponding block. + /// Internal nodes carry the start root from their leftmost leaf. + pub start_ironwood_root: [u8; 32], + /// Ironwood tree root at the end of this node's interval. + /// + /// Leaf nodes represent a single block, so their start and end roots are both + /// the final Ironwood note commitment tree root after the corresponding block. + /// Internal nodes carry the end root from their rightmost leaf. + pub end_ironwood_root: [u8; 32], + /// Number of transactions containing an Ironwood bundle. + pub ironwood_tx: u64, +} + +impl V3 { + pub(crate) fn combine_inner(subtree_commitment: [u8; 32], left: &V3, right: &V3) -> V3 { + V3 { + v2: V2::combine_inner(subtree_commitment, &left.v2, &right.v2), + start_ironwood_root: left.start_ironwood_root, + end_ironwood_root: right.end_ironwood_root, + ironwood_tx: left.ironwood_tx + right.ironwood_tx, + } + } + + /// Write to the byte representation. + pub fn write(&self, w: &mut W) -> corez::io::Result<()> { + self.v2.write(w)?; + w.write_all(&self.start_ironwood_root)?; + w.write_all(&self.end_ironwood_root)?; + CompactSize::write_unbounded(&mut *w, self.ironwood_tx)?; + Ok(()) + } + + /// Read from the byte representation. + pub fn read( + consensus_branch_id: u32, + r: &mut R, + ) -> corez::io::Result { + let mut data = V3 { + v2: V2::read(consensus_branch_id, r)?, + ..Default::default() + }; + r.read_exact(&mut data.start_ironwood_root)?; + r.read_exact(&mut data.end_ironwood_root)?; + data.ironwood_tx = CompactSize::read_unbounded(&mut *r)?; + + Ok(data) + } +} + +/// V4 node metadata. +/// +/// This extends the NU6.3 history node format with metadata for the Tachyon +/// shielded pool. Tachyon has no note commitment tree; its pool state is a +/// running anchor, so the anchor takes the place a tree root has for the other +/// pools. +#[cfg(zcash_unstable = "nutachyon")] +#[derive(Debug, Clone, Default)] +#[cfg_attr(test, derive(PartialEq, Eq))] +pub struct V4 { + /// The V3 node data retained in V4. + pub v3: V3, + /// Tachyon anchor at the start of this node's interval. + pub start_tachyon_anchor: [u8; 32], + /// Tachyon anchor at the end of this node's interval. + pub end_tachyon_anchor: [u8; 32], + /// Number of transactions containing a Tachyon bundle. + pub tachyon_tx: u64, +} + +#[cfg(zcash_unstable = "nutachyon")] +impl V4 { + pub(crate) fn combine_inner(subtree_commitment: [u8; 32], left: &V4, right: &V4) -> V4 { + V4 { + v3: V3::combine_inner(subtree_commitment, &left.v3, &right.v3), + start_tachyon_anchor: left.start_tachyon_anchor, + end_tachyon_anchor: right.end_tachyon_anchor, + tachyon_tx: left.tachyon_tx + right.tachyon_tx, + } + } + + /// Write to the byte representation. + pub fn write(&self, w: &mut W) -> corez::io::Result<()> { + self.v3.write(w)?; + w.write_all(&self.start_tachyon_anchor)?; + w.write_all(&self.end_tachyon_anchor)?; + CompactSize::write_unbounded(&mut *w, self.tachyon_tx)?; + Ok(()) + } + + /// Read from the byte representation. + pub fn read( + consensus_branch_id: u32, + r: &mut R, + ) -> corez::io::Result { + let mut data = V4 { + v3: V3::read(consensus_branch_id, r)?, + ..Default::default() + }; + r.read_exact(&mut data.start_tachyon_anchor)?; + r.read_exact(&mut data.end_tachyon_anchor)?; + data.tachyon_tx = CompactSize::read_unbounded(&mut *r)?; + + Ok(data) + } +} + +#[cfg(any(test, feature = "test-dependencies"))] +pub mod testing { + use primitive_types::U256; + use proptest::array::uniform32; + use proptest::prelude::{any, prop_compose}; + + use super::NodeData; + + prop_compose! { + pub fn arb_node_data()( + subtree_commitment in uniform32(any::()), + start_time in any::(), + end_time in any::(), + start_target in any::(), + end_target in any::(), + start_sapling_root in uniform32(any::()), + end_sapling_root in uniform32(any::()), + subtree_total_work in uniform32(any::()), + start_height in any::(), + end_height in any::(), + sapling_tx in any::(), + ) -> NodeData { + NodeData { + consensus_branch_id: 0, + subtree_commitment, + start_time, + end_time, + start_target, + end_target, + start_sapling_root, + end_sapling_root, + subtree_total_work: U256::from_little_endian(&subtree_total_work[..]), + start_height, + end_height, + sapling_tx + } + } + } +} + +#[cfg(test)] +mod tests { + use alloc::vec::Vec; + + use super::testing::arb_node_data; + use proptest::prelude::*; + + use primitive_types::U256; + + #[cfg(zcash_unstable = "nutachyon")] + use crate::V4 as HistoryV4; + use crate::{ + Entry, EntryLink, MAX_ENTRY_SIZE, V1 as HistoryV1, V2 as HistoryV2, V3 as HistoryV3, + Version, + }; + + #[cfg(zcash_unstable = "nutachyon")] + use super::V4; + use super::{MAX_NODE_DATA_SIZE, NodeData, V2, V3}; + + fn node_data(start_height: u64, end_height: u64) -> NodeData { + NodeData { + consensus_branch_id: 1, + subtree_commitment: [1; 32], + start_time: 2, + end_time: 3, + start_target: 4, + end_target: 5, + start_sapling_root: [6; 32], + end_sapling_root: [7; 32], + subtree_total_work: U256::from(8u64), + start_height, + end_height, + sapling_tx: 9, + } + } + + fn node_data_v2(start_height: u64, end_height: u64) -> V2 { + V2 { + v1: node_data(start_height, end_height), + start_orchard_root: [10; 32], + end_orchard_root: [11; 32], + orchard_tx: 12, + } + } + + fn node_data_v3(start_height: u64, end_height: u64) -> V3 { + V3 { + v2: node_data_v2(start_height, end_height), + start_ironwood_root: [13; 32], + end_ironwood_root: [14; 32], + ironwood_tx: 15, + } + } + + #[cfg(zcash_unstable = "nutachyon")] + fn node_data_v4(start_height: u64, end_height: u64) -> V4 { + V4 { + v3: node_data_v3(start_height, end_height), + start_tachyon_anchor: [16; 32], + end_tachyon_anchor: [17; 32], + tachyon_tx: 18, + } + } + + fn max_node_data() -> NodeData { + NodeData { + consensus_branch_id: u32::MAX, + subtree_commitment: [1; 32], + start_time: u32::MAX, + end_time: u32::MAX, + start_target: u32::MAX, + end_target: u32::MAX, + start_sapling_root: [2; 32], + end_sapling_root: [3; 32], + subtree_total_work: U256::MAX, + start_height: u64::MAX, + end_height: u64::MAX, + sapling_tx: u64::MAX, + } + } + + fn max_node_data_v2() -> V2 { + V2 { + v1: max_node_data(), + start_orchard_root: [4; 32], + end_orchard_root: [5; 32], + orchard_tx: u64::MAX, + } + } + + fn max_node_data_v3() -> V3 { + V3 { + v2: max_node_data_v2(), + start_ironwood_root: [6; 32], + end_ironwood_root: [7; 32], + ironwood_tx: u64::MAX, + } + } + + #[cfg(zcash_unstable = "nutachyon")] + fn max_node_data_v4() -> V4 { + V4 { + v3: max_node_data_v3(), + start_tachyon_anchor: [8; 32], + end_tachyon_anchor: [9; 32], + tachyon_tx: u64::MAX, + } + } + + fn v1_fixture_bytes() -> Vec { + let mut expected = vec![]; + expected.extend_from_slice(&[1; 32]); + expected.extend_from_slice(&2u32.to_le_bytes()); + expected.extend_from_slice(&3u32.to_le_bytes()); + expected.extend_from_slice(&4u32.to_le_bytes()); + expected.extend_from_slice(&5u32.to_le_bytes()); + expected.extend_from_slice(&[6; 32]); + expected.extend_from_slice(&[7; 32]); + expected.extend_from_slice(&8u64.to_le_bytes()); + expected.extend_from_slice(&[0; 24]); + expected.push(1); + expected.push(2); + expected.push(9); + expected + } + + fn v2_fixture_bytes() -> Vec { + let mut expected = v1_fixture_bytes(); + expected.extend_from_slice(&[10; 32]); + expected.extend_from_slice(&[11; 32]); + expected.push(12); + expected + } + + fn v3_fixture_bytes() -> Vec { + let mut expected = v2_fixture_bytes(); + expected.extend_from_slice(&[13; 32]); + expected.extend_from_slice(&[14; 32]); + expected.push(15); + expected + } + + #[cfg(zcash_unstable = "nutachyon")] + fn v4_fixture_bytes() -> Vec { + let mut expected = v3_fixture_bytes(); + expected.extend_from_slice(&[16; 32]); + expected.extend_from_slice(&[17; 32]); + expected.push(18); + expected + } + + proptest! { + #[test] + fn serialization_round_trip(node_data in arb_node_data()) { + let decoded = NodeData::from_bytes(0, node_data.to_bytes()); + let leaf_count = node_data + .end_height + .checked_sub(node_data.start_height) + .and_then(|height_diff| height_diff.checked_add(1)); + + if leaf_count.is_some() { + prop_assert_eq!(decoded.unwrap(), node_data); + } else { + prop_assert_eq!( + decoded.unwrap_err().kind(), + corez::io::ErrorKind::InvalidData + ); + } + } + } + + #[test] + fn genesis_height_round_trip() { + let node_data = NodeData { + start_height: 0, + end_height: 0, + ..Default::default() + }; + let entry = Entry::::new_leaf(node_data); + let mut encoded = vec![]; + entry.write(&mut encoded).unwrap(); + + assert_eq!( + Entry::::from_bytes(0, encoded) + .unwrap() + .leaf_count(), + 1 + ); + } + + #[test] + fn zero_start_height_combined_node_round_trip() { + // Regtest scenario: Heartwood activates at height 0, so the genesis + // leaf has start_height == 0. When two leaves are combined into a + // node spanning heights 0..=1, leaf_count() must not underflow. + let left = Entry::::new_leaf(node_data(0, 0)); + let right = Entry::::new_leaf(node_data(1, 1)); + let combined = HistoryV1::combine(left.data(), right.data()); + let entry = Entry::::new(combined, EntryLink::Stored(0), EntryLink::Stored(1)); + let mut encoded = vec![]; + entry.write(&mut encoded).unwrap(); + + let decoded = Entry::::from_bytes(0, encoded).unwrap(); + assert_eq!(decoded.leaf_count(), 2); + assert!(decoded.complete()); + } + + #[test] + fn invalid_height_ranges_are_rejected() { + for (start_height, end_height) in [ + // Descending ranges. + (200, 5), + (u64::MAX, 5), + // Ascending, but the leaf count overflows a `u64`. + (0, u64::MAX), + ] { + let node_data = NodeData { + start_height, + end_height, + ..Default::default() + }; + let entry = Entry::::new_leaf(node_data); + let mut encoded = vec![]; + entry.write(&mut encoded).unwrap(); + let error = match Entry::::from_bytes(0, encoded) { + Ok(_) => panic!("invalid height range was accepted"), + Err(error) => error, + }; + + assert_eq!(error.kind(), corez::io::ErrorKind::InvalidData); + } + } + + #[test] + fn v1_and_v2_serialization_fixtures_are_stable() { + assert_eq!(HistoryV1::to_bytes(&node_data(1, 2)), v1_fixture_bytes()); + assert_eq!(HistoryV2::to_bytes(&node_data_v2(1, 2)), v2_fixture_bytes()); + } + + #[test] + fn v3_serialization_round_trip() { + let node_data = node_data_v3(1, 2); + + assert_eq!( + HistoryV3::from_bytes(1, v3_fixture_bytes()).unwrap(), + node_data + ); + assert_eq!(HistoryV3::to_bytes(&node_data), v3_fixture_bytes()); + } + + #[cfg(zcash_unstable = "nutachyon")] + #[test] + fn v4_serialization_round_trip() { + let node_data = node_data_v4(1, 2); + + assert_eq!( + HistoryV4::from_bytes(1, v4_fixture_bytes()).unwrap(), + node_data + ); + assert_eq!(HistoryV4::to_bytes(&node_data), v4_fixture_bytes()); + } + + #[test] + fn max_serialized_sizes_cover_all_versions() { + // ZIP 221 specifies that history nodes are at most 171 bytes before NU5 + // and 244 bytes after NU5; those bounds require the compact-encoded + // fields to span the full `u64` range (a 9-byte compact encoding each). + assert_eq!(HistoryV1::to_bytes(&max_node_data()).len(), 171); + assert_eq!(HistoryV2::to_bytes(&max_node_data_v2()).len(), 244); + let max_v3_bytes = HistoryV3::to_bytes(&max_node_data_v3()); + assert_eq!(max_v3_bytes.len(), 317); + assert_eq!( + HistoryV3::from_bytes(u32::MAX, &max_v3_bytes).unwrap(), + max_node_data_v3() + ); + + #[cfg(not(zcash_unstable = "nutachyon"))] + let entry = { + assert_eq!(MAX_NODE_DATA_SIZE, 317); + Entry::::new( + max_node_data_v3(), + EntryLink::Stored(u32::MAX), + EntryLink::Stored(u32::MAX), + ) + }; + + #[cfg(zcash_unstable = "nutachyon")] + let entry = { + let max_v4_bytes = HistoryV4::to_bytes(&max_node_data_v4()); + assert_eq!(max_v4_bytes.len(), MAX_NODE_DATA_SIZE); + assert_eq!( + HistoryV4::from_bytes(u32::MAX, &max_v4_bytes).unwrap(), + max_node_data_v4() + ); + assert_eq!(MAX_NODE_DATA_SIZE, 390); + Entry::::new( + max_node_data_v4(), + EntryLink::Stored(u32::MAX), + EntryLink::Stored(u32::MAX), + ) + }; + + let mut encoded = vec![]; + entry.write(&mut encoded).unwrap(); + assert_eq!(encoded.len(), MAX_ENTRY_SIZE); + } + + #[cfg(zcash_unstable = "nutachyon")] + #[test] + fn v4_combine_tracks_tachyon_fields() { + let mut left = node_data_v4(1, 1); + left.start_tachyon_anchor = [22; 32]; + left.end_tachyon_anchor = [23; 32]; + left.tachyon_tx = 24; + + let mut right = node_data_v4(2, 2); + right.start_tachyon_anchor = [25; 32]; + right.end_tachyon_anchor = [26; 32]; + right.tachyon_tx = 27; + + let combined = HistoryV4::combine(&left, &right); + + assert_eq!(combined.v3.v2.v1.start_height, 1); + assert_eq!(combined.v3.v2.v1.end_height, 2); + assert_eq!(combined.start_tachyon_anchor, [22; 32]); + assert_eq!(combined.end_tachyon_anchor, [26; 32]); + assert_eq!(combined.tachyon_tx, 51); + } + + #[cfg(zcash_unstable = "nutachyon")] + #[test] + fn v4_combine_hash_commits_to_tachyon_fields() { + let left = node_data_v4(1, 1); + let right = node_data_v4(2, 2); + let base_hash = HistoryV4::combine(&left, &right) + .v3 + .v2 + .v1 + .subtree_commitment; + + let combined_hash = + |left, right| HistoryV4::combine(left, right).v3.v2.v1.subtree_commitment; + + let mut changed_left_start_anchor = left.clone(); + changed_left_start_anchor.start_tachyon_anchor[0] ^= 1; + assert_ne!(combined_hash(&changed_left_start_anchor, &right), base_hash); + + let mut changed_left_end_anchor = left.clone(); + changed_left_end_anchor.end_tachyon_anchor[0] ^= 1; + assert_ne!(combined_hash(&changed_left_end_anchor, &right), base_hash); + + let mut changed_right_start_anchor = right.clone(); + changed_right_start_anchor.start_tachyon_anchor[0] ^= 1; + assert_ne!(combined_hash(&left, &changed_right_start_anchor), base_hash); + + let mut changed_right_end_anchor = right.clone(); + changed_right_end_anchor.end_tachyon_anchor[0] ^= 1; + assert_ne!(combined_hash(&left, &changed_right_end_anchor), base_hash); + + let mut changed_tx_count = left.clone(); + changed_tx_count.tachyon_tx += 1; + assert_ne!(combined_hash(&changed_tx_count, &right), base_hash); + + let mut redistributed_left_tx = left.clone(); + let mut redistributed_right_tx = right.clone(); + redistributed_left_tx.tachyon_tx += 1; + redistributed_right_tx.tachyon_tx -= 1; + assert_ne!( + combined_hash(&redistributed_left_tx, &redistributed_right_tx), + base_hash + ); + } + + #[test] + fn v3_combine_tracks_ironwood_fields() { + let mut left = node_data_v3(1, 1); + left.start_ironwood_root = [16; 32]; + left.end_ironwood_root = [17; 32]; + left.ironwood_tx = 18; + + let mut right = node_data_v3(2, 2); + right.start_ironwood_root = [19; 32]; + right.end_ironwood_root = [20; 32]; + right.ironwood_tx = 21; + + let combined = HistoryV3::combine(&left, &right); + + assert_eq!(combined.v2.v1.start_height, 1); + assert_eq!(combined.v2.v1.end_height, 2); + assert_eq!(combined.start_ironwood_root, [16; 32]); + assert_eq!(combined.end_ironwood_root, [20; 32]); + assert_eq!(combined.ironwood_tx, 39); + } + + #[test] + fn v3_combine_hash_commits_to_ironwood_fields() { + let left = node_data_v3(1, 1); + let right = node_data_v3(2, 2); + let base_hash = HistoryV3::combine(&left, &right).v2.v1.subtree_commitment; + + let mut changed_start_root = left.clone(); + changed_start_root.start_ironwood_root[0] ^= 1; + assert_ne!( + HistoryV3::combine(&changed_start_root, &right) + .v2 + .v1 + .subtree_commitment, + base_hash + ); + + let mut changed_left_end_root = left.clone(); + changed_left_end_root.end_ironwood_root[0] ^= 1; + assert_ne!( + HistoryV3::combine(&changed_left_end_root, &right) + .v2 + .v1 + .subtree_commitment, + base_hash + ); + + let mut changed_right_start_root = right.clone(); + changed_right_start_root.start_ironwood_root[0] ^= 1; + assert_ne!( + HistoryV3::combine(&left, &changed_right_start_root) + .v2 + .v1 + .subtree_commitment, + base_hash + ); + + let mut changed_end_root = right.clone(); + changed_end_root.end_ironwood_root[0] ^= 1; + assert_ne!( + HistoryV3::combine(&left, &changed_end_root) + .v2 + .v1 + .subtree_commitment, + base_hash + ); + + let mut changed_tx_count = left.clone(); + changed_tx_count.ironwood_tx += 1; + assert_ne!( + HistoryV3::combine(&changed_tx_count, &right) + .v2 + .v1 + .subtree_commitment, + base_hash + ); + + let mut redistributed_left_tx = left.clone(); + let mut redistributed_right_tx = right; + redistributed_left_tx.ironwood_tx += 1; + redistributed_right_tx.ironwood_tx -= 1; + assert_ne!( + HistoryV3::combine(&redistributed_left_tx, &redistributed_right_tx) + .v2 + .v1 + .subtree_commitment, + base_hash + ); + } +} diff --git a/crates/zcash_history/src/test_vectors.rs b/crates/zcash_history/src/test_vectors.rs new file mode 100644 index 00000000..fff780ec --- /dev/null +++ b/crates/zcash_history/src/test_vectors.rs @@ -0,0 +1,196 @@ +//! Conformance tests against the ZIP 221 / ZIP 229 chain history MMR test +//! vectors published by `zcash-test-vectors`. +//! +//! The vector modules below are generated by an independent reimplementation of +//! the specification (`zcash_test_vectors/zip_0221.py`), so checking this crate +//! against them is a genuine cross-validation rather than a self-consistency +//! check. For each tree version the vectors walk a deterministic 16-leaf tree, +//! recording, per tree size, the appended leaf's inputs together with the +//! serialized peaks, serialized root node, and `hashChainHistoryRoot`. + +mod zip_0221_v1; +mod zip_0221_v2; +mod zip_0221_v3; + +use alloc::vec::Vec; + +use primitive_types::U256; + +use crate::{Entry, NodeData, NodeDataV2, NodeDataV3, Tree, V1, V2, V3, Version}; + +/// Builds the V1 (Sapling) leaf metadata for a single block. +/// +/// A leaf spans a single block, so every earliest/latest pair collapses to that +/// block's single value. +// A block leaf is built from eight independent header/metadata values; bundling +// them into a struct would not make the conversion any clearer. +#[allow(clippy::too_many_arguments)] +fn sapling_leaf( + consensus_branch_id: u32, + block_hash: [u8; 32], + time: u32, + target_bits: u32, + sapling_root: [u8; 32], + work: [u8; 32], + height: u64, + sapling_tx: u64, +) -> NodeData { + NodeData { + consensus_branch_id, + subtree_commitment: block_hash, + start_time: time, + end_time: time, + start_target: target_bits, + end_target: target_bits, + start_sapling_root: sapling_root, + end_sapling_root: sapling_root, + subtree_total_work: U256::from_little_endian(&work), + start_height: height, + end_height: height, + sapling_tx, + } +} + +/// Appends `leaf` to `tree` (initializing it on the first leaf) and asserts the +/// resulting state matches the test vector for this tree size. +fn check_leaf( + tree: &mut Option>, + leaf: V::NodeData, + n_leaves: u32, + leaf_serialized: &[u8], + peaks: &[&[u8]], + root_serialized: &[u8], + hash_chain_history_root: [u8; 32], +) where + V: Version, + V::NodeData: PartialEq + core::fmt::Debug, +{ + // The leaf metadata serializes to the spec bytes and round-trips. The + // consensus branch ID is not part of the serialization; on read it is + // supplied out of band, here recovered from the leaf itself. + let consensus_branch_id = V::consensus_branch_id(&leaf); + assert_eq!(V::to_bytes(&leaf).as_slice(), leaf_serialized); + assert_eq!( + V::from_bytes(consensus_branch_id, leaf_serialized).expect("leaf should deserialize"), + leaf + ); + + // Append the leaf, initializing the tree from the first leaf. + match tree { + None => *tree = Some(Tree::new(1, vec![(0, Entry::new_leaf(leaf))], Vec::new())), + Some(tree) => { + tree.append_leaf(leaf).expect("append should succeed"); + } + } + let tree = tree.as_ref().expect("tree was initialized above"); + + // The root spans the expected number of leaves and commits to the same + // serialization and `hashChainHistoryRoot` as the spec. + let root = tree.root_node().expect("root should be resolvable"); + assert_eq!(root.node().leaf_count(), u64::from(n_leaves)); + assert_eq!(V::to_bytes(root.data()).as_slice(), root_serialized); + assert_eq!(V::hash(root.data()), hash_chain_history_root); + + // The peaks enumerate left-to-right and serialize to the expected bytes. + let mut peak_links = Vec::new(); + tree.get_peaks(tree.root(), &mut peak_links) + .expect("peaks should be resolvable"); + assert_eq!(peak_links.len(), peaks.len()); + for (link, expected) in peak_links.iter().zip(peaks) { + let peak = tree.resolve_link(*link).expect("peak should be resolvable"); + assert_eq!(V::to_bytes(peak.data()).as_slice(), *expected); + } +} + +#[test] +fn zip_0221_v1_chain_history() { + let mut tree: Option> = None; + for tv in zip_0221_v1::TEST_VECTORS { + let leaf = sapling_leaf( + tv.consensus_branch_id, + tv.leaf_block_hash, + tv.leaf_time, + tv.leaf_target_bits, + tv.leaf_sapling_root, + tv.leaf_work, + tv.leaf_height, + tv.leaf_sapling_tx_count, + ); + check_leaf::( + &mut tree, + leaf, + tv.n_leaves, + tv.leaf_serialized, + tv.peaks, + tv.root_serialized, + tv.hash_chain_history_root, + ); + } +} + +#[test] +fn zip_0221_v2_chain_history() { + let mut tree: Option> = None; + for tv in zip_0221_v2::TEST_VECTORS { + let leaf = NodeDataV2 { + v1: sapling_leaf( + tv.consensus_branch_id, + tv.leaf_block_hash, + tv.leaf_time, + tv.leaf_target_bits, + tv.leaf_sapling_root, + tv.leaf_work, + tv.leaf_height, + tv.leaf_sapling_tx_count, + ), + start_orchard_root: tv.leaf_orchard_root, + end_orchard_root: tv.leaf_orchard_root, + orchard_tx: tv.leaf_orchard_tx_count, + }; + check_leaf::( + &mut tree, + leaf, + tv.n_leaves, + tv.leaf_serialized, + tv.peaks, + tv.root_serialized, + tv.hash_chain_history_root, + ); + } +} + +#[test] +fn zip_0221_v3_chain_history() { + let mut tree: Option> = None; + for tv in zip_0221_v3::TEST_VECTORS { + let leaf = NodeDataV3 { + v2: NodeDataV2 { + v1: sapling_leaf( + tv.consensus_branch_id, + tv.leaf_block_hash, + tv.leaf_time, + tv.leaf_target_bits, + tv.leaf_sapling_root, + tv.leaf_work, + tv.leaf_height, + tv.leaf_sapling_tx_count, + ), + start_orchard_root: tv.leaf_orchard_root, + end_orchard_root: tv.leaf_orchard_root, + orchard_tx: tv.leaf_orchard_tx_count, + }, + start_ironwood_root: tv.leaf_ironwood_root, + end_ironwood_root: tv.leaf_ironwood_root, + ironwood_tx: tv.leaf_ironwood_tx_count, + }; + check_leaf::( + &mut tree, + leaf, + tv.n_leaves, + tv.leaf_serialized, + tv.peaks, + tv.root_serialized, + tv.hash_chain_history_root, + ); + } +} diff --git a/crates/zcash_history/src/test_vectors/zip_0221_v1.rs b/crates/zcash_history/src/test_vectors/zip_0221_v1.rs new file mode 100644 index 00000000..be83382c --- /dev/null +++ b/crates/zcash_history/src/test_vectors/zip_0221_v1.rs @@ -0,0 +1,1400 @@ +// From https://github.com/zcash/zcash-test-vectors/blob/master/zcash_test_vectors/zip_0221.py + +pub(crate) struct TestVector { + pub(crate) consensus_branch_id: u32, + pub(crate) n_leaves: u32, + pub(crate) leaf_block_hash: [u8; 32], + pub(crate) leaf_time: u32, + pub(crate) leaf_target_bits: u32, + pub(crate) leaf_sapling_root: [u8; 32], + pub(crate) leaf_work: [u8; 32], + pub(crate) leaf_height: u64, + pub(crate) leaf_sapling_tx_count: u64, + pub(crate) leaf_serialized: &'static [u8], + pub(crate) peaks: &'static [&'static [u8]], + pub(crate) root_serialized: &'static [u8], + pub(crate) hash_chain_history_root: [u8; 32], +} + +pub(crate) const TEST_VECTORS: &[TestVector] = &[ + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 1, + leaf_block_hash: [ + 0x58, 0xae, 0x02, 0x29, 0x8f, 0xf6, 0x06, 0xff, 0x65, 0x7c, 0xd7, 0x07, 0x54, 0x09, + 0xbb, 0x2a, 0x2b, 0x9d, 0xb7, 0x3d, 0x52, 0x35, 0x24, 0x24, 0x48, 0x59, 0x8a, 0x24, + 0x21, 0x71, 0x9f, 0x99, + ], + leaf_time: 1437395079, + leaf_target_bits: 508676804, + leaf_sapling_root: [ + 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, + 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, + 0x0c, 0x8e, 0x3d, 0x46, + ], + leaf_work: [ + 0x40, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903000, + leaf_sapling_tx_count: 0, + leaf_serialized: &[ + 0x58, 0xae, 0x02, 0x29, 0x8f, 0xf6, 0x06, 0xff, 0x65, 0x7c, 0xd7, 0x07, 0x54, 0x09, + 0xbb, 0x2a, 0x2b, 0x9d, 0xb7, 0x3d, 0x52, 0x35, 0x24, 0x24, 0x48, 0x59, 0x8a, 0x24, + 0x21, 0x71, 0x9f, 0x99, 0x87, 0xe8, 0xac, 0x55, 0x87, 0xe8, 0xac, 0x55, 0xc4, 0xca, + 0x51, 0x1e, 0xc4, 0xca, 0x51, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x4f, 0x60, 0x20, 0x2c, + 0x93, 0x7a, 0x03, 0x63, 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, + 0x38, 0xfe, 0xa8, 0x0a, 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, + 0x40, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, + 0x00, + ], + peaks: &[&[ + 0x58, 0xae, 0x02, 0x29, 0x8f, 0xf6, 0x06, 0xff, 0x65, 0x7c, 0xd7, 0x07, 0x54, 0x09, + 0xbb, 0x2a, 0x2b, 0x9d, 0xb7, 0x3d, 0x52, 0x35, 0x24, 0x24, 0x48, 0x59, 0x8a, 0x24, + 0x21, 0x71, 0x9f, 0x99, 0x87, 0xe8, 0xac, 0x55, 0x87, 0xe8, 0xac, 0x55, 0xc4, 0xca, + 0x51, 0x1e, 0xc4, 0xca, 0x51, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x4f, 0x60, 0x20, 0x2c, + 0x93, 0x7a, 0x03, 0x63, 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, + 0x38, 0xfe, 0xa8, 0x0a, 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, + 0x40, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, + 0x00, + ]], + root_serialized: &[ + 0x58, 0xae, 0x02, 0x29, 0x8f, 0xf6, 0x06, 0xff, 0x65, 0x7c, 0xd7, 0x07, 0x54, 0x09, + 0xbb, 0x2a, 0x2b, 0x9d, 0xb7, 0x3d, 0x52, 0x35, 0x24, 0x24, 0x48, 0x59, 0x8a, 0x24, + 0x21, 0x71, 0x9f, 0x99, 0x87, 0xe8, 0xac, 0x55, 0x87, 0xe8, 0xac, 0x55, 0xc4, 0xca, + 0x51, 0x1e, 0xc4, 0xca, 0x51, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x4f, 0x60, 0x20, 0x2c, + 0x93, 0x7a, 0x03, 0x63, 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, + 0x38, 0xfe, 0xa8, 0x0a, 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, + 0x40, 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, + 0x00, + ], + hash_chain_history_root: [ + 0x44, 0xfc, 0xa9, 0x15, 0x5e, 0x06, 0x11, 0xda, 0xa1, 0xe0, 0x5a, 0x2b, 0x8a, 0x89, + 0xbf, 0xac, 0xc5, 0x07, 0x3b, 0x9a, 0x5c, 0xcf, 0x4a, 0xec, 0x7b, 0xb0, 0xa1, 0x3d, + 0xd3, 0xde, 0x2b, 0x78, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 2, + leaf_block_hash: [ + 0xe9, 0x5f, 0xbe, 0xec, 0x8d, 0x3d, 0xfd, 0xf4, 0xe5, 0x0e, 0xc1, 0x96, 0x47, 0xba, + 0x58, 0x39, 0x0e, 0xaa, 0x57, 0xd2, 0x5c, 0x68, 0x57, 0xfd, 0xd2, 0xf9, 0xf6, 0xf3, + 0x59, 0x1e, 0xff, 0x57, + ], + leaf_time: 3447347931, + leaf_target_bits: 509321498, + leaf_sapling_root: [ + 0x39, 0x3e, 0xec, 0xde, 0xfa, 0xde, 0x9c, 0x6f, 0x41, 0x0d, 0xc7, 0x4e, 0x52, 0x90, + 0x73, 0xc6, 0x90, 0x3c, 0x36, 0xec, 0xcc, 0x8f, 0xb2, 0xb3, 0xe5, 0x6c, 0xd6, 0xe0, + 0x54, 0x30, 0xec, 0x09, + ], + leaf_work: [ + 0x3a, 0xcb, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903001, + leaf_sapling_tx_count: 4, + leaf_serialized: &[ + 0xe9, 0x5f, 0xbe, 0xec, 0x8d, 0x3d, 0xfd, 0xf4, 0xe5, 0x0e, 0xc1, 0x96, 0x47, 0xba, + 0x58, 0x39, 0x0e, 0xaa, 0x57, 0xd2, 0x5c, 0x68, 0x57, 0xfd, 0xd2, 0xf9, 0xf6, 0xf3, + 0x59, 0x1e, 0xff, 0x57, 0xdb, 0x5a, 0x7a, 0xcd, 0xdb, 0x5a, 0x7a, 0xcd, 0x1a, 0xa1, + 0x5b, 0x1e, 0x1a, 0xa1, 0x5b, 0x1e, 0x39, 0x3e, 0xec, 0xde, 0xfa, 0xde, 0x9c, 0x6f, + 0x41, 0x0d, 0xc7, 0x4e, 0x52, 0x90, 0x73, 0xc6, 0x90, 0x3c, 0x36, 0xec, 0xcc, 0x8f, + 0xb2, 0xb3, 0xe5, 0x6c, 0xd6, 0xe0, 0x54, 0x30, 0xec, 0x09, 0x39, 0x3e, 0xec, 0xde, + 0xfa, 0xde, 0x9c, 0x6f, 0x41, 0x0d, 0xc7, 0x4e, 0x52, 0x90, 0x73, 0xc6, 0x90, 0x3c, + 0x36, 0xec, 0xcc, 0x8f, 0xb2, 0xb3, 0xe5, 0x6c, 0xd6, 0xe0, 0x54, 0x30, 0xec, 0x09, + 0x3a, 0xcb, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x59, 0xc7, 0x0d, 0x00, 0xfe, 0x59, 0xc7, 0x0d, 0x00, + 0x04, + ], + peaks: &[&[ + 0x18, 0xed, 0x84, 0xca, 0xa2, 0x7d, 0x0b, 0x68, 0x44, 0x72, 0xc1, 0x40, 0xfa, 0xfd, + 0x04, 0x4f, 0x2b, 0x46, 0x50, 0x50, 0xa1, 0xe0, 0xd0, 0x30, 0x0a, 0xba, 0x02, 0xb5, + 0xdb, 0x42, 0x3a, 0x52, 0x87, 0xe8, 0xac, 0x55, 0xdb, 0x5a, 0x7a, 0xcd, 0xc4, 0xca, + 0x51, 0x1e, 0x1a, 0xa1, 0x5b, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x39, 0x3e, 0xec, 0xde, + 0xfa, 0xde, 0x9c, 0x6f, 0x41, 0x0d, 0xc7, 0x4e, 0x52, 0x90, 0x73, 0xc6, 0x90, 0x3c, + 0x36, 0xec, 0xcc, 0x8f, 0xb2, 0xb3, 0xe5, 0x6c, 0xd6, 0xe0, 0x54, 0x30, 0xec, 0x09, + 0x7a, 0xec, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x59, 0xc7, 0x0d, 0x00, + 0x04, + ]], + root_serialized: &[ + 0x18, 0xed, 0x84, 0xca, 0xa2, 0x7d, 0x0b, 0x68, 0x44, 0x72, 0xc1, 0x40, 0xfa, 0xfd, + 0x04, 0x4f, 0x2b, 0x46, 0x50, 0x50, 0xa1, 0xe0, 0xd0, 0x30, 0x0a, 0xba, 0x02, 0xb5, + 0xdb, 0x42, 0x3a, 0x52, 0x87, 0xe8, 0xac, 0x55, 0xdb, 0x5a, 0x7a, 0xcd, 0xc4, 0xca, + 0x51, 0x1e, 0x1a, 0xa1, 0x5b, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x39, 0x3e, 0xec, 0xde, + 0xfa, 0xde, 0x9c, 0x6f, 0x41, 0x0d, 0xc7, 0x4e, 0x52, 0x90, 0x73, 0xc6, 0x90, 0x3c, + 0x36, 0xec, 0xcc, 0x8f, 0xb2, 0xb3, 0xe5, 0x6c, 0xd6, 0xe0, 0x54, 0x30, 0xec, 0x09, + 0x7a, 0xec, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x59, 0xc7, 0x0d, 0x00, + 0x04, + ], + hash_chain_history_root: [ + 0x84, 0x96, 0x31, 0x13, 0x9c, 0xcc, 0xf4, 0xeb, 0x30, 0xdd, 0x58, 0xb8, 0x09, 0xf9, + 0xf9, 0x27, 0x1e, 0x34, 0x67, 0x5a, 0xe7, 0x1e, 0xe9, 0x2a, 0x73, 0x4b, 0x03, 0x98, + 0x5a, 0x7e, 0xfe, 0xaa, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 3, + leaf_block_hash: [ + 0xda, 0x1e, 0x11, 0x4c, 0x06, 0xbb, 0xb2, 0x35, 0x2f, 0x73, 0x7d, 0x13, 0xa6, 0xb1, + 0x7b, 0x7d, 0x94, 0xd8, 0x4f, 0xd0, 0xfc, 0x4d, 0xaf, 0x8c, 0xfa, 0x79, 0x70, 0x2b, + 0x08, 0x9c, 0x47, 0x58, + ], + leaf_time: 870755273, + leaf_target_bits: 527352672, + leaf_sapling_root: [ + 0x88, 0x7c, 0xe3, 0xfb, 0xab, 0x46, 0x9a, 0xf1, 0xf4, 0x6a, 0x8c, 0x25, 0xae, 0xf8, + 0x1f, 0x28, 0x7f, 0xf2, 0x15, 0xea, 0xa3, 0x72, 0x47, 0x0a, 0x30, 0x2f, 0x5b, 0x43, + 0x5e, 0x96, 0x63, 0x29, + ], + leaf_work: [ + 0x4f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903002, + leaf_sapling_tx_count: 1, + leaf_serialized: &[ + 0xda, 0x1e, 0x11, 0x4c, 0x06, 0xbb, 0xb2, 0x35, 0x2f, 0x73, 0x7d, 0x13, 0xa6, 0xb1, + 0x7b, 0x7d, 0x94, 0xd8, 0x4f, 0xd0, 0xfc, 0x4d, 0xaf, 0x8c, 0xfa, 0x79, 0x70, 0x2b, + 0x08, 0x9c, 0x47, 0x58, 0xc9, 0xab, 0xe6, 0x33, 0xc9, 0xab, 0xe6, 0x33, 0x60, 0xc3, + 0x6e, 0x1f, 0x60, 0xc3, 0x6e, 0x1f, 0x88, 0x7c, 0xe3, 0xfb, 0xab, 0x46, 0x9a, 0xf1, + 0xf4, 0x6a, 0x8c, 0x25, 0xae, 0xf8, 0x1f, 0x28, 0x7f, 0xf2, 0x15, 0xea, 0xa3, 0x72, + 0x47, 0x0a, 0x30, 0x2f, 0x5b, 0x43, 0x5e, 0x96, 0x63, 0x29, 0x88, 0x7c, 0xe3, 0xfb, + 0xab, 0x46, 0x9a, 0xf1, 0xf4, 0x6a, 0x8c, 0x25, 0xae, 0xf8, 0x1f, 0x28, 0x7f, 0xf2, + 0x15, 0xea, 0xa3, 0x72, 0x47, 0x0a, 0x30, 0x2f, 0x5b, 0x43, 0x5e, 0x96, 0x63, 0x29, + 0x4f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5a, 0xc7, 0x0d, 0x00, 0xfe, 0x5a, 0xc7, 0x0d, 0x00, + 0x01, + ], + peaks: &[ + &[ + 0x18, 0xed, 0x84, 0xca, 0xa2, 0x7d, 0x0b, 0x68, 0x44, 0x72, 0xc1, 0x40, 0xfa, 0xfd, + 0x04, 0x4f, 0x2b, 0x46, 0x50, 0x50, 0xa1, 0xe0, 0xd0, 0x30, 0x0a, 0xba, 0x02, 0xb5, + 0xdb, 0x42, 0x3a, 0x52, 0x87, 0xe8, 0xac, 0x55, 0xdb, 0x5a, 0x7a, 0xcd, 0xc4, 0xca, + 0x51, 0x1e, 0x1a, 0xa1, 0x5b, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x39, 0x3e, 0xec, 0xde, + 0xfa, 0xde, 0x9c, 0x6f, 0x41, 0x0d, 0xc7, 0x4e, 0x52, 0x90, 0x73, 0xc6, 0x90, 0x3c, + 0x36, 0xec, 0xcc, 0x8f, 0xb2, 0xb3, 0xe5, 0x6c, 0xd6, 0xe0, 0x54, 0x30, 0xec, 0x09, + 0x7a, 0xec, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x59, 0xc7, 0x0d, 0x00, + 0x04, + ], + &[ + 0xda, 0x1e, 0x11, 0x4c, 0x06, 0xbb, 0xb2, 0x35, 0x2f, 0x73, 0x7d, 0x13, 0xa6, 0xb1, + 0x7b, 0x7d, 0x94, 0xd8, 0x4f, 0xd0, 0xfc, 0x4d, 0xaf, 0x8c, 0xfa, 0x79, 0x70, 0x2b, + 0x08, 0x9c, 0x47, 0x58, 0xc9, 0xab, 0xe6, 0x33, 0xc9, 0xab, 0xe6, 0x33, 0x60, 0xc3, + 0x6e, 0x1f, 0x60, 0xc3, 0x6e, 0x1f, 0x88, 0x7c, 0xe3, 0xfb, 0xab, 0x46, 0x9a, 0xf1, + 0xf4, 0x6a, 0x8c, 0x25, 0xae, 0xf8, 0x1f, 0x28, 0x7f, 0xf2, 0x15, 0xea, 0xa3, 0x72, + 0x47, 0x0a, 0x30, 0x2f, 0x5b, 0x43, 0x5e, 0x96, 0x63, 0x29, 0x88, 0x7c, 0xe3, 0xfb, + 0xab, 0x46, 0x9a, 0xf1, 0xf4, 0x6a, 0x8c, 0x25, 0xae, 0xf8, 0x1f, 0x28, 0x7f, 0xf2, + 0x15, 0xea, 0xa3, 0x72, 0x47, 0x0a, 0x30, 0x2f, 0x5b, 0x43, 0x5e, 0x96, 0x63, 0x29, + 0x4f, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5a, 0xc7, 0x0d, 0x00, 0xfe, 0x5a, 0xc7, 0x0d, 0x00, + 0x01, + ], + ], + root_serialized: &[ + 0x21, 0x69, 0x47, 0x08, 0x86, 0xa1, 0x0e, 0xfd, 0xf1, 0x15, 0x9c, 0xce, 0x2a, 0x27, + 0x0b, 0x58, 0x80, 0x05, 0xf3, 0xbc, 0xfc, 0xbe, 0x29, 0x1d, 0x21, 0x41, 0xa5, 0xf5, + 0x5c, 0xdb, 0x48, 0x4b, 0x87, 0xe8, 0xac, 0x55, 0xc9, 0xab, 0xe6, 0x33, 0xc4, 0xca, + 0x51, 0x1e, 0x60, 0xc3, 0x6e, 0x1f, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x88, 0x7c, 0xe3, 0xfb, + 0xab, 0x46, 0x9a, 0xf1, 0xf4, 0x6a, 0x8c, 0x25, 0xae, 0xf8, 0x1f, 0x28, 0x7f, 0xf2, + 0x15, 0xea, 0xa3, 0x72, 0x47, 0x0a, 0x30, 0x2f, 0x5b, 0x43, 0x5e, 0x96, 0x63, 0x29, + 0xc9, 0xee, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5a, 0xc7, 0x0d, 0x00, + 0x05, + ], + hash_chain_history_root: [ + 0x8a, 0x3f, 0xee, 0x77, 0x5a, 0x70, 0xe9, 0x72, 0xe3, 0x1f, 0x61, 0x42, 0x79, 0x1e, + 0x8e, 0xca, 0x32, 0x4d, 0xb6, 0x87, 0x4c, 0xa0, 0xe4, 0x57, 0x91, 0xc1, 0x6b, 0x1f, + 0x92, 0x15, 0x3c, 0x2c, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 4, + leaf_block_hash: [ + 0x22, 0x32, 0x9a, 0xd1, 0x8c, 0xc4, 0x14, 0x28, 0xae, 0xf1, 0xcd, 0xbb, 0xa1, 0xbf, + 0x69, 0x2a, 0x40, 0xce, 0x56, 0xe1, 0x81, 0xde, 0x3b, 0x33, 0x12, 0x75, 0x50, 0xf9, + 0xd8, 0x28, 0x32, 0x29, + ], + leaf_time: 1095315700, + leaf_target_bits: 491671506, + leaf_sapling_root: [ + 0xd9, 0x86, 0xfd, 0x01, 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, + 0x00, 0xdf, 0x37, 0x44, 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, + 0x91, 0xa6, 0x4a, 0x07, + ], + leaf_work: [ + 0x1f, 0xdc, 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903003, + leaf_sapling_tx_count: 6, + leaf_serialized: &[ + 0x22, 0x32, 0x9a, 0xd1, 0x8c, 0xc4, 0x14, 0x28, 0xae, 0xf1, 0xcd, 0xbb, 0xa1, 0xbf, + 0x69, 0x2a, 0x40, 0xce, 0x56, 0xe1, 0x81, 0xde, 0x3b, 0x33, 0x12, 0x75, 0x50, 0xf9, + 0xd8, 0x28, 0x32, 0x29, 0xf4, 0x30, 0x49, 0x41, 0xf4, 0x30, 0x49, 0x41, 0xd2, 0x4f, + 0x4e, 0x1d, 0xd2, 0x4f, 0x4e, 0x1d, 0xd9, 0x86, 0xfd, 0x01, 0x58, 0xe2, 0xf5, 0x3f, + 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, 0x73, 0x8d, 0xec, 0xf9, + 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, 0xd9, 0x86, 0xfd, 0x01, + 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, + 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, + 0x1f, 0xdc, 0x44, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, + 0x06, + ], + peaks: &[&[ + 0x15, 0xe9, 0x3a, 0x7e, 0xaa, 0x58, 0xa5, 0x4a, 0x89, 0xa8, 0x67, 0xb9, 0x09, 0x5a, + 0x74, 0xd9, 0x7f, 0x74, 0xe7, 0x96, 0x5b, 0x08, 0x78, 0x8c, 0xac, 0x50, 0x9e, 0x21, + 0x35, 0x93, 0xdf, 0x24, 0x87, 0xe8, 0xac, 0x55, 0xf4, 0x30, 0x49, 0x41, 0xc4, 0xca, + 0x51, 0x1e, 0xd2, 0x4f, 0x4e, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xd9, 0x86, 0xfd, 0x01, + 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, + 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, + 0xe8, 0xca, 0x4a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, + 0x0b, + ]], + root_serialized: &[ + 0x15, 0xe9, 0x3a, 0x7e, 0xaa, 0x58, 0xa5, 0x4a, 0x89, 0xa8, 0x67, 0xb9, 0x09, 0x5a, + 0x74, 0xd9, 0x7f, 0x74, 0xe7, 0x96, 0x5b, 0x08, 0x78, 0x8c, 0xac, 0x50, 0x9e, 0x21, + 0x35, 0x93, 0xdf, 0x24, 0x87, 0xe8, 0xac, 0x55, 0xf4, 0x30, 0x49, 0x41, 0xc4, 0xca, + 0x51, 0x1e, 0xd2, 0x4f, 0x4e, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xd9, 0x86, 0xfd, 0x01, + 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, + 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, + 0xe8, 0xca, 0x4a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, + 0x0b, + ], + hash_chain_history_root: [ + 0x6d, 0xad, 0x28, 0x0e, 0xc2, 0x28, 0x8c, 0x2e, 0x97, 0x26, 0xf8, 0xab, 0x82, 0xc8, + 0x84, 0x38, 0x3f, 0x78, 0xb5, 0x39, 0x15, 0x71, 0x14, 0xbf, 0x78, 0x65, 0x39, 0xd3, + 0x6c, 0xb2, 0xd3, 0x10, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 5, + leaf_block_hash: [ + 0xed, 0xdc, 0x24, 0xb9, 0x4a, 0x68, 0x1a, 0x63, 0x6d, 0xba, 0x49, 0xb0, 0xd6, 0x7f, + 0x69, 0xd6, 0xbe, 0xe7, 0x34, 0xa9, 0xd3, 0xd9, 0x59, 0x27, 0x5f, 0x0d, 0xa7, 0xe6, + 0x7f, 0x51, 0xbe, 0x98, + ], + leaf_time: 3654169239, + leaf_target_bits: 510630354, + leaf_sapling_root: [ + 0xee, 0x86, 0x99, 0x4b, 0x1b, 0xbb, 0x5d, 0x13, 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, + 0x02, 0xd5, 0x45, 0x3c, 0x8b, 0x53, 0xf1, 0x64, 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, + 0x6e, 0xb3, 0x51, 0xa8, + ], + leaf_work: [ + 0x3c, 0x4b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903004, + leaf_sapling_tx_count: 0, + leaf_serialized: &[ + 0xed, 0xdc, 0x24, 0xb9, 0x4a, 0x68, 0x1a, 0x63, 0x6d, 0xba, 0x49, 0xb0, 0xd6, 0x7f, + 0x69, 0xd6, 0xbe, 0xe7, 0x34, 0xa9, 0xd3, 0xd9, 0x59, 0x27, 0x5f, 0x0d, 0xa7, 0xe6, + 0x7f, 0x51, 0xbe, 0x98, 0x97, 0x32, 0xce, 0xd9, 0x97, 0x32, 0xce, 0xd9, 0xd2, 0x99, + 0x6f, 0x1e, 0xd2, 0x99, 0x6f, 0x1e, 0xee, 0x86, 0x99, 0x4b, 0x1b, 0xbb, 0x5d, 0x13, + 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, 0x8b, 0x53, 0xf1, 0x64, + 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, 0xee, 0x86, 0x99, 0x4b, + 0x1b, 0xbb, 0x5d, 0x13, 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, + 0x8b, 0x53, 0xf1, 0x64, 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, + 0x3c, 0x4b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, + 0x00, + ], + peaks: &[ + &[ + 0x15, 0xe9, 0x3a, 0x7e, 0xaa, 0x58, 0xa5, 0x4a, 0x89, 0xa8, 0x67, 0xb9, 0x09, 0x5a, + 0x74, 0xd9, 0x7f, 0x74, 0xe7, 0x96, 0x5b, 0x08, 0x78, 0x8c, 0xac, 0x50, 0x9e, 0x21, + 0x35, 0x93, 0xdf, 0x24, 0x87, 0xe8, 0xac, 0x55, 0xf4, 0x30, 0x49, 0x41, 0xc4, 0xca, + 0x51, 0x1e, 0xd2, 0x4f, 0x4e, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xd9, 0x86, 0xfd, 0x01, + 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, + 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, + 0xe8, 0xca, 0x4a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, + 0x0b, + ], + &[ + 0xed, 0xdc, 0x24, 0xb9, 0x4a, 0x68, 0x1a, 0x63, 0x6d, 0xba, 0x49, 0xb0, 0xd6, 0x7f, + 0x69, 0xd6, 0xbe, 0xe7, 0x34, 0xa9, 0xd3, 0xd9, 0x59, 0x27, 0x5f, 0x0d, 0xa7, 0xe6, + 0x7f, 0x51, 0xbe, 0x98, 0x97, 0x32, 0xce, 0xd9, 0x97, 0x32, 0xce, 0xd9, 0xd2, 0x99, + 0x6f, 0x1e, 0xd2, 0x99, 0x6f, 0x1e, 0xee, 0x86, 0x99, 0x4b, 0x1b, 0xbb, 0x5d, 0x13, + 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, 0x8b, 0x53, 0xf1, 0x64, + 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, 0xee, 0x86, 0x99, 0x4b, + 0x1b, 0xbb, 0x5d, 0x13, 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, + 0x8b, 0x53, 0xf1, 0x64, 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, + 0x3c, 0x4b, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, + 0x00, + ], + ], + root_serialized: &[ + 0xc2, 0xc9, 0x5b, 0x56, 0x79, 0x05, 0x80, 0x30, 0x3d, 0x8a, 0x4f, 0x64, 0xff, 0x9c, + 0x5d, 0x28, 0x14, 0x1d, 0xad, 0x79, 0x91, 0x68, 0xe3, 0xb5, 0xeb, 0xab, 0x41, 0xb1, + 0x2c, 0xac, 0x22, 0x65, 0x87, 0xe8, 0xac, 0x55, 0x97, 0x32, 0xce, 0xd9, 0xc4, 0xca, + 0x51, 0x1e, 0xd2, 0x99, 0x6f, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xee, 0x86, 0x99, 0x4b, + 0x1b, 0xbb, 0x5d, 0x13, 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, + 0x8b, 0x53, 0xf1, 0x64, 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, + 0x24, 0x16, 0x4d, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, + 0x0b, + ], + hash_chain_history_root: [ + 0xca, 0x3f, 0xf7, 0xd3, 0x7c, 0x61, 0x14, 0xc5, 0xaa, 0x2b, 0xc3, 0x5d, 0x09, 0xe9, + 0xfe, 0x13, 0x1f, 0x0b, 0x15, 0xe5, 0x2c, 0xb9, 0x91, 0x29, 0x89, 0x0c, 0xa2, 0xa9, + 0xfa, 0xc8, 0xc2, 0x5c, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 6, + leaf_block_hash: [ + 0xe0, 0xa3, 0x34, 0xc5, 0x0c, 0xa3, 0xeb, 0x78, 0x93, 0x3e, 0xd6, 0x25, 0x26, 0x46, + 0x17, 0xc3, 0x41, 0x71, 0xc2, 0x8a, 0xca, 0xc1, 0x22, 0xf7, 0xfb, 0x3c, 0x1d, 0xe4, + 0x80, 0x78, 0xed, 0x58, + ], + leaf_time: 581751678, + leaf_target_bits: 488015619, + leaf_sapling_root: [ + 0x50, 0x1f, 0xfa, 0xec, 0xca, 0xa3, 0xdb, 0x68, 0x43, 0x77, 0x43, 0x4a, 0x9a, 0x2a, + 0x2b, 0xf5, 0x85, 0x3c, 0x47, 0xeb, 0xea, 0x50, 0x0b, 0xcf, 0x00, 0xf9, 0x98, 0xe5, + 0xae, 0x8d, 0xab, 0x86, + ], + leaf_work: [ + 0x74, 0x2b, 0x5d, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903005, + leaf_sapling_tx_count: 7, + leaf_serialized: &[ + 0xe0, 0xa3, 0x34, 0xc5, 0x0c, 0xa3, 0xeb, 0x78, 0x93, 0x3e, 0xd6, 0x25, 0x26, 0x46, + 0x17, 0xc3, 0x41, 0x71, 0xc2, 0x8a, 0xca, 0xc1, 0x22, 0xf7, 0xfb, 0x3c, 0x1d, 0xe4, + 0x80, 0x78, 0xed, 0x58, 0x7e, 0xd3, 0xac, 0x22, 0x7e, 0xd3, 0xac, 0x22, 0x03, 0x87, + 0x16, 0x1d, 0x03, 0x87, 0x16, 0x1d, 0x50, 0x1f, 0xfa, 0xec, 0xca, 0xa3, 0xdb, 0x68, + 0x43, 0x77, 0x43, 0x4a, 0x9a, 0x2a, 0x2b, 0xf5, 0x85, 0x3c, 0x47, 0xeb, 0xea, 0x50, + 0x0b, 0xcf, 0x00, 0xf9, 0x98, 0xe5, 0xae, 0x8d, 0xab, 0x86, 0x50, 0x1f, 0xfa, 0xec, + 0xca, 0xa3, 0xdb, 0x68, 0x43, 0x77, 0x43, 0x4a, 0x9a, 0x2a, 0x2b, 0xf5, 0x85, 0x3c, + 0x47, 0xeb, 0xea, 0x50, 0x0b, 0xcf, 0x00, 0xf9, 0x98, 0xe5, 0xae, 0x8d, 0xab, 0x86, + 0x74, 0x2b, 0x5d, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5d, 0xc7, 0x0d, 0x00, 0xfe, 0x5d, 0xc7, 0x0d, 0x00, + 0x07, + ], + peaks: &[ + &[ + 0x15, 0xe9, 0x3a, 0x7e, 0xaa, 0x58, 0xa5, 0x4a, 0x89, 0xa8, 0x67, 0xb9, 0x09, 0x5a, + 0x74, 0xd9, 0x7f, 0x74, 0xe7, 0x96, 0x5b, 0x08, 0x78, 0x8c, 0xac, 0x50, 0x9e, 0x21, + 0x35, 0x93, 0xdf, 0x24, 0x87, 0xe8, 0xac, 0x55, 0xf4, 0x30, 0x49, 0x41, 0xc4, 0xca, + 0x51, 0x1e, 0xd2, 0x4f, 0x4e, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xd9, 0x86, 0xfd, 0x01, + 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, + 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, + 0xe8, 0xca, 0x4a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, + 0x0b, + ], + &[ + 0x6e, 0x1b, 0x3c, 0x94, 0xa9, 0xb5, 0x70, 0xe6, 0x65, 0x4d, 0x8b, 0x08, 0xfa, 0xb8, + 0xc5, 0xdf, 0xd2, 0x52, 0xa6, 0xd9, 0xe9, 0x88, 0x69, 0x34, 0x18, 0xee, 0xfd, 0x0d, + 0xd2, 0x5f, 0x9c, 0x40, 0x97, 0x32, 0xce, 0xd9, 0x7e, 0xd3, 0xac, 0x22, 0xd2, 0x99, + 0x6f, 0x1e, 0x03, 0x87, 0x16, 0x1d, 0xee, 0x86, 0x99, 0x4b, 0x1b, 0xbb, 0x5d, 0x13, + 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, 0x8b, 0x53, 0xf1, 0x64, + 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, 0x50, 0x1f, 0xfa, 0xec, + 0xca, 0xa3, 0xdb, 0x68, 0x43, 0x77, 0x43, 0x4a, 0x9a, 0x2a, 0x2b, 0xf5, 0x85, 0x3c, + 0x47, 0xeb, 0xea, 0x50, 0x0b, 0xcf, 0x00, 0xf9, 0x98, 0xe5, 0xae, 0x8d, 0xab, 0x86, + 0xb0, 0x76, 0x5f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, 0xfe, 0x5d, 0xc7, 0x0d, 0x00, + 0x07, + ], + ], + root_serialized: &[ + 0x6b, 0x40, 0x2f, 0x72, 0x15, 0x6b, 0x19, 0x8a, 0x29, 0x3f, 0x33, 0x8f, 0x9e, 0x74, + 0xba, 0xd8, 0xb5, 0xa4, 0xfa, 0xef, 0x1d, 0x5c, 0xe6, 0xb1, 0x16, 0xbe, 0xbf, 0xe6, + 0xda, 0x5b, 0x8d, 0xea, 0x87, 0xe8, 0xac, 0x55, 0x7e, 0xd3, 0xac, 0x22, 0xc4, 0xca, + 0x51, 0x1e, 0x03, 0x87, 0x16, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x50, 0x1f, 0xfa, 0xec, + 0xca, 0xa3, 0xdb, 0x68, 0x43, 0x77, 0x43, 0x4a, 0x9a, 0x2a, 0x2b, 0xf5, 0x85, 0x3c, + 0x47, 0xeb, 0xea, 0x50, 0x0b, 0xcf, 0x00, 0xf9, 0x98, 0xe5, 0xae, 0x8d, 0xab, 0x86, + 0x98, 0x41, 0xaa, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5d, 0xc7, 0x0d, 0x00, + 0x12, + ], + hash_chain_history_root: [ + 0x7a, 0xf2, 0x56, 0x00, 0x1e, 0x4c, 0xff, 0xfe, 0x79, 0x0c, 0x43, 0x02, 0x97, 0xe9, + 0x7b, 0xc5, 0x0f, 0xc9, 0x23, 0x98, 0x80, 0xd7, 0x08, 0x07, 0x8f, 0x17, 0x4c, 0xd9, + 0x38, 0x5b, 0x4e, 0xce, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 7, + leaf_block_hash: [ + 0x36, 0x60, 0x1d, 0x16, 0x25, 0xc5, 0x8c, 0x15, 0xc5, 0xb7, 0x68, 0x51, 0x73, 0x0e, + 0x2b, 0xdf, 0x43, 0xbf, 0x21, 0x0e, 0xdc, 0xf5, 0x14, 0xfc, 0x2b, 0xb5, 0xd3, 0x66, + 0x98, 0x5b, 0xee, 0xd3, + ], + leaf_time: 3328163140, + leaf_target_bits: 528403144, + leaf_sapling_root: [ + 0xc1, 0xc6, 0xc9, 0xbe, 0x6c, 0xd5, 0x4f, 0x84, 0x2b, 0x14, 0xaa, 0x9d, 0xd2, 0xd9, + 0x50, 0x2d, 0x7d, 0x04, 0x8c, 0xf1, 0x2e, 0xec, 0x41, 0x3c, 0x6a, 0xba, 0x46, 0x72, + 0x74, 0x0e, 0xb4, 0x0d, + ], + leaf_work: [ + 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903006, + leaf_sapling_tx_count: 2, + leaf_serialized: &[ + 0x36, 0x60, 0x1d, 0x16, 0x25, 0xc5, 0x8c, 0x15, 0xc5, 0xb7, 0x68, 0x51, 0x73, 0x0e, + 0x2b, 0xdf, 0x43, 0xbf, 0x21, 0x0e, 0xdc, 0xf5, 0x14, 0xfc, 0x2b, 0xb5, 0xd3, 0x66, + 0x98, 0x5b, 0xee, 0xd3, 0x44, 0xbd, 0x5f, 0xc6, 0x44, 0xbd, 0x5f, 0xc6, 0xc8, 0xca, + 0x7e, 0x1f, 0xc8, 0xca, 0x7e, 0x1f, 0xc1, 0xc6, 0xc9, 0xbe, 0x6c, 0xd5, 0x4f, 0x84, + 0x2b, 0x14, 0xaa, 0x9d, 0xd2, 0xd9, 0x50, 0x2d, 0x7d, 0x04, 0x8c, 0xf1, 0x2e, 0xec, + 0x41, 0x3c, 0x6a, 0xba, 0x46, 0x72, 0x74, 0x0e, 0xb4, 0x0d, 0xc1, 0xc6, 0xc9, 0xbe, + 0x6c, 0xd5, 0x4f, 0x84, 0x2b, 0x14, 0xaa, 0x9d, 0xd2, 0xd9, 0x50, 0x2d, 0x7d, 0x04, + 0x8c, 0xf1, 0x2e, 0xec, 0x41, 0x3c, 0x6a, 0xba, 0x46, 0x72, 0x74, 0x0e, 0xb4, 0x0d, + 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5e, 0xc7, 0x0d, 0x00, 0xfe, 0x5e, 0xc7, 0x0d, 0x00, + 0x02, + ], + peaks: &[ + &[ + 0x15, 0xe9, 0x3a, 0x7e, 0xaa, 0x58, 0xa5, 0x4a, 0x89, 0xa8, 0x67, 0xb9, 0x09, 0x5a, + 0x74, 0xd9, 0x7f, 0x74, 0xe7, 0x96, 0x5b, 0x08, 0x78, 0x8c, 0xac, 0x50, 0x9e, 0x21, + 0x35, 0x93, 0xdf, 0x24, 0x87, 0xe8, 0xac, 0x55, 0xf4, 0x30, 0x49, 0x41, 0xc4, 0xca, + 0x51, 0x1e, 0xd2, 0x4f, 0x4e, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xd9, 0x86, 0xfd, 0x01, + 0x58, 0xe2, 0xf5, 0x3f, 0x47, 0x7c, 0x3c, 0xda, 0xc9, 0x17, 0x00, 0xdf, 0x37, 0x44, + 0x73, 0x8d, 0xec, 0xf9, 0x1b, 0x8d, 0x36, 0xaf, 0x41, 0x9c, 0x91, 0xa6, 0x4a, 0x07, + 0xe8, 0xca, 0x4a, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5b, 0xc7, 0x0d, 0x00, + 0x0b, + ], + &[ + 0x6e, 0x1b, 0x3c, 0x94, 0xa9, 0xb5, 0x70, 0xe6, 0x65, 0x4d, 0x8b, 0x08, 0xfa, 0xb8, + 0xc5, 0xdf, 0xd2, 0x52, 0xa6, 0xd9, 0xe9, 0x88, 0x69, 0x34, 0x18, 0xee, 0xfd, 0x0d, + 0xd2, 0x5f, 0x9c, 0x40, 0x97, 0x32, 0xce, 0xd9, 0x7e, 0xd3, 0xac, 0x22, 0xd2, 0x99, + 0x6f, 0x1e, 0x03, 0x87, 0x16, 0x1d, 0xee, 0x86, 0x99, 0x4b, 0x1b, 0xbb, 0x5d, 0x13, + 0x27, 0x64, 0x6f, 0x4f, 0x1e, 0xd1, 0x02, 0xd5, 0x45, 0x3c, 0x8b, 0x53, 0xf1, 0x64, + 0x72, 0x9a, 0x3c, 0xc9, 0x78, 0x06, 0x6e, 0xb3, 0x51, 0xa8, 0x50, 0x1f, 0xfa, 0xec, + 0xca, 0xa3, 0xdb, 0x68, 0x43, 0x77, 0x43, 0x4a, 0x9a, 0x2a, 0x2b, 0xf5, 0x85, 0x3c, + 0x47, 0xeb, 0xea, 0x50, 0x0b, 0xcf, 0x00, 0xf9, 0x98, 0xe5, 0xae, 0x8d, 0xab, 0x86, + 0xb0, 0x76, 0x5f, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5c, 0xc7, 0x0d, 0x00, 0xfe, 0x5d, 0xc7, 0x0d, 0x00, + 0x07, + ], + &[ + 0x36, 0x60, 0x1d, 0x16, 0x25, 0xc5, 0x8c, 0x15, 0xc5, 0xb7, 0x68, 0x51, 0x73, 0x0e, + 0x2b, 0xdf, 0x43, 0xbf, 0x21, 0x0e, 0xdc, 0xf5, 0x14, 0xfc, 0x2b, 0xb5, 0xd3, 0x66, + 0x98, 0x5b, 0xee, 0xd3, 0x44, 0xbd, 0x5f, 0xc6, 0x44, 0xbd, 0x5f, 0xc6, 0xc8, 0xca, + 0x7e, 0x1f, 0xc8, 0xca, 0x7e, 0x1f, 0xc1, 0xc6, 0xc9, 0xbe, 0x6c, 0xd5, 0x4f, 0x84, + 0x2b, 0x14, 0xaa, 0x9d, 0xd2, 0xd9, 0x50, 0x2d, 0x7d, 0x04, 0x8c, 0xf1, 0x2e, 0xec, + 0x41, 0x3c, 0x6a, 0xba, 0x46, 0x72, 0x74, 0x0e, 0xb4, 0x0d, 0xc1, 0xc6, 0xc9, 0xbe, + 0x6c, 0xd5, 0x4f, 0x84, 0x2b, 0x14, 0xaa, 0x9d, 0xd2, 0xd9, 0x50, 0x2d, 0x7d, 0x04, + 0x8c, 0xf1, 0x2e, 0xec, 0x41, 0x3c, 0x6a, 0xba, 0x46, 0x72, 0x74, 0x0e, 0xb4, 0x0d, + 0x04, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5e, 0xc7, 0x0d, 0x00, 0xfe, 0x5e, 0xc7, 0x0d, 0x00, + 0x02, + ], + ], + root_serialized: &[ + 0xb6, 0xc1, 0xc8, 0xe3, 0x52, 0x5e, 0x56, 0x56, 0x59, 0x77, 0x14, 0x50, 0xce, 0xce, + 0xe3, 0x8b, 0x7a, 0x8b, 0xd9, 0xcb, 0x0f, 0xb6, 0x74, 0xf5, 0x97, 0x78, 0x39, 0x5d, + 0x2e, 0x18, 0xd3, 0x79, 0x87, 0xe8, 0xac, 0x55, 0x44, 0xbd, 0x5f, 0xc6, 0xc4, 0xca, + 0x51, 0x1e, 0xc8, 0xca, 0x7e, 0x1f, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xc1, 0xc6, 0xc9, 0xbe, + 0x6c, 0xd5, 0x4f, 0x84, 0x2b, 0x14, 0xaa, 0x9d, 0xd2, 0xd9, 0x50, 0x2d, 0x7d, 0x04, + 0x8c, 0xf1, 0x2e, 0xec, 0x41, 0x3c, 0x6a, 0xba, 0x46, 0x72, 0x74, 0x0e, 0xb4, 0x0d, + 0x9c, 0x43, 0xaa, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5e, 0xc7, 0x0d, 0x00, + 0x14, + ], + hash_chain_history_root: [ + 0xdd, 0x76, 0x15, 0xde, 0x0a, 0xd3, 0x80, 0x3a, 0x00, 0x00, 0x2a, 0xfd, 0xf8, 0x74, + 0x3c, 0x97, 0x70, 0x6f, 0x6f, 0xe4, 0x94, 0x54, 0x49, 0xb0, 0xe4, 0x83, 0xad, 0xa5, + 0x9f, 0xc1, 0x3a, 0x0f, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 8, + leaf_block_hash: [ + 0x49, 0x11, 0x0d, 0xde, 0x73, 0x56, 0x76, 0xb3, 0x08, 0x8c, 0x1d, 0x06, 0x82, 0x2e, + 0x29, 0x14, 0xdb, 0x8d, 0x03, 0xdc, 0x9e, 0xa6, 0x2e, 0x80, 0x42, 0x6b, 0x9a, 0x29, + 0x6d, 0xd4, 0x92, 0x85, + ], + leaf_time: 2700292835, + leaf_target_bits: 505299833, + leaf_sapling_root: [ + 0xb2, 0x66, 0x51, 0x90, 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, + 0xf7, 0xc0, 0xe2, 0xde, 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, + 0xef, 0xc2, 0xc4, 0x56, + ], + leaf_work: [ + 0x82, 0x75, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903007, + leaf_sapling_tx_count: 3, + leaf_serialized: &[ + 0x49, 0x11, 0x0d, 0xde, 0x73, 0x56, 0x76, 0xb3, 0x08, 0x8c, 0x1d, 0x06, 0x82, 0x2e, + 0x29, 0x14, 0xdb, 0x8d, 0x03, 0xdc, 0x9e, 0xa6, 0x2e, 0x80, 0x42, 0x6b, 0x9a, 0x29, + 0x6d, 0xd4, 0x92, 0x85, 0xe3, 0x32, 0xf3, 0xa0, 0xe3, 0x32, 0xf3, 0xa0, 0x79, 0x43, + 0x1e, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0xb2, 0x66, 0x51, 0x90, 0x5e, 0xf6, 0x83, 0xb5, + 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, 0x9c, 0x45, 0x16, 0x0a, + 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x82, 0x75, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x03, + ], + peaks: &[&[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ]], + root_serialized: &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + hash_chain_history_root: [ + 0xe7, 0xca, 0xd3, 0xbb, 0x47, 0x02, 0x6e, 0x6c, 0x2f, 0x4d, 0x37, 0xdf, 0x08, 0x6c, + 0xc2, 0xab, 0x1e, 0xcf, 0xc7, 0x7d, 0xfd, 0x59, 0x0e, 0xa7, 0xd6, 0x79, 0xa7, 0x64, + 0xeb, 0x49, 0x7e, 0x89, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 9, + leaf_block_hash: [ + 0x9f, 0x03, 0x81, 0x29, 0x57, 0xaa, 0xe6, 0x5d, 0x22, 0xb5, 0x8c, 0x18, 0xe7, 0xc5, + 0xfe, 0x5a, 0x88, 0x59, 0xd4, 0xd7, 0xb4, 0x6c, 0x38, 0x13, 0x8a, 0x09, 0x4e, 0x68, + 0x22, 0x71, 0xbf, 0x43, + ], + leaf_time: 1942273234, + leaf_target_bits: 525768147, + leaf_sapling_root: [ + 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, + 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, + 0xb3, 0xc5, 0x9a, 0x1d, + ], + leaf_work: [ + 0xf4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903008, + leaf_sapling_tx_count: 5, + leaf_serialized: &[ + 0x9f, 0x03, 0x81, 0x29, 0x57, 0xaa, 0xe6, 0x5d, 0x22, 0xb5, 0x8c, 0x18, 0xe7, 0xc5, + 0xfe, 0x5a, 0x88, 0x59, 0xd4, 0xd7, 0xb4, 0x6c, 0x38, 0x13, 0x8a, 0x09, 0x4e, 0x68, + 0x22, 0x71, 0xbf, 0x43, 0xd2, 0xbc, 0xc4, 0x73, 0xd2, 0xbc, 0xc4, 0x73, 0xd3, 0x95, + 0x56, 0x1f, 0xd3, 0x95, 0x56, 0x1f, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0x1f, 0xcd, 0x09, 0xdc, + 0xd1, 0x6e, 0x06, 0x79, 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, + 0xef, 0x45, 0x7d, 0x6f, 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, + 0xf4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, + 0x05, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0x9f, 0x03, 0x81, 0x29, 0x57, 0xaa, 0xe6, 0x5d, 0x22, 0xb5, 0x8c, 0x18, 0xe7, 0xc5, + 0xfe, 0x5a, 0x88, 0x59, 0xd4, 0xd7, 0xb4, 0x6c, 0x38, 0x13, 0x8a, 0x09, 0x4e, 0x68, + 0x22, 0x71, 0xbf, 0x43, 0xd2, 0xbc, 0xc4, 0x73, 0xd2, 0xbc, 0xc4, 0x73, 0xd3, 0x95, + 0x56, 0x1f, 0xd3, 0x95, 0x56, 0x1f, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0x1f, 0xcd, 0x09, 0xdc, + 0xd1, 0x6e, 0x06, 0x79, 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, + 0xef, 0x45, 0x7d, 0x6f, 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, + 0xf4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, + 0x05, + ], + ], + root_serialized: &[ + 0x25, 0xec, 0x6f, 0xf4, 0x08, 0xbd, 0xe6, 0x9e, 0x96, 0xed, 0xd3, 0x6a, 0x5c, 0x49, + 0x86, 0x73, 0x87, 0x6d, 0xa4, 0xdc, 0x7a, 0x6f, 0x0c, 0x16, 0xf7, 0xa4, 0xe6, 0x48, + 0xf0, 0x7d, 0x89, 0x0d, 0x87, 0xe8, 0xac, 0x55, 0xd2, 0xbc, 0xc4, 0x73, 0xc4, 0xca, + 0x51, 0x1e, 0xd3, 0x95, 0x56, 0x1f, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x1f, 0xcd, 0x09, 0xdc, + 0xd1, 0x6e, 0x06, 0x79, 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, + 0xef, 0x45, 0x7d, 0x6f, 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, + 0x12, 0xbc, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, + 0x1c, + ], + hash_chain_history_root: [ + 0xd9, 0x90, 0x78, 0xa6, 0x87, 0x0a, 0x64, 0xce, 0x22, 0x5f, 0x2d, 0x0f, 0x92, 0xd7, + 0x4a, 0xe4, 0xa1, 0xa7, 0xb0, 0x7d, 0x6e, 0xfd, 0xe0, 0x00, 0xed, 0x98, 0xdb, 0x45, + 0xe3, 0x59, 0x7e, 0x8c, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 10, + leaf_block_hash: [ + 0x18, 0x78, 0xf3, 0xf3, 0x2d, 0x94, 0x14, 0x1a, 0x9c, 0x15, 0xb7, 0x31, 0xf8, 0x52, + 0x24, 0x57, 0x49, 0xd5, 0x27, 0xf6, 0xe6, 0xd6, 0x19, 0xfd, 0xe5, 0x1e, 0xf1, 0x5b, + 0x98, 0x3d, 0xc9, 0xb1, + ], + leaf_time: 554306976, + leaf_target_bits: 503668785, + leaf_sapling_root: [ + 0x46, 0x10, 0xba, 0x76, 0x7d, 0x94, 0x9f, 0x20, 0x4c, 0x44, 0x20, 0xcd, 0x20, 0x3d, + 0x79, 0x9c, 0x98, 0xea, 0x2b, 0xad, 0xa8, 0xc6, 0xcb, 0xf7, 0x66, 0x9a, 0x8a, 0x7a, + 0xb2, 0x17, 0x82, 0xff, + ], + leaf_work: [ + 0x0c, 0x9f, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903009, + leaf_sapling_tx_count: 1, + leaf_serialized: &[ + 0x18, 0x78, 0xf3, 0xf3, 0x2d, 0x94, 0x14, 0x1a, 0x9c, 0x15, 0xb7, 0x31, 0xf8, 0x52, + 0x24, 0x57, 0x49, 0xd5, 0x27, 0xf6, 0xe6, 0xd6, 0x19, 0xfd, 0xe5, 0x1e, 0xf1, 0x5b, + 0x98, 0x3d, 0xc9, 0xb1, 0xa0, 0x0d, 0x0a, 0x21, 0xa0, 0x0d, 0x0a, 0x21, 0x31, 0x60, + 0x05, 0x1e, 0x31, 0x60, 0x05, 0x1e, 0x46, 0x10, 0xba, 0x76, 0x7d, 0x94, 0x9f, 0x20, + 0x4c, 0x44, 0x20, 0xcd, 0x20, 0x3d, 0x79, 0x9c, 0x98, 0xea, 0x2b, 0xad, 0xa8, 0xc6, + 0xcb, 0xf7, 0x66, 0x9a, 0x8a, 0x7a, 0xb2, 0x17, 0x82, 0xff, 0x46, 0x10, 0xba, 0x76, + 0x7d, 0x94, 0x9f, 0x20, 0x4c, 0x44, 0x20, 0xcd, 0x20, 0x3d, 0x79, 0x9c, 0x98, 0xea, + 0x2b, 0xad, 0xa8, 0xc6, 0xcb, 0xf7, 0x66, 0x9a, 0x8a, 0x7a, 0xb2, 0x17, 0x82, 0xff, + 0x0c, 0x9f, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x61, 0xc7, 0x0d, 0x00, 0xfe, 0x61, 0xc7, 0x0d, 0x00, + 0x01, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0x52, 0xf5, 0xb1, 0xa2, 0x67, 0x38, 0xdb, 0x5e, 0x0e, 0xd1, 0xf4, 0x04, 0xda, 0x1a, + 0x62, 0x5a, 0x07, 0x7f, 0x2e, 0x24, 0x6d, 0xa8, 0x06, 0xf9, 0x05, 0x87, 0x11, 0x92, + 0xa2, 0x31, 0xe3, 0xa7, 0xd2, 0xbc, 0xc4, 0x73, 0xa0, 0x0d, 0x0a, 0x21, 0xd3, 0x95, + 0x56, 0x1f, 0x31, 0x60, 0x05, 0x1e, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0x46, 0x10, 0xba, 0x76, + 0x7d, 0x94, 0x9f, 0x20, 0x4c, 0x44, 0x20, 0xcd, 0x20, 0x3d, 0x79, 0x9c, 0x98, 0xea, + 0x2b, 0xad, 0xa8, 0xc6, 0xcb, 0xf7, 0x66, 0x9a, 0x8a, 0x7a, 0xb2, 0x17, 0x82, 0xff, + 0x00, 0xa2, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x61, 0xc7, 0x0d, 0x00, + 0x06, + ], + ], + root_serialized: &[ + 0xa3, 0x49, 0xab, 0x16, 0xd0, 0x19, 0x3c, 0x16, 0xe0, 0xfd, 0x5d, 0x5b, 0xfe, 0xde, + 0x3d, 0x86, 0x1f, 0x44, 0xd3, 0x02, 0x1f, 0x8e, 0x05, 0x8a, 0x90, 0x31, 0x77, 0x8d, + 0xff, 0x16, 0x6a, 0x21, 0x87, 0xe8, 0xac, 0x55, 0xa0, 0x0d, 0x0a, 0x21, 0xc4, 0xca, + 0x51, 0x1e, 0x31, 0x60, 0x05, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x46, 0x10, 0xba, 0x76, + 0x7d, 0x94, 0x9f, 0x20, 0x4c, 0x44, 0x20, 0xcd, 0x20, 0x3d, 0x79, 0x9c, 0x98, 0xea, + 0x2b, 0xad, 0xa8, 0xc6, 0xcb, 0xf7, 0x66, 0x9a, 0x8a, 0x7a, 0xb2, 0x17, 0x82, 0xff, + 0x1e, 0x5b, 0xe2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x61, 0xc7, 0x0d, 0x00, + 0x1d, + ], + hash_chain_history_root: [ + 0x4a, 0x75, 0xab, 0xde, 0xc4, 0x4f, 0x18, 0xa1, 0x6a, 0x63, 0x01, 0x07, 0xb8, 0x7b, + 0x83, 0xcf, 0xfb, 0x09, 0x20, 0xa8, 0xab, 0xa2, 0x9c, 0xa1, 0xc5, 0x01, 0xbf, 0x17, + 0x7e, 0x21, 0x89, 0x38, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 11, + leaf_block_hash: [ + 0xf2, 0x31, 0x38, 0x18, 0x4c, 0x9e, 0xec, 0x7c, 0xa0, 0x69, 0xca, 0xac, 0x34, 0xda, + 0x48, 0x3a, 0xc9, 0xd4, 0x13, 0x8b, 0x95, 0x74, 0xa1, 0x77, 0x95, 0x0a, 0xa6, 0x05, + 0xea, 0x03, 0xd7, 0xd0, + ], + leaf_time: 1305834307, + leaf_target_bits: 521567514, + leaf_sapling_root: [ + 0x03, 0x6b, 0x29, 0x4d, 0xe2, 0xd8, 0x65, 0x52, 0x92, 0x2b, 0x5c, 0x98, 0x6e, 0x17, + 0x81, 0xd9, 0x99, 0xb5, 0x4e, 0x44, 0x15, 0x1e, 0xe1, 0x1f, 0x02, 0x94, 0x54, 0xd8, + 0x86, 0x9c, 0xff, 0x22, + ], + leaf_work: [ + 0x62, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903010, + leaf_sapling_tx_count: 4, + leaf_serialized: &[ + 0xf2, 0x31, 0x38, 0x18, 0x4c, 0x9e, 0xec, 0x7c, 0xa0, 0x69, 0xca, 0xac, 0x34, 0xda, + 0x48, 0x3a, 0xc9, 0xd4, 0x13, 0x8b, 0x95, 0x74, 0xa1, 0x77, 0x95, 0x0a, 0xa6, 0x05, + 0xea, 0x03, 0xd7, 0xd0, 0x43, 0x73, 0xd5, 0x4d, 0x43, 0x73, 0xd5, 0x4d, 0x1a, 0x7d, + 0x16, 0x1f, 0x1a, 0x7d, 0x16, 0x1f, 0x03, 0x6b, 0x29, 0x4d, 0xe2, 0xd8, 0x65, 0x52, + 0x92, 0x2b, 0x5c, 0x98, 0x6e, 0x17, 0x81, 0xd9, 0x99, 0xb5, 0x4e, 0x44, 0x15, 0x1e, + 0xe1, 0x1f, 0x02, 0x94, 0x54, 0xd8, 0x86, 0x9c, 0xff, 0x22, 0x03, 0x6b, 0x29, 0x4d, + 0xe2, 0xd8, 0x65, 0x52, 0x92, 0x2b, 0x5c, 0x98, 0x6e, 0x17, 0x81, 0xd9, 0x99, 0xb5, + 0x4e, 0x44, 0x15, 0x1e, 0xe1, 0x1f, 0x02, 0x94, 0x54, 0xd8, 0x86, 0x9c, 0xff, 0x22, + 0x62, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x62, 0xc7, 0x0d, 0x00, 0xfe, 0x62, 0xc7, 0x0d, 0x00, + 0x04, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0x52, 0xf5, 0xb1, 0xa2, 0x67, 0x38, 0xdb, 0x5e, 0x0e, 0xd1, 0xf4, 0x04, 0xda, 0x1a, + 0x62, 0x5a, 0x07, 0x7f, 0x2e, 0x24, 0x6d, 0xa8, 0x06, 0xf9, 0x05, 0x87, 0x11, 0x92, + 0xa2, 0x31, 0xe3, 0xa7, 0xd2, 0xbc, 0xc4, 0x73, 0xa0, 0x0d, 0x0a, 0x21, 0xd3, 0x95, + 0x56, 0x1f, 0x31, 0x60, 0x05, 0x1e, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0x46, 0x10, 0xba, 0x76, + 0x7d, 0x94, 0x9f, 0x20, 0x4c, 0x44, 0x20, 0xcd, 0x20, 0x3d, 0x79, 0x9c, 0x98, 0xea, + 0x2b, 0xad, 0xa8, 0xc6, 0xcb, 0xf7, 0x66, 0x9a, 0x8a, 0x7a, 0xb2, 0x17, 0x82, 0xff, + 0x00, 0xa2, 0x2f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x61, 0xc7, 0x0d, 0x00, + 0x06, + ], + &[ + 0xf2, 0x31, 0x38, 0x18, 0x4c, 0x9e, 0xec, 0x7c, 0xa0, 0x69, 0xca, 0xac, 0x34, 0xda, + 0x48, 0x3a, 0xc9, 0xd4, 0x13, 0x8b, 0x95, 0x74, 0xa1, 0x77, 0x95, 0x0a, 0xa6, 0x05, + 0xea, 0x03, 0xd7, 0xd0, 0x43, 0x73, 0xd5, 0x4d, 0x43, 0x73, 0xd5, 0x4d, 0x1a, 0x7d, + 0x16, 0x1f, 0x1a, 0x7d, 0x16, 0x1f, 0x03, 0x6b, 0x29, 0x4d, 0xe2, 0xd8, 0x65, 0x52, + 0x92, 0x2b, 0x5c, 0x98, 0x6e, 0x17, 0x81, 0xd9, 0x99, 0xb5, 0x4e, 0x44, 0x15, 0x1e, + 0xe1, 0x1f, 0x02, 0x94, 0x54, 0xd8, 0x86, 0x9c, 0xff, 0x22, 0x03, 0x6b, 0x29, 0x4d, + 0xe2, 0xd8, 0x65, 0x52, 0x92, 0x2b, 0x5c, 0x98, 0x6e, 0x17, 0x81, 0xd9, 0x99, 0xb5, + 0x4e, 0x44, 0x15, 0x1e, 0xe1, 0x1f, 0x02, 0x94, 0x54, 0xd8, 0x86, 0x9c, 0xff, 0x22, + 0x62, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x62, 0xc7, 0x0d, 0x00, 0xfe, 0x62, 0xc7, 0x0d, 0x00, + 0x04, + ], + ], + root_serialized: &[ + 0x13, 0x82, 0x59, 0x9f, 0x81, 0xe9, 0x2a, 0x0d, 0x27, 0x84, 0x64, 0x9e, 0x60, 0xb3, + 0x19, 0xf8, 0x18, 0x96, 0x81, 0xe0, 0x2c, 0x9e, 0xbe, 0x5d, 0x05, 0x76, 0xc6, 0x11, + 0x4b, 0xb7, 0x05, 0x24, 0x87, 0xe8, 0xac, 0x55, 0x43, 0x73, 0xd5, 0x4d, 0xc4, 0xca, + 0x51, 0x1e, 0x1a, 0x7d, 0x16, 0x1f, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x03, 0x6b, 0x29, 0x4d, + 0xe2, 0xd8, 0x65, 0x52, 0x92, 0x2b, 0x5c, 0x98, 0x6e, 0x17, 0x81, 0xd9, 0x99, 0xb5, + 0x4e, 0x44, 0x15, 0x1e, 0xe1, 0x1f, 0x02, 0x94, 0x54, 0xd8, 0x86, 0x9c, 0xff, 0x22, + 0x80, 0x66, 0xe2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x62, 0xc7, 0x0d, 0x00, + 0x21, + ], + hash_chain_history_root: [ + 0x69, 0x78, 0xd6, 0x8d, 0x1b, 0x4e, 0xe9, 0x57, 0x76, 0x47, 0x12, 0xb4, 0xb7, 0x6b, + 0xb1, 0xd1, 0x90, 0xd2, 0x2b, 0x9f, 0xce, 0xeb, 0x06, 0x90, 0x33, 0x65, 0x61, 0xdf, + 0xb5, 0x8f, 0x45, 0xd1, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 12, + leaf_block_hash: [ + 0x33, 0x0c, 0x6e, 0x24, 0x29, 0x32, 0xc6, 0x43, 0xed, 0x6c, 0x05, 0x1a, 0x71, 0x85, + 0x8a, 0x82, 0x8a, 0xff, 0xa0, 0xb9, 0x8b, 0x1b, 0xcd, 0xf1, 0xc6, 0xc6, 0xc9, 0xe8, + 0x2e, 0x90, 0x65, 0xfa, + ], + leaf_time: 2860047587, + leaf_target_bits: 503851091, + leaf_sapling_root: [ + 0xe6, 0x35, 0xa5, 0x6d, 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, + 0x4b, 0xe1, 0x56, 0x9f, 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, + 0x37, 0x76, 0xb7, 0x6a, + ], + leaf_work: [ + 0xd1, 0x61, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903011, + leaf_sapling_tx_count: 4, + leaf_serialized: &[ + 0x33, 0x0c, 0x6e, 0x24, 0x29, 0x32, 0xc6, 0x43, 0xed, 0x6c, 0x05, 0x1a, 0x71, 0x85, + 0x8a, 0x82, 0x8a, 0xff, 0xa0, 0xb9, 0x8b, 0x1b, 0xcd, 0xf1, 0xc6, 0xc6, 0xc9, 0xe8, + 0x2e, 0x90, 0x65, 0xfa, 0xe3, 0xdc, 0x78, 0xaa, 0xe3, 0xdc, 0x78, 0xaa, 0x53, 0x28, + 0x08, 0x1e, 0x53, 0x28, 0x08, 0x1e, 0xe6, 0x35, 0xa5, 0x6d, 0x32, 0x9a, 0xa4, 0x48, + 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, 0x58, 0x0e, 0x14, 0x21, + 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, 0xe6, 0x35, 0xa5, 0x6d, + 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, + 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, + 0xd1, 0x61, 0x1f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, + 0x04, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0xc5, 0xee, 0x36, 0x45, 0xff, 0xaf, 0x07, 0xab, 0x1e, 0x89, 0xb8, 0x1f, 0x1b, 0x05, + 0x36, 0x68, 0x17, 0x44, 0x70, 0xf0, 0xea, 0x42, 0x9f, 0x84, 0x85, 0xf6, 0xe2, 0x55, + 0xfe, 0x9c, 0x87, 0x7b, 0xd2, 0xbc, 0xc4, 0x73, 0xe3, 0xdc, 0x78, 0xaa, 0xd3, 0x95, + 0x56, 0x1f, 0x53, 0x28, 0x08, 0x1e, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0xe6, 0x35, 0xa5, 0x6d, + 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, + 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, + 0x33, 0x0f, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, + 0x0e, + ], + ], + root_serialized: &[ + 0x47, 0xce, 0x2b, 0x48, 0x31, 0xbf, 0x23, 0xb4, 0x3c, 0x78, 0x8e, 0xf8, 0x65, 0x96, + 0x2b, 0xeb, 0xf7, 0xf8, 0x9e, 0xe1, 0x93, 0x25, 0xc6, 0x8e, 0xf7, 0x94, 0xf6, 0x42, + 0x5e, 0x4c, 0x44, 0x68, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0xdc, 0x78, 0xaa, 0xc4, 0xca, + 0x51, 0x1e, 0x53, 0x28, 0x08, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xe6, 0x35, 0xa5, 0x6d, + 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, + 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, + 0x51, 0xc8, 0x01, 0x0f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, + 0x25, + ], + hash_chain_history_root: [ + 0x02, 0x83, 0x20, 0x50, 0xd1, 0x9a, 0x6e, 0xcc, 0x31, 0x6e, 0x0b, 0xfd, 0x79, 0xde, + 0xb4, 0xe9, 0xf2, 0x7c, 0xc0, 0x89, 0x32, 0x54, 0x53, 0xc1, 0xa5, 0x68, 0xa9, 0xd1, + 0x3a, 0x87, 0x21, 0x43, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 13, + leaf_block_hash: [ + 0xb6, 0xa3, 0xeb, 0x39, 0x41, 0x3a, 0x9e, 0x2a, 0xc3, 0x99, 0x9d, 0x1a, 0x28, 0x98, + 0xfe, 0x50, 0x76, 0x51, 0x6d, 0x9e, 0xb3, 0xa7, 0x8b, 0x46, 0x8c, 0xb9, 0xfe, 0xcd, + 0x3c, 0x31, 0x43, 0x9e, + ], + leaf_time: 1023131482, + leaf_target_bits: 475709697, + leaf_sapling_root: [ + 0x9f, 0x4f, 0xf5, 0x0c, 0x7a, 0xbe, 0xe2, 0xb3, 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, + 0x8a, 0xef, 0xb5, 0xca, 0x1c, 0xa7, 0xf0, 0x36, 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, + 0x53, 0xfe, 0xf5, 0x58, + ], + leaf_work: [ + 0x47, 0xea, 0x20, 0xd2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903012, + leaf_sapling_tx_count: 6, + leaf_serialized: &[ + 0xb6, 0xa3, 0xeb, 0x39, 0x41, 0x3a, 0x9e, 0x2a, 0xc3, 0x99, 0x9d, 0x1a, 0x28, 0x98, + 0xfe, 0x50, 0x76, 0x51, 0x6d, 0x9e, 0xb3, 0xa7, 0x8b, 0x46, 0x8c, 0xb9, 0xfe, 0xcd, + 0x3c, 0x31, 0x43, 0x9e, 0x5a, 0xbf, 0xfb, 0x3c, 0x5a, 0xbf, 0xfb, 0x3c, 0x01, 0xc1, + 0x5a, 0x1c, 0x01, 0xc1, 0x5a, 0x1c, 0x9f, 0x4f, 0xf5, 0x0c, 0x7a, 0xbe, 0xe2, 0xb3, + 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, 0x1c, 0xa7, 0xf0, 0x36, + 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, 0x9f, 0x4f, 0xf5, 0x0c, + 0x7a, 0xbe, 0xe2, 0xb3, 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, + 0x1c, 0xa7, 0xf0, 0x36, 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, + 0x47, 0xea, 0x20, 0xd2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, + 0x06, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0xc5, 0xee, 0x36, 0x45, 0xff, 0xaf, 0x07, 0xab, 0x1e, 0x89, 0xb8, 0x1f, 0x1b, 0x05, + 0x36, 0x68, 0x17, 0x44, 0x70, 0xf0, 0xea, 0x42, 0x9f, 0x84, 0x85, 0xf6, 0xe2, 0x55, + 0xfe, 0x9c, 0x87, 0x7b, 0xd2, 0xbc, 0xc4, 0x73, 0xe3, 0xdc, 0x78, 0xaa, 0xd3, 0x95, + 0x56, 0x1f, 0x53, 0x28, 0x08, 0x1e, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0xe6, 0x35, 0xa5, 0x6d, + 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, + 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, + 0x33, 0x0f, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, + 0x0e, + ], + &[ + 0xb6, 0xa3, 0xeb, 0x39, 0x41, 0x3a, 0x9e, 0x2a, 0xc3, 0x99, 0x9d, 0x1a, 0x28, 0x98, + 0xfe, 0x50, 0x76, 0x51, 0x6d, 0x9e, 0xb3, 0xa7, 0x8b, 0x46, 0x8c, 0xb9, 0xfe, 0xcd, + 0x3c, 0x31, 0x43, 0x9e, 0x5a, 0xbf, 0xfb, 0x3c, 0x5a, 0xbf, 0xfb, 0x3c, 0x01, 0xc1, + 0x5a, 0x1c, 0x01, 0xc1, 0x5a, 0x1c, 0x9f, 0x4f, 0xf5, 0x0c, 0x7a, 0xbe, 0xe2, 0xb3, + 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, 0x1c, 0xa7, 0xf0, 0x36, + 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, 0x9f, 0x4f, 0xf5, 0x0c, + 0x7a, 0xbe, 0xe2, 0xb3, 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, + 0x1c, 0xa7, 0xf0, 0x36, 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, + 0x47, 0xea, 0x20, 0xd2, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, + 0x06, + ], + ], + root_serialized: &[ + 0x64, 0xcb, 0x44, 0xff, 0x45, 0x89, 0x95, 0x46, 0x5b, 0x36, 0xee, 0xa9, 0xd3, 0x71, + 0xe2, 0x58, 0x6a, 0x86, 0x39, 0x89, 0x0d, 0xcd, 0xcc, 0xde, 0x8e, 0x4b, 0xde, 0x49, + 0x4d, 0xe2, 0x83, 0x57, 0x87, 0xe8, 0xac, 0x55, 0x5a, 0xbf, 0xfb, 0x3c, 0xc4, 0xca, + 0x51, 0x1e, 0x01, 0xc1, 0x5a, 0x1c, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x9f, 0x4f, 0xf5, 0x0c, + 0x7a, 0xbe, 0xe2, 0xb3, 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, + 0x1c, 0xa7, 0xf0, 0x36, 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, + 0x98, 0xb2, 0x22, 0xe1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, + 0x2b, + ], + hash_chain_history_root: [ + 0x50, 0x1f, 0x6d, 0x84, 0x92, 0x88, 0x08, 0x10, 0x52, 0x8a, 0xbd, 0xcb, 0x27, 0x5d, + 0x97, 0xee, 0xb8, 0x77, 0x8d, 0xd0, 0x9b, 0xbb, 0xab, 0xcc, 0xb5, 0xb7, 0x0d, 0x9e, + 0xb1, 0x72, 0xd9, 0x97, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 14, + leaf_block_hash: [ + 0x89, 0xc2, 0x7a, 0xbd, 0x83, 0x92, 0xd1, 0x24, 0x70, 0x28, 0x2a, 0xc5, 0x92, 0x1c, + 0xbb, 0x86, 0x2c, 0xd0, 0xf1, 0x34, 0xff, 0xc5, 0x79, 0x4d, 0xa3, 0x89, 0xef, 0xdc, + 0xfa, 0x8d, 0x5c, 0x2b, + ], + leaf_time: 4202533293, + leaf_target_bits: 493240239, + leaf_sapling_root: [ + 0x56, 0xa0, 0xcd, 0xf6, 0x99, 0x16, 0x48, 0xa5, 0x27, 0x16, 0xed, 0xc8, 0x3b, 0xd2, + 0x9b, 0xe9, 0x7d, 0x44, 0x25, 0x2a, 0x81, 0x58, 0x56, 0x60, 0x62, 0xf7, 0x8d, 0x16, + 0xd9, 0x54, 0x0b, 0x1b, + ], + leaf_work: [ + 0x55, 0xf2, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903013, + leaf_sapling_tx_count: 5, + leaf_serialized: &[ + 0x89, 0xc2, 0x7a, 0xbd, 0x83, 0x92, 0xd1, 0x24, 0x70, 0x28, 0x2a, 0xc5, 0x92, 0x1c, + 0xbb, 0x86, 0x2c, 0xd0, 0xf1, 0x34, 0xff, 0xc5, 0x79, 0x4d, 0xa3, 0x89, 0xef, 0xdc, + 0xfa, 0x8d, 0x5c, 0x2b, 0xad, 0x91, 0x7d, 0xfa, 0xad, 0x91, 0x7d, 0xfa, 0xaf, 0x3f, + 0x66, 0x1d, 0xaf, 0x3f, 0x66, 0x1d, 0x56, 0xa0, 0xcd, 0xf6, 0x99, 0x16, 0x48, 0xa5, + 0x27, 0x16, 0xed, 0xc8, 0x3b, 0xd2, 0x9b, 0xe9, 0x7d, 0x44, 0x25, 0x2a, 0x81, 0x58, + 0x56, 0x60, 0x62, 0xf7, 0x8d, 0x16, 0xd9, 0x54, 0x0b, 0x1b, 0x56, 0xa0, 0xcd, 0xf6, + 0x99, 0x16, 0x48, 0xa5, 0x27, 0x16, 0xed, 0xc8, 0x3b, 0xd2, 0x9b, 0xe9, 0x7d, 0x44, + 0x25, 0x2a, 0x81, 0x58, 0x56, 0x60, 0x62, 0xf7, 0x8d, 0x16, 0xd9, 0x54, 0x0b, 0x1b, + 0x55, 0xf2, 0x80, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x65, 0xc7, 0x0d, 0x00, 0xfe, 0x65, 0xc7, 0x0d, 0x00, + 0x05, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0xc5, 0xee, 0x36, 0x45, 0xff, 0xaf, 0x07, 0xab, 0x1e, 0x89, 0xb8, 0x1f, 0x1b, 0x05, + 0x36, 0x68, 0x17, 0x44, 0x70, 0xf0, 0xea, 0x42, 0x9f, 0x84, 0x85, 0xf6, 0xe2, 0x55, + 0xfe, 0x9c, 0x87, 0x7b, 0xd2, 0xbc, 0xc4, 0x73, 0xe3, 0xdc, 0x78, 0xaa, 0xd3, 0x95, + 0x56, 0x1f, 0x53, 0x28, 0x08, 0x1e, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0xe6, 0x35, 0xa5, 0x6d, + 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, + 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, + 0x33, 0x0f, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, + 0x0e, + ], + &[ + 0x1e, 0xbe, 0xef, 0x04, 0x9b, 0x31, 0x6c, 0xad, 0x0c, 0x95, 0xcf, 0xc6, 0xeb, 0x51, + 0x6b, 0x38, 0x34, 0xf9, 0x76, 0x10, 0xae, 0xb0, 0x8a, 0x49, 0xab, 0x13, 0xb0, 0x9e, + 0xee, 0x7a, 0xe8, 0x73, 0x5a, 0xbf, 0xfb, 0x3c, 0xad, 0x91, 0x7d, 0xfa, 0x01, 0xc1, + 0x5a, 0x1c, 0xaf, 0x3f, 0x66, 0x1d, 0x9f, 0x4f, 0xf5, 0x0c, 0x7a, 0xbe, 0xe2, 0xb3, + 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, 0x1c, 0xa7, 0xf0, 0x36, + 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, 0x56, 0xa0, 0xcd, 0xf6, + 0x99, 0x16, 0x48, 0xa5, 0x27, 0x16, 0xed, 0xc8, 0x3b, 0xd2, 0x9b, 0xe9, 0x7d, 0x44, + 0x25, 0x2a, 0x81, 0x58, 0x56, 0x60, 0x62, 0xf7, 0x8d, 0x16, 0xd9, 0x54, 0x0b, 0x1b, + 0x9c, 0xdc, 0xa1, 0xd4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, 0xfe, 0x65, 0xc7, 0x0d, 0x00, + 0x0b, + ], + ], + root_serialized: &[ + 0x42, 0x08, 0xab, 0xd9, 0xbc, 0x5e, 0xe8, 0xe6, 0xe9, 0xa3, 0x53, 0x98, 0x73, 0xa3, + 0xd3, 0x9d, 0x2d, 0x1a, 0x7a, 0xe5, 0xc5, 0x7a, 0xca, 0xbb, 0xca, 0xad, 0x2f, 0xb8, + 0x42, 0x4f, 0xc8, 0x0a, 0x87, 0xe8, 0xac, 0x55, 0xad, 0x91, 0x7d, 0xfa, 0xc4, 0xca, + 0x51, 0x1e, 0xaf, 0x3f, 0x66, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x56, 0xa0, 0xcd, 0xf6, + 0x99, 0x16, 0x48, 0xa5, 0x27, 0x16, 0xed, 0xc8, 0x3b, 0xd2, 0x9b, 0xe9, 0x7d, 0x44, + 0x25, 0x2a, 0x81, 0x58, 0x56, 0x60, 0x62, 0xf7, 0x8d, 0x16, 0xd9, 0x54, 0x0b, 0x1b, + 0xed, 0xa4, 0xa3, 0xe3, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x65, 0xc7, 0x0d, 0x00, + 0x30, + ], + hash_chain_history_root: [ + 0x83, 0xb7, 0xcd, 0xac, 0xa6, 0x78, 0xb1, 0x3f, 0x0e, 0xa1, 0xcc, 0xa6, 0x2f, 0x60, + 0x5e, 0x5e, 0x1a, 0x33, 0x2a, 0x78, 0xd1, 0xf3, 0x95, 0x3c, 0x0c, 0x48, 0xc8, 0x9e, + 0xbb, 0xb2, 0x00, 0x94, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 15, + leaf_block_hash: [ + 0x08, 0xd5, 0xfe, 0x26, 0xf8, 0x82, 0x4d, 0x87, 0x72, 0x60, 0x4c, 0xce, 0x89, 0xb6, + 0x7f, 0xbb, 0x42, 0xd8, 0xd8, 0x5f, 0xc0, 0xdb, 0xe1, 0xa2, 0x0e, 0x69, 0xa7, 0x5d, + 0xe2, 0x50, 0x99, 0xec, + ], + leaf_time: 3535940368, + leaf_target_bits: 489829745, + leaf_sapling_root: [ + 0x7b, 0x66, 0x58, 0xcb, 0xd9, 0x5e, 0xa2, 0x8f, 0x5b, 0x22, 0x24, 0x96, 0x3b, 0x19, + 0xfd, 0xd4, 0x7d, 0x95, 0x01, 0xf3, 0xa6, 0x86, 0xec, 0x3a, 0x5b, 0x0a, 0x22, 0x4a, + 0xe4, 0x9d, 0x7e, 0x3d, + ], + leaf_work: [ + 0x35, 0x45, 0x19, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903014, + leaf_sapling_tx_count: 7, + leaf_serialized: &[ + 0x08, 0xd5, 0xfe, 0x26, 0xf8, 0x82, 0x4d, 0x87, 0x72, 0x60, 0x4c, 0xce, 0x89, 0xb6, + 0x7f, 0xbb, 0x42, 0xd8, 0xd8, 0x5f, 0xc0, 0xdb, 0xe1, 0xa2, 0x0e, 0x69, 0xa7, 0x5d, + 0xe2, 0x50, 0x99, 0xec, 0x10, 0x2b, 0xc2, 0xd2, 0x10, 0x2b, 0xc2, 0xd2, 0x71, 0x35, + 0x32, 0x1d, 0x71, 0x35, 0x32, 0x1d, 0x7b, 0x66, 0x58, 0xcb, 0xd9, 0x5e, 0xa2, 0x8f, + 0x5b, 0x22, 0x24, 0x96, 0x3b, 0x19, 0xfd, 0xd4, 0x7d, 0x95, 0x01, 0xf3, 0xa6, 0x86, + 0xec, 0x3a, 0x5b, 0x0a, 0x22, 0x4a, 0xe4, 0x9d, 0x7e, 0x3d, 0x7b, 0x66, 0x58, 0xcb, + 0xd9, 0x5e, 0xa2, 0x8f, 0x5b, 0x22, 0x24, 0x96, 0x3b, 0x19, 0xfd, 0xd4, 0x7d, 0x95, + 0x01, 0xf3, 0xa6, 0x86, 0xec, 0x3a, 0x5b, 0x0a, 0x22, 0x4a, 0xe4, 0x9d, 0x7e, 0x3d, + 0x35, 0x45, 0x19, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0xc7, 0x0d, 0x00, 0xfe, 0x66, 0xc7, 0x0d, 0x00, + 0x07, + ], + peaks: &[ + &[ + 0x0a, 0xa0, 0x79, 0x0f, 0x0a, 0x8e, 0x74, 0x04, 0x1e, 0x9b, 0x21, 0xb7, 0xcc, 0xed, + 0xe3, 0xbf, 0x32, 0x48, 0xbb, 0xd9, 0x05, 0x25, 0x9b, 0x5f, 0x89, 0xc5, 0xdf, 0xab, + 0x60, 0x62, 0xe5, 0x78, 0x87, 0xe8, 0xac, 0x55, 0xe3, 0x32, 0xf3, 0xa0, 0xc4, 0xca, + 0x51, 0x1e, 0x79, 0x43, 0x1e, 0x1e, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0xb2, 0x66, 0x51, 0x90, + 0x5e, 0xf6, 0x83, 0xb5, 0xec, 0xa8, 0xb6, 0xce, 0xca, 0x55, 0xf7, 0xc0, 0xe2, 0xde, + 0x9c, 0x45, 0x16, 0x0a, 0x8f, 0x47, 0xe7, 0xf5, 0x61, 0x1f, 0xef, 0xc2, 0xc4, 0x56, + 0x1e, 0xb9, 0xb2, 0x0e, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x5f, 0xc7, 0x0d, 0x00, + 0x17, + ], + &[ + 0xc5, 0xee, 0x36, 0x45, 0xff, 0xaf, 0x07, 0xab, 0x1e, 0x89, 0xb8, 0x1f, 0x1b, 0x05, + 0x36, 0x68, 0x17, 0x44, 0x70, 0xf0, 0xea, 0x42, 0x9f, 0x84, 0x85, 0xf6, 0xe2, 0x55, + 0xfe, 0x9c, 0x87, 0x7b, 0xd2, 0xbc, 0xc4, 0x73, 0xe3, 0xdc, 0x78, 0xaa, 0xd3, 0x95, + 0x56, 0x1f, 0x53, 0x28, 0x08, 0x1e, 0x1f, 0xcd, 0x09, 0xdc, 0xd1, 0x6e, 0x06, 0x79, + 0x6f, 0xa7, 0x72, 0xff, 0x99, 0xb3, 0x1c, 0x57, 0x3e, 0xc4, 0xef, 0x45, 0x7d, 0x6f, + 0xe1, 0x4e, 0xe4, 0xa0, 0x7a, 0x5a, 0xb3, 0xc5, 0x9a, 0x1d, 0xe6, 0x35, 0xa5, 0x6d, + 0x32, 0x9a, 0xa4, 0x48, 0x28, 0xf0, 0x97, 0xba, 0xfd, 0xe2, 0x4b, 0xe1, 0x56, 0x9f, + 0x58, 0x0e, 0x14, 0x21, 0x6c, 0x9b, 0xc4, 0xfe, 0xac, 0xb6, 0x37, 0x76, 0xb7, 0x6a, + 0x33, 0x0f, 0x4f, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x60, 0xc7, 0x0d, 0x00, 0xfe, 0x63, 0xc7, 0x0d, 0x00, + 0x0e, + ], + &[ + 0x1e, 0xbe, 0xef, 0x04, 0x9b, 0x31, 0x6c, 0xad, 0x0c, 0x95, 0xcf, 0xc6, 0xeb, 0x51, + 0x6b, 0x38, 0x34, 0xf9, 0x76, 0x10, 0xae, 0xb0, 0x8a, 0x49, 0xab, 0x13, 0xb0, 0x9e, + 0xee, 0x7a, 0xe8, 0x73, 0x5a, 0xbf, 0xfb, 0x3c, 0xad, 0x91, 0x7d, 0xfa, 0x01, 0xc1, + 0x5a, 0x1c, 0xaf, 0x3f, 0x66, 0x1d, 0x9f, 0x4f, 0xf5, 0x0c, 0x7a, 0xbe, 0xe2, 0xb3, + 0x4d, 0x96, 0x09, 0x88, 0x29, 0x8d, 0x8a, 0xef, 0xb5, 0xca, 0x1c, 0xa7, 0xf0, 0x36, + 0x74, 0xc0, 0x47, 0x73, 0x0e, 0xcc, 0x53, 0xfe, 0xf5, 0x58, 0x56, 0xa0, 0xcd, 0xf6, + 0x99, 0x16, 0x48, 0xa5, 0x27, 0x16, 0xed, 0xc8, 0x3b, 0xd2, 0x9b, 0xe9, 0x7d, 0x44, + 0x25, 0x2a, 0x81, 0x58, 0x56, 0x60, 0x62, 0xf7, 0x8d, 0x16, 0xd9, 0x54, 0x0b, 0x1b, + 0x9c, 0xdc, 0xa1, 0xd4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x64, 0xc7, 0x0d, 0x00, 0xfe, 0x65, 0xc7, 0x0d, 0x00, + 0x0b, + ], + &[ + 0x08, 0xd5, 0xfe, 0x26, 0xf8, 0x82, 0x4d, 0x87, 0x72, 0x60, 0x4c, 0xce, 0x89, 0xb6, + 0x7f, 0xbb, 0x42, 0xd8, 0xd8, 0x5f, 0xc0, 0xdb, 0xe1, 0xa2, 0x0e, 0x69, 0xa7, 0x5d, + 0xe2, 0x50, 0x99, 0xec, 0x10, 0x2b, 0xc2, 0xd2, 0x10, 0x2b, 0xc2, 0xd2, 0x71, 0x35, + 0x32, 0x1d, 0x71, 0x35, 0x32, 0x1d, 0x7b, 0x66, 0x58, 0xcb, 0xd9, 0x5e, 0xa2, 0x8f, + 0x5b, 0x22, 0x24, 0x96, 0x3b, 0x19, 0xfd, 0xd4, 0x7d, 0x95, 0x01, 0xf3, 0xa6, 0x86, + 0xec, 0x3a, 0x5b, 0x0a, 0x22, 0x4a, 0xe4, 0x9d, 0x7e, 0x3d, 0x7b, 0x66, 0x58, 0xcb, + 0xd9, 0x5e, 0xa2, 0x8f, 0x5b, 0x22, 0x24, 0x96, 0x3b, 0x19, 0xfd, 0xd4, 0x7d, 0x95, + 0x01, 0xf3, 0xa6, 0x86, 0xec, 0x3a, 0x5b, 0x0a, 0x22, 0x4a, 0xe4, 0x9d, 0x7e, 0x3d, + 0x35, 0x45, 0x19, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x66, 0xc7, 0x0d, 0x00, 0xfe, 0x66, 0xc7, 0x0d, 0x00, + 0x07, + ], + ], + root_serialized: &[ + 0xf7, 0x2d, 0x7a, 0x2f, 0x47, 0xb2, 0xa2, 0xb7, 0x77, 0xdb, 0x25, 0xd4, 0x27, 0xdc, + 0xc7, 0x13, 0xcf, 0x1b, 0x1a, 0xc2, 0x63, 0x32, 0xf8, 0x4b, 0x6b, 0x9c, 0x94, 0xef, + 0x78, 0x0f, 0x87, 0x24, 0x87, 0xe8, 0xac, 0x55, 0x10, 0x2b, 0xc2, 0xd2, 0xc4, 0xca, + 0x51, 0x1e, 0x71, 0x35, 0x32, 0x1d, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x7b, 0x66, 0x58, 0xcb, + 0xd9, 0x5e, 0xa2, 0x8f, 0x5b, 0x22, 0x24, 0x96, 0x3b, 0x19, 0xfd, 0xd4, 0x7d, 0x95, + 0x01, 0xf3, 0xa6, 0x86, 0xec, 0x3a, 0x5b, 0x0a, 0x22, 0x4a, 0xe4, 0x9d, 0x7e, 0x3d, + 0x22, 0xea, 0xbc, 0xe8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x66, 0xc7, 0x0d, 0x00, + 0x37, + ], + hash_chain_history_root: [ + 0xdf, 0xc3, 0x4f, 0x65, 0xc8, 0x7e, 0xd8, 0x2d, 0xc9, 0x49, 0xeb, 0x52, 0x3c, 0xfe, + 0xf5, 0x8e, 0x0e, 0xd5, 0x75, 0xb9, 0x25, 0x22, 0x1d, 0xa8, 0xe4, 0xa9, 0x0f, 0xab, + 0x30, 0x79, 0x95, 0x44, + ], + }, + TestVector { + consensus_branch_id: 4122551051, + n_leaves: 16, + leaf_block_hash: [ + 0x41, 0x4f, 0x07, 0x47, 0x1e, 0x1b, 0xa6, 0xea, 0xff, 0x7f, 0x99, 0x28, 0x17, 0x13, + 0x44, 0x0a, 0x6c, 0xbd, 0x6d, 0xd1, 0xaa, 0x9f, 0x7a, 0x18, 0xf1, 0xb7, 0x61, 0xe3, + 0x86, 0xc3, 0x8e, 0x76, + ], + leaf_time: 581366922, + leaf_target_bits: 526250231, + leaf_sapling_root: [ + 0x53, 0x4e, 0x85, 0xb7, 0x1f, 0xff, 0xba, 0x9f, 0x1f, 0x2d, 0x96, 0x71, 0x28, 0x52, + 0x67, 0xa3, 0x5b, 0xc0, 0x32, 0x34, 0x82, 0x98, 0x84, 0x0a, 0x3a, 0xc0, 0xd5, 0x1c, + 0x1b, 0xb5, 0x44, 0x82, + ], + leaf_work: [ + 0xb9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 903015, + leaf_sapling_tx_count: 1, + leaf_serialized: &[ + 0x41, 0x4f, 0x07, 0x47, 0x1e, 0x1b, 0xa6, 0xea, 0xff, 0x7f, 0x99, 0x28, 0x17, 0x13, + 0x44, 0x0a, 0x6c, 0xbd, 0x6d, 0xd1, 0xaa, 0x9f, 0x7a, 0x18, 0xf1, 0xb7, 0x61, 0xe3, + 0x86, 0xc3, 0x8e, 0x76, 0x8a, 0xf4, 0xa6, 0x22, 0x8a, 0xf4, 0xa6, 0x22, 0xf7, 0xf0, + 0x5d, 0x1f, 0xf7, 0xf0, 0x5d, 0x1f, 0x53, 0x4e, 0x85, 0xb7, 0x1f, 0xff, 0xba, 0x9f, + 0x1f, 0x2d, 0x96, 0x71, 0x28, 0x52, 0x67, 0xa3, 0x5b, 0xc0, 0x32, 0x34, 0x82, 0x98, + 0x84, 0x0a, 0x3a, 0xc0, 0xd5, 0x1c, 0x1b, 0xb5, 0x44, 0x82, 0x53, 0x4e, 0x85, 0xb7, + 0x1f, 0xff, 0xba, 0x9f, 0x1f, 0x2d, 0x96, 0x71, 0x28, 0x52, 0x67, 0xa3, 0x5b, 0xc0, + 0x32, 0x34, 0x82, 0x98, 0x84, 0x0a, 0x3a, 0xc0, 0xd5, 0x1c, 0x1b, 0xb5, 0x44, 0x82, + 0xb9, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x67, 0xc7, 0x0d, 0x00, 0xfe, 0x67, 0xc7, 0x0d, 0x00, + 0x01, + ], + peaks: &[&[ + 0x19, 0xd0, 0x98, 0x05, 0x3d, 0x68, 0x53, 0x4a, 0x82, 0x16, 0x23, 0x1a, 0x59, 0x4f, + 0xf2, 0xec, 0xe4, 0xf3, 0x84, 0x32, 0x1b, 0x87, 0x68, 0x2d, 0x4b, 0x74, 0x12, 0xd3, + 0x1b, 0x1e, 0x95, 0x28, 0x87, 0xe8, 0xac, 0x55, 0x8a, 0xf4, 0xa6, 0x22, 0xc4, 0xca, + 0x51, 0x1e, 0xf7, 0xf0, 0x5d, 0x1f, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x53, 0x4e, 0x85, 0xb7, + 0x1f, 0xff, 0xba, 0x9f, 0x1f, 0x2d, 0x96, 0x71, 0x28, 0x52, 0x67, 0xa3, 0x5b, 0xc0, + 0x32, 0x34, 0x82, 0x98, 0x84, 0x0a, 0x3a, 0xc0, 0xd5, 0x1c, 0x1b, 0xb5, 0x44, 0x82, + 0xdb, 0xec, 0xbc, 0xe8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x67, 0xc7, 0x0d, 0x00, + 0x38, + ]], + root_serialized: &[ + 0x19, 0xd0, 0x98, 0x05, 0x3d, 0x68, 0x53, 0x4a, 0x82, 0x16, 0x23, 0x1a, 0x59, 0x4f, + 0xf2, 0xec, 0xe4, 0xf3, 0x84, 0x32, 0x1b, 0x87, 0x68, 0x2d, 0x4b, 0x74, 0x12, 0xd3, + 0x1b, 0x1e, 0x95, 0x28, 0x87, 0xe8, 0xac, 0x55, 0x8a, 0xf4, 0xa6, 0x22, 0xc4, 0xca, + 0x51, 0x1e, 0xf7, 0xf0, 0x5d, 0x1f, 0x4f, 0x60, 0x20, 0x2c, 0x93, 0x7a, 0x03, 0x63, + 0x1e, 0x8e, 0xf6, 0xbb, 0x0e, 0xf4, 0x4e, 0xd4, 0xab, 0xfa, 0x38, 0xfe, 0xa8, 0x0a, + 0x38, 0xb8, 0x4b, 0xd0, 0x69, 0xbf, 0x0c, 0x8e, 0x3d, 0x46, 0x53, 0x4e, 0x85, 0xb7, + 0x1f, 0xff, 0xba, 0x9f, 0x1f, 0x2d, 0x96, 0x71, 0x28, 0x52, 0x67, 0xa3, 0x5b, 0xc0, + 0x32, 0x34, 0x82, 0x98, 0x84, 0x0a, 0x3a, 0xc0, 0xd5, 0x1c, 0x1b, 0xb5, 0x44, 0x82, + 0xdb, 0xec, 0xbc, 0xe8, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x58, 0xc7, 0x0d, 0x00, 0xfe, 0x67, 0xc7, 0x0d, 0x00, + 0x38, + ], + hash_chain_history_root: [ + 0xd1, 0x00, 0xee, 0xda, 0xf6, 0x59, 0x2e, 0x34, 0xac, 0x46, 0x05, 0xa5, 0x20, 0x0b, + 0xb6, 0xb7, 0x6b, 0x53, 0x4b, 0x55, 0x72, 0x99, 0x5d, 0xd8, 0xaf, 0xd0, 0x17, 0xc6, + 0xf9, 0x42, 0x97, 0x63, + ], + }, +]; diff --git a/crates/zcash_history/src/test_vectors/zip_0221_v2.rs b/crates/zcash_history/src/test_vectors/zip_0221_v2.rs new file mode 100644 index 00000000..c28c8ec6 --- /dev/null +++ b/crates/zcash_history/src/test_vectors/zip_0221_v2.rs @@ -0,0 +1,1758 @@ +// From https://github.com/zcash/zcash-test-vectors/blob/master/zcash_test_vectors/zip_0221.py + +pub(crate) struct TestVector { + pub(crate) consensus_branch_id: u32, + pub(crate) n_leaves: u32, + pub(crate) leaf_block_hash: [u8; 32], + pub(crate) leaf_time: u32, + pub(crate) leaf_target_bits: u32, + pub(crate) leaf_sapling_root: [u8; 32], + pub(crate) leaf_work: [u8; 32], + pub(crate) leaf_height: u64, + pub(crate) leaf_sapling_tx_count: u64, + pub(crate) leaf_orchard_root: [u8; 32], + pub(crate) leaf_orchard_tx_count: u64, + pub(crate) leaf_serialized: &'static [u8], + pub(crate) peaks: &'static [&'static [u8]], + pub(crate) root_serialized: &'static [u8], + pub(crate) hash_chain_history_root: [u8; 32], +} + +pub(crate) const TEST_VECTORS: &[TestVector] = &[ + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 1, + leaf_block_hash: [ + 0x1c, 0x65, 0xde, 0x3e, 0xe1, 0xf8, 0x31, 0x58, 0x5c, 0xea, 0xac, 0xd1, 0x90, 0x76, + 0xc0, 0xa2, 0x1a, 0xfe, 0xa1, 0x3c, 0x2c, 0x2e, 0x46, 0xe0, 0x4c, 0x04, 0x72, 0x9f, + 0x29, 0xfd, 0xda, 0x1b, + ], + leaf_time: 2475487800, + leaf_target_bits: 488857234, + leaf_sapling_root: [ + 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, + 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, + 0xbd, 0x39, 0x7e, 0x5c, + ], + leaf_work: [ + 0x79, 0xe6, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687104, + leaf_sapling_tx_count: 2, + leaf_orchard_root: [ + 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, 0xda, + 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, 0x4d, + 0x7e, 0xcc, 0xc5, 0x51, + ], + leaf_orchard_tx_count: 4, + leaf_serialized: &[ + 0x1c, 0x65, 0xde, 0x3e, 0xe1, 0xf8, 0x31, 0x58, 0x5c, 0xea, 0xac, 0xd1, 0x90, 0x76, + 0xc0, 0xa2, 0x1a, 0xfe, 0xa1, 0x3c, 0x2c, 0x2e, 0x46, 0xe0, 0x4c, 0x04, 0x72, 0x9f, + 0x29, 0xfd, 0xda, 0x1b, 0x38, 0xf2, 0x8c, 0x93, 0x38, 0xf2, 0x8c, 0x93, 0x92, 0x5e, + 0x23, 0x1d, 0x92, 0x5e, 0x23, 0x1d, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x32, 0xa0, 0x5f, 0x2b, + 0x30, 0xef, 0x19, 0x13, 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, + 0x82, 0x2c, 0x59, 0xc3, 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, + 0x79, 0xe6, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, + 0x02, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, + 0x3e, 0x7a, 0xdb, 0x82, 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, + 0xa5, 0xfd, 0x03, 0xfa, 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x04, + ], + peaks: &[&[ + 0x1c, 0x65, 0xde, 0x3e, 0xe1, 0xf8, 0x31, 0x58, 0x5c, 0xea, 0xac, 0xd1, 0x90, 0x76, + 0xc0, 0xa2, 0x1a, 0xfe, 0xa1, 0x3c, 0x2c, 0x2e, 0x46, 0xe0, 0x4c, 0x04, 0x72, 0x9f, + 0x29, 0xfd, 0xda, 0x1b, 0x38, 0xf2, 0x8c, 0x93, 0x38, 0xf2, 0x8c, 0x93, 0x92, 0x5e, + 0x23, 0x1d, 0x92, 0x5e, 0x23, 0x1d, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x32, 0xa0, 0x5f, 0x2b, + 0x30, 0xef, 0x19, 0x13, 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, + 0x82, 0x2c, 0x59, 0xc3, 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, + 0x79, 0xe6, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, + 0x02, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, + 0x3e, 0x7a, 0xdb, 0x82, 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, + 0xa5, 0xfd, 0x03, 0xfa, 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x04, + ]], + root_serialized: &[ + 0x1c, 0x65, 0xde, 0x3e, 0xe1, 0xf8, 0x31, 0x58, 0x5c, 0xea, 0xac, 0xd1, 0x90, 0x76, + 0xc0, 0xa2, 0x1a, 0xfe, 0xa1, 0x3c, 0x2c, 0x2e, 0x46, 0xe0, 0x4c, 0x04, 0x72, 0x9f, + 0x29, 0xfd, 0xda, 0x1b, 0x38, 0xf2, 0x8c, 0x93, 0x38, 0xf2, 0x8c, 0x93, 0x92, 0x5e, + 0x23, 0x1d, 0x92, 0x5e, 0x23, 0x1d, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x32, 0xa0, 0x5f, 0x2b, + 0x30, 0xef, 0x19, 0x13, 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, + 0x82, 0x2c, 0x59, 0xc3, 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, + 0x79, 0xe6, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, + 0x02, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, + 0x3e, 0x7a, 0xdb, 0x82, 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, + 0xa5, 0xfd, 0x03, 0xfa, 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x04, + ], + hash_chain_history_root: [ + 0x43, 0x21, 0x01, 0x61, 0x4b, 0xe7, 0xde, 0x00, 0x2f, 0x62, 0x51, 0x56, 0x6a, 0xe2, + 0x7f, 0x08, 0xf8, 0x22, 0xb3, 0x64, 0xb3, 0xff, 0xa0, 0x1d, 0x0b, 0x21, 0xcc, 0xe2, + 0x28, 0x81, 0x81, 0x43, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 2, + leaf_block_hash: [ + 0xc2, 0x07, 0x11, 0x98, 0xce, 0x7e, 0x2c, 0xdb, 0x60, 0xc7, 0x45, 0x96, 0xad, 0xd0, + 0xc8, 0x17, 0x56, 0x36, 0x1d, 0xd9, 0x55, 0x74, 0x6c, 0xcd, 0x31, 0x7e, 0x65, 0xa2, + 0x66, 0x3e, 0xc0, 0x75, + ], + leaf_time: 4264773653, + leaf_target_bits: 524400782, + leaf_sapling_root: [ + 0x45, 0x61, 0x13, 0xdd, 0xb5, 0xec, 0xfd, 0xea, 0x7d, 0xb0, 0x79, 0x2f, 0x5e, 0x1c, + 0xa2, 0x64, 0xb4, 0x95, 0x21, 0xd2, 0x4f, 0x37, 0x4d, 0xe6, 0xf8, 0x52, 0xef, 0xc8, + 0x62, 0x10, 0x52, 0xe1, + ], + leaf_work: [ + 0xe5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687105, + leaf_sapling_tx_count: 2, + leaf_orchard_root: [ + 0x6a, 0x83, 0xdb, 0x3e, 0x7c, 0xab, 0xa8, 0x0e, 0x57, 0x9b, 0xf3, 0xd0, 0x7e, 0xf7, + 0x9f, 0x9a, 0x33, 0x88, 0xa0, 0x0e, 0x32, 0xb8, 0x25, 0xec, 0x45, 0x93, 0x22, 0xaa, + 0x1d, 0x14, 0x88, 0x0f, + ], + leaf_orchard_tx_count: 3, + leaf_serialized: &[ + 0xc2, 0x07, 0x11, 0x98, 0xce, 0x7e, 0x2c, 0xdb, 0x60, 0xc7, 0x45, 0x96, 0xad, 0xd0, + 0xc8, 0x17, 0x56, 0x36, 0x1d, 0xd9, 0x55, 0x74, 0x6c, 0xcd, 0x31, 0x7e, 0x65, 0xa2, + 0x66, 0x3e, 0xc0, 0x75, 0x15, 0x48, 0x33, 0xfe, 0x15, 0x48, 0x33, 0xfe, 0x8e, 0xb8, + 0x41, 0x1f, 0x8e, 0xb8, 0x41, 0x1f, 0x45, 0x61, 0x13, 0xdd, 0xb5, 0xec, 0xfd, 0xea, + 0x7d, 0xb0, 0x79, 0x2f, 0x5e, 0x1c, 0xa2, 0x64, 0xb4, 0x95, 0x21, 0xd2, 0x4f, 0x37, + 0x4d, 0xe6, 0xf8, 0x52, 0xef, 0xc8, 0x62, 0x10, 0x52, 0xe1, 0x45, 0x61, 0x13, 0xdd, + 0xb5, 0xec, 0xfd, 0xea, 0x7d, 0xb0, 0x79, 0x2f, 0x5e, 0x1c, 0xa2, 0x64, 0xb4, 0x95, + 0x21, 0xd2, 0x4f, 0x37, 0x4d, 0xe6, 0xf8, 0x52, 0xef, 0xc8, 0x62, 0x10, 0x52, 0xe1, + 0xe5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x41, 0xbe, 0x19, 0x00, 0xfe, 0x41, 0xbe, 0x19, 0x00, + 0x02, 0x6a, 0x83, 0xdb, 0x3e, 0x7c, 0xab, 0xa8, 0x0e, 0x57, 0x9b, 0xf3, 0xd0, 0x7e, + 0xf7, 0x9f, 0x9a, 0x33, 0x88, 0xa0, 0x0e, 0x32, 0xb8, 0x25, 0xec, 0x45, 0x93, 0x22, + 0xaa, 0x1d, 0x14, 0x88, 0x0f, 0x6a, 0x83, 0xdb, 0x3e, 0x7c, 0xab, 0xa8, 0x0e, 0x57, + 0x9b, 0xf3, 0xd0, 0x7e, 0xf7, 0x9f, 0x9a, 0x33, 0x88, 0xa0, 0x0e, 0x32, 0xb8, 0x25, + 0xec, 0x45, 0x93, 0x22, 0xaa, 0x1d, 0x14, 0x88, 0x0f, 0x03, + ], + peaks: &[&[ + 0xe5, 0x3c, 0x8b, 0xf7, 0xcb, 0xf6, 0xae, 0xfc, 0x33, 0xe6, 0xab, 0xac, 0xea, 0x5e, + 0xd0, 0x58, 0x2c, 0x7e, 0xfc, 0x3c, 0xa1, 0xe2, 0x08, 0x16, 0xe0, 0x12, 0xfe, 0xc4, + 0x6d, 0xef, 0x8b, 0x7e, 0x38, 0xf2, 0x8c, 0x93, 0x15, 0x48, 0x33, 0xfe, 0x92, 0x5e, + 0x23, 0x1d, 0x8e, 0xb8, 0x41, 0x1f, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x45, 0x61, 0x13, 0xdd, + 0xb5, 0xec, 0xfd, 0xea, 0x7d, 0xb0, 0x79, 0x2f, 0x5e, 0x1c, 0xa2, 0x64, 0xb4, 0x95, + 0x21, 0xd2, 0x4f, 0x37, 0x4d, 0xe6, 0xf8, 0x52, 0xef, 0xc8, 0x62, 0x10, 0x52, 0xe1, + 0x5e, 0xea, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x41, 0xbe, 0x19, 0x00, + 0x04, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x6a, 0x83, 0xdb, 0x3e, 0x7c, 0xab, 0xa8, 0x0e, 0x57, + 0x9b, 0xf3, 0xd0, 0x7e, 0xf7, 0x9f, 0x9a, 0x33, 0x88, 0xa0, 0x0e, 0x32, 0xb8, 0x25, + 0xec, 0x45, 0x93, 0x22, 0xaa, 0x1d, 0x14, 0x88, 0x0f, 0x07, + ]], + root_serialized: &[ + 0xe5, 0x3c, 0x8b, 0xf7, 0xcb, 0xf6, 0xae, 0xfc, 0x33, 0xe6, 0xab, 0xac, 0xea, 0x5e, + 0xd0, 0x58, 0x2c, 0x7e, 0xfc, 0x3c, 0xa1, 0xe2, 0x08, 0x16, 0xe0, 0x12, 0xfe, 0xc4, + 0x6d, 0xef, 0x8b, 0x7e, 0x38, 0xf2, 0x8c, 0x93, 0x15, 0x48, 0x33, 0xfe, 0x92, 0x5e, + 0x23, 0x1d, 0x8e, 0xb8, 0x41, 0x1f, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x45, 0x61, 0x13, 0xdd, + 0xb5, 0xec, 0xfd, 0xea, 0x7d, 0xb0, 0x79, 0x2f, 0x5e, 0x1c, 0xa2, 0x64, 0xb4, 0x95, + 0x21, 0xd2, 0x4f, 0x37, 0x4d, 0xe6, 0xf8, 0x52, 0xef, 0xc8, 0x62, 0x10, 0x52, 0xe1, + 0x5e, 0xea, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x41, 0xbe, 0x19, 0x00, + 0x04, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x6a, 0x83, 0xdb, 0x3e, 0x7c, 0xab, 0xa8, 0x0e, 0x57, + 0x9b, 0xf3, 0xd0, 0x7e, 0xf7, 0x9f, 0x9a, 0x33, 0x88, 0xa0, 0x0e, 0x32, 0xb8, 0x25, + 0xec, 0x45, 0x93, 0x22, 0xaa, 0x1d, 0x14, 0x88, 0x0f, 0x07, + ], + hash_chain_history_root: [ + 0xb4, 0x9b, 0xd3, 0x99, 0x55, 0xb7, 0x88, 0x45, 0xee, 0x8b, 0xb0, 0xb2, 0x3a, 0x00, + 0x88, 0xd3, 0x5a, 0xb5, 0xab, 0x09, 0x5e, 0x77, 0x34, 0x41, 0x18, 0x4b, 0x8e, 0x4f, + 0x40, 0xc6, 0x1b, 0x88, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 3, + leaf_block_hash: [ + 0x2f, 0x22, 0xe3, 0x22, 0x6c, 0x31, 0x74, 0xc3, 0x1c, 0x47, 0xde, 0x6a, 0x57, 0xac, + 0x8e, 0x67, 0x9d, 0xcc, 0x88, 0x14, 0x27, 0x01, 0x9b, 0x0f, 0xd7, 0x2a, 0xeb, 0x3d, + 0xc2, 0xd8, 0x3e, 0x45, + ], + leaf_time: 2438750730, + leaf_target_bits: 510046671, + leaf_sapling_root: [ + 0x67, 0xcb, 0x77, 0xfa, 0x10, 0x9c, 0x57, 0xa5, 0xef, 0xc0, 0xc4, 0xa2, 0x40, 0xe6, + 0xa1, 0xf2, 0x3d, 0x82, 0x1c, 0x3f, 0x9f, 0xd5, 0xcf, 0x79, 0x83, 0xcb, 0x2e, 0x6a, + 0x70, 0x40, 0xc9, 0xfc, + ], + leaf_work: [ + 0x2a, 0x7e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687106, + leaf_sapling_tx_count: 6, + leaf_orchard_root: [ + 0x20, 0x1b, 0xf5, 0xeb, 0x42, 0x5b, 0xcd, 0x8b, 0xb8, 0xc0, 0xd5, 0x9f, 0xd7, 0x12, + 0x70, 0x0a, 0x64, 0x59, 0x02, 0xf6, 0xad, 0x9e, 0x9c, 0x5b, 0xcf, 0x56, 0x74, 0xc8, + 0xed, 0x3b, 0x71, 0x3b, + ], + leaf_orchard_tx_count: 5, + leaf_serialized: &[ + 0x2f, 0x22, 0xe3, 0x22, 0x6c, 0x31, 0x74, 0xc3, 0x1c, 0x47, 0xde, 0x6a, 0x57, 0xac, + 0x8e, 0x67, 0x9d, 0xcc, 0x88, 0x14, 0x27, 0x01, 0x9b, 0x0f, 0xd7, 0x2a, 0xeb, 0x3d, + 0xc2, 0xd8, 0x3e, 0x45, 0x0a, 0x62, 0x5c, 0x91, 0x0a, 0x62, 0x5c, 0x91, 0xcf, 0xb1, + 0x66, 0x1e, 0xcf, 0xb1, 0x66, 0x1e, 0x67, 0xcb, 0x77, 0xfa, 0x10, 0x9c, 0x57, 0xa5, + 0xef, 0xc0, 0xc4, 0xa2, 0x40, 0xe6, 0xa1, 0xf2, 0x3d, 0x82, 0x1c, 0x3f, 0x9f, 0xd5, + 0xcf, 0x79, 0x83, 0xcb, 0x2e, 0x6a, 0x70, 0x40, 0xc9, 0xfc, 0x67, 0xcb, 0x77, 0xfa, + 0x10, 0x9c, 0x57, 0xa5, 0xef, 0xc0, 0xc4, 0xa2, 0x40, 0xe6, 0xa1, 0xf2, 0x3d, 0x82, + 0x1c, 0x3f, 0x9f, 0xd5, 0xcf, 0x79, 0x83, 0xcb, 0x2e, 0x6a, 0x70, 0x40, 0xc9, 0xfc, + 0x2a, 0x7e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x42, 0xbe, 0x19, 0x00, 0xfe, 0x42, 0xbe, 0x19, 0x00, + 0x06, 0x20, 0x1b, 0xf5, 0xeb, 0x42, 0x5b, 0xcd, 0x8b, 0xb8, 0xc0, 0xd5, 0x9f, 0xd7, + 0x12, 0x70, 0x0a, 0x64, 0x59, 0x02, 0xf6, 0xad, 0x9e, 0x9c, 0x5b, 0xcf, 0x56, 0x74, + 0xc8, 0xed, 0x3b, 0x71, 0x3b, 0x20, 0x1b, 0xf5, 0xeb, 0x42, 0x5b, 0xcd, 0x8b, 0xb8, + 0xc0, 0xd5, 0x9f, 0xd7, 0x12, 0x70, 0x0a, 0x64, 0x59, 0x02, 0xf6, 0xad, 0x9e, 0x9c, + 0x5b, 0xcf, 0x56, 0x74, 0xc8, 0xed, 0x3b, 0x71, 0x3b, 0x05, + ], + peaks: &[ + &[ + 0xe5, 0x3c, 0x8b, 0xf7, 0xcb, 0xf6, 0xae, 0xfc, 0x33, 0xe6, 0xab, 0xac, 0xea, 0x5e, + 0xd0, 0x58, 0x2c, 0x7e, 0xfc, 0x3c, 0xa1, 0xe2, 0x08, 0x16, 0xe0, 0x12, 0xfe, 0xc4, + 0x6d, 0xef, 0x8b, 0x7e, 0x38, 0xf2, 0x8c, 0x93, 0x15, 0x48, 0x33, 0xfe, 0x92, 0x5e, + 0x23, 0x1d, 0x8e, 0xb8, 0x41, 0x1f, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x45, 0x61, 0x13, 0xdd, + 0xb5, 0xec, 0xfd, 0xea, 0x7d, 0xb0, 0x79, 0x2f, 0x5e, 0x1c, 0xa2, 0x64, 0xb4, 0x95, + 0x21, 0xd2, 0x4f, 0x37, 0x4d, 0xe6, 0xf8, 0x52, 0xef, 0xc8, 0x62, 0x10, 0x52, 0xe1, + 0x5e, 0xea, 0x3c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x41, 0xbe, 0x19, 0x00, + 0x04, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x6a, 0x83, 0xdb, 0x3e, 0x7c, 0xab, 0xa8, 0x0e, 0x57, + 0x9b, 0xf3, 0xd0, 0x7e, 0xf7, 0x9f, 0x9a, 0x33, 0x88, 0xa0, 0x0e, 0x32, 0xb8, 0x25, + 0xec, 0x45, 0x93, 0x22, 0xaa, 0x1d, 0x14, 0x88, 0x0f, 0x07, + ], + &[ + 0x2f, 0x22, 0xe3, 0x22, 0x6c, 0x31, 0x74, 0xc3, 0x1c, 0x47, 0xde, 0x6a, 0x57, 0xac, + 0x8e, 0x67, 0x9d, 0xcc, 0x88, 0x14, 0x27, 0x01, 0x9b, 0x0f, 0xd7, 0x2a, 0xeb, 0x3d, + 0xc2, 0xd8, 0x3e, 0x45, 0x0a, 0x62, 0x5c, 0x91, 0x0a, 0x62, 0x5c, 0x91, 0xcf, 0xb1, + 0x66, 0x1e, 0xcf, 0xb1, 0x66, 0x1e, 0x67, 0xcb, 0x77, 0xfa, 0x10, 0x9c, 0x57, 0xa5, + 0xef, 0xc0, 0xc4, 0xa2, 0x40, 0xe6, 0xa1, 0xf2, 0x3d, 0x82, 0x1c, 0x3f, 0x9f, 0xd5, + 0xcf, 0x79, 0x83, 0xcb, 0x2e, 0x6a, 0x70, 0x40, 0xc9, 0xfc, 0x67, 0xcb, 0x77, 0xfa, + 0x10, 0x9c, 0x57, 0xa5, 0xef, 0xc0, 0xc4, 0xa2, 0x40, 0xe6, 0xa1, 0xf2, 0x3d, 0x82, + 0x1c, 0x3f, 0x9f, 0xd5, 0xcf, 0x79, 0x83, 0xcb, 0x2e, 0x6a, 0x70, 0x40, 0xc9, 0xfc, + 0x2a, 0x7e, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x42, 0xbe, 0x19, 0x00, 0xfe, 0x42, 0xbe, 0x19, 0x00, + 0x06, 0x20, 0x1b, 0xf5, 0xeb, 0x42, 0x5b, 0xcd, 0x8b, 0xb8, 0xc0, 0xd5, 0x9f, 0xd7, + 0x12, 0x70, 0x0a, 0x64, 0x59, 0x02, 0xf6, 0xad, 0x9e, 0x9c, 0x5b, 0xcf, 0x56, 0x74, + 0xc8, 0xed, 0x3b, 0x71, 0x3b, 0x20, 0x1b, 0xf5, 0xeb, 0x42, 0x5b, 0xcd, 0x8b, 0xb8, + 0xc0, 0xd5, 0x9f, 0xd7, 0x12, 0x70, 0x0a, 0x64, 0x59, 0x02, 0xf6, 0xad, 0x9e, 0x9c, + 0x5b, 0xcf, 0x56, 0x74, 0xc8, 0xed, 0x3b, 0x71, 0x3b, 0x05, + ], + ], + root_serialized: &[ + 0x59, 0xeb, 0x19, 0xd9, 0x93, 0x98, 0xbf, 0x85, 0x5e, 0x7e, 0xd7, 0x47, 0xa8, 0xe8, + 0xee, 0xe1, 0x48, 0x51, 0xcd, 0x43, 0x85, 0xd0, 0x50, 0x90, 0xf5, 0xbe, 0x4f, 0x24, + 0xbf, 0xad, 0x1d, 0x32, 0x38, 0xf2, 0x8c, 0x93, 0x0a, 0x62, 0x5c, 0x91, 0x92, 0x5e, + 0x23, 0x1d, 0xcf, 0xb1, 0x66, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x67, 0xcb, 0x77, 0xfa, + 0x10, 0x9c, 0x57, 0xa5, 0xef, 0xc0, 0xc4, 0xa2, 0x40, 0xe6, 0xa1, 0xf2, 0x3d, 0x82, + 0x1c, 0x3f, 0x9f, 0xd5, 0xcf, 0x79, 0x83, 0xcb, 0x2e, 0x6a, 0x70, 0x40, 0xc9, 0xfc, + 0x88, 0x68, 0x3f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x42, 0xbe, 0x19, 0x00, + 0x0a, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x20, 0x1b, 0xf5, 0xeb, 0x42, 0x5b, 0xcd, 0x8b, 0xb8, + 0xc0, 0xd5, 0x9f, 0xd7, 0x12, 0x70, 0x0a, 0x64, 0x59, 0x02, 0xf6, 0xad, 0x9e, 0x9c, + 0x5b, 0xcf, 0x56, 0x74, 0xc8, 0xed, 0x3b, 0x71, 0x3b, 0x0c, + ], + hash_chain_history_root: [ + 0x44, 0x56, 0x18, 0x68, 0x91, 0x11, 0x6c, 0x90, 0xd4, 0x82, 0xb9, 0x8d, 0x64, 0xa7, + 0xe9, 0x8c, 0x77, 0x5d, 0x32, 0x2d, 0xc5, 0x39, 0x9a, 0x04, 0x63, 0xc0, 0xb4, 0x1e, + 0x49, 0x97, 0x8e, 0xa6, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 4, + leaf_block_hash: [ + 0x39, 0x14, 0x08, 0xe5, 0x58, 0x6c, 0x07, 0xaf, 0x6e, 0x02, 0x07, 0x5e, 0xef, 0xd5, + 0x36, 0x0e, 0x49, 0x22, 0xde, 0xa0, 0xea, 0xe5, 0xc9, 0x24, 0x2c, 0x5b, 0x3f, 0xa4, + 0x07, 0xfe, 0x49, 0x4d, + ], + leaf_time: 1153743825, + leaf_target_bits: 471481012, + leaf_sapling_root: [ + 0xa8, 0x76, 0x6c, 0x0e, 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, + 0x9b, 0x4b, 0x80, 0x9e, 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, + 0x8f, 0x71, 0xc7, 0x74, + ], + leaf_work: [ + 0x33, 0x37, 0x94, 0xc2, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687107, + leaf_sapling_tx_count: 3, + leaf_orchard_root: [ + 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, + 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, 0x2e, 0xaa, 0x1c, 0x01, 0xb4, + 0xa9, 0x1c, 0x4b, 0x0c, + ], + leaf_orchard_tx_count: 3, + leaf_serialized: &[ + 0x39, 0x14, 0x08, 0xe5, 0x58, 0x6c, 0x07, 0xaf, 0x6e, 0x02, 0x07, 0x5e, 0xef, 0xd5, + 0x36, 0x0e, 0x49, 0x22, 0xde, 0xa0, 0xea, 0xe5, 0xc9, 0x24, 0x2c, 0x5b, 0x3f, 0xa4, + 0x07, 0xfe, 0x49, 0x4d, 0xd1, 0xbb, 0xc4, 0x44, 0xd1, 0xbb, 0xc4, 0x44, 0xb4, 0x3a, + 0x1a, 0x1c, 0xb4, 0x3a, 0x1a, 0x1c, 0xa8, 0x76, 0x6c, 0x0e, 0x1f, 0x3a, 0x80, 0x3a, + 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, 0xbd, 0x31, 0x5f, 0x7b, + 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, 0xa8, 0x76, 0x6c, 0x0e, + 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, + 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, + 0x33, 0x37, 0x94, 0xc2, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, + 0x03, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, 0xb6, 0xb6, 0xf8, 0x5c, + 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, 0x2e, 0xaa, 0x1c, 0x01, + 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, + 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, + 0x2e, 0xaa, 0x1c, 0x01, 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0x03, + ], + peaks: &[&[ + 0xc6, 0x13, 0x60, 0xf6, 0x7e, 0xb7, 0xcc, 0x69, 0x4c, 0x6e, 0x24, 0xbb, 0xfc, 0xdb, + 0x8c, 0x91, 0x53, 0xf3, 0x54, 0xcb, 0xc4, 0x60, 0xb9, 0x9c, 0x3f, 0xa6, 0xb7, 0xb1, + 0xd1, 0xa1, 0xa7, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0xd1, 0xbb, 0xc4, 0x44, 0x92, 0x5e, + 0x23, 0x1d, 0xb4, 0x3a, 0x1a, 0x1c, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa8, 0x76, 0x6c, 0x0e, + 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, + 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, + 0xbb, 0x9f, 0xd3, 0xc9, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, + 0x0d, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, + 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, + 0x2e, 0xaa, 0x1c, 0x01, 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0x0f, + ]], + root_serialized: &[ + 0xc6, 0x13, 0x60, 0xf6, 0x7e, 0xb7, 0xcc, 0x69, 0x4c, 0x6e, 0x24, 0xbb, 0xfc, 0xdb, + 0x8c, 0x91, 0x53, 0xf3, 0x54, 0xcb, 0xc4, 0x60, 0xb9, 0x9c, 0x3f, 0xa6, 0xb7, 0xb1, + 0xd1, 0xa1, 0xa7, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0xd1, 0xbb, 0xc4, 0x44, 0x92, 0x5e, + 0x23, 0x1d, 0xb4, 0x3a, 0x1a, 0x1c, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa8, 0x76, 0x6c, 0x0e, + 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, + 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, + 0xbb, 0x9f, 0xd3, 0xc9, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, + 0x0d, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, + 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, + 0x2e, 0xaa, 0x1c, 0x01, 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0x0f, + ], + hash_chain_history_root: [ + 0x49, 0x8c, 0xc7, 0xa4, 0x7a, 0x2a, 0xfb, 0x97, 0xe3, 0xba, 0x1a, 0x72, 0x25, 0x18, + 0x5a, 0x3d, 0x7b, 0x2b, 0xa0, 0x10, 0x37, 0x99, 0x6b, 0xbc, 0xfe, 0x99, 0x2a, 0xde, + 0xf9, 0xcb, 0x7a, 0x2a, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 5, + leaf_block_hash: [ + 0xa5, 0xe0, 0xe0, 0x23, 0xd7, 0x18, 0x97, 0xe9, 0xad, 0xd5, 0x12, 0x09, 0x78, 0x1c, + 0x2f, 0xf5, 0x88, 0xdb, 0x63, 0xec, 0xaf, 0x26, 0x56, 0xb8, 0xc4, 0xd7, 0xf1, 0x1a, + 0x31, 0x49, 0x6e, 0xbc, + ], + leaf_time: 1689693439, + leaf_target_bits: 524708597, + leaf_sapling_root: [ + 0x36, 0x9a, 0xf4, 0xfe, 0x24, 0x76, 0x9c, 0x8d, 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, + 0x1a, 0xc0, 0x89, 0xac, 0x8e, 0x47, 0x35, 0x1f, 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, + 0xe5, 0xe8, 0xaf, 0xf7, + ], + leaf_work: [ + 0xa2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687108, + leaf_sapling_tx_count: 1, + leaf_orchard_root: [ + 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, 0xe0, 0x52, 0xc0, 0x5a, 0x0e, + 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, 0xb1, 0x04, 0xb6, 0x92, 0xdb, + 0x5d, 0x04, 0x4b, 0x45, + ], + leaf_orchard_tx_count: 6, + leaf_serialized: &[ + 0xa5, 0xe0, 0xe0, 0x23, 0xd7, 0x18, 0x97, 0xe9, 0xad, 0xd5, 0x12, 0x09, 0x78, 0x1c, + 0x2f, 0xf5, 0x88, 0xdb, 0x63, 0xec, 0xaf, 0x26, 0x56, 0xb8, 0xc4, 0xd7, 0xf1, 0x1a, + 0x31, 0x49, 0x6e, 0xbc, 0xff, 0xac, 0xb6, 0x64, 0xff, 0xac, 0xb6, 0x64, 0xf5, 0x6a, + 0x46, 0x1f, 0xf5, 0x6a, 0x46, 0x1f, 0x36, 0x9a, 0xf4, 0xfe, 0x24, 0x76, 0x9c, 0x8d, + 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, 0x8e, 0x47, 0x35, 0x1f, + 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, 0x36, 0x9a, 0xf4, 0xfe, + 0x24, 0x76, 0x9c, 0x8d, 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, + 0x8e, 0x47, 0x35, 0x1f, 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, + 0xa2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, + 0x01, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, 0xe0, 0x52, 0xc0, 0x5a, + 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, 0xb1, 0x04, 0xb6, 0x92, + 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, + 0xe0, 0x52, 0xc0, 0x5a, 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, + 0xb1, 0x04, 0xb6, 0x92, 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0x06, + ], + peaks: &[ + &[ + 0xc6, 0x13, 0x60, 0xf6, 0x7e, 0xb7, 0xcc, 0x69, 0x4c, 0x6e, 0x24, 0xbb, 0xfc, 0xdb, + 0x8c, 0x91, 0x53, 0xf3, 0x54, 0xcb, 0xc4, 0x60, 0xb9, 0x9c, 0x3f, 0xa6, 0xb7, 0xb1, + 0xd1, 0xa1, 0xa7, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0xd1, 0xbb, 0xc4, 0x44, 0x92, 0x5e, + 0x23, 0x1d, 0xb4, 0x3a, 0x1a, 0x1c, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa8, 0x76, 0x6c, 0x0e, + 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, + 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, + 0xbb, 0x9f, 0xd3, 0xc9, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, + 0x0d, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, + 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, + 0x2e, 0xaa, 0x1c, 0x01, 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0x0f, + ], + &[ + 0xa5, 0xe0, 0xe0, 0x23, 0xd7, 0x18, 0x97, 0xe9, 0xad, 0xd5, 0x12, 0x09, 0x78, 0x1c, + 0x2f, 0xf5, 0x88, 0xdb, 0x63, 0xec, 0xaf, 0x26, 0x56, 0xb8, 0xc4, 0xd7, 0xf1, 0x1a, + 0x31, 0x49, 0x6e, 0xbc, 0xff, 0xac, 0xb6, 0x64, 0xff, 0xac, 0xb6, 0x64, 0xf5, 0x6a, + 0x46, 0x1f, 0xf5, 0x6a, 0x46, 0x1f, 0x36, 0x9a, 0xf4, 0xfe, 0x24, 0x76, 0x9c, 0x8d, + 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, 0x8e, 0x47, 0x35, 0x1f, + 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, 0x36, 0x9a, 0xf4, 0xfe, + 0x24, 0x76, 0x9c, 0x8d, 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, + 0x8e, 0x47, 0x35, 0x1f, 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, + 0xa2, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, + 0x01, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, 0xe0, 0x52, 0xc0, 0x5a, + 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, 0xb1, 0x04, 0xb6, 0x92, + 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, + 0xe0, 0x52, 0xc0, 0x5a, 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, + 0xb1, 0x04, 0xb6, 0x92, 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0x06, + ], + ], + root_serialized: &[ + 0x87, 0xe3, 0xc4, 0xf1, 0x78, 0x7a, 0x8c, 0xbc, 0x72, 0xf5, 0x21, 0x88, 0x78, 0x93, + 0xe4, 0x53, 0x88, 0x37, 0x0c, 0xe7, 0x05, 0x25, 0xff, 0x51, 0x85, 0x7d, 0x12, 0xec, + 0x69, 0x1b, 0x21, 0x2c, 0x38, 0xf2, 0x8c, 0x93, 0xff, 0xac, 0xb6, 0x64, 0x92, 0x5e, + 0x23, 0x1d, 0xf5, 0x6a, 0x46, 0x1f, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x36, 0x9a, 0xf4, 0xfe, + 0x24, 0x76, 0x9c, 0x8d, 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, + 0x8e, 0x47, 0x35, 0x1f, 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, + 0x5d, 0xa3, 0xd3, 0xc9, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, + 0x0e, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, + 0xe0, 0x52, 0xc0, 0x5a, 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, + 0xb1, 0x04, 0xb6, 0x92, 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0x15, + ], + hash_chain_history_root: [ + 0x76, 0x66, 0x79, 0xc7, 0x1f, 0xbd, 0xd4, 0xec, 0x23, 0x1e, 0xdb, 0x5c, 0x30, 0xd7, + 0xb4, 0x36, 0xc5, 0xb9, 0xba, 0x23, 0x27, 0x05, 0x2e, 0xdd, 0x0f, 0x68, 0xa5, 0xe2, + 0x3b, 0x0f, 0x68, 0x88, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 6, + leaf_block_hash: [ + 0x2b, 0xc4, 0xc5, 0x96, 0x8b, 0x10, 0x8b, 0x98, 0xf5, 0x47, 0xc9, 0xe1, 0x9c, 0x85, + 0x86, 0x9b, 0x0a, 0x60, 0xce, 0x36, 0x43, 0x62, 0x74, 0x6a, 0x1f, 0x2f, 0x85, 0xca, + 0x67, 0x03, 0xee, 0x6f, + ], + leaf_time: 3626294295, + leaf_target_bits: 493342338, + leaf_sapling_root: [ + 0x64, 0x73, 0xba, 0x6f, 0xbd, 0x5b, 0x0f, 0x5f, 0x79, 0xd4, 0x28, 0x91, 0x1c, 0x73, + 0x6b, 0xa2, 0x6e, 0x59, 0x01, 0xd1, 0x46, 0x20, 0xa2, 0x96, 0x9d, 0x5e, 0x95, 0xd2, + 0x07, 0x0d, 0xd0, 0xdd, + ], + leaf_work: [ + 0xd3, 0x53, 0x77, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687109, + leaf_sapling_tx_count: 3, + leaf_orchard_root: [ + 0x19, 0x83, 0x56, 0x0e, 0xcc, 0xb8, 0x65, 0x73, 0x56, 0x08, 0x5d, 0xe3, 0x03, 0x85, + 0x5e, 0x0a, 0x58, 0x5c, 0xc2, 0xa4, 0xf9, 0x03, 0x75, 0x84, 0xd8, 0x3d, 0xf4, 0x79, + 0x5c, 0x4d, 0x54, 0x63, + ], + leaf_orchard_tx_count: 1, + leaf_serialized: &[ + 0x2b, 0xc4, 0xc5, 0x96, 0x8b, 0x10, 0x8b, 0x98, 0xf5, 0x47, 0xc9, 0xe1, 0x9c, 0x85, + 0x86, 0x9b, 0x0a, 0x60, 0xce, 0x36, 0x43, 0x62, 0x74, 0x6a, 0x1f, 0x2f, 0x85, 0xca, + 0x67, 0x03, 0xee, 0x6f, 0x17, 0xdc, 0x24, 0xd8, 0x17, 0xdc, 0x24, 0xd8, 0x82, 0xce, + 0x67, 0x1d, 0x82, 0xce, 0x67, 0x1d, 0x64, 0x73, 0xba, 0x6f, 0xbd, 0x5b, 0x0f, 0x5f, + 0x79, 0xd4, 0x28, 0x91, 0x1c, 0x73, 0x6b, 0xa2, 0x6e, 0x59, 0x01, 0xd1, 0x46, 0x20, + 0xa2, 0x96, 0x9d, 0x5e, 0x95, 0xd2, 0x07, 0x0d, 0xd0, 0xdd, 0x64, 0x73, 0xba, 0x6f, + 0xbd, 0x5b, 0x0f, 0x5f, 0x79, 0xd4, 0x28, 0x91, 0x1c, 0x73, 0x6b, 0xa2, 0x6e, 0x59, + 0x01, 0xd1, 0x46, 0x20, 0xa2, 0x96, 0x9d, 0x5e, 0x95, 0xd2, 0x07, 0x0d, 0xd0, 0xdd, + 0xd3, 0x53, 0x77, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x45, 0xbe, 0x19, 0x00, 0xfe, 0x45, 0xbe, 0x19, 0x00, + 0x03, 0x19, 0x83, 0x56, 0x0e, 0xcc, 0xb8, 0x65, 0x73, 0x56, 0x08, 0x5d, 0xe3, 0x03, + 0x85, 0x5e, 0x0a, 0x58, 0x5c, 0xc2, 0xa4, 0xf9, 0x03, 0x75, 0x84, 0xd8, 0x3d, 0xf4, + 0x79, 0x5c, 0x4d, 0x54, 0x63, 0x19, 0x83, 0x56, 0x0e, 0xcc, 0xb8, 0x65, 0x73, 0x56, + 0x08, 0x5d, 0xe3, 0x03, 0x85, 0x5e, 0x0a, 0x58, 0x5c, 0xc2, 0xa4, 0xf9, 0x03, 0x75, + 0x84, 0xd8, 0x3d, 0xf4, 0x79, 0x5c, 0x4d, 0x54, 0x63, 0x01, + ], + peaks: &[ + &[ + 0xc6, 0x13, 0x60, 0xf6, 0x7e, 0xb7, 0xcc, 0x69, 0x4c, 0x6e, 0x24, 0xbb, 0xfc, 0xdb, + 0x8c, 0x91, 0x53, 0xf3, 0x54, 0xcb, 0xc4, 0x60, 0xb9, 0x9c, 0x3f, 0xa6, 0xb7, 0xb1, + 0xd1, 0xa1, 0xa7, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0xd1, 0xbb, 0xc4, 0x44, 0x92, 0x5e, + 0x23, 0x1d, 0xb4, 0x3a, 0x1a, 0x1c, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa8, 0x76, 0x6c, 0x0e, + 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, + 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, + 0xbb, 0x9f, 0xd3, 0xc9, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, + 0x0d, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, + 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, + 0x2e, 0xaa, 0x1c, 0x01, 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0x0f, + ], + &[ + 0xef, 0x4b, 0xdc, 0x23, 0xe7, 0xf1, 0x87, 0xa2, 0xa6, 0x7a, 0x78, 0xcd, 0xab, 0x59, + 0x38, 0xa2, 0x67, 0xf5, 0x0f, 0xd5, 0x2c, 0xeb, 0xa6, 0x53, 0xea, 0xd5, 0x80, 0xd7, + 0x30, 0x13, 0x23, 0xe3, 0xff, 0xac, 0xb6, 0x64, 0x17, 0xdc, 0x24, 0xd8, 0xf5, 0x6a, + 0x46, 0x1f, 0x82, 0xce, 0x67, 0x1d, 0x36, 0x9a, 0xf4, 0xfe, 0x24, 0x76, 0x9c, 0x8d, + 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, 0x8e, 0x47, 0x35, 0x1f, + 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, 0x64, 0x73, 0xba, 0x6f, + 0xbd, 0x5b, 0x0f, 0x5f, 0x79, 0xd4, 0x28, 0x91, 0x1c, 0x73, 0x6b, 0xa2, 0x6e, 0x59, + 0x01, 0xd1, 0x46, 0x20, 0xa2, 0x96, 0x9d, 0x5e, 0x95, 0xd2, 0x07, 0x0d, 0xd0, 0xdd, + 0x75, 0x57, 0x77, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, 0xfe, 0x45, 0xbe, 0x19, 0x00, + 0x04, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, 0xe0, 0x52, 0xc0, 0x5a, + 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, 0xb1, 0x04, 0xb6, 0x92, + 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0x19, 0x83, 0x56, 0x0e, 0xcc, 0xb8, 0x65, 0x73, 0x56, + 0x08, 0x5d, 0xe3, 0x03, 0x85, 0x5e, 0x0a, 0x58, 0x5c, 0xc2, 0xa4, 0xf9, 0x03, 0x75, + 0x84, 0xd8, 0x3d, 0xf4, 0x79, 0x5c, 0x4d, 0x54, 0x63, 0x07, + ], + ], + root_serialized: &[ + 0x30, 0x4c, 0xb6, 0x4a, 0xf4, 0xb7, 0x72, 0xd0, 0xd2, 0x70, 0x0f, 0xe8, 0x2b, 0x39, + 0xf8, 0x08, 0x72, 0x70, 0x1d, 0x18, 0x40, 0x0b, 0x13, 0xe7, 0x80, 0xff, 0x41, 0x1d, + 0xbe, 0x26, 0x58, 0x40, 0x38, 0xf2, 0x8c, 0x93, 0x17, 0xdc, 0x24, 0xd8, 0x92, 0x5e, + 0x23, 0x1d, 0x82, 0xce, 0x67, 0x1d, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x64, 0x73, 0xba, 0x6f, + 0xbd, 0x5b, 0x0f, 0x5f, 0x79, 0xd4, 0x28, 0x91, 0x1c, 0x73, 0x6b, 0xa2, 0x6e, 0x59, + 0x01, 0xd1, 0x46, 0x20, 0xa2, 0x96, 0x9d, 0x5e, 0x95, 0xd2, 0x07, 0x0d, 0xd0, 0xdd, + 0x30, 0xf7, 0x4a, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x45, 0xbe, 0x19, 0x00, + 0x11, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x19, 0x83, 0x56, 0x0e, 0xcc, 0xb8, 0x65, 0x73, 0x56, + 0x08, 0x5d, 0xe3, 0x03, 0x85, 0x5e, 0x0a, 0x58, 0x5c, 0xc2, 0xa4, 0xf9, 0x03, 0x75, + 0x84, 0xd8, 0x3d, 0xf4, 0x79, 0x5c, 0x4d, 0x54, 0x63, 0x16, + ], + hash_chain_history_root: [ + 0x99, 0xa1, 0xa3, 0xa0, 0x6d, 0xb4, 0xab, 0x44, 0x73, 0x0c, 0x85, 0x77, 0x99, 0xcc, + 0xa7, 0xf1, 0xc1, 0x2f, 0xe8, 0xbe, 0xad, 0x43, 0xec, 0x9b, 0x36, 0x4c, 0x26, 0xbb, + 0x77, 0x1f, 0x11, 0xb7, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 7, + leaf_block_hash: [ + 0xba, 0x2a, 0x3d, 0x50, 0x91, 0xee, 0x66, 0x2e, 0x80, 0x5f, 0x5e, 0xa6, 0x02, 0x35, + 0x2d, 0xdd, 0xf7, 0x41, 0xe3, 0x82, 0x8b, 0x0d, 0xc3, 0xfc, 0x9e, 0x46, 0x80, 0x8b, + 0xc2, 0xa2, 0x0c, 0x09, + ], + leaf_time: 1935828484, + leaf_target_bits: 503893709, + leaf_sapling_root: [ + 0x6a, 0x77, 0xff, 0xbb, 0x63, 0x5e, 0xea, 0x14, 0x54, 0x72, 0x1c, 0xb5, 0x3a, 0xa2, + 0xae, 0x77, 0x3f, 0x0d, 0x42, 0xd7, 0x23, 0x11, 0x7b, 0x3c, 0xad, 0x06, 0xcc, 0xee, + 0x32, 0x0f, 0x03, 0x10, + ], + leaf_work: [ + 0xaa, 0x10, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687110, + leaf_sapling_tx_count: 6, + leaf_orchard_root: [ + 0x8f, 0x83, 0xdd, 0x12, 0x1e, 0xa0, 0x22, 0x4c, 0x02, 0x17, 0x63, 0x5f, 0x02, 0x81, + 0x95, 0x4c, 0xd5, 0x49, 0xdd, 0xb4, 0x9d, 0xf2, 0x21, 0x9d, 0x7c, 0x91, 0xe1, 0x56, + 0xdd, 0xbd, 0x58, 0xa6, + ], + leaf_orchard_tx_count: 0, + leaf_serialized: &[ + 0xba, 0x2a, 0x3d, 0x50, 0x91, 0xee, 0x66, 0x2e, 0x80, 0x5f, 0x5e, 0xa6, 0x02, 0x35, + 0x2d, 0xdd, 0xf7, 0x41, 0xe3, 0x82, 0x8b, 0x0d, 0xc3, 0xfc, 0x9e, 0x46, 0x80, 0x8b, + 0xc2, 0xa2, 0x0c, 0x09, 0x04, 0x66, 0x62, 0x73, 0x04, 0x66, 0x62, 0x73, 0xcd, 0xce, + 0x08, 0x1e, 0xcd, 0xce, 0x08, 0x1e, 0x6a, 0x77, 0xff, 0xbb, 0x63, 0x5e, 0xea, 0x14, + 0x54, 0x72, 0x1c, 0xb5, 0x3a, 0xa2, 0xae, 0x77, 0x3f, 0x0d, 0x42, 0xd7, 0x23, 0x11, + 0x7b, 0x3c, 0xad, 0x06, 0xcc, 0xee, 0x32, 0x0f, 0x03, 0x10, 0x6a, 0x77, 0xff, 0xbb, + 0x63, 0x5e, 0xea, 0x14, 0x54, 0x72, 0x1c, 0xb5, 0x3a, 0xa2, 0xae, 0x77, 0x3f, 0x0d, + 0x42, 0xd7, 0x23, 0x11, 0x7b, 0x3c, 0xad, 0x06, 0xcc, 0xee, 0x32, 0x0f, 0x03, 0x10, + 0xaa, 0x10, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x46, 0xbe, 0x19, 0x00, 0xfe, 0x46, 0xbe, 0x19, 0x00, + 0x06, 0x8f, 0x83, 0xdd, 0x12, 0x1e, 0xa0, 0x22, 0x4c, 0x02, 0x17, 0x63, 0x5f, 0x02, + 0x81, 0x95, 0x4c, 0xd5, 0x49, 0xdd, 0xb4, 0x9d, 0xf2, 0x21, 0x9d, 0x7c, 0x91, 0xe1, + 0x56, 0xdd, 0xbd, 0x58, 0xa6, 0x8f, 0x83, 0xdd, 0x12, 0x1e, 0xa0, 0x22, 0x4c, 0x02, + 0x17, 0x63, 0x5f, 0x02, 0x81, 0x95, 0x4c, 0xd5, 0x49, 0xdd, 0xb4, 0x9d, 0xf2, 0x21, + 0x9d, 0x7c, 0x91, 0xe1, 0x56, 0xdd, 0xbd, 0x58, 0xa6, 0x00, + ], + peaks: &[ + &[ + 0xc6, 0x13, 0x60, 0xf6, 0x7e, 0xb7, 0xcc, 0x69, 0x4c, 0x6e, 0x24, 0xbb, 0xfc, 0xdb, + 0x8c, 0x91, 0x53, 0xf3, 0x54, 0xcb, 0xc4, 0x60, 0xb9, 0x9c, 0x3f, 0xa6, 0xb7, 0xb1, + 0xd1, 0xa1, 0xa7, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0xd1, 0xbb, 0xc4, 0x44, 0x92, 0x5e, + 0x23, 0x1d, 0xb4, 0x3a, 0x1a, 0x1c, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa8, 0x76, 0x6c, 0x0e, + 0x1f, 0x3a, 0x80, 0x3a, 0x70, 0x18, 0xf6, 0xd3, 0x88, 0x7e, 0x9b, 0x4b, 0x80, 0x9e, + 0xbd, 0x31, 0x5f, 0x7b, 0x34, 0x35, 0x05, 0x46, 0x7a, 0xf4, 0x8f, 0x71, 0xc7, 0x74, + 0xbb, 0x9f, 0xd3, 0xc9, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x43, 0xbe, 0x19, 0x00, + 0x0d, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xb7, 0x2c, 0x4d, 0x40, 0xed, 0xb8, 0x0a, 0x05, 0x9c, + 0xb6, 0xb6, 0xf8, 0x5c, 0xe6, 0xf1, 0x98, 0xbd, 0xae, 0x63, 0xb3, 0xf1, 0x06, 0xa9, + 0x2e, 0xaa, 0x1c, 0x01, 0xb4, 0xa9, 0x1c, 0x4b, 0x0c, 0x0f, + ], + &[ + 0xef, 0x4b, 0xdc, 0x23, 0xe7, 0xf1, 0x87, 0xa2, 0xa6, 0x7a, 0x78, 0xcd, 0xab, 0x59, + 0x38, 0xa2, 0x67, 0xf5, 0x0f, 0xd5, 0x2c, 0xeb, 0xa6, 0x53, 0xea, 0xd5, 0x80, 0xd7, + 0x30, 0x13, 0x23, 0xe3, 0xff, 0xac, 0xb6, 0x64, 0x17, 0xdc, 0x24, 0xd8, 0xf5, 0x6a, + 0x46, 0x1f, 0x82, 0xce, 0x67, 0x1d, 0x36, 0x9a, 0xf4, 0xfe, 0x24, 0x76, 0x9c, 0x8d, + 0x97, 0xa3, 0x32, 0xc8, 0xf4, 0xae, 0x1a, 0xc0, 0x89, 0xac, 0x8e, 0x47, 0x35, 0x1f, + 0x7a, 0x5a, 0xc7, 0xe9, 0x1d, 0x09, 0xe5, 0xe8, 0xaf, 0xf7, 0x64, 0x73, 0xba, 0x6f, + 0xbd, 0x5b, 0x0f, 0x5f, 0x79, 0xd4, 0x28, 0x91, 0x1c, 0x73, 0x6b, 0xa2, 0x6e, 0x59, + 0x01, 0xd1, 0x46, 0x20, 0xa2, 0x96, 0x9d, 0x5e, 0x95, 0xd2, 0x07, 0x0d, 0xd0, 0xdd, + 0x75, 0x57, 0x77, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x44, 0xbe, 0x19, 0x00, 0xfe, 0x45, 0xbe, 0x19, 0x00, + 0x04, 0xab, 0xab, 0xca, 0x77, 0x13, 0x58, 0x03, 0x6a, 0x4b, 0xe0, 0x52, 0xc0, 0x5a, + 0x0e, 0x32, 0x4a, 0xf4, 0xdb, 0xd5, 0x71, 0xcb, 0x83, 0x1a, 0xb1, 0x04, 0xb6, 0x92, + 0xdb, 0x5d, 0x04, 0x4b, 0x45, 0x19, 0x83, 0x56, 0x0e, 0xcc, 0xb8, 0x65, 0x73, 0x56, + 0x08, 0x5d, 0xe3, 0x03, 0x85, 0x5e, 0x0a, 0x58, 0x5c, 0xc2, 0xa4, 0xf9, 0x03, 0x75, + 0x84, 0xd8, 0x3d, 0xf4, 0x79, 0x5c, 0x4d, 0x54, 0x63, 0x07, + ], + &[ + 0xba, 0x2a, 0x3d, 0x50, 0x91, 0xee, 0x66, 0x2e, 0x80, 0x5f, 0x5e, 0xa6, 0x02, 0x35, + 0x2d, 0xdd, 0xf7, 0x41, 0xe3, 0x82, 0x8b, 0x0d, 0xc3, 0xfc, 0x9e, 0x46, 0x80, 0x8b, + 0xc2, 0xa2, 0x0c, 0x09, 0x04, 0x66, 0x62, 0x73, 0x04, 0x66, 0x62, 0x73, 0xcd, 0xce, + 0x08, 0x1e, 0xcd, 0xce, 0x08, 0x1e, 0x6a, 0x77, 0xff, 0xbb, 0x63, 0x5e, 0xea, 0x14, + 0x54, 0x72, 0x1c, 0xb5, 0x3a, 0xa2, 0xae, 0x77, 0x3f, 0x0d, 0x42, 0xd7, 0x23, 0x11, + 0x7b, 0x3c, 0xad, 0x06, 0xcc, 0xee, 0x32, 0x0f, 0x03, 0x10, 0x6a, 0x77, 0xff, 0xbb, + 0x63, 0x5e, 0xea, 0x14, 0x54, 0x72, 0x1c, 0xb5, 0x3a, 0xa2, 0xae, 0x77, 0x3f, 0x0d, + 0x42, 0xd7, 0x23, 0x11, 0x7b, 0x3c, 0xad, 0x06, 0xcc, 0xee, 0x32, 0x0f, 0x03, 0x10, + 0xaa, 0x10, 0x1d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x46, 0xbe, 0x19, 0x00, 0xfe, 0x46, 0xbe, 0x19, 0x00, + 0x06, 0x8f, 0x83, 0xdd, 0x12, 0x1e, 0xa0, 0x22, 0x4c, 0x02, 0x17, 0x63, 0x5f, 0x02, + 0x81, 0x95, 0x4c, 0xd5, 0x49, 0xdd, 0xb4, 0x9d, 0xf2, 0x21, 0x9d, 0x7c, 0x91, 0xe1, + 0x56, 0xdd, 0xbd, 0x58, 0xa6, 0x8f, 0x83, 0xdd, 0x12, 0x1e, 0xa0, 0x22, 0x4c, 0x02, + 0x17, 0x63, 0x5f, 0x02, 0x81, 0x95, 0x4c, 0xd5, 0x49, 0xdd, 0xb4, 0x9d, 0xf2, 0x21, + 0x9d, 0x7c, 0x91, 0xe1, 0x56, 0xdd, 0xbd, 0x58, 0xa6, 0x00, + ], + ], + root_serialized: &[ + 0x2d, 0xfe, 0x94, 0x41, 0xb7, 0x3f, 0xf7, 0xab, 0xb0, 0x5c, 0xaf, 0x65, 0x77, 0xe6, + 0x44, 0x63, 0x97, 0x6a, 0xf8, 0xfa, 0x9c, 0x71, 0xc7, 0xd7, 0x71, 0x32, 0xd7, 0x52, + 0x0c, 0xbd, 0xd6, 0x7d, 0x38, 0xf2, 0x8c, 0x93, 0x04, 0x66, 0x62, 0x73, 0x92, 0x5e, + 0x23, 0x1d, 0xcd, 0xce, 0x08, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x6a, 0x77, 0xff, 0xbb, + 0x63, 0x5e, 0xea, 0x14, 0x54, 0x72, 0x1c, 0xb5, 0x3a, 0xa2, 0xae, 0x77, 0x3f, 0x0d, + 0x42, 0xd7, 0x23, 0x11, 0x7b, 0x3c, 0xad, 0x06, 0xcc, 0xee, 0x32, 0x0f, 0x03, 0x10, + 0xda, 0x07, 0x68, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x46, 0xbe, 0x19, 0x00, + 0x17, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x8f, 0x83, 0xdd, 0x12, 0x1e, 0xa0, 0x22, 0x4c, 0x02, + 0x17, 0x63, 0x5f, 0x02, 0x81, 0x95, 0x4c, 0xd5, 0x49, 0xdd, 0xb4, 0x9d, 0xf2, 0x21, + 0x9d, 0x7c, 0x91, 0xe1, 0x56, 0xdd, 0xbd, 0x58, 0xa6, 0x16, + ], + hash_chain_history_root: [ + 0x46, 0x29, 0x5a, 0x48, 0xc3, 0xc3, 0xe4, 0xf8, 0x07, 0x33, 0x07, 0x29, 0xa4, 0xf7, + 0x6e, 0x9e, 0x3d, 0xc5, 0x31, 0xb7, 0x57, 0x41, 0x3a, 0x7f, 0xa9, 0x5e, 0x2f, 0x71, + 0x1a, 0x16, 0xb0, 0x58, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 8, + leaf_block_hash: [ + 0xd2, 0x68, 0x6f, 0x55, 0x9c, 0xc9, 0xdc, 0xea, 0x69, 0xec, 0xc4, 0x2e, 0xb9, 0x0d, + 0x71, 0x27, 0xb0, 0x5e, 0xda, 0x9e, 0xfb, 0xbc, 0x8c, 0x79, 0x81, 0xa7, 0x92, 0x65, + 0x25, 0xa2, 0x60, 0x10, + ], + leaf_time: 531424771, + leaf_target_bits: 507236081, + leaf_sapling_root: [ + 0xa0, 0xdb, 0x74, 0x96, 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, + 0x03, 0x50, 0x26, 0xee, 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, + 0x35, 0xd9, 0x52, 0x38, + ], + leaf_work: [ + 0xc4, 0x47, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687111, + leaf_sapling_tx_count: 2, + leaf_orchard_root: [ + 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, 0xe5, 0x6f, 0x0e, 0x5c, 0x25, + 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, 0xe8, 0x05, 0x15, 0x24, 0xb9, + 0x68, 0x98, 0x8b, 0x07, + ], + leaf_orchard_tx_count: 5, + leaf_serialized: &[ + 0xd2, 0x68, 0x6f, 0x55, 0x9c, 0xc9, 0xdc, 0xea, 0x69, 0xec, 0xc4, 0x2e, 0xb9, 0x0d, + 0x71, 0x27, 0xb0, 0x5e, 0xda, 0x9e, 0xfb, 0xbc, 0x8c, 0x79, 0x81, 0xa7, 0x92, 0x65, + 0x25, 0xa2, 0x60, 0x10, 0x03, 0xe6, 0xac, 0x1f, 0x03, 0xe6, 0xac, 0x1f, 0xf1, 0xce, + 0x3b, 0x1e, 0xf1, 0xce, 0x3b, 0x1e, 0xa0, 0xdb, 0x74, 0x96, 0x8b, 0x33, 0x5d, 0x4e, + 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, 0x9e, 0x57, 0x97, 0xff, + 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0xc4, 0x47, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x02, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, 0xe5, 0x6f, 0x0e, 0x5c, + 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, 0xe8, 0x05, 0x15, 0x24, + 0xb9, 0x68, 0x98, 0x8b, 0x07, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x05, + ], + peaks: &[&[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ]], + root_serialized: &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + hash_chain_history_root: [ + 0xac, 0x8b, 0x09, 0x2b, 0xc3, 0x55, 0x08, 0x54, 0xa0, 0xfc, 0xdc, 0xe4, 0xc6, 0x7b, + 0x75, 0xee, 0x94, 0x90, 0x7d, 0x81, 0x7f, 0x64, 0x8f, 0x3c, 0x45, 0x42, 0x46, 0x35, + 0xf2, 0x6e, 0x0c, 0xac, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 9, + leaf_block_hash: [ + 0xf7, 0x1d, 0x9d, 0xfd, 0x33, 0x1a, 0x10, 0xf9, 0x8f, 0x3b, 0x38, 0x1e, 0xa3, 0xad, + 0x9e, 0x6c, 0xe5, 0x86, 0xbf, 0xd8, 0xf7, 0x32, 0x06, 0x9b, 0xd2, 0x2d, 0x17, 0xca, + 0x37, 0x0d, 0xff, 0x5b, + ], + leaf_time: 3155609976, + leaf_target_bits: 503478518, + leaf_sapling_root: [ + 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, + 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, + 0x15, 0x4b, 0xc5, 0x23, + ], + leaf_work: [ + 0xed, 0x89, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687112, + leaf_sapling_tx_count: 7, + leaf_orchard_root: [ + 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, 0xe6, + 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, 0x7c, + 0x1f, 0x92, 0xa8, 0x63, + ], + leaf_orchard_tx_count: 7, + leaf_serialized: &[ + 0xf7, 0x1d, 0x9d, 0xfd, 0x33, 0x1a, 0x10, 0xf9, 0x8f, 0x3b, 0x38, 0x1e, 0xa3, 0xad, + 0x9e, 0x6c, 0xe5, 0x86, 0xbf, 0xd8, 0xf7, 0x32, 0x06, 0x9b, 0xd2, 0x2d, 0x17, 0xca, + 0x37, 0x0d, 0xff, 0x5b, 0x78, 0xc9, 0x16, 0xbc, 0x78, 0xc9, 0x16, 0xbc, 0xf6, 0x78, + 0x02, 0x1e, 0xf6, 0x78, 0x02, 0x1e, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe8, 0xb7, 0xf1, 0x14, + 0x9e, 0x68, 0xc5, 0x74, 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, + 0xd4, 0x9e, 0x3d, 0x82, 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, + 0xed, 0x89, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, + 0x07, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, + 0xbc, 0xff, 0x5e, 0x1e, 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, + 0x6b, 0xc3, 0x1a, 0xf1, 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x07, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0xf7, 0x1d, 0x9d, 0xfd, 0x33, 0x1a, 0x10, 0xf9, 0x8f, 0x3b, 0x38, 0x1e, 0xa3, 0xad, + 0x9e, 0x6c, 0xe5, 0x86, 0xbf, 0xd8, 0xf7, 0x32, 0x06, 0x9b, 0xd2, 0x2d, 0x17, 0xca, + 0x37, 0x0d, 0xff, 0x5b, 0x78, 0xc9, 0x16, 0xbc, 0x78, 0xc9, 0x16, 0xbc, 0xf6, 0x78, + 0x02, 0x1e, 0xf6, 0x78, 0x02, 0x1e, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe8, 0xb7, 0xf1, 0x14, + 0x9e, 0x68, 0xc5, 0x74, 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, + 0xd4, 0x9e, 0x3d, 0x82, 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, + 0xed, 0x89, 0x67, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, + 0x07, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, + 0xbc, 0xff, 0x5e, 0x1e, 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, + 0x6b, 0xc3, 0x1a, 0xf1, 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x07, + ], + ], + root_serialized: &[ + 0xe4, 0xc5, 0xf0, 0x4f, 0xed, 0x99, 0xf0, 0x73, 0xcc, 0xbd, 0x8e, 0xdf, 0xd6, 0x48, + 0x5c, 0x8d, 0x3e, 0x2b, 0xd1, 0xac, 0xbf, 0x3e, 0x0c, 0x15, 0x68, 0x54, 0x1b, 0xa6, + 0x08, 0x22, 0x14, 0x57, 0x38, 0xf2, 0x8c, 0x93, 0x78, 0xc9, 0x16, 0xbc, 0x92, 0x5e, + 0x23, 0x1d, 0xf6, 0x78, 0x02, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xe8, 0xb7, 0xf1, 0x14, + 0x9e, 0x68, 0xc5, 0x74, 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, + 0xd4, 0x9e, 0x3d, 0x82, 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, + 0x8b, 0xd9, 0xd3, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, + 0x20, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, + 0xbc, 0xff, 0x5e, 0x1e, 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, + 0x6b, 0xc3, 0x1a, 0xf1, 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x22, + ], + hash_chain_history_root: [ + 0x12, 0x69, 0x39, 0x35, 0xfc, 0x19, 0x59, 0x5e, 0x70, 0xb2, 0xab, 0x2d, 0x35, 0xb3, + 0x67, 0x25, 0x55, 0xef, 0xb3, 0x5a, 0xc7, 0x87, 0xa8, 0x27, 0xe7, 0x03, 0x1e, 0x93, + 0x6e, 0x5a, 0x2f, 0xba, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 10, + leaf_block_hash: [ + 0xca, 0xfa, 0x30, 0xe4, 0x47, 0xde, 0xfd, 0x77, 0xfd, 0x95, 0x2c, 0xc8, 0x1d, 0xe8, + 0x25, 0xd4, 0xba, 0x0e, 0xee, 0xc7, 0x96, 0x36, 0x92, 0x0c, 0xb2, 0x2f, 0x8e, 0x63, + 0x15, 0xdd, 0xc7, 0x7c, + ], + leaf_time: 2458286205, + leaf_target_bits: 493450581, + leaf_sapling_root: [ + 0xe4, 0x31, 0x5c, 0x9d, 0x14, 0xf7, 0x2f, 0x78, 0xf7, 0xc9, 0x55, 0x88, 0x39, 0xa1, + 0x1e, 0xb0, 0x23, 0x95, 0xbe, 0x95, 0xf6, 0x42, 0x25, 0x05, 0x9a, 0xbe, 0x84, 0xae, + 0x5c, 0xb3, 0xcb, 0xfa, + ], + leaf_work: [ + 0x95, 0x70, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687113, + leaf_sapling_tx_count: 2, + leaf_orchard_root: [ + 0x46, 0x2e, 0x9e, 0xd3, 0x2f, 0xe1, 0x21, 0x1d, 0x29, 0xbf, 0x30, 0xa7, 0xf2, 0x0c, + 0xf8, 0x97, 0x9a, 0xe1, 0x8a, 0x01, 0xfb, 0x3d, 0x99, 0xde, 0x1a, 0x1d, 0x7c, 0xc1, + 0xad, 0x44, 0x99, 0x53, + ], + leaf_orchard_tx_count: 2, + leaf_serialized: &[ + 0xca, 0xfa, 0x30, 0xe4, 0x47, 0xde, 0xfd, 0x77, 0xfd, 0x95, 0x2c, 0xc8, 0x1d, 0xe8, + 0x25, 0xd4, 0xba, 0x0e, 0xee, 0xc7, 0x96, 0x36, 0x92, 0x0c, 0xb2, 0x2f, 0x8e, 0x63, + 0x15, 0xdd, 0xc7, 0x7c, 0x7d, 0x78, 0x86, 0x92, 0x7d, 0x78, 0x86, 0x92, 0x55, 0x75, + 0x69, 0x1d, 0x55, 0x75, 0x69, 0x1d, 0xe4, 0x31, 0x5c, 0x9d, 0x14, 0xf7, 0x2f, 0x78, + 0xf7, 0xc9, 0x55, 0x88, 0x39, 0xa1, 0x1e, 0xb0, 0x23, 0x95, 0xbe, 0x95, 0xf6, 0x42, + 0x25, 0x05, 0x9a, 0xbe, 0x84, 0xae, 0x5c, 0xb3, 0xcb, 0xfa, 0xe4, 0x31, 0x5c, 0x9d, + 0x14, 0xf7, 0x2f, 0x78, 0xf7, 0xc9, 0x55, 0x88, 0x39, 0xa1, 0x1e, 0xb0, 0x23, 0x95, + 0xbe, 0x95, 0xf6, 0x42, 0x25, 0x05, 0x9a, 0xbe, 0x84, 0xae, 0x5c, 0xb3, 0xcb, 0xfa, + 0x95, 0x70, 0x6d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x49, 0xbe, 0x19, 0x00, 0xfe, 0x49, 0xbe, 0x19, 0x00, + 0x02, 0x46, 0x2e, 0x9e, 0xd3, 0x2f, 0xe1, 0x21, 0x1d, 0x29, 0xbf, 0x30, 0xa7, 0xf2, + 0x0c, 0xf8, 0x97, 0x9a, 0xe1, 0x8a, 0x01, 0xfb, 0x3d, 0x99, 0xde, 0x1a, 0x1d, 0x7c, + 0xc1, 0xad, 0x44, 0x99, 0x53, 0x46, 0x2e, 0x9e, 0xd3, 0x2f, 0xe1, 0x21, 0x1d, 0x29, + 0xbf, 0x30, 0xa7, 0xf2, 0x0c, 0xf8, 0x97, 0x9a, 0xe1, 0x8a, 0x01, 0xfb, 0x3d, 0x99, + 0xde, 0x1a, 0x1d, 0x7c, 0xc1, 0xad, 0x44, 0x99, 0x53, 0x02, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0x9c, 0x59, 0x6f, 0xe1, 0xfc, 0xcd, 0x76, 0x55, 0x59, 0x7c, 0xb8, 0xdb, 0x7f, 0x9b, + 0x17, 0x15, 0xf2, 0xb0, 0x93, 0x1c, 0x15, 0x85, 0x3d, 0x8d, 0xa8, 0x73, 0x68, 0xcb, + 0x7c, 0x78, 0x91, 0x0c, 0x78, 0xc9, 0x16, 0xbc, 0x7d, 0x78, 0x86, 0x92, 0xf6, 0x78, + 0x02, 0x1e, 0x55, 0x75, 0x69, 0x1d, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe4, 0x31, 0x5c, 0x9d, + 0x14, 0xf7, 0x2f, 0x78, 0xf7, 0xc9, 0x55, 0x88, 0x39, 0xa1, 0x1e, 0xb0, 0x23, 0x95, + 0xbe, 0x95, 0xf6, 0x42, 0x25, 0x05, 0x9a, 0xbe, 0x84, 0xae, 0x5c, 0xb3, 0xcb, 0xfa, + 0x82, 0xfa, 0xd4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x49, 0xbe, 0x19, 0x00, + 0x09, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x46, 0x2e, 0x9e, 0xd3, 0x2f, 0xe1, 0x21, 0x1d, 0x29, + 0xbf, 0x30, 0xa7, 0xf2, 0x0c, 0xf8, 0x97, 0x9a, 0xe1, 0x8a, 0x01, 0xfb, 0x3d, 0x99, + 0xde, 0x1a, 0x1d, 0x7c, 0xc1, 0xad, 0x44, 0x99, 0x53, 0x09, + ], + ], + root_serialized: &[ + 0xb3, 0x8b, 0x8d, 0xe8, 0xa9, 0x7d, 0xcf, 0x96, 0x94, 0x32, 0x10, 0x21, 0xbd, 0x76, + 0xcb, 0xf0, 0x3f, 0x6f, 0x35, 0x7b, 0x4c, 0x1b, 0x04, 0xd2, 0x73, 0xed, 0xf1, 0x3d, + 0xb4, 0x68, 0xe4, 0x30, 0x38, 0xf2, 0x8c, 0x93, 0x7d, 0x78, 0x86, 0x92, 0x92, 0x5e, + 0x23, 0x1d, 0x55, 0x75, 0x69, 0x1d, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xe4, 0x31, 0x5c, 0x9d, + 0x14, 0xf7, 0x2f, 0x78, 0xf7, 0xc9, 0x55, 0x88, 0x39, 0xa1, 0x1e, 0xb0, 0x23, 0x95, + 0xbe, 0x95, 0xf6, 0x42, 0x25, 0x05, 0x9a, 0xbe, 0x84, 0xae, 0x5c, 0xb3, 0xcb, 0xfa, + 0x20, 0x4a, 0x41, 0xcf, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x49, 0xbe, 0x19, 0x00, + 0x22, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x46, 0x2e, 0x9e, 0xd3, 0x2f, 0xe1, 0x21, 0x1d, 0x29, + 0xbf, 0x30, 0xa7, 0xf2, 0x0c, 0xf8, 0x97, 0x9a, 0xe1, 0x8a, 0x01, 0xfb, 0x3d, 0x99, + 0xde, 0x1a, 0x1d, 0x7c, 0xc1, 0xad, 0x44, 0x99, 0x53, 0x24, + ], + hash_chain_history_root: [ + 0x3f, 0xdd, 0x82, 0xf0, 0x6b, 0xb8, 0x43, 0x04, 0x1d, 0xdc, 0x9b, 0x92, 0x74, 0xa8, + 0x4f, 0x7f, 0xa2, 0x21, 0x07, 0x8a, 0x68, 0x2a, 0x40, 0x4f, 0x9e, 0xde, 0x10, 0xe1, + 0x5a, 0x0e, 0x4c, 0x18, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 11, + leaf_block_hash: [ + 0xa7, 0x3d, 0xb8, 0xc7, 0x3e, 0x3e, 0xf1, 0x36, 0x62, 0x97, 0xde, 0xe3, 0x34, 0x5a, + 0x66, 0xb7, 0x7b, 0x0e, 0x21, 0x09, 0xa0, 0xe3, 0xff, 0xa9, 0x40, 0x41, 0x13, 0xda, + 0x09, 0x38, 0x2a, 0x0a, + ], + leaf_time: 1276758199, + leaf_target_bits: 492926747, + leaf_sapling_root: [ + 0xc7, 0x06, 0xf8, 0x2d, 0xd5, 0x13, 0x20, 0xe5, 0x82, 0xfb, 0x27, 0x80, 0xa4, 0x07, + 0x7f, 0xf5, 0xdc, 0x71, 0x2a, 0x21, 0x32, 0xce, 0x74, 0xdb, 0xf4, 0x65, 0x07, 0x3e, + 0x9b, 0xa7, 0x70, 0x71, + ], + leaf_work: [ + 0x59, 0x67, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687114, + leaf_sapling_tx_count: 7, + leaf_orchard_root: [ + 0xcc, 0x67, 0xd4, 0xb4, 0x98, 0xd2, 0x40, 0xef, 0x20, 0xa6, 0x1b, 0xd9, 0xff, 0x33, + 0xfe, 0xf5, 0x63, 0x5f, 0xea, 0x05, 0xce, 0x3a, 0x1d, 0x2f, 0x4e, 0x62, 0x58, 0x3d, + 0x37, 0xd2, 0xa5, 0x1b, + ], + leaf_orchard_tx_count: 0, + leaf_serialized: &[ + 0xa7, 0x3d, 0xb8, 0xc7, 0x3e, 0x3e, 0xf1, 0x36, 0x62, 0x97, 0xde, 0xe3, 0x34, 0x5a, + 0x66, 0xb7, 0x7b, 0x0e, 0x21, 0x09, 0xa0, 0xe3, 0xff, 0xa9, 0x40, 0x41, 0x13, 0xda, + 0x09, 0x38, 0x2a, 0x0a, 0xb7, 0xc8, 0x19, 0x4c, 0xb7, 0xc8, 0x19, 0x4c, 0x1b, 0x77, + 0x61, 0x1d, 0x1b, 0x77, 0x61, 0x1d, 0xc7, 0x06, 0xf8, 0x2d, 0xd5, 0x13, 0x20, 0xe5, + 0x82, 0xfb, 0x27, 0x80, 0xa4, 0x07, 0x7f, 0xf5, 0xdc, 0x71, 0x2a, 0x21, 0x32, 0xce, + 0x74, 0xdb, 0xf4, 0x65, 0x07, 0x3e, 0x9b, 0xa7, 0x70, 0x71, 0xc7, 0x06, 0xf8, 0x2d, + 0xd5, 0x13, 0x20, 0xe5, 0x82, 0xfb, 0x27, 0x80, 0xa4, 0x07, 0x7f, 0xf5, 0xdc, 0x71, + 0x2a, 0x21, 0x32, 0xce, 0x74, 0xdb, 0xf4, 0x65, 0x07, 0x3e, 0x9b, 0xa7, 0x70, 0x71, + 0x59, 0x67, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4a, 0xbe, 0x19, 0x00, 0xfe, 0x4a, 0xbe, 0x19, 0x00, + 0x07, 0xcc, 0x67, 0xd4, 0xb4, 0x98, 0xd2, 0x40, 0xef, 0x20, 0xa6, 0x1b, 0xd9, 0xff, + 0x33, 0xfe, 0xf5, 0x63, 0x5f, 0xea, 0x05, 0xce, 0x3a, 0x1d, 0x2f, 0x4e, 0x62, 0x58, + 0x3d, 0x37, 0xd2, 0xa5, 0x1b, 0xcc, 0x67, 0xd4, 0xb4, 0x98, 0xd2, 0x40, 0xef, 0x20, + 0xa6, 0x1b, 0xd9, 0xff, 0x33, 0xfe, 0xf5, 0x63, 0x5f, 0xea, 0x05, 0xce, 0x3a, 0x1d, + 0x2f, 0x4e, 0x62, 0x58, 0x3d, 0x37, 0xd2, 0xa5, 0x1b, 0x00, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0x9c, 0x59, 0x6f, 0xe1, 0xfc, 0xcd, 0x76, 0x55, 0x59, 0x7c, 0xb8, 0xdb, 0x7f, 0x9b, + 0x17, 0x15, 0xf2, 0xb0, 0x93, 0x1c, 0x15, 0x85, 0x3d, 0x8d, 0xa8, 0x73, 0x68, 0xcb, + 0x7c, 0x78, 0x91, 0x0c, 0x78, 0xc9, 0x16, 0xbc, 0x7d, 0x78, 0x86, 0x92, 0xf6, 0x78, + 0x02, 0x1e, 0x55, 0x75, 0x69, 0x1d, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe4, 0x31, 0x5c, 0x9d, + 0x14, 0xf7, 0x2f, 0x78, 0xf7, 0xc9, 0x55, 0x88, 0x39, 0xa1, 0x1e, 0xb0, 0x23, 0x95, + 0xbe, 0x95, 0xf6, 0x42, 0x25, 0x05, 0x9a, 0xbe, 0x84, 0xae, 0x5c, 0xb3, 0xcb, 0xfa, + 0x82, 0xfa, 0xd4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x49, 0xbe, 0x19, 0x00, + 0x09, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x46, 0x2e, 0x9e, 0xd3, 0x2f, 0xe1, 0x21, 0x1d, 0x29, + 0xbf, 0x30, 0xa7, 0xf2, 0x0c, 0xf8, 0x97, 0x9a, 0xe1, 0x8a, 0x01, 0xfb, 0x3d, 0x99, + 0xde, 0x1a, 0x1d, 0x7c, 0xc1, 0xad, 0x44, 0x99, 0x53, 0x09, + ], + &[ + 0xa7, 0x3d, 0xb8, 0xc7, 0x3e, 0x3e, 0xf1, 0x36, 0x62, 0x97, 0xde, 0xe3, 0x34, 0x5a, + 0x66, 0xb7, 0x7b, 0x0e, 0x21, 0x09, 0xa0, 0xe3, 0xff, 0xa9, 0x40, 0x41, 0x13, 0xda, + 0x09, 0x38, 0x2a, 0x0a, 0xb7, 0xc8, 0x19, 0x4c, 0xb7, 0xc8, 0x19, 0x4c, 0x1b, 0x77, + 0x61, 0x1d, 0x1b, 0x77, 0x61, 0x1d, 0xc7, 0x06, 0xf8, 0x2d, 0xd5, 0x13, 0x20, 0xe5, + 0x82, 0xfb, 0x27, 0x80, 0xa4, 0x07, 0x7f, 0xf5, 0xdc, 0x71, 0x2a, 0x21, 0x32, 0xce, + 0x74, 0xdb, 0xf4, 0x65, 0x07, 0x3e, 0x9b, 0xa7, 0x70, 0x71, 0xc7, 0x06, 0xf8, 0x2d, + 0xd5, 0x13, 0x20, 0xe5, 0x82, 0xfb, 0x27, 0x80, 0xa4, 0x07, 0x7f, 0xf5, 0xdc, 0x71, + 0x2a, 0x21, 0x32, 0xce, 0x74, 0xdb, 0xf4, 0x65, 0x07, 0x3e, 0x9b, 0xa7, 0x70, 0x71, + 0x59, 0x67, 0xa0, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4a, 0xbe, 0x19, 0x00, 0xfe, 0x4a, 0xbe, 0x19, 0x00, + 0x07, 0xcc, 0x67, 0xd4, 0xb4, 0x98, 0xd2, 0x40, 0xef, 0x20, 0xa6, 0x1b, 0xd9, 0xff, + 0x33, 0xfe, 0xf5, 0x63, 0x5f, 0xea, 0x05, 0xce, 0x3a, 0x1d, 0x2f, 0x4e, 0x62, 0x58, + 0x3d, 0x37, 0xd2, 0xa5, 0x1b, 0xcc, 0x67, 0xd4, 0xb4, 0x98, 0xd2, 0x40, 0xef, 0x20, + 0xa6, 0x1b, 0xd9, 0xff, 0x33, 0xfe, 0xf5, 0x63, 0x5f, 0xea, 0x05, 0xce, 0x3a, 0x1d, + 0x2f, 0x4e, 0x62, 0x58, 0x3d, 0x37, 0xd2, 0xa5, 0x1b, 0x00, + ], + ], + root_serialized: &[ + 0x32, 0x49, 0xe7, 0xcf, 0x4c, 0xb0, 0xc7, 0x69, 0x86, 0x52, 0xa5, 0xb4, 0x8b, 0x24, + 0xd6, 0x35, 0x7a, 0x82, 0xab, 0x47, 0x76, 0xc9, 0x2a, 0xe2, 0xe7, 0x48, 0x12, 0x39, + 0x09, 0x48, 0xcf, 0x2d, 0x38, 0xf2, 0x8c, 0x93, 0xb7, 0xc8, 0x19, 0x4c, 0x92, 0x5e, + 0x23, 0x1d, 0x1b, 0x77, 0x61, 0x1d, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xc7, 0x06, 0xf8, 0x2d, + 0xd5, 0x13, 0x20, 0xe5, 0x82, 0xfb, 0x27, 0x80, 0xa4, 0x07, 0x7f, 0xf5, 0xdc, 0x71, + 0x2a, 0x21, 0x32, 0xce, 0x74, 0xdb, 0xf4, 0x65, 0x07, 0x3e, 0x9b, 0xa7, 0x70, 0x71, + 0x79, 0xb1, 0xe1, 0xd1, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4a, 0xbe, 0x19, 0x00, + 0x29, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xcc, 0x67, 0xd4, 0xb4, 0x98, 0xd2, 0x40, 0xef, 0x20, + 0xa6, 0x1b, 0xd9, 0xff, 0x33, 0xfe, 0xf5, 0x63, 0x5f, 0xea, 0x05, 0xce, 0x3a, 0x1d, + 0x2f, 0x4e, 0x62, 0x58, 0x3d, 0x37, 0xd2, 0xa5, 0x1b, 0x24, + ], + hash_chain_history_root: [ + 0xab, 0xb3, 0x53, 0x53, 0x07, 0xea, 0xa6, 0xd5, 0xdf, 0x2d, 0xcc, 0x37, 0x19, 0x89, + 0x10, 0x49, 0x68, 0xc6, 0xd6, 0xf6, 0xed, 0x70, 0x8f, 0xe0, 0x8d, 0x4d, 0x2e, 0x0f, + 0xc7, 0x48, 0x0f, 0x13, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 12, + leaf_block_hash: [ + 0x57, 0xcf, 0x96, 0x4b, 0x70, 0x93, 0x17, 0xb1, 0x81, 0xea, 0xd8, 0x0e, 0x09, 0xb3, + 0xe4, 0x1f, 0xaa, 0xdc, 0x5e, 0xbe, 0xad, 0xa9, 0x06, 0x1e, 0xe7, 0xae, 0xfd, 0xe6, + 0x5c, 0x11, 0xf9, 0xfb, + ], + leaf_time: 1318614089, + leaf_target_bits: 504111727, + leaf_sapling_root: [ + 0xe3, 0x33, 0x1b, 0xce, 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, + 0x81, 0x2e, 0x20, 0x5d, 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, + 0xf8, 0x4e, 0xe2, 0xea, + ], + leaf_work: [ + 0xcb, 0x18, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687115, + leaf_sapling_tx_count: 4, + leaf_orchard_root: [ + 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, 0x16, 0xf2, 0xb8, 0xca, 0xbb, + 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, 0x79, 0x40, 0xea, 0x9d, 0xaa, + 0x36, 0x1e, 0x24, 0x42, + ], + leaf_orchard_tx_count: 4, + leaf_serialized: &[ + 0x57, 0xcf, 0x96, 0x4b, 0x70, 0x93, 0x17, 0xb1, 0x81, 0xea, 0xd8, 0x0e, 0x09, 0xb3, + 0xe4, 0x1f, 0xaa, 0xdc, 0x5e, 0xbe, 0xad, 0xa9, 0x06, 0x1e, 0xe7, 0xae, 0xfd, 0xe6, + 0x5c, 0x11, 0xf9, 0xfb, 0x49, 0x74, 0x98, 0x4e, 0x49, 0x74, 0x98, 0x4e, 0x6f, 0x22, + 0x0c, 0x1e, 0x6f, 0x22, 0x0c, 0x1e, 0xe3, 0x33, 0x1b, 0xce, 0xb7, 0x28, 0x70, 0xcb, + 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, 0xe2, 0x33, 0x5a, 0x5e, + 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, 0xe3, 0x33, 0x1b, 0xce, + 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, + 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, + 0xcb, 0x18, 0x15, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, + 0x04, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, 0x16, 0xf2, 0xb8, 0xca, + 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, 0x79, 0x40, 0xea, 0x9d, + 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, + 0x16, 0xf2, 0xb8, 0xca, 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, + 0x79, 0x40, 0xea, 0x9d, 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x04, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0x2a, 0x60, 0x22, 0x35, 0xef, 0x80, 0x98, 0x64, 0xc9, 0x71, 0x67, 0xbb, 0x03, 0x6f, + 0xef, 0x8d, 0x13, 0xa7, 0x4f, 0xbb, 0x9c, 0x52, 0xd8, 0x6e, 0x6a, 0xb3, 0x79, 0xe0, + 0x4e, 0xce, 0x12, 0x40, 0x78, 0xc9, 0x16, 0xbc, 0x49, 0x74, 0x98, 0x4e, 0xf6, 0x78, + 0x02, 0x1e, 0x6f, 0x22, 0x0c, 0x1e, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe3, 0x33, 0x1b, 0xce, + 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, + 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, + 0xa6, 0x7a, 0x8a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, + 0x14, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, + 0x16, 0xf2, 0xb8, 0xca, 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, + 0x79, 0x40, 0xea, 0x9d, 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x0d, + ], + ], + root_serialized: &[ + 0x53, 0x68, 0x8b, 0x33, 0x72, 0x30, 0x3f, 0x50, 0x47, 0x43, 0x4b, 0xd7, 0x29, 0x61, + 0xcd, 0x3e, 0x9d, 0x8d, 0x8e, 0x4b, 0xfa, 0xe4, 0xd3, 0xbb, 0x25, 0xf3, 0x1f, 0x49, + 0x14, 0x76, 0xf0, 0x93, 0x38, 0xf2, 0x8c, 0x93, 0x49, 0x74, 0x98, 0x4e, 0x92, 0x5e, + 0x23, 0x1d, 0x6f, 0x22, 0x0c, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xe3, 0x33, 0x1b, 0xce, + 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, + 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, + 0x44, 0xca, 0xf6, 0xd1, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, + 0x2d, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, + 0x16, 0xf2, 0xb8, 0xca, 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, + 0x79, 0x40, 0xea, 0x9d, 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x28, + ], + hash_chain_history_root: [ + 0xf8, 0x25, 0xb5, 0x46, 0xd8, 0x2f, 0xce, 0x27, 0x07, 0x26, 0x26, 0x4b, 0x6d, 0x99, + 0x23, 0xd0, 0x9e, 0xb9, 0x90, 0xff, 0x43, 0xf7, 0x44, 0xac, 0xa0, 0xf0, 0xc2, 0xec, + 0x8b, 0xaf, 0x2d, 0x43, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 13, + leaf_block_hash: [ + 0x07, 0x73, 0xa5, 0xd8, 0xba, 0xec, 0xbb, 0xf2, 0x20, 0x63, 0x6d, 0x77, 0x17, 0x79, + 0x8b, 0x18, 0xe9, 0x32, 0x50, 0x36, 0xcc, 0xa3, 0xaa, 0xe0, 0x50, 0x49, 0x1c, 0x41, + 0x70, 0xae, 0x4a, 0x0a, + ], + leaf_time: 1636518341, + leaf_target_bits: 525918826, + leaf_sapling_root: [ + 0xab, 0x49, 0xac, 0xfa, 0x72, 0xcc, 0x97, 0x4e, 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, + 0x32, 0x60, 0x93, 0x19, 0xf8, 0xbe, 0xb1, 0x19, 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, + 0xc7, 0xda, 0x0f, 0x1c, + ], + leaf_work: [ + 0xe1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687116, + leaf_sapling_tx_count: 1, + leaf_orchard_root: [ + 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, 0x32, 0xf7, 0xe7, 0x30, 0xb5, + 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, 0x5e, 0x70, 0xb1, 0xf4, 0xbf, + 0x28, 0x26, 0x19, 0xbd, + ], + leaf_orchard_tx_count: 3, + leaf_serialized: &[ + 0x07, 0x73, 0xa5, 0xd8, 0xba, 0xec, 0xbb, 0xf2, 0x20, 0x63, 0x6d, 0x77, 0x17, 0x79, + 0x8b, 0x18, 0xe9, 0x32, 0x50, 0x36, 0xcc, 0xa3, 0xaa, 0xe0, 0x50, 0x49, 0x1c, 0x41, + 0x70, 0xae, 0x4a, 0x0a, 0xc5, 0x49, 0x8b, 0x61, 0xc5, 0x49, 0x8b, 0x61, 0x6a, 0xe2, + 0x58, 0x1f, 0x6a, 0xe2, 0x58, 0x1f, 0xab, 0x49, 0xac, 0xfa, 0x72, 0xcc, 0x97, 0x4e, + 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, 0xf8, 0xbe, 0xb1, 0x19, + 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, 0xab, 0x49, 0xac, 0xfa, + 0x72, 0xcc, 0x97, 0x4e, 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, + 0xf8, 0xbe, 0xb1, 0x19, 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, + 0xe1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, + 0x01, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, 0x32, 0xf7, 0xe7, 0x30, + 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, 0x5e, 0x70, 0xb1, 0xf4, + 0xbf, 0x28, 0x26, 0x19, 0xbd, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, + 0x32, 0xf7, 0xe7, 0x30, 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, + 0x5e, 0x70, 0xb1, 0xf4, 0xbf, 0x28, 0x26, 0x19, 0xbd, 0x03, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0x2a, 0x60, 0x22, 0x35, 0xef, 0x80, 0x98, 0x64, 0xc9, 0x71, 0x67, 0xbb, 0x03, 0x6f, + 0xef, 0x8d, 0x13, 0xa7, 0x4f, 0xbb, 0x9c, 0x52, 0xd8, 0x6e, 0x6a, 0xb3, 0x79, 0xe0, + 0x4e, 0xce, 0x12, 0x40, 0x78, 0xc9, 0x16, 0xbc, 0x49, 0x74, 0x98, 0x4e, 0xf6, 0x78, + 0x02, 0x1e, 0x6f, 0x22, 0x0c, 0x1e, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe3, 0x33, 0x1b, 0xce, + 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, + 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, + 0xa6, 0x7a, 0x8a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, + 0x14, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, + 0x16, 0xf2, 0xb8, 0xca, 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, + 0x79, 0x40, 0xea, 0x9d, 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x0d, + ], + &[ + 0x07, 0x73, 0xa5, 0xd8, 0xba, 0xec, 0xbb, 0xf2, 0x20, 0x63, 0x6d, 0x77, 0x17, 0x79, + 0x8b, 0x18, 0xe9, 0x32, 0x50, 0x36, 0xcc, 0xa3, 0xaa, 0xe0, 0x50, 0x49, 0x1c, 0x41, + 0x70, 0xae, 0x4a, 0x0a, 0xc5, 0x49, 0x8b, 0x61, 0xc5, 0x49, 0x8b, 0x61, 0x6a, 0xe2, + 0x58, 0x1f, 0x6a, 0xe2, 0x58, 0x1f, 0xab, 0x49, 0xac, 0xfa, 0x72, 0xcc, 0x97, 0x4e, + 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, 0xf8, 0xbe, 0xb1, 0x19, + 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, 0xab, 0x49, 0xac, 0xfa, + 0x72, 0xcc, 0x97, 0x4e, 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, + 0xf8, 0xbe, 0xb1, 0x19, 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, + 0xe1, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, + 0x01, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, 0x32, 0xf7, 0xe7, 0x30, + 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, 0x5e, 0x70, 0xb1, 0xf4, + 0xbf, 0x28, 0x26, 0x19, 0xbd, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, + 0x32, 0xf7, 0xe7, 0x30, 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, + 0x5e, 0x70, 0xb1, 0xf4, 0xbf, 0x28, 0x26, 0x19, 0xbd, 0x03, + ], + ], + root_serialized: &[ + 0x62, 0x70, 0xe2, 0x5e, 0xe2, 0x3d, 0x0a, 0x52, 0xc1, 0xfc, 0x25, 0x5d, 0x97, 0x2b, + 0x96, 0x80, 0x1e, 0x8a, 0x8a, 0x5f, 0x12, 0xb5, 0x1b, 0xcf, 0xa1, 0xee, 0xd2, 0x40, + 0x17, 0xe2, 0x58, 0xcb, 0x38, 0xf2, 0x8c, 0x93, 0xc5, 0x49, 0x8b, 0x61, 0x92, 0x5e, + 0x23, 0x1d, 0x6a, 0xe2, 0x58, 0x1f, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xab, 0x49, 0xac, 0xfa, + 0x72, 0xcc, 0x97, 0x4e, 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, + 0xf8, 0xbe, 0xb1, 0x19, 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, + 0x25, 0xcd, 0xf6, 0xd1, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, + 0x2e, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, + 0x32, 0xf7, 0xe7, 0x30, 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, + 0x5e, 0x70, 0xb1, 0xf4, 0xbf, 0x28, 0x26, 0x19, 0xbd, 0x2b, + ], + hash_chain_history_root: [ + 0x12, 0x13, 0x07, 0x5b, 0x61, 0xbd, 0x4b, 0x25, 0x1e, 0x08, 0xc1, 0x91, 0x76, 0x5c, + 0x27, 0x77, 0x23, 0x3e, 0x28, 0x28, 0xd1, 0x64, 0x9e, 0xe7, 0xc4, 0x01, 0x11, 0x7c, + 0xdb, 0xd9, 0x7b, 0xad, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 14, + leaf_block_hash: [ + 0x51, 0xee, 0xdf, 0x69, 0xaa, 0xf1, 0x0e, 0x20, 0xed, 0xe2, 0x85, 0x13, 0x25, 0xc2, + 0xdc, 0x86, 0x4e, 0x99, 0xa3, 0xb2, 0x6c, 0x73, 0xae, 0x5c, 0xa7, 0x49, 0x0e, 0xb6, + 0x96, 0xea, 0x0f, 0x4a, + ], + leaf_time: 1149777216, + leaf_target_bits: 477461929, + leaf_sapling_root: [ + 0x58, 0x34, 0x68, 0x07, 0x42, 0xd2, 0xb7, 0x7a, 0xa4, 0xec, 0x17, 0x18, 0x80, 0xd2, + 0x2d, 0xe7, 0x95, 0xda, 0x9b, 0x58, 0x62, 0xea, 0x94, 0x45, 0xf3, 0xd1, 0xd1, 0xe7, + 0x71, 0x4a, 0x13, 0x1b, + ], + leaf_work: [ + 0xbb, 0xec, 0xcb, 0x2d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687117, + leaf_sapling_tx_count: 2, + leaf_orchard_root: [ + 0x66, 0x04, 0x0a, 0x83, 0x68, 0x6c, 0x88, 0x9d, 0xa7, 0x07, 0x4b, 0x54, 0xe2, 0xea, + 0x1b, 0xae, 0x1a, 0xdb, 0x84, 0x36, 0x07, 0xc7, 0xf7, 0x26, 0x9b, 0xf1, 0x40, 0x3a, + 0x91, 0x3a, 0x06, 0x89, + ], + leaf_orchard_tx_count: 3, + leaf_serialized: &[ + 0x51, 0xee, 0xdf, 0x69, 0xaa, 0xf1, 0x0e, 0x20, 0xed, 0xe2, 0x85, 0x13, 0x25, 0xc2, + 0xdc, 0x86, 0x4e, 0x99, 0xa3, 0xb2, 0x6c, 0x73, 0xae, 0x5c, 0xa7, 0x49, 0x0e, 0xb6, + 0x96, 0xea, 0x0f, 0x4a, 0x40, 0x35, 0x88, 0x44, 0x40, 0x35, 0x88, 0x44, 0xa9, 0x7d, + 0x75, 0x1c, 0xa9, 0x7d, 0x75, 0x1c, 0x58, 0x34, 0x68, 0x07, 0x42, 0xd2, 0xb7, 0x7a, + 0xa4, 0xec, 0x17, 0x18, 0x80, 0xd2, 0x2d, 0xe7, 0x95, 0xda, 0x9b, 0x58, 0x62, 0xea, + 0x94, 0x45, 0xf3, 0xd1, 0xd1, 0xe7, 0x71, 0x4a, 0x13, 0x1b, 0x58, 0x34, 0x68, 0x07, + 0x42, 0xd2, 0xb7, 0x7a, 0xa4, 0xec, 0x17, 0x18, 0x80, 0xd2, 0x2d, 0xe7, 0x95, 0xda, + 0x9b, 0x58, 0x62, 0xea, 0x94, 0x45, 0xf3, 0xd1, 0xd1, 0xe7, 0x71, 0x4a, 0x13, 0x1b, + 0xbb, 0xec, 0xcb, 0x2d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4d, 0xbe, 0x19, 0x00, 0xfe, 0x4d, 0xbe, 0x19, 0x00, + 0x02, 0x66, 0x04, 0x0a, 0x83, 0x68, 0x6c, 0x88, 0x9d, 0xa7, 0x07, 0x4b, 0x54, 0xe2, + 0xea, 0x1b, 0xae, 0x1a, 0xdb, 0x84, 0x36, 0x07, 0xc7, 0xf7, 0x26, 0x9b, 0xf1, 0x40, + 0x3a, 0x91, 0x3a, 0x06, 0x89, 0x66, 0x04, 0x0a, 0x83, 0x68, 0x6c, 0x88, 0x9d, 0xa7, + 0x07, 0x4b, 0x54, 0xe2, 0xea, 0x1b, 0xae, 0x1a, 0xdb, 0x84, 0x36, 0x07, 0xc7, 0xf7, + 0x26, 0x9b, 0xf1, 0x40, 0x3a, 0x91, 0x3a, 0x06, 0x89, 0x03, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0x2a, 0x60, 0x22, 0x35, 0xef, 0x80, 0x98, 0x64, 0xc9, 0x71, 0x67, 0xbb, 0x03, 0x6f, + 0xef, 0x8d, 0x13, 0xa7, 0x4f, 0xbb, 0x9c, 0x52, 0xd8, 0x6e, 0x6a, 0xb3, 0x79, 0xe0, + 0x4e, 0xce, 0x12, 0x40, 0x78, 0xc9, 0x16, 0xbc, 0x49, 0x74, 0x98, 0x4e, 0xf6, 0x78, + 0x02, 0x1e, 0x6f, 0x22, 0x0c, 0x1e, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe3, 0x33, 0x1b, 0xce, + 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, + 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, + 0xa6, 0x7a, 0x8a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, + 0x14, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, + 0x16, 0xf2, 0xb8, 0xca, 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, + 0x79, 0x40, 0xea, 0x9d, 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x0d, + ], + &[ + 0xe8, 0x33, 0x2a, 0x64, 0x60, 0x8e, 0x63, 0xa9, 0xbc, 0x95, 0x94, 0x2a, 0x64, 0x05, + 0x0f, 0xcc, 0x42, 0x42, 0xec, 0x6b, 0x7f, 0x5b, 0x60, 0x91, 0xfe, 0xf0, 0x79, 0xab, + 0xa2, 0x8e, 0x90, 0x2e, 0xc5, 0x49, 0x8b, 0x61, 0x40, 0x35, 0x88, 0x44, 0x6a, 0xe2, + 0x58, 0x1f, 0xa9, 0x7d, 0x75, 0x1c, 0xab, 0x49, 0xac, 0xfa, 0x72, 0xcc, 0x97, 0x4e, + 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, 0xf8, 0xbe, 0xb1, 0x19, + 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, 0x58, 0x34, 0x68, 0x07, + 0x42, 0xd2, 0xb7, 0x7a, 0xa4, 0xec, 0x17, 0x18, 0x80, 0xd2, 0x2d, 0xe7, 0x95, 0xda, + 0x9b, 0x58, 0x62, 0xea, 0x94, 0x45, 0xf3, 0xd1, 0xd1, 0xe7, 0x71, 0x4a, 0x13, 0x1b, + 0x9c, 0xef, 0xcb, 0x2d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, 0xfe, 0x4d, 0xbe, 0x19, 0x00, + 0x03, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, 0x32, 0xf7, 0xe7, 0x30, + 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, 0x5e, 0x70, 0xb1, 0xf4, + 0xbf, 0x28, 0x26, 0x19, 0xbd, 0x66, 0x04, 0x0a, 0x83, 0x68, 0x6c, 0x88, 0x9d, 0xa7, + 0x07, 0x4b, 0x54, 0xe2, 0xea, 0x1b, 0xae, 0x1a, 0xdb, 0x84, 0x36, 0x07, 0xc7, 0xf7, + 0x26, 0x9b, 0xf1, 0x40, 0x3a, 0x91, 0x3a, 0x06, 0x89, 0x06, + ], + ], + root_serialized: &[ + 0xd4, 0xaa, 0x87, 0x1e, 0xf9, 0x82, 0xe2, 0x26, 0x5c, 0x09, 0x50, 0xfe, 0xda, 0xa3, + 0xc6, 0x6d, 0x3c, 0xde, 0xe9, 0x72, 0xa7, 0x6d, 0xa2, 0x1d, 0x65, 0xa2, 0xf3, 0x73, + 0xc5, 0x2f, 0x79, 0x1e, 0x38, 0xf2, 0x8c, 0x93, 0x40, 0x35, 0x88, 0x44, 0x92, 0x5e, + 0x23, 0x1d, 0xa9, 0x7d, 0x75, 0x1c, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x58, 0x34, 0x68, 0x07, + 0x42, 0xd2, 0xb7, 0x7a, 0xa4, 0xec, 0x17, 0x18, 0x80, 0xd2, 0x2d, 0xe7, 0x95, 0xda, + 0x9b, 0x58, 0x62, 0xea, 0x94, 0x45, 0xf3, 0xd1, 0xd1, 0xe7, 0x71, 0x4a, 0x13, 0x1b, + 0xe0, 0xb9, 0xc2, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4d, 0xbe, 0x19, 0x00, + 0x30, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x66, 0x04, 0x0a, 0x83, 0x68, 0x6c, 0x88, 0x9d, 0xa7, + 0x07, 0x4b, 0x54, 0xe2, 0xea, 0x1b, 0xae, 0x1a, 0xdb, 0x84, 0x36, 0x07, 0xc7, 0xf7, + 0x26, 0x9b, 0xf1, 0x40, 0x3a, 0x91, 0x3a, 0x06, 0x89, 0x2e, + ], + hash_chain_history_root: [ + 0x8d, 0xbf, 0x40, 0x82, 0x97, 0x30, 0xcb, 0xe7, 0x9a, 0x6e, 0x1d, 0x79, 0x5c, 0x8c, + 0x98, 0xe9, 0xfb, 0x0b, 0xd5, 0xf3, 0xbb, 0xab, 0xd6, 0x31, 0x1f, 0x6f, 0x6f, 0x3a, + 0xd7, 0x44, 0xed, 0xc1, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 15, + leaf_block_hash: [ + 0x7f, 0x40, 0xf4, 0x13, 0x9e, 0xac, 0x2b, 0xb1, 0x37, 0xac, 0x93, 0x82, 0x5b, 0x69, + 0xb4, 0x9b, 0x09, 0x9a, 0x64, 0xcd, 0x25, 0x1c, 0x2b, 0x11, 0xb4, 0x8c, 0x15, 0x56, + 0x48, 0xbe, 0x95, 0x11, + ], + leaf_time: 3867210018, + leaf_target_bits: 525454616, + leaf_sapling_root: [ + 0x8c, 0xca, 0xbc, 0x2f, 0xcd, 0x4f, 0xa6, 0xb3, 0x18, 0x06, 0xd4, 0xed, 0xff, 0xa2, + 0x76, 0x48, 0xa2, 0x66, 0x17, 0x15, 0x0a, 0xcb, 0x10, 0xed, 0x3b, 0xf9, 0x35, 0xe1, + 0x4e, 0x27, 0x33, 0x08, + ], + leaf_work: [ + 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687118, + leaf_sapling_tx_count: 6, + leaf_orchard_root: [ + 0x75, 0xdb, 0xd6, 0x08, 0xb0, 0x6c, 0x76, 0x89, 0x36, 0x35, 0x13, 0xaa, 0x0e, 0x09, + 0x27, 0xe9, 0x66, 0xda, 0xa5, 0x3e, 0xb7, 0xb8, 0x1b, 0xbf, 0x25, 0xc7, 0x1d, 0x04, + 0x38, 0x0c, 0x21, 0x19, + ], + leaf_orchard_tx_count: 7, + leaf_serialized: &[ + 0x7f, 0x40, 0xf4, 0x13, 0x9e, 0xac, 0x2b, 0xb1, 0x37, 0xac, 0x93, 0x82, 0x5b, 0x69, + 0xb4, 0x9b, 0x09, 0x9a, 0x64, 0xcd, 0x25, 0x1c, 0x2b, 0x11, 0xb4, 0x8c, 0x15, 0x56, + 0x48, 0xbe, 0x95, 0x11, 0x22, 0xf1, 0x80, 0xe6, 0x22, 0xf1, 0x80, 0xe6, 0x18, 0xcd, + 0x51, 0x1f, 0x18, 0xcd, 0x51, 0x1f, 0x8c, 0xca, 0xbc, 0x2f, 0xcd, 0x4f, 0xa6, 0xb3, + 0x18, 0x06, 0xd4, 0xed, 0xff, 0xa2, 0x76, 0x48, 0xa2, 0x66, 0x17, 0x15, 0x0a, 0xcb, + 0x10, 0xed, 0x3b, 0xf9, 0x35, 0xe1, 0x4e, 0x27, 0x33, 0x08, 0x8c, 0xca, 0xbc, 0x2f, + 0xcd, 0x4f, 0xa6, 0xb3, 0x18, 0x06, 0xd4, 0xed, 0xff, 0xa2, 0x76, 0x48, 0xa2, 0x66, + 0x17, 0x15, 0x0a, 0xcb, 0x10, 0xed, 0x3b, 0xf9, 0x35, 0xe1, 0x4e, 0x27, 0x33, 0x08, + 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4e, 0xbe, 0x19, 0x00, 0xfe, 0x4e, 0xbe, 0x19, 0x00, + 0x06, 0x75, 0xdb, 0xd6, 0x08, 0xb0, 0x6c, 0x76, 0x89, 0x36, 0x35, 0x13, 0xaa, 0x0e, + 0x09, 0x27, 0xe9, 0x66, 0xda, 0xa5, 0x3e, 0xb7, 0xb8, 0x1b, 0xbf, 0x25, 0xc7, 0x1d, + 0x04, 0x38, 0x0c, 0x21, 0x19, 0x75, 0xdb, 0xd6, 0x08, 0xb0, 0x6c, 0x76, 0x89, 0x36, + 0x35, 0x13, 0xaa, 0x0e, 0x09, 0x27, 0xe9, 0x66, 0xda, 0xa5, 0x3e, 0xb7, 0xb8, 0x1b, + 0xbf, 0x25, 0xc7, 0x1d, 0x04, 0x38, 0x0c, 0x21, 0x19, 0x07, + ], + peaks: &[ + &[ + 0x17, 0xd6, 0x54, 0x3e, 0x0a, 0x77, 0x2a, 0x53, 0x80, 0x53, 0x65, 0x6a, 0xe9, 0x09, + 0x3e, 0xa6, 0x89, 0x4f, 0x68, 0x6c, 0xaf, 0x31, 0x97, 0x1b, 0x39, 0x91, 0x28, 0x28, + 0xb7, 0x2f, 0x9f, 0x02, 0x38, 0xf2, 0x8c, 0x93, 0x03, 0xe6, 0xac, 0x1f, 0x92, 0x5e, + 0x23, 0x1d, 0xf1, 0xce, 0x3b, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xa0, 0xdb, 0x74, 0x96, + 0x8b, 0x33, 0x5d, 0x4e, 0x3a, 0x6d, 0xc9, 0x64, 0x08, 0x8e, 0x03, 0x50, 0x26, 0xee, + 0x9e, 0x57, 0x97, 0xff, 0xbd, 0x40, 0xe5, 0xa2, 0x24, 0xaf, 0x35, 0xd9, 0x52, 0x38, + 0x9e, 0x4f, 0x6c, 0xcc, 0x09, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x47, 0xbe, 0x19, 0x00, + 0x19, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xf0, 0x63, 0xe4, 0x86, 0x05, 0xca, 0x03, 0xac, 0xbe, + 0xe5, 0x6f, 0x0e, 0x5c, 0x25, 0x91, 0xe7, 0xb4, 0x6c, 0x04, 0xbd, 0xdf, 0xbe, 0xbd, + 0xe8, 0x05, 0x15, 0x24, 0xb9, 0x68, 0x98, 0x8b, 0x07, 0x1b, + ], + &[ + 0x2a, 0x60, 0x22, 0x35, 0xef, 0x80, 0x98, 0x64, 0xc9, 0x71, 0x67, 0xbb, 0x03, 0x6f, + 0xef, 0x8d, 0x13, 0xa7, 0x4f, 0xbb, 0x9c, 0x52, 0xd8, 0x6e, 0x6a, 0xb3, 0x79, 0xe0, + 0x4e, 0xce, 0x12, 0x40, 0x78, 0xc9, 0x16, 0xbc, 0x49, 0x74, 0x98, 0x4e, 0xf6, 0x78, + 0x02, 0x1e, 0x6f, 0x22, 0x0c, 0x1e, 0xe8, 0xb7, 0xf1, 0x14, 0x9e, 0x68, 0xc5, 0x74, + 0xf5, 0x4b, 0xd2, 0x4c, 0x8a, 0x73, 0x3b, 0xa1, 0xb4, 0xee, 0xd4, 0x9e, 0x3d, 0x82, + 0x82, 0xb0, 0x68, 0xed, 0x6d, 0x17, 0x15, 0x4b, 0xc5, 0x23, 0xe3, 0x33, 0x1b, 0xce, + 0xb7, 0x28, 0x70, 0xcb, 0x70, 0x36, 0xac, 0xbf, 0xff, 0x9a, 0x81, 0x2e, 0x20, 0x5d, + 0xe2, 0x33, 0x5a, 0x5e, 0x84, 0xc1, 0x11, 0xcf, 0x99, 0x1c, 0xf8, 0x4e, 0xe2, 0xea, + 0xa6, 0x7a, 0x8a, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x48, 0xbe, 0x19, 0x00, 0xfe, 0x4b, 0xbe, 0x19, 0x00, + 0x14, 0x91, 0x4a, 0x06, 0x54, 0x04, 0x31, 0x40, 0xd2, 0x07, 0xbc, 0xff, 0x5e, 0x1e, + 0xe6, 0x01, 0x5d, 0xdf, 0xf3, 0xd2, 0x21, 0x0d, 0x58, 0x67, 0x6b, 0xc3, 0x1a, 0xf1, + 0x7c, 0x1f, 0x92, 0xa8, 0x63, 0x23, 0x41, 0x0c, 0x57, 0xb3, 0xed, 0xfd, 0x20, 0x8b, + 0x16, 0xf2, 0xb8, 0xca, 0xbb, 0xcc, 0x8d, 0x41, 0x4e, 0x60, 0xe3, 0x17, 0xe7, 0x97, + 0x79, 0x40, 0xea, 0x9d, 0xaa, 0x36, 0x1e, 0x24, 0x42, 0x0d, + ], + &[ + 0xe8, 0x33, 0x2a, 0x64, 0x60, 0x8e, 0x63, 0xa9, 0xbc, 0x95, 0x94, 0x2a, 0x64, 0x05, + 0x0f, 0xcc, 0x42, 0x42, 0xec, 0x6b, 0x7f, 0x5b, 0x60, 0x91, 0xfe, 0xf0, 0x79, 0xab, + 0xa2, 0x8e, 0x90, 0x2e, 0xc5, 0x49, 0x8b, 0x61, 0x40, 0x35, 0x88, 0x44, 0x6a, 0xe2, + 0x58, 0x1f, 0xa9, 0x7d, 0x75, 0x1c, 0xab, 0x49, 0xac, 0xfa, 0x72, 0xcc, 0x97, 0x4e, + 0x9b, 0xc2, 0xa9, 0xae, 0xe2, 0x73, 0x32, 0x60, 0x93, 0x19, 0xf8, 0xbe, 0xb1, 0x19, + 0x21, 0xdd, 0xeb, 0x8d, 0x0b, 0x1c, 0xc7, 0xda, 0x0f, 0x1c, 0x58, 0x34, 0x68, 0x07, + 0x42, 0xd2, 0xb7, 0x7a, 0xa4, 0xec, 0x17, 0x18, 0x80, 0xd2, 0x2d, 0xe7, 0x95, 0xda, + 0x9b, 0x58, 0x62, 0xea, 0x94, 0x45, 0xf3, 0xd1, 0xd1, 0xe7, 0x71, 0x4a, 0x13, 0x1b, + 0x9c, 0xef, 0xcb, 0x2d, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4c, 0xbe, 0x19, 0x00, 0xfe, 0x4d, 0xbe, 0x19, 0x00, + 0x03, 0xc8, 0x9c, 0x76, 0x2c, 0x89, 0xf0, 0x1b, 0xf8, 0xd4, 0x32, 0xf7, 0xe7, 0x30, + 0xb5, 0xf5, 0xf2, 0x7a, 0xd4, 0x21, 0xa5, 0x2c, 0x28, 0x6c, 0x5e, 0x70, 0xb1, 0xf4, + 0xbf, 0x28, 0x26, 0x19, 0xbd, 0x66, 0x04, 0x0a, 0x83, 0x68, 0x6c, 0x88, 0x9d, 0xa7, + 0x07, 0x4b, 0x54, 0xe2, 0xea, 0x1b, 0xae, 0x1a, 0xdb, 0x84, 0x36, 0x07, 0xc7, 0xf7, + 0x26, 0x9b, 0xf1, 0x40, 0x3a, 0x91, 0x3a, 0x06, 0x89, 0x06, + ], + &[ + 0x7f, 0x40, 0xf4, 0x13, 0x9e, 0xac, 0x2b, 0xb1, 0x37, 0xac, 0x93, 0x82, 0x5b, 0x69, + 0xb4, 0x9b, 0x09, 0x9a, 0x64, 0xcd, 0x25, 0x1c, 0x2b, 0x11, 0xb4, 0x8c, 0x15, 0x56, + 0x48, 0xbe, 0x95, 0x11, 0x22, 0xf1, 0x80, 0xe6, 0x22, 0xf1, 0x80, 0xe6, 0x18, 0xcd, + 0x51, 0x1f, 0x18, 0xcd, 0x51, 0x1f, 0x8c, 0xca, 0xbc, 0x2f, 0xcd, 0x4f, 0xa6, 0xb3, + 0x18, 0x06, 0xd4, 0xed, 0xff, 0xa2, 0x76, 0x48, 0xa2, 0x66, 0x17, 0x15, 0x0a, 0xcb, + 0x10, 0xed, 0x3b, 0xf9, 0x35, 0xe1, 0x4e, 0x27, 0x33, 0x08, 0x8c, 0xca, 0xbc, 0x2f, + 0xcd, 0x4f, 0xa6, 0xb3, 0x18, 0x06, 0xd4, 0xed, 0xff, 0xa2, 0x76, 0x48, 0xa2, 0x66, + 0x17, 0x15, 0x0a, 0xcb, 0x10, 0xed, 0x3b, 0xf9, 0x35, 0xe1, 0x4e, 0x27, 0x33, 0x08, + 0x21, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4e, 0xbe, 0x19, 0x00, 0xfe, 0x4e, 0xbe, 0x19, 0x00, + 0x06, 0x75, 0xdb, 0xd6, 0x08, 0xb0, 0x6c, 0x76, 0x89, 0x36, 0x35, 0x13, 0xaa, 0x0e, + 0x09, 0x27, 0xe9, 0x66, 0xda, 0xa5, 0x3e, 0xb7, 0xb8, 0x1b, 0xbf, 0x25, 0xc7, 0x1d, + 0x04, 0x38, 0x0c, 0x21, 0x19, 0x75, 0xdb, 0xd6, 0x08, 0xb0, 0x6c, 0x76, 0x89, 0x36, + 0x35, 0x13, 0xaa, 0x0e, 0x09, 0x27, 0xe9, 0x66, 0xda, 0xa5, 0x3e, 0xb7, 0xb8, 0x1b, + 0xbf, 0x25, 0xc7, 0x1d, 0x04, 0x38, 0x0c, 0x21, 0x19, 0x07, + ], + ], + root_serialized: &[ + 0x36, 0x64, 0x13, 0x4b, 0x0f, 0x90, 0x02, 0x60, 0x90, 0xa4, 0x2b, 0x76, 0xbc, 0x42, + 0x16, 0x92, 0xde, 0xe7, 0x84, 0xf0, 0xb2, 0x4b, 0x24, 0x8b, 0xdf, 0xb4, 0xcf, 0x1a, + 0xd5, 0x03, 0x9b, 0x90, 0x38, 0xf2, 0x8c, 0x93, 0x22, 0xf1, 0x80, 0xe6, 0x92, 0x5e, + 0x23, 0x1d, 0x18, 0xcd, 0x51, 0x1f, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0x8c, 0xca, 0xbc, 0x2f, + 0xcd, 0x4f, 0xa6, 0xb3, 0x18, 0x06, 0xd4, 0xed, 0xff, 0xa2, 0x76, 0x48, 0xa2, 0x66, + 0x17, 0x15, 0x0a, 0xcb, 0x10, 0xed, 0x3b, 0xf9, 0x35, 0xe1, 0x4e, 0x27, 0x33, 0x08, + 0x01, 0xbd, 0xc2, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4e, 0xbe, 0x19, 0x00, + 0x36, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0x75, 0xdb, 0xd6, 0x08, 0xb0, 0x6c, 0x76, 0x89, 0x36, + 0x35, 0x13, 0xaa, 0x0e, 0x09, 0x27, 0xe9, 0x66, 0xda, 0xa5, 0x3e, 0xb7, 0xb8, 0x1b, + 0xbf, 0x25, 0xc7, 0x1d, 0x04, 0x38, 0x0c, 0x21, 0x19, 0x35, + ], + hash_chain_history_root: [ + 0x8c, 0xc1, 0x4e, 0x64, 0xc2, 0x56, 0xb8, 0xe6, 0x9f, 0x30, 0x54, 0x95, 0x8c, 0xf8, + 0x39, 0x52, 0xd5, 0xa5, 0xf4, 0x01, 0x37, 0x42, 0x0e, 0xb1, 0x7e, 0x35, 0x91, 0xdc, + 0x8a, 0x5e, 0x8e, 0xab, + ], + }, + TestVector { + consensus_branch_id: 3268858036, + n_leaves: 16, + leaf_block_hash: [ + 0x4b, 0x2e, 0x58, 0xc8, 0x2a, 0x71, 0xef, 0x01, 0xa7, 0xf8, 0xa4, 0xfa, 0x55, 0x2c, + 0x63, 0x36, 0xa8, 0xda, 0xcd, 0x46, 0xb0, 0xa5, 0x06, 0x8e, 0xa7, 0xbf, 0xc7, 0x5b, + 0x48, 0x8f, 0x5a, 0x43, + ], + leaf_time: 3962074132, + leaf_target_bits: 506828970, + leaf_sapling_root: [ + 0xbb, 0xce, 0x07, 0x2a, 0x87, 0x7e, 0xf7, 0xd0, 0x8c, 0x58, 0xb4, 0x54, 0x93, 0x33, + 0x60, 0x75, 0xca, 0xa8, 0x5e, 0xf3, 0x22, 0x0a, 0x0c, 0x37, 0x74, 0x77, 0x76, 0x83, + 0x22, 0xad, 0x38, 0x05, + ], + leaf_work: [ + 0xc5, 0xc6, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 1687119, + leaf_sapling_tx_count: 3, + leaf_orchard_root: [ + 0xc6, 0x68, 0xce, 0x97, 0x50, 0x4f, 0x40, 0x0e, 0xbb, 0x2d, 0x23, 0x45, 0x43, 0x89, + 0xf9, 0xc1, 0xb1, 0x33, 0xdd, 0x30, 0xbf, 0xc9, 0x1e, 0x6d, 0xb5, 0x93, 0x0f, 0xe9, + 0x8b, 0x3b, 0x1f, 0x50, + ], + leaf_orchard_tx_count: 5, + leaf_serialized: &[ + 0x4b, 0x2e, 0x58, 0xc8, 0x2a, 0x71, 0xef, 0x01, 0xa7, 0xf8, 0xa4, 0xfa, 0x55, 0x2c, + 0x63, 0x36, 0xa8, 0xda, 0xcd, 0x46, 0xb0, 0xa5, 0x06, 0x8e, 0xa7, 0xbf, 0xc7, 0x5b, + 0x48, 0x8f, 0x5a, 0x43, 0x14, 0x74, 0x28, 0xec, 0x14, 0x74, 0x28, 0xec, 0xaa, 0x98, + 0x35, 0x1e, 0xaa, 0x98, 0x35, 0x1e, 0xbb, 0xce, 0x07, 0x2a, 0x87, 0x7e, 0xf7, 0xd0, + 0x8c, 0x58, 0xb4, 0x54, 0x93, 0x33, 0x60, 0x75, 0xca, 0xa8, 0x5e, 0xf3, 0x22, 0x0a, + 0x0c, 0x37, 0x74, 0x77, 0x76, 0x83, 0x22, 0xad, 0x38, 0x05, 0xbb, 0xce, 0x07, 0x2a, + 0x87, 0x7e, 0xf7, 0xd0, 0x8c, 0x58, 0xb4, 0x54, 0x93, 0x33, 0x60, 0x75, 0xca, 0xa8, + 0x5e, 0xf3, 0x22, 0x0a, 0x0c, 0x37, 0x74, 0x77, 0x76, 0x83, 0x22, 0xad, 0x38, 0x05, + 0xc5, 0xc6, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x4f, 0xbe, 0x19, 0x00, 0xfe, 0x4f, 0xbe, 0x19, 0x00, + 0x03, 0xc6, 0x68, 0xce, 0x97, 0x50, 0x4f, 0x40, 0x0e, 0xbb, 0x2d, 0x23, 0x45, 0x43, + 0x89, 0xf9, 0xc1, 0xb1, 0x33, 0xdd, 0x30, 0xbf, 0xc9, 0x1e, 0x6d, 0xb5, 0x93, 0x0f, + 0xe9, 0x8b, 0x3b, 0x1f, 0x50, 0xc6, 0x68, 0xce, 0x97, 0x50, 0x4f, 0x40, 0x0e, 0xbb, + 0x2d, 0x23, 0x45, 0x43, 0x89, 0xf9, 0xc1, 0xb1, 0x33, 0xdd, 0x30, 0xbf, 0xc9, 0x1e, + 0x6d, 0xb5, 0x93, 0x0f, 0xe9, 0x8b, 0x3b, 0x1f, 0x50, 0x05, + ], + peaks: &[&[ + 0x64, 0xed, 0xac, 0x55, 0x72, 0x51, 0x59, 0x07, 0x24, 0xd0, 0x79, 0x47, 0xad, 0xca, + 0x58, 0xd1, 0xec, 0x64, 0x93, 0x42, 0x30, 0x6a, 0x89, 0x9d, 0xb2, 0x8d, 0xa7, 0x87, + 0x31, 0x85, 0x0b, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0x14, 0x74, 0x28, 0xec, 0x92, 0x5e, + 0x23, 0x1d, 0xaa, 0x98, 0x35, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xbb, 0xce, 0x07, 0x2a, + 0x87, 0x7e, 0xf7, 0xd0, 0x8c, 0x58, 0xb4, 0x54, 0x93, 0x33, 0x60, 0x75, 0xca, 0xa8, + 0x5e, 0xf3, 0x22, 0x0a, 0x0c, 0x37, 0x74, 0x77, 0x76, 0x83, 0x22, 0xad, 0x38, 0x05, + 0xc6, 0x83, 0xc7, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4f, 0xbe, 0x19, 0x00, + 0x39, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xc6, 0x68, 0xce, 0x97, 0x50, 0x4f, 0x40, 0x0e, 0xbb, + 0x2d, 0x23, 0x45, 0x43, 0x89, 0xf9, 0xc1, 0xb1, 0x33, 0xdd, 0x30, 0xbf, 0xc9, 0x1e, + 0x6d, 0xb5, 0x93, 0x0f, 0xe9, 0x8b, 0x3b, 0x1f, 0x50, 0x3a, + ]], + root_serialized: &[ + 0x64, 0xed, 0xac, 0x55, 0x72, 0x51, 0x59, 0x07, 0x24, 0xd0, 0x79, 0x47, 0xad, 0xca, + 0x58, 0xd1, 0xec, 0x64, 0x93, 0x42, 0x30, 0x6a, 0x89, 0x9d, 0xb2, 0x8d, 0xa7, 0x87, + 0x31, 0x85, 0x0b, 0xe3, 0x38, 0xf2, 0x8c, 0x93, 0x14, 0x74, 0x28, 0xec, 0x92, 0x5e, + 0x23, 0x1d, 0xaa, 0x98, 0x35, 0x1e, 0x32, 0xa0, 0x5f, 0x2b, 0x30, 0xef, 0x19, 0x13, + 0xe2, 0x4c, 0xdc, 0x96, 0x85, 0x91, 0x85, 0xa6, 0xd4, 0x37, 0x82, 0x2c, 0x59, 0xc3, + 0x9b, 0x5d, 0xb2, 0x79, 0xb3, 0xbe, 0xbd, 0x39, 0x7e, 0x5c, 0xbb, 0xce, 0x07, 0x2a, + 0x87, 0x7e, 0xf7, 0xd0, 0x8c, 0x58, 0xb4, 0x54, 0x93, 0x33, 0x60, 0x75, 0xca, 0xa8, + 0x5e, 0xf3, 0x22, 0x0a, 0x0c, 0x37, 0x74, 0x77, 0x76, 0x83, 0x22, 0xad, 0x38, 0x05, + 0xc6, 0x83, 0xc7, 0xff, 0x0b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0x40, 0xbe, 0x19, 0x00, 0xfe, 0x4f, 0xbe, 0x19, 0x00, + 0x39, 0xf2, 0x5e, 0x7f, 0x47, 0xa8, 0xf8, 0x63, 0xea, 0x04, 0x3e, 0x7a, 0xdb, 0x82, + 0xda, 0x62, 0xc1, 0x1f, 0x4f, 0xeb, 0x69, 0x02, 0x6b, 0x00, 0xa5, 0xfd, 0x03, 0xfa, + 0x4d, 0x7e, 0xcc, 0xc5, 0x51, 0xc6, 0x68, 0xce, 0x97, 0x50, 0x4f, 0x40, 0x0e, 0xbb, + 0x2d, 0x23, 0x45, 0x43, 0x89, 0xf9, 0xc1, 0xb1, 0x33, 0xdd, 0x30, 0xbf, 0xc9, 0x1e, + 0x6d, 0xb5, 0x93, 0x0f, 0xe9, 0x8b, 0x3b, 0x1f, 0x50, 0x3a, + ], + hash_chain_history_root: [ + 0xa5, 0x7b, 0xad, 0x52, 0xf4, 0x8b, 0xd1, 0x44, 0x2f, 0x86, 0x8e, 0xb2, 0x2f, 0x83, + 0xf4, 0xaa, 0x25, 0x3f, 0x8f, 0xd6, 0xf1, 0x0d, 0x71, 0xce, 0x01, 0xf0, 0x20, 0x81, + 0x4e, 0xb3, 0x39, 0xbe, + ], + }, +]; diff --git a/crates/zcash_history/src/test_vectors/zip_0221_v3.rs b/crates/zcash_history/src/test_vectors/zip_0221_v3.rs new file mode 100644 index 00000000..4c53f5ad --- /dev/null +++ b/crates/zcash_history/src/test_vectors/zip_0221_v3.rs @@ -0,0 +1,2181 @@ +// From https://github.com/zcash/zcash-test-vectors/blob/master/zcash_test_vectors/zip_0221.py + +pub(crate) struct TestVector { + pub(crate) consensus_branch_id: u32, + pub(crate) n_leaves: u32, + pub(crate) leaf_block_hash: [u8; 32], + pub(crate) leaf_time: u32, + pub(crate) leaf_target_bits: u32, + pub(crate) leaf_sapling_root: [u8; 32], + pub(crate) leaf_work: [u8; 32], + pub(crate) leaf_height: u64, + pub(crate) leaf_sapling_tx_count: u64, + pub(crate) leaf_orchard_root: [u8; 32], + pub(crate) leaf_orchard_tx_count: u64, + pub(crate) leaf_ironwood_root: [u8; 32], + pub(crate) leaf_ironwood_tx_count: u64, + pub(crate) leaf_serialized: &'static [u8], + pub(crate) peaks: &'static [&'static [u8]], + pub(crate) root_serialized: &'static [u8], + pub(crate) hash_chain_history_root: [u8; 32], +} + +pub(crate) const TEST_VECTORS: &[TestVector] = &[ + TestVector { + consensus_branch_id: 933566043, + n_leaves: 1, + leaf_block_hash: [ + 0x07, 0xf3, 0x7e, 0xe4, 0xcb, 0xc8, 0x41, 0x8f, 0xaf, 0xb2, 0x1f, 0x70, 0xd2, 0xb6, + 0x80, 0xe2, 0x4b, 0x8b, 0xa8, 0xa9, 0x71, 0x25, 0xf1, 0x93, 0xa0, 0x8e, 0x19, 0x2c, + 0x18, 0x8b, 0x01, 0x45, + ], + leaf_time: 408628447, + leaf_target_bits: 487212906, + leaf_sapling_root: [ + 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, + 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, + 0x64, 0x40, 0xdd, 0x4c, + ], + leaf_work: [ + 0xd6, 0xbd, 0xe7, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500000, + leaf_sapling_tx_count: 0, + leaf_orchard_root: [ + 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, 0x41, + 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, 0x6a, + 0x60, 0x38, 0x51, 0xe1, + ], + leaf_orchard_tx_count: 5, + leaf_ironwood_root: [ + 0x65, 0xe2, 0x32, 0x26, 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, + 0x72, 0xb1, 0x6a, 0x3e, 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, + 0xd2, 0xe8, 0xeb, 0x84, + ], + leaf_ironwood_tx_count: 5, + leaf_serialized: &[ + 0x07, 0xf3, 0x7e, 0xe4, 0xcb, 0xc8, 0x41, 0x8f, 0xaf, 0xb2, 0x1f, 0x70, 0xd2, 0xb6, + 0x80, 0xe2, 0x4b, 0x8b, 0xa8, 0xa9, 0x71, 0x25, 0xf1, 0x93, 0xa0, 0x8e, 0x19, 0x2c, + 0x18, 0x8b, 0x01, 0x45, 0xdf, 0x2c, 0x5b, 0x18, 0xdf, 0x2c, 0x5b, 0x18, 0x6a, 0x47, + 0x0a, 0x1d, 0x6a, 0x47, 0x0a, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xf4, 0x91, 0x46, 0xc8, + 0x30, 0x77, 0x23, 0xda, 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, + 0xda, 0xe5, 0xfe, 0x69, 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, + 0xd6, 0xbd, 0xe7, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, + 0x00, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, + 0x7b, 0xed, 0xa3, 0x84, 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, + 0x52, 0xa3, 0xc1, 0x0e, 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x05, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x65, 0xe2, 0x32, 0x26, 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, + 0x72, 0xb1, 0x6a, 0x3e, 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, + 0xd2, 0xe8, 0xeb, 0x84, 0x05, + ], + peaks: &[&[ + 0x07, 0xf3, 0x7e, 0xe4, 0xcb, 0xc8, 0x41, 0x8f, 0xaf, 0xb2, 0x1f, 0x70, 0xd2, 0xb6, + 0x80, 0xe2, 0x4b, 0x8b, 0xa8, 0xa9, 0x71, 0x25, 0xf1, 0x93, 0xa0, 0x8e, 0x19, 0x2c, + 0x18, 0x8b, 0x01, 0x45, 0xdf, 0x2c, 0x5b, 0x18, 0xdf, 0x2c, 0x5b, 0x18, 0x6a, 0x47, + 0x0a, 0x1d, 0x6a, 0x47, 0x0a, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xf4, 0x91, 0x46, 0xc8, + 0x30, 0x77, 0x23, 0xda, 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, + 0xda, 0xe5, 0xfe, 0x69, 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, + 0xd6, 0xbd, 0xe7, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, + 0x00, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, + 0x7b, 0xed, 0xa3, 0x84, 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, + 0x52, 0xa3, 0xc1, 0x0e, 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x05, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x65, 0xe2, 0x32, 0x26, 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, + 0x72, 0xb1, 0x6a, 0x3e, 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, + 0xd2, 0xe8, 0xeb, 0x84, 0x05, + ]], + root_serialized: &[ + 0x07, 0xf3, 0x7e, 0xe4, 0xcb, 0xc8, 0x41, 0x8f, 0xaf, 0xb2, 0x1f, 0x70, 0xd2, 0xb6, + 0x80, 0xe2, 0x4b, 0x8b, 0xa8, 0xa9, 0x71, 0x25, 0xf1, 0x93, 0xa0, 0x8e, 0x19, 0x2c, + 0x18, 0x8b, 0x01, 0x45, 0xdf, 0x2c, 0x5b, 0x18, 0xdf, 0x2c, 0x5b, 0x18, 0x6a, 0x47, + 0x0a, 0x1d, 0x6a, 0x47, 0x0a, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xf4, 0x91, 0x46, 0xc8, + 0x30, 0x77, 0x23, 0xda, 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, + 0xda, 0xe5, 0xfe, 0x69, 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, + 0xd6, 0xbd, 0xe7, 0x18, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, + 0x00, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, + 0x7b, 0xed, 0xa3, 0x84, 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, + 0x52, 0xa3, 0xc1, 0x0e, 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x05, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x65, 0xe2, 0x32, 0x26, 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, + 0x72, 0xb1, 0x6a, 0x3e, 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, + 0xd2, 0xe8, 0xeb, 0x84, 0x05, + ], + hash_chain_history_root: [ + 0x03, 0xd0, 0x4e, 0x84, 0xda, 0x6f, 0x5e, 0x1b, 0x59, 0x8f, 0xaf, 0xd2, 0x30, 0x39, + 0x30, 0x16, 0xc8, 0x2b, 0x00, 0x7f, 0x02, 0x43, 0xa6, 0x35, 0xc6, 0x49, 0xf0, 0xeb, + 0x96, 0xe0, 0x4f, 0x72, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 2, + leaf_block_hash: [ + 0x89, 0x7f, 0x89, 0x4b, 0xed, 0x44, 0x11, 0x14, 0x29, 0x56, 0x7a, 0x54, 0xda, 0x58, + 0x90, 0x02, 0x6b, 0x95, 0x35, 0x8a, 0x09, 0x08, 0xf3, 0x03, 0x01, 0x34, 0x45, 0x56, + 0xa0, 0xea, 0x7c, 0x03, + ], + leaf_time: 469021842, + leaf_target_bits: 494413288, + leaf_sapling_root: [ + 0x61, 0x1d, 0x29, 0x39, 0x0f, 0x1e, 0xa0, 0x0f, 0x56, 0xf6, 0xa6, 0xb7, 0x83, 0x39, + 0xfa, 0x49, 0xd1, 0xb2, 0xd3, 0x7d, 0xc2, 0x65, 0x1e, 0x4c, 0x6d, 0x03, 0xea, 0xba, + 0x12, 0xde, 0x7f, 0x8b, + ], + leaf_work: [ + 0xd4, 0x75, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500001, + leaf_sapling_tx_count: 1, + leaf_orchard_root: [ + 0x5d, 0xc9, 0x70, 0x15, 0x20, 0x4d, 0x22, 0xc5, 0xa0, 0x63, 0x89, 0xc7, 0xf8, 0x82, + 0xa6, 0xa3, 0xa0, 0x72, 0x77, 0x6c, 0x99, 0x22, 0x7c, 0x8b, 0x12, 0x3a, 0x8b, 0x9a, + 0x8c, 0xd3, 0xff, 0x92, + ], + leaf_orchard_tx_count: 7, + leaf_ironwood_root: [ + 0x94, 0x4f, 0x2c, 0x82, 0xd4, 0x17, 0x30, 0x57, 0x74, 0x88, 0xaf, 0x4f, 0xad, 0xea, + 0x90, 0x19, 0x17, 0x4b, 0xd9, 0xba, 0x7f, 0xda, 0xf9, 0x03, 0xc6, 0x0d, 0xdc, 0x7f, + 0x73, 0xfd, 0xf1, 0xef, + ], + leaf_ironwood_tx_count: 7, + leaf_serialized: &[ + 0x89, 0x7f, 0x89, 0x4b, 0xed, 0x44, 0x11, 0x14, 0x29, 0x56, 0x7a, 0x54, 0xda, 0x58, + 0x90, 0x02, 0x6b, 0x95, 0x35, 0x8a, 0x09, 0x08, 0xf3, 0x03, 0x01, 0x34, 0x45, 0x56, + 0xa0, 0xea, 0x7c, 0x03, 0x92, 0xb4, 0xf4, 0x1b, 0x92, 0xb4, 0xf4, 0x1b, 0xe8, 0x25, + 0x78, 0x1d, 0xe8, 0x25, 0x78, 0x1d, 0x61, 0x1d, 0x29, 0x39, 0x0f, 0x1e, 0xa0, 0x0f, + 0x56, 0xf6, 0xa6, 0xb7, 0x83, 0x39, 0xfa, 0x49, 0xd1, 0xb2, 0xd3, 0x7d, 0xc2, 0x65, + 0x1e, 0x4c, 0x6d, 0x03, 0xea, 0xba, 0x12, 0xde, 0x7f, 0x8b, 0x61, 0x1d, 0x29, 0x39, + 0x0f, 0x1e, 0xa0, 0x0f, 0x56, 0xf6, 0xa6, 0xb7, 0x83, 0x39, 0xfa, 0x49, 0xd1, 0xb2, + 0xd3, 0x7d, 0xc2, 0x65, 0x1e, 0x4c, 0x6d, 0x03, 0xea, 0xba, 0x12, 0xde, 0x7f, 0x8b, + 0xd4, 0x75, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe1, 0x67, 0x35, 0x00, 0xfe, 0xe1, 0x67, 0x35, 0x00, + 0x01, 0x5d, 0xc9, 0x70, 0x15, 0x20, 0x4d, 0x22, 0xc5, 0xa0, 0x63, 0x89, 0xc7, 0xf8, + 0x82, 0xa6, 0xa3, 0xa0, 0x72, 0x77, 0x6c, 0x99, 0x22, 0x7c, 0x8b, 0x12, 0x3a, 0x8b, + 0x9a, 0x8c, 0xd3, 0xff, 0x92, 0x5d, 0xc9, 0x70, 0x15, 0x20, 0x4d, 0x22, 0xc5, 0xa0, + 0x63, 0x89, 0xc7, 0xf8, 0x82, 0xa6, 0xa3, 0xa0, 0x72, 0x77, 0x6c, 0x99, 0x22, 0x7c, + 0x8b, 0x12, 0x3a, 0x8b, 0x9a, 0x8c, 0xd3, 0xff, 0x92, 0x07, 0x94, 0x4f, 0x2c, 0x82, + 0xd4, 0x17, 0x30, 0x57, 0x74, 0x88, 0xaf, 0x4f, 0xad, 0xea, 0x90, 0x19, 0x17, 0x4b, + 0xd9, 0xba, 0x7f, 0xda, 0xf9, 0x03, 0xc6, 0x0d, 0xdc, 0x7f, 0x73, 0xfd, 0xf1, 0xef, + 0x94, 0x4f, 0x2c, 0x82, 0xd4, 0x17, 0x30, 0x57, 0x74, 0x88, 0xaf, 0x4f, 0xad, 0xea, + 0x90, 0x19, 0x17, 0x4b, 0xd9, 0xba, 0x7f, 0xda, 0xf9, 0x03, 0xc6, 0x0d, 0xdc, 0x7f, + 0x73, 0xfd, 0xf1, 0xef, 0x07, + ], + peaks: &[&[ + 0x46, 0x7c, 0xa6, 0x06, 0x65, 0x3d, 0x8b, 0xdf, 0x62, 0x0b, 0x0f, 0x5f, 0xc8, 0x8a, + 0x56, 0xb9, 0x75, 0x86, 0xc8, 0xa6, 0xfe, 0xf4, 0xb4, 0xad, 0xf1, 0x8c, 0x67, 0x68, + 0x04, 0xdf, 0xe8, 0x1c, 0xdf, 0x2c, 0x5b, 0x18, 0x92, 0xb4, 0xf4, 0x1b, 0x6a, 0x47, + 0x0a, 0x1d, 0xe8, 0x25, 0x78, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x61, 0x1d, 0x29, 0x39, + 0x0f, 0x1e, 0xa0, 0x0f, 0x56, 0xf6, 0xa6, 0xb7, 0x83, 0x39, 0xfa, 0x49, 0xd1, 0xb2, + 0xd3, 0x7d, 0xc2, 0x65, 0x1e, 0x4c, 0x6d, 0x03, 0xea, 0xba, 0x12, 0xde, 0x7f, 0x8b, + 0xaa, 0x33, 0x09, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe1, 0x67, 0x35, 0x00, + 0x01, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x5d, 0xc9, 0x70, 0x15, 0x20, 0x4d, 0x22, 0xc5, 0xa0, + 0x63, 0x89, 0xc7, 0xf8, 0x82, 0xa6, 0xa3, 0xa0, 0x72, 0x77, 0x6c, 0x99, 0x22, 0x7c, + 0x8b, 0x12, 0x3a, 0x8b, 0x9a, 0x8c, 0xd3, 0xff, 0x92, 0x0c, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x94, 0x4f, 0x2c, 0x82, 0xd4, 0x17, 0x30, 0x57, 0x74, 0x88, 0xaf, 0x4f, 0xad, 0xea, + 0x90, 0x19, 0x17, 0x4b, 0xd9, 0xba, 0x7f, 0xda, 0xf9, 0x03, 0xc6, 0x0d, 0xdc, 0x7f, + 0x73, 0xfd, 0xf1, 0xef, 0x0c, + ]], + root_serialized: &[ + 0x46, 0x7c, 0xa6, 0x06, 0x65, 0x3d, 0x8b, 0xdf, 0x62, 0x0b, 0x0f, 0x5f, 0xc8, 0x8a, + 0x56, 0xb9, 0x75, 0x86, 0xc8, 0xa6, 0xfe, 0xf4, 0xb4, 0xad, 0xf1, 0x8c, 0x67, 0x68, + 0x04, 0xdf, 0xe8, 0x1c, 0xdf, 0x2c, 0x5b, 0x18, 0x92, 0xb4, 0xf4, 0x1b, 0x6a, 0x47, + 0x0a, 0x1d, 0xe8, 0x25, 0x78, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x61, 0x1d, 0x29, 0x39, + 0x0f, 0x1e, 0xa0, 0x0f, 0x56, 0xf6, 0xa6, 0xb7, 0x83, 0x39, 0xfa, 0x49, 0xd1, 0xb2, + 0xd3, 0x7d, 0xc2, 0x65, 0x1e, 0x4c, 0x6d, 0x03, 0xea, 0xba, 0x12, 0xde, 0x7f, 0x8b, + 0xaa, 0x33, 0x09, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe1, 0x67, 0x35, 0x00, + 0x01, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x5d, 0xc9, 0x70, 0x15, 0x20, 0x4d, 0x22, 0xc5, 0xa0, + 0x63, 0x89, 0xc7, 0xf8, 0x82, 0xa6, 0xa3, 0xa0, 0x72, 0x77, 0x6c, 0x99, 0x22, 0x7c, + 0x8b, 0x12, 0x3a, 0x8b, 0x9a, 0x8c, 0xd3, 0xff, 0x92, 0x0c, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x94, 0x4f, 0x2c, 0x82, 0xd4, 0x17, 0x30, 0x57, 0x74, 0x88, 0xaf, 0x4f, 0xad, 0xea, + 0x90, 0x19, 0x17, 0x4b, 0xd9, 0xba, 0x7f, 0xda, 0xf9, 0x03, 0xc6, 0x0d, 0xdc, 0x7f, + 0x73, 0xfd, 0xf1, 0xef, 0x0c, + ], + hash_chain_history_root: [ + 0xca, 0xd5, 0xdf, 0x3e, 0xcf, 0xf0, 0x8b, 0x57, 0x01, 0x4c, 0x7b, 0x86, 0x1b, 0xe2, + 0x76, 0x73, 0x6c, 0x2c, 0xe4, 0x31, 0xcb, 0x06, 0x93, 0xf0, 0x67, 0x9a, 0x41, 0xf8, + 0xb1, 0xf8, 0x07, 0x75, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 3, + leaf_block_hash: [ + 0xe5, 0x9a, 0xb0, 0xa5, 0x91, 0x84, 0x63, 0x1c, 0x90, 0x9a, 0xa2, 0xab, 0x08, 0x48, + 0x58, 0xf6, 0xbe, 0x04, 0x90, 0x79, 0x1a, 0x43, 0x0a, 0xf5, 0x6e, 0x9e, 0x2f, 0x7c, + 0xed, 0x00, 0x0b, 0x9f, + ], + leaf_time: 2074696017, + leaf_target_bits: 505212441, + leaf_sapling_root: [ + 0xfd, 0xbd, 0x5f, 0x47, 0xcc, 0x3c, 0xf2, 0x76, 0xeb, 0xf4, 0x40, 0x9b, 0x83, 0x45, + 0x5c, 0x79, 0x0c, 0x53, 0xf5, 0xf1, 0x09, 0x96, 0x05, 0x51, 0xcd, 0x86, 0xdb, 0xb5, + 0x23, 0xd8, 0xad, 0x86, + ], + leaf_work: [ + 0x53, 0xd9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500002, + leaf_sapling_tx_count: 5, + leaf_orchard_root: [ + 0x83, 0xec, 0xb9, 0x8c, 0x18, 0x31, 0x27, 0x11, 0x24, 0xca, 0xc5, 0x61, 0x2e, 0x04, + 0x0c, 0x33, 0x38, 0x9f, 0xbf, 0x8b, 0xae, 0xfb, 0x16, 0x22, 0x58, 0x22, 0xea, 0x68, + 0x8e, 0x23, 0xa3, 0x56, + ], + leaf_orchard_tx_count: 2, + leaf_ironwood_root: [ + 0xd6, 0x32, 0x4e, 0xb7, 0x22, 0x0f, 0x12, 0x1b, 0x98, 0xff, 0x15, 0x3b, 0x38, 0xe1, + 0xbd, 0xa3, 0x7d, 0x4f, 0xf7, 0x96, 0x46, 0xf9, 0x74, 0xf6, 0x8d, 0xe0, 0xeb, 0xcb, + 0x1c, 0x44, 0x6e, 0x43, + ], + leaf_ironwood_tx_count: 4, + leaf_serialized: &[ + 0xe5, 0x9a, 0xb0, 0xa5, 0x91, 0x84, 0x63, 0x1c, 0x90, 0x9a, 0xa2, 0xab, 0x08, 0x48, + 0x58, 0xf6, 0xbe, 0x04, 0x90, 0x79, 0x1a, 0x43, 0x0a, 0xf5, 0x6e, 0x9e, 0x2f, 0x7c, + 0xed, 0x00, 0x0b, 0x9f, 0x51, 0x59, 0xa9, 0x7b, 0x51, 0x59, 0xa9, 0x7b, 0x19, 0xee, + 0x1c, 0x1e, 0x19, 0xee, 0x1c, 0x1e, 0xfd, 0xbd, 0x5f, 0x47, 0xcc, 0x3c, 0xf2, 0x76, + 0xeb, 0xf4, 0x40, 0x9b, 0x83, 0x45, 0x5c, 0x79, 0x0c, 0x53, 0xf5, 0xf1, 0x09, 0x96, + 0x05, 0x51, 0xcd, 0x86, 0xdb, 0xb5, 0x23, 0xd8, 0xad, 0x86, 0xfd, 0xbd, 0x5f, 0x47, + 0xcc, 0x3c, 0xf2, 0x76, 0xeb, 0xf4, 0x40, 0x9b, 0x83, 0x45, 0x5c, 0x79, 0x0c, 0x53, + 0xf5, 0xf1, 0x09, 0x96, 0x05, 0x51, 0xcd, 0x86, 0xdb, 0xb5, 0x23, 0xd8, 0xad, 0x86, + 0x53, 0xd9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe2, 0x67, 0x35, 0x00, 0xfe, 0xe2, 0x67, 0x35, 0x00, + 0x05, 0x83, 0xec, 0xb9, 0x8c, 0x18, 0x31, 0x27, 0x11, 0x24, 0xca, 0xc5, 0x61, 0x2e, + 0x04, 0x0c, 0x33, 0x38, 0x9f, 0xbf, 0x8b, 0xae, 0xfb, 0x16, 0x22, 0x58, 0x22, 0xea, + 0x68, 0x8e, 0x23, 0xa3, 0x56, 0x83, 0xec, 0xb9, 0x8c, 0x18, 0x31, 0x27, 0x11, 0x24, + 0xca, 0xc5, 0x61, 0x2e, 0x04, 0x0c, 0x33, 0x38, 0x9f, 0xbf, 0x8b, 0xae, 0xfb, 0x16, + 0x22, 0x58, 0x22, 0xea, 0x68, 0x8e, 0x23, 0xa3, 0x56, 0x02, 0xd6, 0x32, 0x4e, 0xb7, + 0x22, 0x0f, 0x12, 0x1b, 0x98, 0xff, 0x15, 0x3b, 0x38, 0xe1, 0xbd, 0xa3, 0x7d, 0x4f, + 0xf7, 0x96, 0x46, 0xf9, 0x74, 0xf6, 0x8d, 0xe0, 0xeb, 0xcb, 0x1c, 0x44, 0x6e, 0x43, + 0xd6, 0x32, 0x4e, 0xb7, 0x22, 0x0f, 0x12, 0x1b, 0x98, 0xff, 0x15, 0x3b, 0x38, 0xe1, + 0xbd, 0xa3, 0x7d, 0x4f, 0xf7, 0x96, 0x46, 0xf9, 0x74, 0xf6, 0x8d, 0xe0, 0xeb, 0xcb, + 0x1c, 0x44, 0x6e, 0x43, 0x04, + ], + peaks: &[ + &[ + 0x46, 0x7c, 0xa6, 0x06, 0x65, 0x3d, 0x8b, 0xdf, 0x62, 0x0b, 0x0f, 0x5f, 0xc8, 0x8a, + 0x56, 0xb9, 0x75, 0x86, 0xc8, 0xa6, 0xfe, 0xf4, 0xb4, 0xad, 0xf1, 0x8c, 0x67, 0x68, + 0x04, 0xdf, 0xe8, 0x1c, 0xdf, 0x2c, 0x5b, 0x18, 0x92, 0xb4, 0xf4, 0x1b, 0x6a, 0x47, + 0x0a, 0x1d, 0xe8, 0x25, 0x78, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x61, 0x1d, 0x29, 0x39, + 0x0f, 0x1e, 0xa0, 0x0f, 0x56, 0xf6, 0xa6, 0xb7, 0x83, 0x39, 0xfa, 0x49, 0xd1, 0xb2, + 0xd3, 0x7d, 0xc2, 0x65, 0x1e, 0x4c, 0x6d, 0x03, 0xea, 0xba, 0x12, 0xde, 0x7f, 0x8b, + 0xaa, 0x33, 0x09, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe1, 0x67, 0x35, 0x00, + 0x01, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x5d, 0xc9, 0x70, 0x15, 0x20, 0x4d, 0x22, 0xc5, 0xa0, + 0x63, 0x89, 0xc7, 0xf8, 0x82, 0xa6, 0xa3, 0xa0, 0x72, 0x77, 0x6c, 0x99, 0x22, 0x7c, + 0x8b, 0x12, 0x3a, 0x8b, 0x9a, 0x8c, 0xd3, 0xff, 0x92, 0x0c, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x94, 0x4f, 0x2c, 0x82, 0xd4, 0x17, 0x30, 0x57, 0x74, 0x88, 0xaf, 0x4f, 0xad, 0xea, + 0x90, 0x19, 0x17, 0x4b, 0xd9, 0xba, 0x7f, 0xda, 0xf9, 0x03, 0xc6, 0x0d, 0xdc, 0x7f, + 0x73, 0xfd, 0xf1, 0xef, 0x0c, + ], + &[ + 0xe5, 0x9a, 0xb0, 0xa5, 0x91, 0x84, 0x63, 0x1c, 0x90, 0x9a, 0xa2, 0xab, 0x08, 0x48, + 0x58, 0xf6, 0xbe, 0x04, 0x90, 0x79, 0x1a, 0x43, 0x0a, 0xf5, 0x6e, 0x9e, 0x2f, 0x7c, + 0xed, 0x00, 0x0b, 0x9f, 0x51, 0x59, 0xa9, 0x7b, 0x51, 0x59, 0xa9, 0x7b, 0x19, 0xee, + 0x1c, 0x1e, 0x19, 0xee, 0x1c, 0x1e, 0xfd, 0xbd, 0x5f, 0x47, 0xcc, 0x3c, 0xf2, 0x76, + 0xeb, 0xf4, 0x40, 0x9b, 0x83, 0x45, 0x5c, 0x79, 0x0c, 0x53, 0xf5, 0xf1, 0x09, 0x96, + 0x05, 0x51, 0xcd, 0x86, 0xdb, 0xb5, 0x23, 0xd8, 0xad, 0x86, 0xfd, 0xbd, 0x5f, 0x47, + 0xcc, 0x3c, 0xf2, 0x76, 0xeb, 0xf4, 0x40, 0x9b, 0x83, 0x45, 0x5c, 0x79, 0x0c, 0x53, + 0xf5, 0xf1, 0x09, 0x96, 0x05, 0x51, 0xcd, 0x86, 0xdb, 0xb5, 0x23, 0xd8, 0xad, 0x86, + 0x53, 0xd9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe2, 0x67, 0x35, 0x00, 0xfe, 0xe2, 0x67, 0x35, 0x00, + 0x05, 0x83, 0xec, 0xb9, 0x8c, 0x18, 0x31, 0x27, 0x11, 0x24, 0xca, 0xc5, 0x61, 0x2e, + 0x04, 0x0c, 0x33, 0x38, 0x9f, 0xbf, 0x8b, 0xae, 0xfb, 0x16, 0x22, 0x58, 0x22, 0xea, + 0x68, 0x8e, 0x23, 0xa3, 0x56, 0x83, 0xec, 0xb9, 0x8c, 0x18, 0x31, 0x27, 0x11, 0x24, + 0xca, 0xc5, 0x61, 0x2e, 0x04, 0x0c, 0x33, 0x38, 0x9f, 0xbf, 0x8b, 0xae, 0xfb, 0x16, + 0x22, 0x58, 0x22, 0xea, 0x68, 0x8e, 0x23, 0xa3, 0x56, 0x02, 0xd6, 0x32, 0x4e, 0xb7, + 0x22, 0x0f, 0x12, 0x1b, 0x98, 0xff, 0x15, 0x3b, 0x38, 0xe1, 0xbd, 0xa3, 0x7d, 0x4f, + 0xf7, 0x96, 0x46, 0xf9, 0x74, 0xf6, 0x8d, 0xe0, 0xeb, 0xcb, 0x1c, 0x44, 0x6e, 0x43, + 0xd6, 0x32, 0x4e, 0xb7, 0x22, 0x0f, 0x12, 0x1b, 0x98, 0xff, 0x15, 0x3b, 0x38, 0xe1, + 0xbd, 0xa3, 0x7d, 0x4f, 0xf7, 0x96, 0x46, 0xf9, 0x74, 0xf6, 0x8d, 0xe0, 0xeb, 0xcb, + 0x1c, 0x44, 0x6e, 0x43, 0x04, + ], + ], + root_serialized: &[ + 0xbc, 0x51, 0x83, 0xb7, 0xf7, 0xfb, 0x87, 0x1e, 0xe5, 0x96, 0x18, 0x11, 0x55, 0x79, + 0x11, 0x3e, 0xf7, 0x29, 0xce, 0xd8, 0x67, 0x39, 0x13, 0x4c, 0x26, 0x14, 0xd3, 0xfb, + 0x3a, 0x32, 0xfe, 0xc0, 0xdf, 0x2c, 0x5b, 0x18, 0x51, 0x59, 0xa9, 0x7b, 0x6a, 0x47, + 0x0a, 0x1d, 0x19, 0xee, 0x1c, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xfd, 0xbd, 0x5f, 0x47, + 0xcc, 0x3c, 0xf2, 0x76, 0xeb, 0xf4, 0x40, 0x9b, 0x83, 0x45, 0x5c, 0x79, 0x0c, 0x53, + 0xf5, 0xf1, 0x09, 0x96, 0x05, 0x51, 0xcd, 0x86, 0xdb, 0xb5, 0x23, 0xd8, 0xad, 0x86, + 0xfd, 0x0c, 0x12, 0x1b, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe2, 0x67, 0x35, 0x00, + 0x06, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x83, 0xec, 0xb9, 0x8c, 0x18, 0x31, 0x27, 0x11, 0x24, + 0xca, 0xc5, 0x61, 0x2e, 0x04, 0x0c, 0x33, 0x38, 0x9f, 0xbf, 0x8b, 0xae, 0xfb, 0x16, + 0x22, 0x58, 0x22, 0xea, 0x68, 0x8e, 0x23, 0xa3, 0x56, 0x0e, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd6, 0x32, 0x4e, 0xb7, 0x22, 0x0f, 0x12, 0x1b, 0x98, 0xff, 0x15, 0x3b, 0x38, 0xe1, + 0xbd, 0xa3, 0x7d, 0x4f, 0xf7, 0x96, 0x46, 0xf9, 0x74, 0xf6, 0x8d, 0xe0, 0xeb, 0xcb, + 0x1c, 0x44, 0x6e, 0x43, 0x10, + ], + hash_chain_history_root: [ + 0x11, 0xa6, 0xbd, 0xcd, 0xd8, 0xb5, 0xa8, 0x23, 0xbb, 0xa4, 0x15, 0xa8, 0x8b, 0x51, + 0xc0, 0xa5, 0xa0, 0xaa, 0xe8, 0xd0, 0x94, 0x73, 0xe4, 0x18, 0x11, 0x18, 0x68, 0x27, + 0xce, 0x64, 0xf6, 0xc5, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 4, + leaf_block_hash: [ + 0xdb, 0x64, 0xca, 0x85, 0x5a, 0xd5, 0xd6, 0x31, 0x03, 0x60, 0x00, 0x6a, 0x12, 0x05, + 0xc7, 0x6d, 0xe4, 0xc1, 0xa8, 0x4e, 0xc6, 0x8c, 0x30, 0x9d, 0xb3, 0xc3, 0x97, 0x1c, + 0x36, 0xc5, 0xdf, 0x27, + ], + leaf_time: 3242040883, + leaf_target_bits: 473252462, + leaf_sapling_root: [ + 0xcd, 0x77, 0xb4, 0xec, 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, + 0x29, 0xe4, 0x59, 0x98, 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, + 0xad, 0x6c, 0x86, 0x91, + ], + leaf_work: [ + 0xa0, 0xf1, 0x80, 0xce, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500003, + leaf_sapling_tx_count: 5, + leaf_orchard_root: [ + 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, 0x24, 0xb8, 0x84, 0xa7, 0xf5, + 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, 0xdc, 0x5e, 0x27, 0x1e, 0xeb, + 0x3b, 0x21, 0x01, 0x90, + ], + leaf_orchard_tx_count: 3, + leaf_ironwood_root: [ + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, + ], + leaf_ironwood_tx_count: 0, + leaf_serialized: &[ + 0xdb, 0x64, 0xca, 0x85, 0x5a, 0xd5, 0xd6, 0x31, 0x03, 0x60, 0x00, 0x6a, 0x12, 0x05, + 0xc7, 0x6d, 0xe4, 0xc1, 0xa8, 0x4e, 0xc6, 0x8c, 0x30, 0x9d, 0xb3, 0xc3, 0x97, 0x1c, + 0x36, 0xc5, 0xdf, 0x27, 0x33, 0x9e, 0x3d, 0xc1, 0x33, 0x9e, 0x3d, 0xc1, 0x6e, 0x42, + 0x35, 0x1c, 0x6e, 0x42, 0x35, 0x1c, 0xcd, 0x77, 0xb4, 0xec, 0x95, 0x97, 0xdf, 0x4e, + 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, 0x1f, 0xba, 0x18, 0x79, + 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, 0xcd, 0x77, 0xb4, 0xec, + 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, + 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, + 0xa0, 0xf1, 0x80, 0xce, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, + 0x05, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, 0x24, 0xb8, 0x84, 0xa7, + 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, 0xdc, 0x5e, 0x27, 0x1e, + 0xeb, 0x3b, 0x21, 0x01, 0x90, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, + 0x24, 0xb8, 0x84, 0xa7, 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, + 0xdc, 0x5e, 0x27, 0x1e, 0xeb, 0x3b, 0x21, 0x01, 0x90, 0x03, 0xd4, 0x5a, 0xd5, 0x17, + 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, 0xff, 0xf3, 0x09, 0x77, + 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, 0xe3, 0x65, 0x14, 0x6b, + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, 0x00, + ], + peaks: &[&[ + 0x95, 0x81, 0x3f, 0x76, 0x80, 0xbf, 0x09, 0xae, 0xd9, 0x16, 0x2c, 0x28, 0x0e, 0xf7, + 0x61, 0xb2, 0x2f, 0xab, 0xdf, 0x5e, 0x9d, 0xa8, 0x83, 0x9b, 0xb6, 0xaa, 0x91, 0x60, + 0x49, 0x09, 0x86, 0x8e, 0xdf, 0x2c, 0x5b, 0x18, 0x33, 0x9e, 0x3d, 0xc1, 0x6a, 0x47, + 0x0a, 0x1d, 0x6e, 0x42, 0x35, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xcd, 0x77, 0xb4, 0xec, + 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, + 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, + 0x9d, 0xfe, 0x92, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, + 0x0b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, + 0x24, 0xb8, 0x84, 0xa7, 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, + 0xdc, 0x5e, 0x27, 0x1e, 0xeb, 0x3b, 0x21, 0x01, 0x90, 0x11, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, 0x10, + ]], + root_serialized: &[ + 0x95, 0x81, 0x3f, 0x76, 0x80, 0xbf, 0x09, 0xae, 0xd9, 0x16, 0x2c, 0x28, 0x0e, 0xf7, + 0x61, 0xb2, 0x2f, 0xab, 0xdf, 0x5e, 0x9d, 0xa8, 0x83, 0x9b, 0xb6, 0xaa, 0x91, 0x60, + 0x49, 0x09, 0x86, 0x8e, 0xdf, 0x2c, 0x5b, 0x18, 0x33, 0x9e, 0x3d, 0xc1, 0x6a, 0x47, + 0x0a, 0x1d, 0x6e, 0x42, 0x35, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xcd, 0x77, 0xb4, 0xec, + 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, + 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, + 0x9d, 0xfe, 0x92, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, + 0x0b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, + 0x24, 0xb8, 0x84, 0xa7, 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, + 0xdc, 0x5e, 0x27, 0x1e, 0xeb, 0x3b, 0x21, 0x01, 0x90, 0x11, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, 0x10, + ], + hash_chain_history_root: [ + 0x09, 0x55, 0x4c, 0x7d, 0x10, 0xef, 0x96, 0xcc, 0x32, 0x0f, 0xad, 0xc0, 0xbf, 0x5e, + 0xce, 0x66, 0x19, 0xb2, 0xf8, 0x4f, 0x74, 0xcb, 0x11, 0x1d, 0x44, 0xe6, 0x66, 0x2a, + 0x88, 0xeb, 0xec, 0x77, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 5, + leaf_block_hash: [ + 0x9c, 0xef, 0x60, 0x9f, 0xd8, 0xf0, 0x14, 0xcb, 0xc6, 0xb0, 0xd7, 0x14, 0x59, 0xbe, + 0xc7, 0x4f, 0xf5, 0x3d, 0x16, 0x3b, 0xd5, 0xb4, 0xdd, 0x80, 0x05, 0xaf, 0xb9, 0xa9, + 0xde, 0xed, 0xdb, 0xbe, + ], + leaf_time: 4055285814, + leaf_target_bits: 503969160, + leaf_sapling_root: [ + 0x7d, 0x89, 0x4e, 0x3c, 0x7c, 0x36, 0xc4, 0xbd, 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, + 0x10, 0xba, 0x5b, 0x54, 0x67, 0xde, 0xc6, 0x2f, 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, + 0x44, 0xae, 0x5f, 0x39, + ], + leaf_work: [ + 0x82, 0xb4, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500004, + leaf_sapling_tx_count: 4, + leaf_orchard_root: [ + 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, 0x41, 0xd6, 0x9e, 0xb8, 0xd5, + 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, 0xdf, 0xe9, 0xd8, 0xbb, 0xd8, + 0xb4, 0x81, 0xe7, 0xcf, + ], + leaf_orchard_tx_count: 1, + leaf_ironwood_root: [ + 0xd5, 0x3e, 0x83, 0x5d, 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, + 0xbc, 0x79, 0xc7, 0xca, 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, + 0xe9, 0xb6, 0x66, 0xd2, + ], + leaf_ironwood_tx_count: 6, + leaf_serialized: &[ + 0x9c, 0xef, 0x60, 0x9f, 0xd8, 0xf0, 0x14, 0xcb, 0xc6, 0xb0, 0xd7, 0x14, 0x59, 0xbe, + 0xc7, 0x4f, 0xf5, 0x3d, 0x16, 0x3b, 0xd5, 0xb4, 0xdd, 0x80, 0x05, 0xaf, 0xb9, 0xa9, + 0xde, 0xed, 0xdb, 0xbe, 0x36, 0xc0, 0xb6, 0xf1, 0x36, 0xc0, 0xb6, 0xf1, 0x88, 0xf5, + 0x09, 0x1e, 0x88, 0xf5, 0x09, 0x1e, 0x7d, 0x89, 0x4e, 0x3c, 0x7c, 0x36, 0xc4, 0xbd, + 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, 0x67, 0xde, 0xc6, 0x2f, + 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, 0x7d, 0x89, 0x4e, 0x3c, + 0x7c, 0x36, 0xc4, 0xbd, 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, + 0x67, 0xde, 0xc6, 0x2f, 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, + 0x82, 0xb4, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, + 0x04, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, 0x41, 0xd6, 0x9e, 0xb8, + 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, 0xdf, 0xe9, 0xd8, 0xbb, + 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, + 0x41, 0xd6, 0x9e, 0xb8, 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, + 0xdf, 0xe9, 0xd8, 0xbb, 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x01, 0xd5, 0x3e, 0x83, 0x5d, + 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, 0xbc, 0x79, 0xc7, 0xca, + 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, 0xe9, 0xb6, 0x66, 0xd2, + 0xd5, 0x3e, 0x83, 0x5d, 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, + 0xbc, 0x79, 0xc7, 0xca, 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, + 0xe9, 0xb6, 0x66, 0xd2, 0x06, + ], + peaks: &[ + &[ + 0x95, 0x81, 0x3f, 0x76, 0x80, 0xbf, 0x09, 0xae, 0xd9, 0x16, 0x2c, 0x28, 0x0e, 0xf7, + 0x61, 0xb2, 0x2f, 0xab, 0xdf, 0x5e, 0x9d, 0xa8, 0x83, 0x9b, 0xb6, 0xaa, 0x91, 0x60, + 0x49, 0x09, 0x86, 0x8e, 0xdf, 0x2c, 0x5b, 0x18, 0x33, 0x9e, 0x3d, 0xc1, 0x6a, 0x47, + 0x0a, 0x1d, 0x6e, 0x42, 0x35, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xcd, 0x77, 0xb4, 0xec, + 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, + 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, + 0x9d, 0xfe, 0x92, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, + 0x0b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, + 0x24, 0xb8, 0x84, 0xa7, 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, + 0xdc, 0x5e, 0x27, 0x1e, 0xeb, 0x3b, 0x21, 0x01, 0x90, 0x11, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, 0x10, + ], + &[ + 0x9c, 0xef, 0x60, 0x9f, 0xd8, 0xf0, 0x14, 0xcb, 0xc6, 0xb0, 0xd7, 0x14, 0x59, 0xbe, + 0xc7, 0x4f, 0xf5, 0x3d, 0x16, 0x3b, 0xd5, 0xb4, 0xdd, 0x80, 0x05, 0xaf, 0xb9, 0xa9, + 0xde, 0xed, 0xdb, 0xbe, 0x36, 0xc0, 0xb6, 0xf1, 0x36, 0xc0, 0xb6, 0xf1, 0x88, 0xf5, + 0x09, 0x1e, 0x88, 0xf5, 0x09, 0x1e, 0x7d, 0x89, 0x4e, 0x3c, 0x7c, 0x36, 0xc4, 0xbd, + 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, 0x67, 0xde, 0xc6, 0x2f, + 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, 0x7d, 0x89, 0x4e, 0x3c, + 0x7c, 0x36, 0xc4, 0xbd, 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, + 0x67, 0xde, 0xc6, 0x2f, 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, + 0x82, 0xb4, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, + 0x04, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, 0x41, 0xd6, 0x9e, 0xb8, + 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, 0xdf, 0xe9, 0xd8, 0xbb, + 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, + 0x41, 0xd6, 0x9e, 0xb8, 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, + 0xdf, 0xe9, 0xd8, 0xbb, 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x01, 0xd5, 0x3e, 0x83, 0x5d, + 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, 0xbc, 0x79, 0xc7, 0xca, + 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, 0xe9, 0xb6, 0x66, 0xd2, + 0xd5, 0x3e, 0x83, 0x5d, 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, + 0xbc, 0x79, 0xc7, 0xca, 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, + 0xe9, 0xb6, 0x66, 0xd2, 0x06, + ], + ], + root_serialized: &[ + 0xa6, 0x09, 0xd4, 0xb8, 0xb0, 0xa2, 0xd8, 0x41, 0xd5, 0xbd, 0xbc, 0x51, 0x49, 0x90, + 0xb7, 0x81, 0x33, 0xbd, 0x25, 0x39, 0x33, 0x85, 0xe5, 0x73, 0x82, 0xcc, 0x51, 0xa1, + 0x1e, 0xc7, 0x3e, 0xad, 0xdf, 0x2c, 0x5b, 0x18, 0x36, 0xc0, 0xb6, 0xf1, 0x6a, 0x47, + 0x0a, 0x1d, 0x88, 0xf5, 0x09, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x7d, 0x89, 0x4e, 0x3c, + 0x7c, 0x36, 0xc4, 0xbd, 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, + 0x67, 0xde, 0xc6, 0x2f, 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, + 0x1f, 0xb3, 0xac, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, + 0x0f, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, + 0x41, 0xd6, 0x9e, 0xb8, 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, + 0xdf, 0xe9, 0xd8, 0xbb, 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x12, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd5, 0x3e, 0x83, 0x5d, 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, + 0xbc, 0x79, 0xc7, 0xca, 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, + 0xe9, 0xb6, 0x66, 0xd2, 0x16, + ], + hash_chain_history_root: [ + 0xb7, 0xfa, 0x81, 0x7d, 0x8c, 0xb5, 0x25, 0x84, 0xad, 0x78, 0xdf, 0xdb, 0x9d, 0x0c, + 0x54, 0x23, 0x9a, 0xa7, 0xc6, 0x1a, 0xa5, 0x58, 0x44, 0x83, 0x06, 0x5f, 0xf2, 0xeb, + 0x3f, 0x1a, 0x3e, 0x57, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 6, + leaf_block_hash: [ + 0x67, 0xc0, 0x20, 0xdf, 0x50, 0xbc, 0xb4, 0xf9, 0xa1, 0xaf, 0x92, 0x9b, 0xa6, 0x24, + 0x62, 0x1e, 0x64, 0xf2, 0x45, 0x02, 0xe2, 0x7d, 0x10, 0x89, 0xc1, 0xd6, 0x3a, 0xc7, + 0xb5, 0x78, 0xb9, 0x87, + ], + leaf_time: 2918784062, + leaf_target_bits: 521355286, + leaf_sapling_root: [ + 0x8e, 0x26, 0x53, 0xa9, 0x9d, 0x53, 0x16, 0x5f, 0xee, 0x27, 0x29, 0xec, 0x8a, 0x3d, + 0x71, 0x06, 0x0a, 0xd3, 0x7f, 0x29, 0x29, 0xfb, 0x1c, 0x85, 0x7a, 0x50, 0xef, 0x3c, + 0xab, 0x7e, 0x06, 0x19, + ], + leaf_work: [ + 0x4c, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500005, + leaf_sapling_tx_count: 7, + leaf_orchard_root: [ + 0x3d, 0xab, 0xa9, 0x59, 0xca, 0x66, 0x41, 0x0d, 0x58, 0x9d, 0x7c, 0xc3, 0x20, 0xf5, + 0xbc, 0x8b, 0xcc, 0xad, 0x03, 0x04, 0x2d, 0xb3, 0xb6, 0x37, 0x5e, 0x40, 0xee, 0x36, + 0x7d, 0xcc, 0x77, 0x4d, + ], + leaf_orchard_tx_count: 6, + leaf_ironwood_root: [ + 0x07, 0x65, 0xdf, 0x84, 0xcc, 0x05, 0x00, 0x20, 0x6a, 0xd4, 0xfb, 0x9e, 0x57, 0x84, + 0x4b, 0x57, 0xda, 0xf2, 0xb9, 0x7e, 0xe8, 0x90, 0xd7, 0x9d, 0xa4, 0x1b, 0xc9, 0xea, + 0x4e, 0x1e, 0xee, 0x5a, + ], + leaf_ironwood_tx_count: 7, + leaf_serialized: &[ + 0x67, 0xc0, 0x20, 0xdf, 0x50, 0xbc, 0xb4, 0xf9, 0xa1, 0xaf, 0x92, 0x9b, 0xa6, 0x24, + 0x62, 0x1e, 0x64, 0xf2, 0x45, 0x02, 0xe2, 0x7d, 0x10, 0x89, 0xc1, 0xd6, 0x3a, 0xc7, + 0xb5, 0x78, 0xb9, 0x87, 0x3e, 0x1c, 0xf9, 0xad, 0x3e, 0x1c, 0xf9, 0xad, 0x16, 0x40, + 0x13, 0x1f, 0x16, 0x40, 0x13, 0x1f, 0x8e, 0x26, 0x53, 0xa9, 0x9d, 0x53, 0x16, 0x5f, + 0xee, 0x27, 0x29, 0xec, 0x8a, 0x3d, 0x71, 0x06, 0x0a, 0xd3, 0x7f, 0x29, 0x29, 0xfb, + 0x1c, 0x85, 0x7a, 0x50, 0xef, 0x3c, 0xab, 0x7e, 0x06, 0x19, 0x8e, 0x26, 0x53, 0xa9, + 0x9d, 0x53, 0x16, 0x5f, 0xee, 0x27, 0x29, 0xec, 0x8a, 0x3d, 0x71, 0x06, 0x0a, 0xd3, + 0x7f, 0x29, 0x29, 0xfb, 0x1c, 0x85, 0x7a, 0x50, 0xef, 0x3c, 0xab, 0x7e, 0x06, 0x19, + 0x4c, 0x0d, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe5, 0x67, 0x35, 0x00, 0xfe, 0xe5, 0x67, 0x35, 0x00, + 0x07, 0x3d, 0xab, 0xa9, 0x59, 0xca, 0x66, 0x41, 0x0d, 0x58, 0x9d, 0x7c, 0xc3, 0x20, + 0xf5, 0xbc, 0x8b, 0xcc, 0xad, 0x03, 0x04, 0x2d, 0xb3, 0xb6, 0x37, 0x5e, 0x40, 0xee, + 0x36, 0x7d, 0xcc, 0x77, 0x4d, 0x3d, 0xab, 0xa9, 0x59, 0xca, 0x66, 0x41, 0x0d, 0x58, + 0x9d, 0x7c, 0xc3, 0x20, 0xf5, 0xbc, 0x8b, 0xcc, 0xad, 0x03, 0x04, 0x2d, 0xb3, 0xb6, + 0x37, 0x5e, 0x40, 0xee, 0x36, 0x7d, 0xcc, 0x77, 0x4d, 0x06, 0x07, 0x65, 0xdf, 0x84, + 0xcc, 0x05, 0x00, 0x20, 0x6a, 0xd4, 0xfb, 0x9e, 0x57, 0x84, 0x4b, 0x57, 0xda, 0xf2, + 0xb9, 0x7e, 0xe8, 0x90, 0xd7, 0x9d, 0xa4, 0x1b, 0xc9, 0xea, 0x4e, 0x1e, 0xee, 0x5a, + 0x07, 0x65, 0xdf, 0x84, 0xcc, 0x05, 0x00, 0x20, 0x6a, 0xd4, 0xfb, 0x9e, 0x57, 0x84, + 0x4b, 0x57, 0xda, 0xf2, 0xb9, 0x7e, 0xe8, 0x90, 0xd7, 0x9d, 0xa4, 0x1b, 0xc9, 0xea, + 0x4e, 0x1e, 0xee, 0x5a, 0x07, + ], + peaks: &[ + &[ + 0x95, 0x81, 0x3f, 0x76, 0x80, 0xbf, 0x09, 0xae, 0xd9, 0x16, 0x2c, 0x28, 0x0e, 0xf7, + 0x61, 0xb2, 0x2f, 0xab, 0xdf, 0x5e, 0x9d, 0xa8, 0x83, 0x9b, 0xb6, 0xaa, 0x91, 0x60, + 0x49, 0x09, 0x86, 0x8e, 0xdf, 0x2c, 0x5b, 0x18, 0x33, 0x9e, 0x3d, 0xc1, 0x6a, 0x47, + 0x0a, 0x1d, 0x6e, 0x42, 0x35, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xcd, 0x77, 0xb4, 0xec, + 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, + 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, + 0x9d, 0xfe, 0x92, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, + 0x0b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, + 0x24, 0xb8, 0x84, 0xa7, 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, + 0xdc, 0x5e, 0x27, 0x1e, 0xeb, 0x3b, 0x21, 0x01, 0x90, 0x11, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, 0x10, + ], + &[ + 0x77, 0xd9, 0xf9, 0xf3, 0xd8, 0x7f, 0xf8, 0xc1, 0x9f, 0xc7, 0x01, 0x99, 0xb9, 0x24, + 0xb5, 0x98, 0xa9, 0x7d, 0x7e, 0x62, 0x0a, 0xbd, 0xc8, 0x1b, 0xd1, 0x50, 0x30, 0x08, + 0x20, 0xc0, 0xff, 0x63, 0x36, 0xc0, 0xb6, 0xf1, 0x3e, 0x1c, 0xf9, 0xad, 0x88, 0xf5, + 0x09, 0x1e, 0x16, 0x40, 0x13, 0x1f, 0x7d, 0x89, 0x4e, 0x3c, 0x7c, 0x36, 0xc4, 0xbd, + 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, 0x67, 0xde, 0xc6, 0x2f, + 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, 0x8e, 0x26, 0x53, 0xa9, + 0x9d, 0x53, 0x16, 0x5f, 0xee, 0x27, 0x29, 0xec, 0x8a, 0x3d, 0x71, 0x06, 0x0a, 0xd3, + 0x7f, 0x29, 0x29, 0xfb, 0x1c, 0x85, 0x7a, 0x50, 0xef, 0x3c, 0xab, 0x7e, 0x06, 0x19, + 0xce, 0xc1, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, 0xfe, 0xe5, 0x67, 0x35, 0x00, + 0x0b, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, 0x41, 0xd6, 0x9e, 0xb8, + 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, 0xdf, 0xe9, 0xd8, 0xbb, + 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x3d, 0xab, 0xa9, 0x59, 0xca, 0x66, 0x41, 0x0d, 0x58, + 0x9d, 0x7c, 0xc3, 0x20, 0xf5, 0xbc, 0x8b, 0xcc, 0xad, 0x03, 0x04, 0x2d, 0xb3, 0xb6, + 0x37, 0x5e, 0x40, 0xee, 0x36, 0x7d, 0xcc, 0x77, 0x4d, 0x07, 0xd5, 0x3e, 0x83, 0x5d, + 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, 0xbc, 0x79, 0xc7, 0xca, + 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, 0xe9, 0xb6, 0x66, 0xd2, + 0x07, 0x65, 0xdf, 0x84, 0xcc, 0x05, 0x00, 0x20, 0x6a, 0xd4, 0xfb, 0x9e, 0x57, 0x84, + 0x4b, 0x57, 0xda, 0xf2, 0xb9, 0x7e, 0xe8, 0x90, 0xd7, 0x9d, 0xa4, 0x1b, 0xc9, 0xea, + 0x4e, 0x1e, 0xee, 0x5a, 0x0d, + ], + ], + root_serialized: &[ + 0xec, 0xdf, 0x86, 0x62, 0xa6, 0x08, 0xe2, 0x67, 0x05, 0xb1, 0x87, 0xe7, 0x29, 0x0a, + 0x0a, 0x5a, 0xc7, 0xda, 0x0d, 0x6f, 0x2f, 0x35, 0xd1, 0x9b, 0xca, 0x92, 0x2b, 0x4c, + 0xff, 0x54, 0xe6, 0xe2, 0xdf, 0x2c, 0x5b, 0x18, 0x3e, 0x1c, 0xf9, 0xad, 0x6a, 0x47, + 0x0a, 0x1d, 0x16, 0x40, 0x13, 0x1f, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x8e, 0x26, 0x53, 0xa9, + 0x9d, 0x53, 0x16, 0x5f, 0xee, 0x27, 0x29, 0xec, 0x8a, 0x3d, 0x71, 0x06, 0x0a, 0xd3, + 0x7f, 0x29, 0x29, 0xfb, 0x1c, 0x85, 0x7a, 0x50, 0xef, 0x3c, 0xab, 0x7e, 0x06, 0x19, + 0x6b, 0xc0, 0xac, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe5, 0x67, 0x35, 0x00, + 0x16, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x3d, 0xab, 0xa9, 0x59, 0xca, 0x66, 0x41, 0x0d, 0x58, + 0x9d, 0x7c, 0xc3, 0x20, 0xf5, 0xbc, 0x8b, 0xcc, 0xad, 0x03, 0x04, 0x2d, 0xb3, 0xb6, + 0x37, 0x5e, 0x40, 0xee, 0x36, 0x7d, 0xcc, 0x77, 0x4d, 0x18, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x07, 0x65, 0xdf, 0x84, 0xcc, 0x05, 0x00, 0x20, 0x6a, 0xd4, 0xfb, 0x9e, 0x57, 0x84, + 0x4b, 0x57, 0xda, 0xf2, 0xb9, 0x7e, 0xe8, 0x90, 0xd7, 0x9d, 0xa4, 0x1b, 0xc9, 0xea, + 0x4e, 0x1e, 0xee, 0x5a, 0x1d, + ], + hash_chain_history_root: [ + 0x9a, 0xd5, 0x17, 0xf6, 0x3a, 0xb8, 0x78, 0x90, 0xdd, 0x3f, 0xd5, 0xee, 0xd6, 0x1d, + 0xfe, 0x2e, 0x93, 0x70, 0x3f, 0x22, 0x6c, 0x39, 0x7e, 0x9d, 0x24, 0xa9, 0xb0, 0xc9, + 0x03, 0xd2, 0x58, 0xa3, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 7, + leaf_block_hash: [ + 0x30, 0x9f, 0x72, 0x0f, 0xc0, 0xd9, 0x35, 0x59, 0xfa, 0xd9, 0xe1, 0xe1, 0xcc, 0x55, + 0x27, 0xb2, 0x49, 0xb0, 0x1a, 0x1e, 0xd5, 0x0b, 0x6c, 0x57, 0xf8, 0xec, 0x64, 0x0d, + 0xc0, 0xa3, 0xa1, 0x2c, + ], + leaf_time: 3388477409, + leaf_target_bits: 524244310, + leaf_sapling_root: [ + 0x3e, 0xfe, 0x5b, 0xae, 0xfe, 0x9e, 0x17, 0x48, 0x8e, 0x9c, 0x65, 0xf3, 0x8a, 0xd8, + 0xd2, 0x38, 0x51, 0x77, 0x94, 0x79, 0x3a, 0x55, 0xe1, 0x4f, 0x84, 0x6c, 0xbc, 0x1f, + 0xc1, 0x41, 0x16, 0x0e, + ], + leaf_work: [ + 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500006, + leaf_sapling_tx_count: 5, + leaf_orchard_root: [ + 0x1d, 0x1e, 0xc2, 0xf1, 0xf3, 0x8e, 0xba, 0x04, 0xca, 0xae, 0xca, 0x4e, 0x93, 0x33, + 0xa5, 0xa2, 0x3d, 0x35, 0x84, 0x90, 0x41, 0x6a, 0x8b, 0x46, 0x5d, 0x81, 0x3d, 0xf2, + 0x05, 0x7e, 0x25, 0xcd, + ], + leaf_orchard_tx_count: 6, + leaf_ironwood_root: [ + 0x5b, 0xdd, 0xbd, 0x09, 0x24, 0x93, 0x63, 0x67, 0x9e, 0xda, 0xa1, 0x22, 0x34, 0x03, + 0x17, 0x6e, 0xc3, 0xea, 0x57, 0xd2, 0xff, 0x5b, 0x0c, 0x68, 0x2a, 0x67, 0xa6, 0x11, + 0x17, 0x63, 0xe8, 0x49, + ], + leaf_ironwood_tx_count: 0, + leaf_serialized: &[ + 0x30, 0x9f, 0x72, 0x0f, 0xc0, 0xd9, 0x35, 0x59, 0xfa, 0xd9, 0xe1, 0xe1, 0xcc, 0x55, + 0x27, 0xb2, 0x49, 0xb0, 0x1a, 0x1e, 0xd5, 0x0b, 0x6c, 0x57, 0xf8, 0xec, 0x64, 0x0d, + 0xc0, 0xa3, 0xa1, 0x2c, 0xe1, 0x0f, 0xf8, 0xc9, 0xe1, 0x0f, 0xf8, 0xc9, 0x56, 0x55, + 0x3f, 0x1f, 0x56, 0x55, 0x3f, 0x1f, 0x3e, 0xfe, 0x5b, 0xae, 0xfe, 0x9e, 0x17, 0x48, + 0x8e, 0x9c, 0x65, 0xf3, 0x8a, 0xd8, 0xd2, 0x38, 0x51, 0x77, 0x94, 0x79, 0x3a, 0x55, + 0xe1, 0x4f, 0x84, 0x6c, 0xbc, 0x1f, 0xc1, 0x41, 0x16, 0x0e, 0x3e, 0xfe, 0x5b, 0xae, + 0xfe, 0x9e, 0x17, 0x48, 0x8e, 0x9c, 0x65, 0xf3, 0x8a, 0xd8, 0xd2, 0x38, 0x51, 0x77, + 0x94, 0x79, 0x3a, 0x55, 0xe1, 0x4f, 0x84, 0x6c, 0xbc, 0x1f, 0xc1, 0x41, 0x16, 0x0e, + 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe6, 0x67, 0x35, 0x00, 0xfe, 0xe6, 0x67, 0x35, 0x00, + 0x05, 0x1d, 0x1e, 0xc2, 0xf1, 0xf3, 0x8e, 0xba, 0x04, 0xca, 0xae, 0xca, 0x4e, 0x93, + 0x33, 0xa5, 0xa2, 0x3d, 0x35, 0x84, 0x90, 0x41, 0x6a, 0x8b, 0x46, 0x5d, 0x81, 0x3d, + 0xf2, 0x05, 0x7e, 0x25, 0xcd, 0x1d, 0x1e, 0xc2, 0xf1, 0xf3, 0x8e, 0xba, 0x04, 0xca, + 0xae, 0xca, 0x4e, 0x93, 0x33, 0xa5, 0xa2, 0x3d, 0x35, 0x84, 0x90, 0x41, 0x6a, 0x8b, + 0x46, 0x5d, 0x81, 0x3d, 0xf2, 0x05, 0x7e, 0x25, 0xcd, 0x06, 0x5b, 0xdd, 0xbd, 0x09, + 0x24, 0x93, 0x63, 0x67, 0x9e, 0xda, 0xa1, 0x22, 0x34, 0x03, 0x17, 0x6e, 0xc3, 0xea, + 0x57, 0xd2, 0xff, 0x5b, 0x0c, 0x68, 0x2a, 0x67, 0xa6, 0x11, 0x17, 0x63, 0xe8, 0x49, + 0x5b, 0xdd, 0xbd, 0x09, 0x24, 0x93, 0x63, 0x67, 0x9e, 0xda, 0xa1, 0x22, 0x34, 0x03, + 0x17, 0x6e, 0xc3, 0xea, 0x57, 0xd2, 0xff, 0x5b, 0x0c, 0x68, 0x2a, 0x67, 0xa6, 0x11, + 0x17, 0x63, 0xe8, 0x49, 0x00, + ], + peaks: &[ + &[ + 0x95, 0x81, 0x3f, 0x76, 0x80, 0xbf, 0x09, 0xae, 0xd9, 0x16, 0x2c, 0x28, 0x0e, 0xf7, + 0x61, 0xb2, 0x2f, 0xab, 0xdf, 0x5e, 0x9d, 0xa8, 0x83, 0x9b, 0xb6, 0xaa, 0x91, 0x60, + 0x49, 0x09, 0x86, 0x8e, 0xdf, 0x2c, 0x5b, 0x18, 0x33, 0x9e, 0x3d, 0xc1, 0x6a, 0x47, + 0x0a, 0x1d, 0x6e, 0x42, 0x35, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xcd, 0x77, 0xb4, 0xec, + 0x95, 0x97, 0xdf, 0x4e, 0x00, 0x70, 0x8f, 0x40, 0x4b, 0xe0, 0x29, 0xe4, 0x59, 0x98, + 0x1f, 0xba, 0x18, 0x79, 0x81, 0xa2, 0x23, 0x49, 0x2e, 0x53, 0xad, 0x6c, 0x86, 0x91, + 0x9d, 0xfe, 0x92, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe3, 0x67, 0x35, 0x00, + 0x0b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xbf, 0x97, 0x12, 0x3e, 0x03, 0x6a, 0x6f, 0x4d, 0x17, + 0x24, 0xb8, 0x84, 0xa7, 0xf5, 0x4a, 0x4b, 0xee, 0x6c, 0x69, 0x48, 0xaa, 0x80, 0x70, + 0xdc, 0x5e, 0x27, 0x1e, 0xeb, 0x3b, 0x21, 0x01, 0x90, 0x11, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xd4, 0x5a, 0xd5, 0x17, 0xa0, 0xc3, 0x82, 0xfb, 0x0c, 0xce, 0x6b, 0xb9, 0x05, 0xe5, + 0xff, 0xf3, 0x09, 0x77, 0x65, 0xca, 0xb0, 0x24, 0xaa, 0x01, 0xc1, 0x81, 0x4e, 0xaf, + 0xe3, 0x65, 0x14, 0x6b, 0x10, + ], + &[ + 0x77, 0xd9, 0xf9, 0xf3, 0xd8, 0x7f, 0xf8, 0xc1, 0x9f, 0xc7, 0x01, 0x99, 0xb9, 0x24, + 0xb5, 0x98, 0xa9, 0x7d, 0x7e, 0x62, 0x0a, 0xbd, 0xc8, 0x1b, 0xd1, 0x50, 0x30, 0x08, + 0x20, 0xc0, 0xff, 0x63, 0x36, 0xc0, 0xb6, 0xf1, 0x3e, 0x1c, 0xf9, 0xad, 0x88, 0xf5, + 0x09, 0x1e, 0x16, 0x40, 0x13, 0x1f, 0x7d, 0x89, 0x4e, 0x3c, 0x7c, 0x36, 0xc4, 0xbd, + 0x17, 0x86, 0xb5, 0x42, 0xfd, 0xe2, 0x10, 0xba, 0x5b, 0x54, 0x67, 0xde, 0xc6, 0x2f, + 0x4c, 0xe0, 0x97, 0xb4, 0xc1, 0x5e, 0x44, 0xae, 0x5f, 0x39, 0x8e, 0x26, 0x53, 0xa9, + 0x9d, 0x53, 0x16, 0x5f, 0xee, 0x27, 0x29, 0xec, 0x8a, 0x3d, 0x71, 0x06, 0x0a, 0xd3, + 0x7f, 0x29, 0x29, 0xfb, 0x1c, 0x85, 0x7a, 0x50, 0xef, 0x3c, 0xab, 0x7e, 0x06, 0x19, + 0xce, 0xc1, 0x19, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe4, 0x67, 0x35, 0x00, 0xfe, 0xe5, 0x67, 0x35, 0x00, + 0x0b, 0x6a, 0xb2, 0x30, 0x94, 0xef, 0x02, 0x79, 0xed, 0x27, 0x41, 0xd6, 0x9e, 0xb8, + 0xd5, 0xcd, 0xdf, 0x15, 0xcd, 0x92, 0xe2, 0xdd, 0x63, 0xf0, 0xdf, 0xe9, 0xd8, 0xbb, + 0xd8, 0xb4, 0x81, 0xe7, 0xcf, 0x3d, 0xab, 0xa9, 0x59, 0xca, 0x66, 0x41, 0x0d, 0x58, + 0x9d, 0x7c, 0xc3, 0x20, 0xf5, 0xbc, 0x8b, 0xcc, 0xad, 0x03, 0x04, 0x2d, 0xb3, 0xb6, + 0x37, 0x5e, 0x40, 0xee, 0x36, 0x7d, 0xcc, 0x77, 0x4d, 0x07, 0xd5, 0x3e, 0x83, 0x5d, + 0xc7, 0x87, 0x1c, 0xf6, 0xf1, 0x99, 0xe5, 0xb9, 0x7b, 0xc1, 0xbc, 0x79, 0xc7, 0xca, + 0x4e, 0xb9, 0xd0, 0xca, 0x98, 0xde, 0x3e, 0x71, 0x37, 0x8d, 0xe9, 0xb6, 0x66, 0xd2, + 0x07, 0x65, 0xdf, 0x84, 0xcc, 0x05, 0x00, 0x20, 0x6a, 0xd4, 0xfb, 0x9e, 0x57, 0x84, + 0x4b, 0x57, 0xda, 0xf2, 0xb9, 0x7e, 0xe8, 0x90, 0xd7, 0x9d, 0xa4, 0x1b, 0xc9, 0xea, + 0x4e, 0x1e, 0xee, 0x5a, 0x0d, + ], + &[ + 0x30, 0x9f, 0x72, 0x0f, 0xc0, 0xd9, 0x35, 0x59, 0xfa, 0xd9, 0xe1, 0xe1, 0xcc, 0x55, + 0x27, 0xb2, 0x49, 0xb0, 0x1a, 0x1e, 0xd5, 0x0b, 0x6c, 0x57, 0xf8, 0xec, 0x64, 0x0d, + 0xc0, 0xa3, 0xa1, 0x2c, 0xe1, 0x0f, 0xf8, 0xc9, 0xe1, 0x0f, 0xf8, 0xc9, 0x56, 0x55, + 0x3f, 0x1f, 0x56, 0x55, 0x3f, 0x1f, 0x3e, 0xfe, 0x5b, 0xae, 0xfe, 0x9e, 0x17, 0x48, + 0x8e, 0x9c, 0x65, 0xf3, 0x8a, 0xd8, 0xd2, 0x38, 0x51, 0x77, 0x94, 0x79, 0x3a, 0x55, + 0xe1, 0x4f, 0x84, 0x6c, 0xbc, 0x1f, 0xc1, 0x41, 0x16, 0x0e, 0x3e, 0xfe, 0x5b, 0xae, + 0xfe, 0x9e, 0x17, 0x48, 0x8e, 0x9c, 0x65, 0xf3, 0x8a, 0xd8, 0xd2, 0x38, 0x51, 0x77, + 0x94, 0x79, 0x3a, 0x55, 0xe1, 0x4f, 0x84, 0x6c, 0xbc, 0x1f, 0xc1, 0x41, 0x16, 0x0e, + 0x0a, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe6, 0x67, 0x35, 0x00, 0xfe, 0xe6, 0x67, 0x35, 0x00, + 0x05, 0x1d, 0x1e, 0xc2, 0xf1, 0xf3, 0x8e, 0xba, 0x04, 0xca, 0xae, 0xca, 0x4e, 0x93, + 0x33, 0xa5, 0xa2, 0x3d, 0x35, 0x84, 0x90, 0x41, 0x6a, 0x8b, 0x46, 0x5d, 0x81, 0x3d, + 0xf2, 0x05, 0x7e, 0x25, 0xcd, 0x1d, 0x1e, 0xc2, 0xf1, 0xf3, 0x8e, 0xba, 0x04, 0xca, + 0xae, 0xca, 0x4e, 0x93, 0x33, 0xa5, 0xa2, 0x3d, 0x35, 0x84, 0x90, 0x41, 0x6a, 0x8b, + 0x46, 0x5d, 0x81, 0x3d, 0xf2, 0x05, 0x7e, 0x25, 0xcd, 0x06, 0x5b, 0xdd, 0xbd, 0x09, + 0x24, 0x93, 0x63, 0x67, 0x9e, 0xda, 0xa1, 0x22, 0x34, 0x03, 0x17, 0x6e, 0xc3, 0xea, + 0x57, 0xd2, 0xff, 0x5b, 0x0c, 0x68, 0x2a, 0x67, 0xa6, 0x11, 0x17, 0x63, 0xe8, 0x49, + 0x5b, 0xdd, 0xbd, 0x09, 0x24, 0x93, 0x63, 0x67, 0x9e, 0xda, 0xa1, 0x22, 0x34, 0x03, + 0x17, 0x6e, 0xc3, 0xea, 0x57, 0xd2, 0xff, 0x5b, 0x0c, 0x68, 0x2a, 0x67, 0xa6, 0x11, + 0x17, 0x63, 0xe8, 0x49, 0x00, + ], + ], + root_serialized: &[ + 0x5c, 0x04, 0x5b, 0x4f, 0x3a, 0xd1, 0xc0, 0xd1, 0x23, 0x3e, 0x89, 0xec, 0x25, 0xa9, + 0x73, 0xcc, 0x39, 0x0c, 0xa1, 0xf0, 0x63, 0x24, 0x05, 0xce, 0xe8, 0x7b, 0x35, 0x2d, + 0x41, 0x8c, 0x5f, 0x47, 0xdf, 0x2c, 0x5b, 0x18, 0xe1, 0x0f, 0xf8, 0xc9, 0x6a, 0x47, + 0x0a, 0x1d, 0x56, 0x55, 0x3f, 0x1f, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x3e, 0xfe, 0x5b, 0xae, + 0xfe, 0x9e, 0x17, 0x48, 0x8e, 0x9c, 0x65, 0xf3, 0x8a, 0xd8, 0xd2, 0x38, 0x51, 0x77, + 0x94, 0x79, 0x3a, 0x55, 0xe1, 0x4f, 0x84, 0x6c, 0xbc, 0x1f, 0xc1, 0x41, 0x16, 0x0e, + 0x75, 0xc4, 0xac, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe6, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x1d, 0x1e, 0xc2, 0xf1, 0xf3, 0x8e, 0xba, 0x04, 0xca, + 0xae, 0xca, 0x4e, 0x93, 0x33, 0xa5, 0xa2, 0x3d, 0x35, 0x84, 0x90, 0x41, 0x6a, 0x8b, + 0x46, 0x5d, 0x81, 0x3d, 0xf2, 0x05, 0x7e, 0x25, 0xcd, 0x1e, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x5b, 0xdd, 0xbd, 0x09, 0x24, 0x93, 0x63, 0x67, 0x9e, 0xda, 0xa1, 0x22, 0x34, 0x03, + 0x17, 0x6e, 0xc3, 0xea, 0x57, 0xd2, 0xff, 0x5b, 0x0c, 0x68, 0x2a, 0x67, 0xa6, 0x11, + 0x17, 0x63, 0xe8, 0x49, 0x1d, + ], + hash_chain_history_root: [ + 0xed, 0xab, 0xa1, 0x23, 0xc0, 0xbf, 0xdd, 0x3a, 0x33, 0xe4, 0x3e, 0xa8, 0x99, 0x89, + 0x51, 0x83, 0x28, 0x14, 0xf5, 0x93, 0xe8, 0xc2, 0x19, 0xee, 0x47, 0xb2, 0x06, 0x6d, + 0xe0, 0x7a, 0xfa, 0xa7, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 8, + leaf_block_hash: [ + 0xab, 0x84, 0x07, 0x16, 0xa1, 0x6b, 0x30, 0x9f, 0x73, 0x01, 0x55, 0x57, 0x33, 0x77, + 0x6c, 0x4c, 0xc0, 0xeb, 0x63, 0x96, 0x35, 0x09, 0x56, 0x7d, 0x81, 0xc2, 0xd3, 0xc9, + 0xb3, 0x5a, 0xea, 0x53, + ], + leaf_time: 2165447232, + leaf_target_bits: 510772214, + leaf_sapling_root: [ + 0x96, 0x25, 0xcc, 0x7e, 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, + 0x4d, 0xeb, 0x9f, 0x19, 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, + 0xc6, 0xc1, 0xbd, 0x1a, + ], + leaf_work: [ + 0x0f, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500007, + leaf_sapling_tx_count: 0, + leaf_orchard_root: [ + 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, 0x27, 0x1f, 0xf2, 0xa2, 0x7b, + 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, 0xcc, 0x6a, 0x66, 0x3a, 0x72, + 0x36, 0xd5, 0xc3, 0x64, + ], + leaf_orchard_tx_count: 6, + leaf_ironwood_root: [ + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, + ], + leaf_ironwood_tx_count: 4, + leaf_serialized: &[ + 0xab, 0x84, 0x07, 0x16, 0xa1, 0x6b, 0x30, 0x9f, 0x73, 0x01, 0x55, 0x57, 0x33, 0x77, + 0x6c, 0x4c, 0xc0, 0xeb, 0x63, 0x96, 0x35, 0x09, 0x56, 0x7d, 0x81, 0xc2, 0xd3, 0xc9, + 0xb3, 0x5a, 0xea, 0x53, 0x40, 0x1a, 0x12, 0x81, 0x40, 0x1a, 0x12, 0x81, 0xf6, 0xc3, + 0x71, 0x1e, 0xf6, 0xc3, 0x71, 0x1e, 0x96, 0x25, 0xcc, 0x7e, 0x88, 0x45, 0x2e, 0xeb, + 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, 0xf9, 0x06, 0x8f, 0xef, + 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x0f, 0x40, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x00, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, 0x27, 0x1f, 0xf2, 0xa2, + 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, 0xcc, 0x6a, 0x66, 0x3a, + 0x72, 0x36, 0xd5, 0xc3, 0x64, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x06, 0x3a, 0x36, 0x8b, 0x27, + 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, 0xa1, 0xba, 0xbf, 0xfb, + 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, 0x77, 0x8b, 0xb4, 0x15, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x04, + ], + peaks: &[&[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ]], + root_serialized: &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + hash_chain_history_root: [ + 0x60, 0x51, 0xb0, 0xc3, 0x16, 0x12, 0xbf, 0xd0, 0x1c, 0xcf, 0xed, 0x33, 0xe8, 0x0e, + 0x3b, 0x54, 0x89, 0x3e, 0x61, 0xcb, 0x69, 0xde, 0x7e, 0x37, 0x0d, 0x23, 0xc3, 0x7c, + 0x7d, 0x98, 0x20, 0x77, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 9, + leaf_block_hash: [ + 0xfe, 0xed, 0x5c, 0x8b, 0x1a, 0xfb, 0xae, 0x81, 0xd7, 0x13, 0xd3, 0x7f, 0xed, 0x2d, + 0x04, 0x89, 0x36, 0x6e, 0x47, 0x5d, 0x81, 0xeb, 0xcf, 0xae, 0x95, 0x2a, 0xf5, 0x99, + 0xfd, 0x3f, 0xaa, 0x7c, + ], + leaf_time: 3169701737, + leaf_target_bits: 494419835, + leaf_sapling_root: [ + 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, + 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, + 0x57, 0x2d, 0x0d, 0x01, + ], + leaf_work: [ + 0xd2, 0x01, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500008, + leaf_sapling_tx_count: 0, + leaf_orchard_root: [ + 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, 0x4b, + 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, 0xf1, + 0xd3, 0x06, 0x9a, 0x99, + ], + leaf_orchard_tx_count: 1, + leaf_ironwood_root: [ + 0xe8, 0x5e, 0x0d, 0x11, 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, + 0x7c, 0x7f, 0xec, 0xc9, 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, + 0x36, 0xef, 0x03, 0xdb, + ], + leaf_ironwood_tx_count: 3, + leaf_serialized: &[ + 0xfe, 0xed, 0x5c, 0x8b, 0x1a, 0xfb, 0xae, 0x81, 0xd7, 0x13, 0xd3, 0x7f, 0xed, 0x2d, + 0x04, 0x89, 0x36, 0x6e, 0x47, 0x5d, 0x81, 0xeb, 0xcf, 0xae, 0x95, 0x2a, 0xf5, 0x99, + 0xfd, 0x3f, 0xaa, 0x7c, 0x69, 0xcf, 0xed, 0xbc, 0x69, 0xcf, 0xed, 0xbc, 0x7b, 0x3f, + 0x78, 0x1d, 0x7b, 0x3f, 0x78, 0x1d, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xf1, 0xba, 0x85, 0x9e, + 0x42, 0x15, 0x26, 0x75, 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, + 0x11, 0x5f, 0xbc, 0xbd, 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, + 0xd2, 0x01, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, + 0x00, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, + 0x96, 0x61, 0x2d, 0x1f, 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, + 0x22, 0xf3, 0xcc, 0x38, 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x01, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xe8, 0x5e, 0x0d, 0x11, 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, + 0x7c, 0x7f, 0xec, 0xc9, 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, + 0x36, 0xef, 0x03, 0xdb, 0x03, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0xfe, 0xed, 0x5c, 0x8b, 0x1a, 0xfb, 0xae, 0x81, 0xd7, 0x13, 0xd3, 0x7f, 0xed, 0x2d, + 0x04, 0x89, 0x36, 0x6e, 0x47, 0x5d, 0x81, 0xeb, 0xcf, 0xae, 0x95, 0x2a, 0xf5, 0x99, + 0xfd, 0x3f, 0xaa, 0x7c, 0x69, 0xcf, 0xed, 0xbc, 0x69, 0xcf, 0xed, 0xbc, 0x7b, 0x3f, + 0x78, 0x1d, 0x7b, 0x3f, 0x78, 0x1d, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xf1, 0xba, 0x85, 0x9e, + 0x42, 0x15, 0x26, 0x75, 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, + 0x11, 0x5f, 0xbc, 0xbd, 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, + 0xd2, 0x01, 0x21, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, + 0x00, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, + 0x96, 0x61, 0x2d, 0x1f, 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, + 0x22, 0xf3, 0xcc, 0x38, 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x01, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xe8, 0x5e, 0x0d, 0x11, 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, + 0x7c, 0x7f, 0xec, 0xc9, 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, + 0x36, 0xef, 0x03, 0xdb, 0x03, + ], + ], + root_serialized: &[ + 0x65, 0x9a, 0xed, 0x6a, 0x3a, 0xc7, 0xc1, 0x0d, 0xed, 0xc3, 0x58, 0x41, 0xff, 0x51, + 0xf0, 0x11, 0x87, 0xef, 0x1c, 0xf0, 0x25, 0x6c, 0xce, 0x5b, 0x1b, 0xae, 0xf3, 0x79, + 0x65, 0x41, 0x4d, 0xa8, 0xdf, 0x2c, 0x5b, 0x18, 0x69, 0xcf, 0xed, 0xbc, 0x6a, 0x47, + 0x0a, 0x1d, 0x7b, 0x3f, 0x78, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xf1, 0xba, 0x85, 0x9e, + 0x42, 0x15, 0x26, 0x75, 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, + 0x11, 0x5f, 0xbc, 0xbd, 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, + 0x56, 0x06, 0xd0, 0xeb, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, + 0x96, 0x61, 0x2d, 0x1f, 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, + 0x22, 0xf3, 0xcc, 0x38, 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x25, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xe8, 0x5e, 0x0d, 0x11, 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, + 0x7c, 0x7f, 0xec, 0xc9, 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, + 0x36, 0xef, 0x03, 0xdb, 0x24, + ], + hash_chain_history_root: [ + 0x0e, 0x22, 0x80, 0x02, 0xcd, 0xa5, 0xb2, 0xe4, 0xfb, 0x36, 0xde, 0xf4, 0x1e, 0x40, + 0x68, 0xcd, 0x9b, 0x38, 0x14, 0x0c, 0x7b, 0x7d, 0x0b, 0x2b, 0x4b, 0x17, 0x4c, 0xd8, + 0x4d, 0xc9, 0x66, 0x4e, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 10, + leaf_block_hash: [ + 0x19, 0x34, 0x4d, 0x7e, 0x18, 0xf0, 0x1d, 0x2c, 0x71, 0xd1, 0x08, 0x2c, 0xbb, 0x1e, + 0x7f, 0x22, 0x7a, 0x56, 0x3d, 0xd8, 0xe5, 0xa8, 0xdb, 0xff, 0x19, 0x44, 0x45, 0xf0, + 0xc8, 0x75, 0x3d, 0xf9, + ], + leaf_time: 3341769045, + leaf_target_bits: 473998425, + leaf_sapling_root: [ + 0xf4, 0x32, 0xb9, 0x29, 0x3f, 0x80, 0x23, 0x22, 0xf3, 0xbf, 0xa2, 0x53, 0x4d, 0x4b, + 0x6d, 0x04, 0x3e, 0xd5, 0xcc, 0xd3, 0xee, 0xe9, 0x10, 0x3a, 0x59, 0x3e, 0x9f, 0x6a, + 0xfe, 0x84, 0x61, 0xf5, + ], + leaf_work: [ + 0x79, 0x8d, 0xd4, 0xf5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500009, + leaf_sapling_tx_count: 4, + leaf_orchard_root: [ + 0x3f, 0x9e, 0x05, 0x7f, 0xe3, 0x90, 0xba, 0xf8, 0x95, 0x3b, 0x07, 0x11, 0xa2, 0x4a, + 0x85, 0x8c, 0x62, 0xb0, 0xa9, 0xf3, 0x79, 0x7a, 0x5f, 0x7f, 0xd1, 0xdd, 0x3a, 0x5e, + 0x3d, 0x44, 0x31, 0xb2, + ], + leaf_orchard_tx_count: 7, + leaf_ironwood_root: [ + 0xbb, 0xe1, 0x01, 0x08, 0xe3, 0x76, 0x9d, 0x71, 0x1e, 0xc5, 0xb1, 0xf8, 0x6a, 0xe3, + 0xae, 0x5b, 0x00, 0x35, 0x0f, 0x25, 0x8c, 0x1e, 0x3d, 0x30, 0x92, 0x46, 0x06, 0x3f, + 0x4b, 0xee, 0x5c, 0xec, + ], + leaf_ironwood_tx_count: 6, + leaf_serialized: &[ + 0x19, 0x34, 0x4d, 0x7e, 0x18, 0xf0, 0x1d, 0x2c, 0x71, 0xd1, 0x08, 0x2c, 0xbb, 0x1e, + 0x7f, 0x22, 0x7a, 0x56, 0x3d, 0xd8, 0xe5, 0xa8, 0xdb, 0xff, 0x19, 0x44, 0x45, 0xf0, + 0xc8, 0x75, 0x3d, 0xf9, 0x55, 0x59, 0x2f, 0xc7, 0x55, 0x59, 0x2f, 0xc7, 0x59, 0xa4, + 0x40, 0x1c, 0x59, 0xa4, 0x40, 0x1c, 0xf4, 0x32, 0xb9, 0x29, 0x3f, 0x80, 0x23, 0x22, + 0xf3, 0xbf, 0xa2, 0x53, 0x4d, 0x4b, 0x6d, 0x04, 0x3e, 0xd5, 0xcc, 0xd3, 0xee, 0xe9, + 0x10, 0x3a, 0x59, 0x3e, 0x9f, 0x6a, 0xfe, 0x84, 0x61, 0xf5, 0xf4, 0x32, 0xb9, 0x29, + 0x3f, 0x80, 0x23, 0x22, 0xf3, 0xbf, 0xa2, 0x53, 0x4d, 0x4b, 0x6d, 0x04, 0x3e, 0xd5, + 0xcc, 0xd3, 0xee, 0xe9, 0x10, 0x3a, 0x59, 0x3e, 0x9f, 0x6a, 0xfe, 0x84, 0x61, 0xf5, + 0x79, 0x8d, 0xd4, 0xf5, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe9, 0x67, 0x35, 0x00, 0xfe, 0xe9, 0x67, 0x35, 0x00, + 0x04, 0x3f, 0x9e, 0x05, 0x7f, 0xe3, 0x90, 0xba, 0xf8, 0x95, 0x3b, 0x07, 0x11, 0xa2, + 0x4a, 0x85, 0x8c, 0x62, 0xb0, 0xa9, 0xf3, 0x79, 0x7a, 0x5f, 0x7f, 0xd1, 0xdd, 0x3a, + 0x5e, 0x3d, 0x44, 0x31, 0xb2, 0x3f, 0x9e, 0x05, 0x7f, 0xe3, 0x90, 0xba, 0xf8, 0x95, + 0x3b, 0x07, 0x11, 0xa2, 0x4a, 0x85, 0x8c, 0x62, 0xb0, 0xa9, 0xf3, 0x79, 0x7a, 0x5f, + 0x7f, 0xd1, 0xdd, 0x3a, 0x5e, 0x3d, 0x44, 0x31, 0xb2, 0x07, 0xbb, 0xe1, 0x01, 0x08, + 0xe3, 0x76, 0x9d, 0x71, 0x1e, 0xc5, 0xb1, 0xf8, 0x6a, 0xe3, 0xae, 0x5b, 0x00, 0x35, + 0x0f, 0x25, 0x8c, 0x1e, 0x3d, 0x30, 0x92, 0x46, 0x06, 0x3f, 0x4b, 0xee, 0x5c, 0xec, + 0xbb, 0xe1, 0x01, 0x08, 0xe3, 0x76, 0x9d, 0x71, 0x1e, 0xc5, 0xb1, 0xf8, 0x6a, 0xe3, + 0xae, 0x5b, 0x00, 0x35, 0x0f, 0x25, 0x8c, 0x1e, 0x3d, 0x30, 0x92, 0x46, 0x06, 0x3f, + 0x4b, 0xee, 0x5c, 0xec, 0x06, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0x02, 0x27, 0xb5, 0x3b, 0x02, 0xcb, 0xf0, 0x99, 0xee, 0xb6, 0xc6, 0x02, 0xf3, 0xdd, + 0x38, 0x7e, 0x9d, 0xb4, 0xc4, 0xdb, 0x21, 0xdc, 0x9e, 0xdf, 0x4a, 0x4c, 0x89, 0x58, + 0xb1, 0x15, 0xc1, 0xe0, 0x69, 0xcf, 0xed, 0xbc, 0x55, 0x59, 0x2f, 0xc7, 0x7b, 0x3f, + 0x78, 0x1d, 0x59, 0xa4, 0x40, 0x1c, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xf4, 0x32, 0xb9, 0x29, + 0x3f, 0x80, 0x23, 0x22, 0xf3, 0xbf, 0xa2, 0x53, 0x4d, 0x4b, 0x6d, 0x04, 0x3e, 0xd5, + 0xcc, 0xd3, 0xee, 0xe9, 0x10, 0x3a, 0x59, 0x3e, 0x9f, 0x6a, 0xfe, 0x84, 0x61, 0xf5, + 0x4b, 0x8f, 0xf5, 0xf7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xe9, 0x67, 0x35, 0x00, + 0x04, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x3f, 0x9e, 0x05, 0x7f, 0xe3, 0x90, 0xba, 0xf8, 0x95, + 0x3b, 0x07, 0x11, 0xa2, 0x4a, 0x85, 0x8c, 0x62, 0xb0, 0xa9, 0xf3, 0x79, 0x7a, 0x5f, + 0x7f, 0xd1, 0xdd, 0x3a, 0x5e, 0x3d, 0x44, 0x31, 0xb2, 0x08, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xbb, 0xe1, 0x01, 0x08, 0xe3, 0x76, 0x9d, 0x71, 0x1e, 0xc5, 0xb1, 0xf8, 0x6a, 0xe3, + 0xae, 0x5b, 0x00, 0x35, 0x0f, 0x25, 0x8c, 0x1e, 0x3d, 0x30, 0x92, 0x46, 0x06, 0x3f, + 0x4b, 0xee, 0x5c, 0xec, 0x09, + ], + ], + root_serialized: &[ + 0xb4, 0x31, 0x7b, 0x03, 0xde, 0x7f, 0xaf, 0xbf, 0xfc, 0x87, 0xb8, 0xc9, 0x23, 0xd3, + 0x53, 0xdf, 0x29, 0x0f, 0x8a, 0x0b, 0xce, 0x55, 0xdf, 0xa6, 0xab, 0x26, 0x6d, 0x71, + 0x69, 0x7c, 0x19, 0x71, 0xdf, 0x2c, 0x5b, 0x18, 0x55, 0x59, 0x2f, 0xc7, 0x6a, 0x47, + 0x0a, 0x1d, 0x59, 0xa4, 0x40, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xf4, 0x32, 0xb9, 0x29, + 0x3f, 0x80, 0x23, 0x22, 0xf3, 0xbf, 0xa2, 0x53, 0x4d, 0x4b, 0x6d, 0x04, 0x3e, 0xd5, + 0xcc, 0xd3, 0xee, 0xe9, 0x10, 0x3a, 0x59, 0x3e, 0x9f, 0x6a, 0xfe, 0x84, 0x61, 0xf5, + 0xcf, 0x93, 0xa4, 0xe1, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe9, 0x67, 0x35, 0x00, + 0x1f, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x3f, 0x9e, 0x05, 0x7f, 0xe3, 0x90, 0xba, 0xf8, 0x95, + 0x3b, 0x07, 0x11, 0xa2, 0x4a, 0x85, 0x8c, 0x62, 0xb0, 0xa9, 0xf3, 0x79, 0x7a, 0x5f, + 0x7f, 0xd1, 0xdd, 0x3a, 0x5e, 0x3d, 0x44, 0x31, 0xb2, 0x2c, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xbb, 0xe1, 0x01, 0x08, 0xe3, 0x76, 0x9d, 0x71, 0x1e, 0xc5, 0xb1, 0xf8, 0x6a, 0xe3, + 0xae, 0x5b, 0x00, 0x35, 0x0f, 0x25, 0x8c, 0x1e, 0x3d, 0x30, 0x92, 0x46, 0x06, 0x3f, + 0x4b, 0xee, 0x5c, 0xec, 0x2a, + ], + hash_chain_history_root: [ + 0x48, 0xb3, 0xde, 0xa2, 0xa3, 0xe2, 0x0f, 0xef, 0x89, 0xf9, 0xca, 0xd0, 0xe1, 0xd4, + 0xb8, 0x59, 0x0a, 0x20, 0x91, 0x27, 0xe3, 0x39, 0x5f, 0x88, 0xb9, 0xe8, 0x5f, 0x32, + 0x81, 0x42, 0x18, 0x78, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 11, + leaf_block_hash: [ + 0x6d, 0x4e, 0x50, 0x29, 0x79, 0x71, 0x6a, 0xc6, 0x71, 0xdb, 0xd9, 0xa4, 0xea, 0x30, + 0xf6, 0x72, 0x6f, 0x99, 0x79, 0x9e, 0x8d, 0x53, 0xaf, 0x99, 0xb3, 0x4c, 0x2b, 0x6f, + 0x81, 0x0e, 0xde, 0x9e, + ], + leaf_time: 3121963702, + leaf_target_bits: 492745137, + leaf_sapling_root: [ + 0x8e, 0xc9, 0x44, 0x5b, 0x3b, 0x1f, 0x04, 0x60, 0xab, 0x08, 0x31, 0x4d, 0x74, 0xea, + 0x8e, 0x98, 0xcc, 0x25, 0xd6, 0xaa, 0xc0, 0xf3, 0x70, 0xa6, 0x19, 0x13, 0xf7, 0x0e, + 0x51, 0xa7, 0x28, 0x7e, + ], + leaf_work: [ + 0xc1, 0x14, 0xb4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500010, + leaf_sapling_tx_count: 7, + leaf_orchard_root: [ + 0xf1, 0xb5, 0xe8, 0x8b, 0x02, 0x97, 0x3d, 0x56, 0x06, 0x6b, 0xf7, 0xf4, 0x7a, 0xed, + 0x4e, 0x0c, 0xf2, 0x63, 0x40, 0xf2, 0x8f, 0x75, 0xe4, 0xd1, 0x56, 0xe5, 0xf5, 0x16, + 0x4e, 0x0d, 0x39, 0xf4, + ], + leaf_orchard_tx_count: 2, + leaf_ironwood_root: [ + 0x4d, 0xb5, 0x8c, 0x0b, 0x81, 0xa1, 0x79, 0xb7, 0xa4, 0x01, 0xe9, 0x44, 0x34, 0x3b, + 0xa9, 0x5f, 0xb2, 0x28, 0x33, 0x77, 0x37, 0x78, 0xa8, 0x64, 0x99, 0xd2, 0x12, 0x95, + 0x78, 0xbf, 0x69, 0x57, + ], + leaf_ironwood_tx_count: 3, + leaf_serialized: &[ + 0x6d, 0x4e, 0x50, 0x29, 0x79, 0x71, 0x6a, 0xc6, 0x71, 0xdb, 0xd9, 0xa4, 0xea, 0x30, + 0xf6, 0x72, 0x6f, 0x99, 0x79, 0x9e, 0x8d, 0x53, 0xaf, 0x99, 0xb3, 0x4c, 0x2b, 0x6f, + 0x81, 0x0e, 0xde, 0x9e, 0xb6, 0x62, 0x15, 0xba, 0xb6, 0x62, 0x15, 0xba, 0xb1, 0xb1, + 0x5e, 0x1d, 0xb1, 0xb1, 0x5e, 0x1d, 0x8e, 0xc9, 0x44, 0x5b, 0x3b, 0x1f, 0x04, 0x60, + 0xab, 0x08, 0x31, 0x4d, 0x74, 0xea, 0x8e, 0x98, 0xcc, 0x25, 0xd6, 0xaa, 0xc0, 0xf3, + 0x70, 0xa6, 0x19, 0x13, 0xf7, 0x0e, 0x51, 0xa7, 0x28, 0x7e, 0x8e, 0xc9, 0x44, 0x5b, + 0x3b, 0x1f, 0x04, 0x60, 0xab, 0x08, 0x31, 0x4d, 0x74, 0xea, 0x8e, 0x98, 0xcc, 0x25, + 0xd6, 0xaa, 0xc0, 0xf3, 0x70, 0xa6, 0x19, 0x13, 0xf7, 0x0e, 0x51, 0xa7, 0x28, 0x7e, + 0xc1, 0x14, 0xb4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xea, 0x67, 0x35, 0x00, 0xfe, 0xea, 0x67, 0x35, 0x00, + 0x07, 0xf1, 0xb5, 0xe8, 0x8b, 0x02, 0x97, 0x3d, 0x56, 0x06, 0x6b, 0xf7, 0xf4, 0x7a, + 0xed, 0x4e, 0x0c, 0xf2, 0x63, 0x40, 0xf2, 0x8f, 0x75, 0xe4, 0xd1, 0x56, 0xe5, 0xf5, + 0x16, 0x4e, 0x0d, 0x39, 0xf4, 0xf1, 0xb5, 0xe8, 0x8b, 0x02, 0x97, 0x3d, 0x56, 0x06, + 0x6b, 0xf7, 0xf4, 0x7a, 0xed, 0x4e, 0x0c, 0xf2, 0x63, 0x40, 0xf2, 0x8f, 0x75, 0xe4, + 0xd1, 0x56, 0xe5, 0xf5, 0x16, 0x4e, 0x0d, 0x39, 0xf4, 0x02, 0x4d, 0xb5, 0x8c, 0x0b, + 0x81, 0xa1, 0x79, 0xb7, 0xa4, 0x01, 0xe9, 0x44, 0x34, 0x3b, 0xa9, 0x5f, 0xb2, 0x28, + 0x33, 0x77, 0x37, 0x78, 0xa8, 0x64, 0x99, 0xd2, 0x12, 0x95, 0x78, 0xbf, 0x69, 0x57, + 0x4d, 0xb5, 0x8c, 0x0b, 0x81, 0xa1, 0x79, 0xb7, 0xa4, 0x01, 0xe9, 0x44, 0x34, 0x3b, + 0xa9, 0x5f, 0xb2, 0x28, 0x33, 0x77, 0x37, 0x78, 0xa8, 0x64, 0x99, 0xd2, 0x12, 0x95, + 0x78, 0xbf, 0x69, 0x57, 0x03, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0x02, 0x27, 0xb5, 0x3b, 0x02, 0xcb, 0xf0, 0x99, 0xee, 0xb6, 0xc6, 0x02, 0xf3, 0xdd, + 0x38, 0x7e, 0x9d, 0xb4, 0xc4, 0xdb, 0x21, 0xdc, 0x9e, 0xdf, 0x4a, 0x4c, 0x89, 0x58, + 0xb1, 0x15, 0xc1, 0xe0, 0x69, 0xcf, 0xed, 0xbc, 0x55, 0x59, 0x2f, 0xc7, 0x7b, 0x3f, + 0x78, 0x1d, 0x59, 0xa4, 0x40, 0x1c, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xf4, 0x32, 0xb9, 0x29, + 0x3f, 0x80, 0x23, 0x22, 0xf3, 0xbf, 0xa2, 0x53, 0x4d, 0x4b, 0x6d, 0x04, 0x3e, 0xd5, + 0xcc, 0xd3, 0xee, 0xe9, 0x10, 0x3a, 0x59, 0x3e, 0x9f, 0x6a, 0xfe, 0x84, 0x61, 0xf5, + 0x4b, 0x8f, 0xf5, 0xf7, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xe9, 0x67, 0x35, 0x00, + 0x04, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x3f, 0x9e, 0x05, 0x7f, 0xe3, 0x90, 0xba, 0xf8, 0x95, + 0x3b, 0x07, 0x11, 0xa2, 0x4a, 0x85, 0x8c, 0x62, 0xb0, 0xa9, 0xf3, 0x79, 0x7a, 0x5f, + 0x7f, 0xd1, 0xdd, 0x3a, 0x5e, 0x3d, 0x44, 0x31, 0xb2, 0x08, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xbb, 0xe1, 0x01, 0x08, 0xe3, 0x76, 0x9d, 0x71, 0x1e, 0xc5, 0xb1, 0xf8, 0x6a, 0xe3, + 0xae, 0x5b, 0x00, 0x35, 0x0f, 0x25, 0x8c, 0x1e, 0x3d, 0x30, 0x92, 0x46, 0x06, 0x3f, + 0x4b, 0xee, 0x5c, 0xec, 0x09, + ], + &[ + 0x6d, 0x4e, 0x50, 0x29, 0x79, 0x71, 0x6a, 0xc6, 0x71, 0xdb, 0xd9, 0xa4, 0xea, 0x30, + 0xf6, 0x72, 0x6f, 0x99, 0x79, 0x9e, 0x8d, 0x53, 0xaf, 0x99, 0xb3, 0x4c, 0x2b, 0x6f, + 0x81, 0x0e, 0xde, 0x9e, 0xb6, 0x62, 0x15, 0xba, 0xb6, 0x62, 0x15, 0xba, 0xb1, 0xb1, + 0x5e, 0x1d, 0xb1, 0xb1, 0x5e, 0x1d, 0x8e, 0xc9, 0x44, 0x5b, 0x3b, 0x1f, 0x04, 0x60, + 0xab, 0x08, 0x31, 0x4d, 0x74, 0xea, 0x8e, 0x98, 0xcc, 0x25, 0xd6, 0xaa, 0xc0, 0xf3, + 0x70, 0xa6, 0x19, 0x13, 0xf7, 0x0e, 0x51, 0xa7, 0x28, 0x7e, 0x8e, 0xc9, 0x44, 0x5b, + 0x3b, 0x1f, 0x04, 0x60, 0xab, 0x08, 0x31, 0x4d, 0x74, 0xea, 0x8e, 0x98, 0xcc, 0x25, + 0xd6, 0xaa, 0xc0, 0xf3, 0x70, 0xa6, 0x19, 0x13, 0xf7, 0x0e, 0x51, 0xa7, 0x28, 0x7e, + 0xc1, 0x14, 0xb4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xea, 0x67, 0x35, 0x00, 0xfe, 0xea, 0x67, 0x35, 0x00, + 0x07, 0xf1, 0xb5, 0xe8, 0x8b, 0x02, 0x97, 0x3d, 0x56, 0x06, 0x6b, 0xf7, 0xf4, 0x7a, + 0xed, 0x4e, 0x0c, 0xf2, 0x63, 0x40, 0xf2, 0x8f, 0x75, 0xe4, 0xd1, 0x56, 0xe5, 0xf5, + 0x16, 0x4e, 0x0d, 0x39, 0xf4, 0xf1, 0xb5, 0xe8, 0x8b, 0x02, 0x97, 0x3d, 0x56, 0x06, + 0x6b, 0xf7, 0xf4, 0x7a, 0xed, 0x4e, 0x0c, 0xf2, 0x63, 0x40, 0xf2, 0x8f, 0x75, 0xe4, + 0xd1, 0x56, 0xe5, 0xf5, 0x16, 0x4e, 0x0d, 0x39, 0xf4, 0x02, 0x4d, 0xb5, 0x8c, 0x0b, + 0x81, 0xa1, 0x79, 0xb7, 0xa4, 0x01, 0xe9, 0x44, 0x34, 0x3b, 0xa9, 0x5f, 0xb2, 0x28, + 0x33, 0x77, 0x37, 0x78, 0xa8, 0x64, 0x99, 0xd2, 0x12, 0x95, 0x78, 0xbf, 0x69, 0x57, + 0x4d, 0xb5, 0x8c, 0x0b, 0x81, 0xa1, 0x79, 0xb7, 0xa4, 0x01, 0xe9, 0x44, 0x34, 0x3b, + 0xa9, 0x5f, 0xb2, 0x28, 0x33, 0x77, 0x37, 0x78, 0xa8, 0x64, 0x99, 0xd2, 0x12, 0x95, + 0x78, 0xbf, 0x69, 0x57, 0x03, + ], + ], + root_serialized: &[ + 0xca, 0xbb, 0xbf, 0xfb, 0xc5, 0x80, 0x41, 0xb8, 0x07, 0x1a, 0x2a, 0x9b, 0x4c, 0x92, + 0x7d, 0x8b, 0x5e, 0xcf, 0x68, 0x98, 0xbb, 0x28, 0x3d, 0xd7, 0x96, 0xa6, 0xa4, 0xdb, + 0xd3, 0x59, 0x59, 0x9c, 0xdf, 0x2c, 0x5b, 0x18, 0xb6, 0x62, 0x15, 0xba, 0x6a, 0x47, + 0x0a, 0x1d, 0xb1, 0xb1, 0x5e, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x8e, 0xc9, 0x44, 0x5b, + 0x3b, 0x1f, 0x04, 0x60, 0xab, 0x08, 0x31, 0x4d, 0x74, 0xea, 0x8e, 0x98, 0xcc, 0x25, + 0xd6, 0xaa, 0xc0, 0xf3, 0x70, 0xa6, 0x19, 0x13, 0xf7, 0x0e, 0x51, 0xa7, 0x28, 0x7e, + 0x90, 0xa8, 0x58, 0xe4, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xea, 0x67, 0x35, 0x00, + 0x26, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xf1, 0xb5, 0xe8, 0x8b, 0x02, 0x97, 0x3d, 0x56, 0x06, + 0x6b, 0xf7, 0xf4, 0x7a, 0xed, 0x4e, 0x0c, 0xf2, 0x63, 0x40, 0xf2, 0x8f, 0x75, 0xe4, + 0xd1, 0x56, 0xe5, 0xf5, 0x16, 0x4e, 0x0d, 0x39, 0xf4, 0x2e, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x4d, 0xb5, 0x8c, 0x0b, 0x81, 0xa1, 0x79, 0xb7, 0xa4, 0x01, 0xe9, 0x44, 0x34, 0x3b, + 0xa9, 0x5f, 0xb2, 0x28, 0x33, 0x77, 0x37, 0x78, 0xa8, 0x64, 0x99, 0xd2, 0x12, 0x95, + 0x78, 0xbf, 0x69, 0x57, 0x2d, + ], + hash_chain_history_root: [ + 0xc7, 0x3c, 0xca, 0x1c, 0x9f, 0x43, 0x91, 0xf8, 0x7b, 0xa0, 0x3c, 0x63, 0x62, 0xfa, + 0x36, 0xec, 0x94, 0x8b, 0x62, 0xc1, 0x8d, 0x96, 0x49, 0x5e, 0x2e, 0xef, 0xd2, 0xdb, + 0xe3, 0x66, 0xca, 0x98, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 12, + leaf_block_hash: [ + 0x63, 0x66, 0x22, 0xea, 0xee, 0xfe, 0x13, 0x25, 0x9e, 0x15, 0x18, 0x3b, 0x93, 0x91, + 0x08, 0x41, 0xec, 0x43, 0x64, 0xc7, 0xe6, 0x22, 0xe3, 0xd4, 0x6a, 0xe5, 0x16, 0xac, + 0xbb, 0x1d, 0x83, 0xa2, + ], + leaf_time: 2163916852, + leaf_target_bits: 506228691, + leaf_sapling_root: [ + 0xdd, 0x95, 0x0d, 0x40, 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, + 0xf1, 0x96, 0xa0, 0x46, 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, + 0xdd, 0x54, 0xe6, 0x3f, + ], + leaf_work: [ + 0xd0, 0xc2, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500011, + leaf_sapling_tx_count: 0, + leaf_orchard_root: [ + 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, 0x97, 0x95, 0xc4, 0xb2, 0x47, + 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, 0x3b, 0x36, 0x0c, 0x62, 0xd2, + 0x58, 0x95, 0x5d, 0x3a, + ], + leaf_orchard_tx_count: 2, + leaf_ironwood_root: [ + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, + ], + leaf_ironwood_tx_count: 4, + leaf_serialized: &[ + 0x63, 0x66, 0x22, 0xea, 0xee, 0xfe, 0x13, 0x25, 0x9e, 0x15, 0x18, 0x3b, 0x93, 0x91, + 0x08, 0x41, 0xec, 0x43, 0x64, 0xc7, 0xe6, 0x22, 0xe3, 0xd4, 0x6a, 0xe5, 0x16, 0xac, + 0xbb, 0x1d, 0x83, 0xa2, 0x34, 0xc0, 0xfa, 0x80, 0x34, 0xc0, 0xfa, 0x80, 0xd3, 0x6f, + 0x2c, 0x1e, 0xd3, 0x6f, 0x2c, 0x1e, 0xdd, 0x95, 0x0d, 0x40, 0x90, 0x67, 0x02, 0x67, + 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, 0x2a, 0xe6, 0xc4, 0xb8, + 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, 0xdd, 0x95, 0x0d, 0x40, + 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, + 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, + 0xd0, 0xc2, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, + 0x00, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, 0x97, 0x95, 0xc4, 0xb2, + 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, 0x3b, 0x36, 0x0c, 0x62, + 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, + 0x97, 0x95, 0xc4, 0xb2, 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, + 0x3b, 0x36, 0x0c, 0x62, 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x02, 0xed, 0x25, 0x06, 0x93, + 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, 0x0b, 0xd5, 0xbd, 0xcd, + 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, 0xb8, 0x5e, 0x38, 0x97, + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, 0x04, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0xd7, 0x2d, 0x05, 0xdf, 0xc2, 0xfe, 0x3c, 0x0f, 0xd2, 0x9e, 0xa4, 0xb0, 0x99, 0x5c, + 0xc0, 0x87, 0xd0, 0x91, 0x8d, 0x0e, 0x87, 0xb1, 0x34, 0x07, 0x4e, 0x55, 0x88, 0xbd, + 0xa6, 0xef, 0xe4, 0x95, 0x69, 0xcf, 0xed, 0xbc, 0x34, 0xc0, 0xfa, 0x80, 0x7b, 0x3f, + 0x78, 0x1d, 0xd3, 0x6f, 0x2c, 0x1e, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xdd, 0x95, 0x0d, 0x40, + 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, + 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, + 0xdc, 0x66, 0xaf, 0xfa, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, + 0x0b, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, + 0x97, 0x95, 0xc4, 0xb2, 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, + 0x3b, 0x36, 0x0c, 0x62, 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x0c, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, 0x10, + ], + ], + root_serialized: &[ + 0xb4, 0xde, 0xd8, 0x70, 0x80, 0x86, 0xe5, 0x7c, 0xd9, 0xe4, 0x01, 0xe6, 0x5e, 0x33, + 0xa9, 0x95, 0x35, 0xfe, 0x74, 0xae, 0x28, 0x18, 0xf6, 0x90, 0xbd, 0xe6, 0xa7, 0xa6, + 0xb8, 0x36, 0x5b, 0xe3, 0xdf, 0x2c, 0x5b, 0x18, 0x34, 0xc0, 0xfa, 0x80, 0x6a, 0x47, + 0x0a, 0x1d, 0xd3, 0x6f, 0x2c, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0xdd, 0x95, 0x0d, 0x40, + 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, + 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, + 0x60, 0x6b, 0x5e, 0xe4, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, + 0x26, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, + 0x97, 0x95, 0xc4, 0xb2, 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, + 0x3b, 0x36, 0x0c, 0x62, 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x30, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, 0x31, + ], + hash_chain_history_root: [ + 0x5e, 0x4a, 0xc7, 0x1c, 0xb4, 0x5f, 0xd0, 0x00, 0x12, 0x56, 0x83, 0x04, 0xc0, 0x39, + 0x7a, 0x49, 0x48, 0xa3, 0xf5, 0xbe, 0xc7, 0xbf, 0xa6, 0x0f, 0x8f, 0xcb, 0x2e, 0xb2, + 0xdc, 0x83, 0x26, 0x69, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 13, + leaf_block_hash: [ + 0x5b, 0xea, 0xca, 0x7e, 0xfd, 0x86, 0xf0, 0xaa, 0x33, 0xf1, 0x4d, 0x57, 0x0f, 0xa2, + 0xe7, 0x1a, 0xfe, 0x1b, 0xec, 0x7a, 0xf9, 0x96, 0xd5, 0xb1, 0xba, 0xb7, 0x9c, 0x02, + 0x6e, 0x04, 0xb9, 0x12, + ], + leaf_time: 2603962213, + leaf_target_bits: 492342936, + leaf_sapling_root: [ + 0x7d, 0x7e, 0x18, 0x55, 0x88, 0x1d, 0x76, 0x32, 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, + 0x63, 0xb0, 0x08, 0x14, 0x3b, 0xe3, 0x83, 0x4d, 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, + 0x68, 0xa3, 0xb6, 0x44, + ], + leaf_work: [ + 0x07, 0x0b, 0xe4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500012, + leaf_sapling_tx_count: 4, + leaf_orchard_root: [ + 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, 0xf1, 0xf2, 0x7d, 0xca, 0x48, + 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, 0x1a, 0xb3, 0x04, 0x2b, 0x0b, + 0xad, 0xf6, 0xc4, 0xcd, + ], + leaf_orchard_tx_count: 0, + leaf_ironwood_root: [ + 0x91, 0xe2, 0xba, 0x52, 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, + 0x77, 0xd8, 0x3d, 0x2a, 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, + 0xab, 0x40, 0xdc, 0xdd, + ], + leaf_ironwood_tx_count: 7, + leaf_serialized: &[ + 0x5b, 0xea, 0xca, 0x7e, 0xfd, 0x86, 0xf0, 0xaa, 0x33, 0xf1, 0x4d, 0x57, 0x0f, 0xa2, + 0xe7, 0x1a, 0xfe, 0x1b, 0xec, 0x7a, 0xf9, 0x96, 0xd5, 0xb1, 0xba, 0xb7, 0x9c, 0x02, + 0x6e, 0x04, 0xb9, 0x12, 0x65, 0x4f, 0x35, 0x9b, 0x65, 0x4f, 0x35, 0x9b, 0x98, 0x8e, + 0x58, 0x1d, 0x98, 0x8e, 0x58, 0x1d, 0x7d, 0x7e, 0x18, 0x55, 0x88, 0x1d, 0x76, 0x32, + 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, 0x3b, 0xe3, 0x83, 0x4d, + 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, 0x7d, 0x7e, 0x18, 0x55, + 0x88, 0x1d, 0x76, 0x32, 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, + 0x3b, 0xe3, 0x83, 0x4d, 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, + 0x07, 0x0b, 0xe4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, + 0x04, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, 0xf1, 0xf2, 0x7d, 0xca, + 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, 0x1a, 0xb3, 0x04, 0x2b, + 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, + 0xf1, 0xf2, 0x7d, 0xca, 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, + 0x1a, 0xb3, 0x04, 0x2b, 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x00, 0x91, 0xe2, 0xba, 0x52, + 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, 0x77, 0xd8, 0x3d, 0x2a, + 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, 0xab, 0x40, 0xdc, 0xdd, + 0x91, 0xe2, 0xba, 0x52, 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, + 0x77, 0xd8, 0x3d, 0x2a, 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, + 0xab, 0x40, 0xdc, 0xdd, 0x07, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0xd7, 0x2d, 0x05, 0xdf, 0xc2, 0xfe, 0x3c, 0x0f, 0xd2, 0x9e, 0xa4, 0xb0, 0x99, 0x5c, + 0xc0, 0x87, 0xd0, 0x91, 0x8d, 0x0e, 0x87, 0xb1, 0x34, 0x07, 0x4e, 0x55, 0x88, 0xbd, + 0xa6, 0xef, 0xe4, 0x95, 0x69, 0xcf, 0xed, 0xbc, 0x34, 0xc0, 0xfa, 0x80, 0x7b, 0x3f, + 0x78, 0x1d, 0xd3, 0x6f, 0x2c, 0x1e, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xdd, 0x95, 0x0d, 0x40, + 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, + 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, + 0xdc, 0x66, 0xaf, 0xfa, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, + 0x0b, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, + 0x97, 0x95, 0xc4, 0xb2, 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, + 0x3b, 0x36, 0x0c, 0x62, 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x0c, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, 0x10, + ], + &[ + 0x5b, 0xea, 0xca, 0x7e, 0xfd, 0x86, 0xf0, 0xaa, 0x33, 0xf1, 0x4d, 0x57, 0x0f, 0xa2, + 0xe7, 0x1a, 0xfe, 0x1b, 0xec, 0x7a, 0xf9, 0x96, 0xd5, 0xb1, 0xba, 0xb7, 0x9c, 0x02, + 0x6e, 0x04, 0xb9, 0x12, 0x65, 0x4f, 0x35, 0x9b, 0x65, 0x4f, 0x35, 0x9b, 0x98, 0x8e, + 0x58, 0x1d, 0x98, 0x8e, 0x58, 0x1d, 0x7d, 0x7e, 0x18, 0x55, 0x88, 0x1d, 0x76, 0x32, + 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, 0x3b, 0xe3, 0x83, 0x4d, + 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, 0x7d, 0x7e, 0x18, 0x55, + 0x88, 0x1d, 0x76, 0x32, 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, + 0x3b, 0xe3, 0x83, 0x4d, 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, + 0x07, 0x0b, 0xe4, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, + 0x04, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, 0xf1, 0xf2, 0x7d, 0xca, + 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, 0x1a, 0xb3, 0x04, 0x2b, + 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, + 0xf1, 0xf2, 0x7d, 0xca, 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, + 0x1a, 0xb3, 0x04, 0x2b, 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x00, 0x91, 0xe2, 0xba, 0x52, + 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, 0x77, 0xd8, 0x3d, 0x2a, + 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, 0xab, 0x40, 0xdc, 0xdd, + 0x91, 0xe2, 0xba, 0x52, 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, + 0x77, 0xd8, 0x3d, 0x2a, 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, + 0xab, 0x40, 0xdc, 0xdd, 0x07, + ], + ], + root_serialized: &[ + 0x04, 0xb9, 0x12, 0x93, 0x31, 0x7e, 0xde, 0x11, 0x47, 0x0c, 0xcb, 0xbf, 0x88, 0x92, + 0xbe, 0x78, 0x06, 0x4b, 0x15, 0x2a, 0x7b, 0x15, 0xef, 0x72, 0x8e, 0x55, 0xb7, 0x03, + 0x3b, 0x35, 0x13, 0x17, 0xdf, 0x2c, 0x5b, 0x18, 0x65, 0x4f, 0x35, 0x9b, 0x6a, 0x47, + 0x0a, 0x1d, 0x98, 0x8e, 0x58, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x7d, 0x7e, 0x18, 0x55, + 0x88, 0x1d, 0x76, 0x32, 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, + 0x3b, 0xe3, 0x83, 0x4d, 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, + 0x67, 0x76, 0x42, 0xe7, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, + 0x2a, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, + 0xf1, 0xf2, 0x7d, 0xca, 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, + 0x1a, 0xb3, 0x04, 0x2b, 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x30, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x91, 0xe2, 0xba, 0x52, 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, + 0x77, 0xd8, 0x3d, 0x2a, 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, + 0xab, 0x40, 0xdc, 0xdd, 0x38, + ], + hash_chain_history_root: [ + 0x32, 0x05, 0x02, 0x31, 0x7b, 0x44, 0x57, 0x33, 0x7d, 0x2e, 0x47, 0x6b, 0x82, 0x70, + 0x34, 0x47, 0x56, 0xf5, 0xc6, 0x39, 0xb2, 0x98, 0xdb, 0x81, 0x95, 0x99, 0x6b, 0xe4, + 0xa4, 0x76, 0xdd, 0x26, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 14, + leaf_block_hash: [ + 0xa9, 0x70, 0xf3, 0xc2, 0xf7, 0xf7, 0xe6, 0x72, 0xfa, 0xd8, 0x05, 0xba, 0x8a, 0xf9, + 0x69, 0xea, 0x7a, 0x50, 0x63, 0x9a, 0xdc, 0x44, 0x02, 0xb5, 0xce, 0xb0, 0x18, 0x27, + 0x21, 0x4a, 0x35, 0x5e, + ], + leaf_time: 1366511667, + leaf_target_bits: 494322770, + leaf_sapling_root: [ + 0x9c, 0xf0, 0x73, 0x6b, 0x68, 0x56, 0x09, 0x60, 0x03, 0xe3, 0x3b, 0xf8, 0x53, 0xa1, + 0xac, 0x28, 0xcb, 0x73, 0x36, 0x0c, 0x38, 0x33, 0xca, 0x49, 0x6d, 0xf5, 0x12, 0x00, + 0x2d, 0x59, 0x9f, 0x08, + ], + leaf_work: [ + 0xbe, 0xcd, 0x27, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500013, + leaf_sapling_tx_count: 4, + leaf_orchard_root: [ + 0x93, 0xb9, 0xec, 0xe9, 0xe5, 0x87, 0x98, 0x9a, 0x22, 0x5b, 0xce, 0x4f, 0xe9, 0xa8, + 0xf8, 0x9d, 0xbf, 0xa6, 0xbf, 0xcc, 0xe1, 0x74, 0x04, 0x55, 0xc8, 0x6c, 0xd2, 0x08, + 0x3b, 0x6a, 0xa3, 0x34, + ], + leaf_orchard_tx_count: 0, + leaf_ironwood_root: [ + 0xba, 0x21, 0xfb, 0xf1, 0x70, 0x25, 0xe1, 0x5c, 0x33, 0x09, 0x3e, 0x74, 0x87, 0x2e, + 0xf1, 0xa8, 0xc5, 0x06, 0xdf, 0xc4, 0x7b, 0xc0, 0xcf, 0x28, 0xe5, 0x21, 0xdf, 0x73, + 0xce, 0x0d, 0x5d, 0x4a, + ], + leaf_ironwood_tx_count: 0, + leaf_serialized: &[ + 0xa9, 0x70, 0xf3, 0xc2, 0xf7, 0xf7, 0xe6, 0x72, 0xfa, 0xd8, 0x05, 0xba, 0x8a, 0xf9, + 0x69, 0xea, 0x7a, 0x50, 0x63, 0x9a, 0xdc, 0x44, 0x02, 0xb5, 0xce, 0xb0, 0x18, 0x27, + 0x21, 0x4a, 0x35, 0x5e, 0x33, 0x50, 0x73, 0x51, 0x33, 0x50, 0x73, 0x51, 0x52, 0xc4, + 0x76, 0x1d, 0x52, 0xc4, 0x76, 0x1d, 0x9c, 0xf0, 0x73, 0x6b, 0x68, 0x56, 0x09, 0x60, + 0x03, 0xe3, 0x3b, 0xf8, 0x53, 0xa1, 0xac, 0x28, 0xcb, 0x73, 0x36, 0x0c, 0x38, 0x33, + 0xca, 0x49, 0x6d, 0xf5, 0x12, 0x00, 0x2d, 0x59, 0x9f, 0x08, 0x9c, 0xf0, 0x73, 0x6b, + 0x68, 0x56, 0x09, 0x60, 0x03, 0xe3, 0x3b, 0xf8, 0x53, 0xa1, 0xac, 0x28, 0xcb, 0x73, + 0x36, 0x0c, 0x38, 0x33, 0xca, 0x49, 0x6d, 0xf5, 0x12, 0x00, 0x2d, 0x59, 0x9f, 0x08, + 0xbe, 0xcd, 0x27, 0x02, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xed, 0x67, 0x35, 0x00, 0xfe, 0xed, 0x67, 0x35, 0x00, + 0x04, 0x93, 0xb9, 0xec, 0xe9, 0xe5, 0x87, 0x98, 0x9a, 0x22, 0x5b, 0xce, 0x4f, 0xe9, + 0xa8, 0xf8, 0x9d, 0xbf, 0xa6, 0xbf, 0xcc, 0xe1, 0x74, 0x04, 0x55, 0xc8, 0x6c, 0xd2, + 0x08, 0x3b, 0x6a, 0xa3, 0x34, 0x93, 0xb9, 0xec, 0xe9, 0xe5, 0x87, 0x98, 0x9a, 0x22, + 0x5b, 0xce, 0x4f, 0xe9, 0xa8, 0xf8, 0x9d, 0xbf, 0xa6, 0xbf, 0xcc, 0xe1, 0x74, 0x04, + 0x55, 0xc8, 0x6c, 0xd2, 0x08, 0x3b, 0x6a, 0xa3, 0x34, 0x00, 0xba, 0x21, 0xfb, 0xf1, + 0x70, 0x25, 0xe1, 0x5c, 0x33, 0x09, 0x3e, 0x74, 0x87, 0x2e, 0xf1, 0xa8, 0xc5, 0x06, + 0xdf, 0xc4, 0x7b, 0xc0, 0xcf, 0x28, 0xe5, 0x21, 0xdf, 0x73, 0xce, 0x0d, 0x5d, 0x4a, + 0xba, 0x21, 0xfb, 0xf1, 0x70, 0x25, 0xe1, 0x5c, 0x33, 0x09, 0x3e, 0x74, 0x87, 0x2e, + 0xf1, 0xa8, 0xc5, 0x06, 0xdf, 0xc4, 0x7b, 0xc0, 0xcf, 0x28, 0xe5, 0x21, 0xdf, 0x73, + 0xce, 0x0d, 0x5d, 0x4a, 0x00, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0xd7, 0x2d, 0x05, 0xdf, 0xc2, 0xfe, 0x3c, 0x0f, 0xd2, 0x9e, 0xa4, 0xb0, 0x99, 0x5c, + 0xc0, 0x87, 0xd0, 0x91, 0x8d, 0x0e, 0x87, 0xb1, 0x34, 0x07, 0x4e, 0x55, 0x88, 0xbd, + 0xa6, 0xef, 0xe4, 0x95, 0x69, 0xcf, 0xed, 0xbc, 0x34, 0xc0, 0xfa, 0x80, 0x7b, 0x3f, + 0x78, 0x1d, 0xd3, 0x6f, 0x2c, 0x1e, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xdd, 0x95, 0x0d, 0x40, + 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, + 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, + 0xdc, 0x66, 0xaf, 0xfa, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, + 0x0b, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, + 0x97, 0x95, 0xc4, 0xb2, 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, + 0x3b, 0x36, 0x0c, 0x62, 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x0c, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, 0x10, + ], + &[ + 0x28, 0xd1, 0x6b, 0x90, 0x8f, 0xe8, 0x99, 0x9d, 0x8c, 0x45, 0x8b, 0x8b, 0x57, 0x54, + 0x45, 0x3c, 0x2f, 0x3e, 0xa3, 0xcb, 0x16, 0xf6, 0x37, 0xe0, 0x40, 0xd7, 0x81, 0xbe, + 0x26, 0x5b, 0x1a, 0x66, 0x65, 0x4f, 0x35, 0x9b, 0x33, 0x50, 0x73, 0x51, 0x98, 0x8e, + 0x58, 0x1d, 0x52, 0xc4, 0x76, 0x1d, 0x7d, 0x7e, 0x18, 0x55, 0x88, 0x1d, 0x76, 0x32, + 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, 0x3b, 0xe3, 0x83, 0x4d, + 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, 0x9c, 0xf0, 0x73, 0x6b, + 0x68, 0x56, 0x09, 0x60, 0x03, 0xe3, 0x3b, 0xf8, 0x53, 0xa1, 0xac, 0x28, 0xcb, 0x73, + 0x36, 0x0c, 0x38, 0x33, 0xca, 0x49, 0x6d, 0xf5, 0x12, 0x00, 0x2d, 0x59, 0x9f, 0x08, + 0xc5, 0xd8, 0x0b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, 0xfe, 0xed, 0x67, 0x35, 0x00, + 0x08, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, 0xf1, 0xf2, 0x7d, 0xca, + 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, 0x1a, 0xb3, 0x04, 0x2b, + 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x93, 0xb9, 0xec, 0xe9, 0xe5, 0x87, 0x98, 0x9a, 0x22, + 0x5b, 0xce, 0x4f, 0xe9, 0xa8, 0xf8, 0x9d, 0xbf, 0xa6, 0xbf, 0xcc, 0xe1, 0x74, 0x04, + 0x55, 0xc8, 0x6c, 0xd2, 0x08, 0x3b, 0x6a, 0xa3, 0x34, 0x00, 0x91, 0xe2, 0xba, 0x52, + 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, 0x77, 0xd8, 0x3d, 0x2a, + 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, 0xab, 0x40, 0xdc, 0xdd, + 0xba, 0x21, 0xfb, 0xf1, 0x70, 0x25, 0xe1, 0x5c, 0x33, 0x09, 0x3e, 0x74, 0x87, 0x2e, + 0xf1, 0xa8, 0xc5, 0x06, 0xdf, 0xc4, 0x7b, 0xc0, 0xcf, 0x28, 0xe5, 0x21, 0xdf, 0x73, + 0xce, 0x0d, 0x5d, 0x4a, 0x07, + ], + ], + root_serialized: &[ + 0xa8, 0x21, 0xa1, 0xdf, 0xb7, 0x64, 0x42, 0x22, 0xa2, 0x2e, 0xb8, 0xd2, 0xc1, 0xaa, + 0x5b, 0xbc, 0x1a, 0x15, 0x82, 0x20, 0xb7, 0x32, 0x6f, 0x4a, 0x09, 0x3f, 0x86, 0x15, + 0x47, 0x45, 0x3a, 0x62, 0xdf, 0x2c, 0x5b, 0x18, 0x33, 0x50, 0x73, 0x51, 0x6a, 0x47, + 0x0a, 0x1d, 0x52, 0xc4, 0x76, 0x1d, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x9c, 0xf0, 0x73, 0x6b, + 0x68, 0x56, 0x09, 0x60, 0x03, 0xe3, 0x3b, 0xf8, 0x53, 0xa1, 0xac, 0x28, 0xcb, 0x73, + 0x36, 0x0c, 0x38, 0x33, 0xca, 0x49, 0x6d, 0xf5, 0x12, 0x00, 0x2d, 0x59, 0x9f, 0x08, + 0x25, 0x44, 0x6a, 0xe9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xed, 0x67, 0x35, 0x00, + 0x2e, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x93, 0xb9, 0xec, 0xe9, 0xe5, 0x87, 0x98, 0x9a, 0x22, + 0x5b, 0xce, 0x4f, 0xe9, 0xa8, 0xf8, 0x9d, 0xbf, 0xa6, 0xbf, 0xcc, 0xe1, 0x74, 0x04, + 0x55, 0xc8, 0x6c, 0xd2, 0x08, 0x3b, 0x6a, 0xa3, 0x34, 0x30, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xba, 0x21, 0xfb, 0xf1, 0x70, 0x25, 0xe1, 0x5c, 0x33, 0x09, 0x3e, 0x74, 0x87, 0x2e, + 0xf1, 0xa8, 0xc5, 0x06, 0xdf, 0xc4, 0x7b, 0xc0, 0xcf, 0x28, 0xe5, 0x21, 0xdf, 0x73, + 0xce, 0x0d, 0x5d, 0x4a, 0x38, + ], + hash_chain_history_root: [ + 0xe3, 0x5f, 0xad, 0x49, 0x2e, 0x69, 0x82, 0xfe, 0x2b, 0xca, 0x17, 0x73, 0x76, 0xb3, + 0x49, 0xe0, 0x20, 0x65, 0x76, 0x93, 0x66, 0x6e, 0x6a, 0x27, 0x1d, 0x12, 0x9a, 0x2a, + 0xdb, 0xd3, 0xe6, 0xbf, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 15, + leaf_block_hash: [ + 0xcf, 0x74, 0xf2, 0xfa, 0xbf, 0x4e, 0x82, 0xa4, 0xcf, 0x4d, 0x40, 0x23, 0x6e, 0x70, + 0x89, 0xd6, 0x16, 0x62, 0x5f, 0x19, 0xf4, 0x70, 0x38, 0x23, 0xb2, 0x5c, 0x30, 0xcd, + 0xe7, 0xde, 0x0a, 0x81, + ], + leaf_time: 4148338162, + leaf_target_bits: 504647565, + leaf_sapling_root: [ + 0x52, 0xa0, 0x2c, 0x99, 0x44, 0x16, 0x92, 0x8b, 0x4c, 0x88, 0x42, 0x45, 0x7e, 0xfa, + 0x51, 0x3d, 0x2a, 0xb2, 0xeb, 0x58, 0x50, 0xf0, 0xa0, 0x9b, 0xed, 0x08, 0x54, 0xcf, + 0xf4, 0x8b, 0xee, 0xa0, + ], + leaf_work: [ + 0xaa, 0x9a, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500014, + leaf_sapling_tx_count: 2, + leaf_orchard_root: [ + 0xa9, 0x8f, 0x60, 0x53, 0x4f, 0xc6, 0xd8, 0x79, 0x2f, 0x03, 0x86, 0xe8, 0xec, 0x75, + 0xc3, 0x98, 0x1a, 0x9a, 0x7e, 0x7c, 0x3e, 0xf2, 0x83, 0x4f, 0x96, 0x48, 0xfd, 0xa4, + 0x57, 0x0e, 0xb6, 0xed, + ], + leaf_orchard_tx_count: 2, + leaf_ironwood_root: [ + 0xfb, 0x0a, 0xc3, 0xa9, 0xc3, 0x16, 0x40, 0x6b, 0xb7, 0xad, 0x67, 0x4d, 0x67, 0xe6, + 0x5b, 0x4e, 0x16, 0xb6, 0x43, 0xf7, 0xf4, 0x0f, 0xe0, 0x05, 0x98, 0x63, 0x47, 0x68, + 0xd2, 0x0e, 0x36, 0x50, + ], + leaf_ironwood_tx_count: 3, + leaf_serialized: &[ + 0xcf, 0x74, 0xf2, 0xfa, 0xbf, 0x4e, 0x82, 0xa4, 0xcf, 0x4d, 0x40, 0x23, 0x6e, 0x70, + 0x89, 0xd6, 0x16, 0x62, 0x5f, 0x19, 0xf4, 0x70, 0x38, 0x23, 0xb2, 0x5c, 0x30, 0xcd, + 0xe7, 0xde, 0x0a, 0x81, 0xf2, 0x9d, 0x42, 0xf7, 0xf2, 0x9d, 0x42, 0xf7, 0x8d, 0x4f, + 0x14, 0x1e, 0x8d, 0x4f, 0x14, 0x1e, 0x52, 0xa0, 0x2c, 0x99, 0x44, 0x16, 0x92, 0x8b, + 0x4c, 0x88, 0x42, 0x45, 0x7e, 0xfa, 0x51, 0x3d, 0x2a, 0xb2, 0xeb, 0x58, 0x50, 0xf0, + 0xa0, 0x9b, 0xed, 0x08, 0x54, 0xcf, 0xf4, 0x8b, 0xee, 0xa0, 0x52, 0xa0, 0x2c, 0x99, + 0x44, 0x16, 0x92, 0x8b, 0x4c, 0x88, 0x42, 0x45, 0x7e, 0xfa, 0x51, 0x3d, 0x2a, 0xb2, + 0xeb, 0x58, 0x50, 0xf0, 0xa0, 0x9b, 0xed, 0x08, 0x54, 0xcf, 0xf4, 0x8b, 0xee, 0xa0, + 0xaa, 0x9a, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xee, 0x67, 0x35, 0x00, 0xfe, 0xee, 0x67, 0x35, 0x00, + 0x02, 0xa9, 0x8f, 0x60, 0x53, 0x4f, 0xc6, 0xd8, 0x79, 0x2f, 0x03, 0x86, 0xe8, 0xec, + 0x75, 0xc3, 0x98, 0x1a, 0x9a, 0x7e, 0x7c, 0x3e, 0xf2, 0x83, 0x4f, 0x96, 0x48, 0xfd, + 0xa4, 0x57, 0x0e, 0xb6, 0xed, 0xa9, 0x8f, 0x60, 0x53, 0x4f, 0xc6, 0xd8, 0x79, 0x2f, + 0x03, 0x86, 0xe8, 0xec, 0x75, 0xc3, 0x98, 0x1a, 0x9a, 0x7e, 0x7c, 0x3e, 0xf2, 0x83, + 0x4f, 0x96, 0x48, 0xfd, 0xa4, 0x57, 0x0e, 0xb6, 0xed, 0x02, 0xfb, 0x0a, 0xc3, 0xa9, + 0xc3, 0x16, 0x40, 0x6b, 0xb7, 0xad, 0x67, 0x4d, 0x67, 0xe6, 0x5b, 0x4e, 0x16, 0xb6, + 0x43, 0xf7, 0xf4, 0x0f, 0xe0, 0x05, 0x98, 0x63, 0x47, 0x68, 0xd2, 0x0e, 0x36, 0x50, + 0xfb, 0x0a, 0xc3, 0xa9, 0xc3, 0x16, 0x40, 0x6b, 0xb7, 0xad, 0x67, 0x4d, 0x67, 0xe6, + 0x5b, 0x4e, 0x16, 0xb6, 0x43, 0xf7, 0xf4, 0x0f, 0xe0, 0x05, 0x98, 0x63, 0x47, 0x68, + 0xd2, 0x0e, 0x36, 0x50, 0x03, + ], + peaks: &[ + &[ + 0x3f, 0xbe, 0x86, 0x35, 0xad, 0xef, 0x30, 0x26, 0x5f, 0xa4, 0x94, 0x22, 0x1e, 0x74, + 0x0e, 0x93, 0x1a, 0xc7, 0xd1, 0x91, 0xf6, 0xfd, 0xe1, 0x9e, 0x1d, 0xd5, 0xaf, 0xd9, + 0x31, 0xd5, 0x17, 0x63, 0xdf, 0x2c, 0x5b, 0x18, 0x40, 0x1a, 0x12, 0x81, 0x6a, 0x47, + 0x0a, 0x1d, 0xf6, 0xc3, 0x71, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x96, 0x25, 0xcc, 0x7e, + 0x88, 0x45, 0x2e, 0xeb, 0xee, 0x91, 0x25, 0x84, 0x9d, 0xd0, 0x4d, 0xeb, 0x9f, 0x19, + 0xf9, 0x06, 0x8f, 0xef, 0x43, 0xcb, 0xc5, 0xe4, 0x2f, 0x01, 0xc6, 0xc1, 0xbd, 0x1a, + 0x84, 0x04, 0xaf, 0xe9, 0x04, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xe7, 0x67, 0x35, 0x00, + 0x1b, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xc3, 0x5e, 0xfc, 0xa8, 0xcb, 0xf9, 0x3b, 0xd0, 0x98, + 0x27, 0x1f, 0xf2, 0xa2, 0x7b, 0xb3, 0xd8, 0x70, 0xd5, 0x29, 0x97, 0xd2, 0x6c, 0xa9, + 0xcc, 0x6a, 0x66, 0x3a, 0x72, 0x36, 0xd5, 0xc3, 0x64, 0x24, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0x3a, 0x36, 0x8b, 0x27, 0x00, 0xcb, 0x2b, 0x38, 0x3c, 0x2e, 0x3d, 0x82, 0x55, 0x61, + 0xa1, 0xba, 0xbf, 0xfb, 0xe6, 0x82, 0x15, 0x00, 0x1b, 0xf0, 0xc2, 0xb9, 0xa4, 0xff, + 0x77, 0x8b, 0xb4, 0x15, 0x21, + ], + &[ + 0xd7, 0x2d, 0x05, 0xdf, 0xc2, 0xfe, 0x3c, 0x0f, 0xd2, 0x9e, 0xa4, 0xb0, 0x99, 0x5c, + 0xc0, 0x87, 0xd0, 0x91, 0x8d, 0x0e, 0x87, 0xb1, 0x34, 0x07, 0x4e, 0x55, 0x88, 0xbd, + 0xa6, 0xef, 0xe4, 0x95, 0x69, 0xcf, 0xed, 0xbc, 0x34, 0xc0, 0xfa, 0x80, 0x7b, 0x3f, + 0x78, 0x1d, 0xd3, 0x6f, 0x2c, 0x1e, 0xf1, 0xba, 0x85, 0x9e, 0x42, 0x15, 0x26, 0x75, + 0x6d, 0xcd, 0x7f, 0xec, 0xfa, 0x02, 0xe4, 0x2f, 0x0f, 0x0b, 0x11, 0x5f, 0xbc, 0xbd, + 0x05, 0x53, 0x75, 0x07, 0xbc, 0x52, 0x57, 0x2d, 0x0d, 0x01, 0xdd, 0x95, 0x0d, 0x40, + 0x90, 0x67, 0x02, 0x67, 0x94, 0x4d, 0x64, 0x60, 0xb3, 0xfc, 0xf1, 0x96, 0xa0, 0x46, + 0x2a, 0xe6, 0xc4, 0xb8, 0x4f, 0x77, 0x01, 0x9f, 0x9b, 0x2f, 0xdd, 0x54, 0xe6, 0x3f, + 0xdc, 0x66, 0xaf, 0xfa, 0x03, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe8, 0x67, 0x35, 0x00, 0xfe, 0xeb, 0x67, 0x35, 0x00, + 0x0b, 0x36, 0x6d, 0xfe, 0x47, 0x93, 0x27, 0x0b, 0x65, 0x4f, 0x96, 0x61, 0x2d, 0x1f, + 0x4b, 0x1b, 0xc2, 0x32, 0x8f, 0x97, 0x43, 0xd3, 0x59, 0x5d, 0x22, 0xf3, 0xcc, 0x38, + 0xf1, 0xd3, 0x06, 0x9a, 0x99, 0x49, 0xd2, 0xd3, 0xf6, 0x34, 0x99, 0x44, 0x0d, 0x56, + 0x97, 0x95, 0xc4, 0xb2, 0x47, 0x8d, 0xc0, 0x0f, 0xe4, 0xe6, 0x65, 0xf5, 0x91, 0x1c, + 0x3b, 0x36, 0x0c, 0x62, 0xd2, 0x58, 0x95, 0x5d, 0x3a, 0x0c, 0xe8, 0x5e, 0x0d, 0x11, + 0x17, 0x95, 0xa9, 0xca, 0x33, 0x42, 0x3c, 0xa4, 0x4f, 0x6c, 0x7c, 0x7f, 0xec, 0xc9, + 0xb3, 0xd1, 0x64, 0xd7, 0x83, 0x78, 0xc9, 0x7a, 0x4d, 0x65, 0x36, 0xef, 0x03, 0xdb, + 0xed, 0x25, 0x06, 0x93, 0xd7, 0x56, 0x8d, 0xe1, 0x26, 0x51, 0x50, 0x0d, 0x73, 0x98, + 0x0b, 0xd5, 0xbd, 0xcd, 0x87, 0x29, 0xd8, 0xdd, 0x51, 0xbd, 0xe9, 0x7b, 0xeb, 0x42, + 0xb8, 0x5e, 0x38, 0x97, 0x10, + ], + &[ + 0x28, 0xd1, 0x6b, 0x90, 0x8f, 0xe8, 0x99, 0x9d, 0x8c, 0x45, 0x8b, 0x8b, 0x57, 0x54, + 0x45, 0x3c, 0x2f, 0x3e, 0xa3, 0xcb, 0x16, 0xf6, 0x37, 0xe0, 0x40, 0xd7, 0x81, 0xbe, + 0x26, 0x5b, 0x1a, 0x66, 0x65, 0x4f, 0x35, 0x9b, 0x33, 0x50, 0x73, 0x51, 0x98, 0x8e, + 0x58, 0x1d, 0x52, 0xc4, 0x76, 0x1d, 0x7d, 0x7e, 0x18, 0x55, 0x88, 0x1d, 0x76, 0x32, + 0x05, 0x91, 0xfb, 0x62, 0x97, 0x0b, 0x63, 0xb0, 0x08, 0x14, 0x3b, 0xe3, 0x83, 0x4d, + 0x4e, 0xc8, 0xf6, 0xb9, 0xda, 0xa9, 0x68, 0xa3, 0xb6, 0x44, 0x9c, 0xf0, 0x73, 0x6b, + 0x68, 0x56, 0x09, 0x60, 0x03, 0xe3, 0x3b, 0xf8, 0x53, 0xa1, 0xac, 0x28, 0xcb, 0x73, + 0x36, 0x0c, 0x38, 0x33, 0xca, 0x49, 0x6d, 0xf5, 0x12, 0x00, 0x2d, 0x59, 0x9f, 0x08, + 0xc5, 0xd8, 0x0b, 0x05, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xec, 0x67, 0x35, 0x00, 0xfe, 0xed, 0x67, 0x35, 0x00, + 0x08, 0x61, 0x37, 0x25, 0xde, 0x44, 0xf5, 0x08, 0x05, 0xf7, 0xf1, 0xf2, 0x7d, 0xca, + 0x48, 0x8e, 0x09, 0x8b, 0xae, 0x6d, 0xfe, 0xb8, 0x02, 0x8c, 0x1a, 0xb3, 0x04, 0x2b, + 0x0b, 0xad, 0xf6, 0xc4, 0xcd, 0x93, 0xb9, 0xec, 0xe9, 0xe5, 0x87, 0x98, 0x9a, 0x22, + 0x5b, 0xce, 0x4f, 0xe9, 0xa8, 0xf8, 0x9d, 0xbf, 0xa6, 0xbf, 0xcc, 0xe1, 0x74, 0x04, + 0x55, 0xc8, 0x6c, 0xd2, 0x08, 0x3b, 0x6a, 0xa3, 0x34, 0x00, 0x91, 0xe2, 0xba, 0x52, + 0xe7, 0x2f, 0xaa, 0x13, 0x85, 0xf0, 0xa1, 0xbd, 0x2e, 0x20, 0x77, 0xd8, 0x3d, 0x2a, + 0x70, 0xa1, 0x4f, 0xff, 0xc3, 0x04, 0x33, 0xe3, 0xb4, 0x24, 0xab, 0x40, 0xdc, 0xdd, + 0xba, 0x21, 0xfb, 0xf1, 0x70, 0x25, 0xe1, 0x5c, 0x33, 0x09, 0x3e, 0x74, 0x87, 0x2e, + 0xf1, 0xa8, 0xc5, 0x06, 0xdf, 0xc4, 0x7b, 0xc0, 0xcf, 0x28, 0xe5, 0x21, 0xdf, 0x73, + 0xce, 0x0d, 0x5d, 0x4a, 0x07, + ], + &[ + 0xcf, 0x74, 0xf2, 0xfa, 0xbf, 0x4e, 0x82, 0xa4, 0xcf, 0x4d, 0x40, 0x23, 0x6e, 0x70, + 0x89, 0xd6, 0x16, 0x62, 0x5f, 0x19, 0xf4, 0x70, 0x38, 0x23, 0xb2, 0x5c, 0x30, 0xcd, + 0xe7, 0xde, 0x0a, 0x81, 0xf2, 0x9d, 0x42, 0xf7, 0xf2, 0x9d, 0x42, 0xf7, 0x8d, 0x4f, + 0x14, 0x1e, 0x8d, 0x4f, 0x14, 0x1e, 0x52, 0xa0, 0x2c, 0x99, 0x44, 0x16, 0x92, 0x8b, + 0x4c, 0x88, 0x42, 0x45, 0x7e, 0xfa, 0x51, 0x3d, 0x2a, 0xb2, 0xeb, 0x58, 0x50, 0xf0, + 0xa0, 0x9b, 0xed, 0x08, 0x54, 0xcf, 0xf4, 0x8b, 0xee, 0xa0, 0x52, 0xa0, 0x2c, 0x99, + 0x44, 0x16, 0x92, 0x8b, 0x4c, 0x88, 0x42, 0x45, 0x7e, 0xfa, 0x51, 0x3d, 0x2a, 0xb2, + 0xeb, 0x58, 0x50, 0xf0, 0xa0, 0x9b, 0xed, 0x08, 0x54, 0xcf, 0xf4, 0x8b, 0xee, 0xa0, + 0xaa, 0x9a, 0x0c, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xee, 0x67, 0x35, 0x00, 0xfe, 0xee, 0x67, 0x35, 0x00, + 0x02, 0xa9, 0x8f, 0x60, 0x53, 0x4f, 0xc6, 0xd8, 0x79, 0x2f, 0x03, 0x86, 0xe8, 0xec, + 0x75, 0xc3, 0x98, 0x1a, 0x9a, 0x7e, 0x7c, 0x3e, 0xf2, 0x83, 0x4f, 0x96, 0x48, 0xfd, + 0xa4, 0x57, 0x0e, 0xb6, 0xed, 0xa9, 0x8f, 0x60, 0x53, 0x4f, 0xc6, 0xd8, 0x79, 0x2f, + 0x03, 0x86, 0xe8, 0xec, 0x75, 0xc3, 0x98, 0x1a, 0x9a, 0x7e, 0x7c, 0x3e, 0xf2, 0x83, + 0x4f, 0x96, 0x48, 0xfd, 0xa4, 0x57, 0x0e, 0xb6, 0xed, 0x02, 0xfb, 0x0a, 0xc3, 0xa9, + 0xc3, 0x16, 0x40, 0x6b, 0xb7, 0xad, 0x67, 0x4d, 0x67, 0xe6, 0x5b, 0x4e, 0x16, 0xb6, + 0x43, 0xf7, 0xf4, 0x0f, 0xe0, 0x05, 0x98, 0x63, 0x47, 0x68, 0xd2, 0x0e, 0x36, 0x50, + 0xfb, 0x0a, 0xc3, 0xa9, 0xc3, 0x16, 0x40, 0x6b, 0xb7, 0xad, 0x67, 0x4d, 0x67, 0xe6, + 0x5b, 0x4e, 0x16, 0xb6, 0x43, 0xf7, 0xf4, 0x0f, 0xe0, 0x05, 0x98, 0x63, 0x47, 0x68, + 0xd2, 0x0e, 0x36, 0x50, 0x03, + ], + ], + root_serialized: &[ + 0x12, 0xc4, 0xc5, 0x23, 0x26, 0x36, 0xb7, 0x61, 0xd7, 0xc4, 0x9a, 0xdd, 0xb1, 0xa3, + 0xbe, 0xb7, 0xa7, 0x6a, 0xe6, 0x55, 0x50, 0xb0, 0xec, 0xaf, 0x7e, 0x86, 0x7e, 0xd5, + 0x2e, 0xff, 0xb8, 0x10, 0xdf, 0x2c, 0x5b, 0x18, 0xf2, 0x9d, 0x42, 0xf7, 0x6a, 0x47, + 0x0a, 0x1d, 0x8d, 0x4f, 0x14, 0x1e, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x52, 0xa0, 0x2c, 0x99, + 0x44, 0x16, 0x92, 0x8b, 0x4c, 0x88, 0x42, 0x45, 0x7e, 0xfa, 0x51, 0x3d, 0x2a, 0xb2, + 0xeb, 0x58, 0x50, 0xf0, 0xa0, 0x9b, 0xed, 0x08, 0x54, 0xcf, 0xf4, 0x8b, 0xee, 0xa0, + 0xcf, 0xde, 0x76, 0xe9, 0x08, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xee, 0x67, 0x35, 0x00, + 0x30, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0xa9, 0x8f, 0x60, 0x53, 0x4f, 0xc6, 0xd8, 0x79, 0x2f, + 0x03, 0x86, 0xe8, 0xec, 0x75, 0xc3, 0x98, 0x1a, 0x9a, 0x7e, 0x7c, 0x3e, 0xf2, 0x83, + 0x4f, 0x96, 0x48, 0xfd, 0xa4, 0x57, 0x0e, 0xb6, 0xed, 0x32, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xfb, 0x0a, 0xc3, 0xa9, 0xc3, 0x16, 0x40, 0x6b, 0xb7, 0xad, 0x67, 0x4d, 0x67, 0xe6, + 0x5b, 0x4e, 0x16, 0xb6, 0x43, 0xf7, 0xf4, 0x0f, 0xe0, 0x05, 0x98, 0x63, 0x47, 0x68, + 0xd2, 0x0e, 0x36, 0x50, 0x3b, + ], + hash_chain_history_root: [ + 0xbc, 0xd5, 0x70, 0x67, 0x5c, 0x47, 0x12, 0xd2, 0x93, 0x03, 0x2d, 0xa3, 0xb9, 0x69, + 0xac, 0xeb, 0x76, 0xb5, 0xa8, 0x97, 0x7d, 0x6e, 0x0a, 0xc9, 0x77, 0x18, 0xf3, 0x3b, + 0x38, 0x20, 0x73, 0x17, + ], + }, + TestVector { + consensus_branch_id: 933566043, + n_leaves: 16, + leaf_block_hash: [ + 0x26, 0x7e, 0x9f, 0x5f, 0xb6, 0xe6, 0xc5, 0x19, 0x6a, 0x67, 0xfb, 0xe4, 0x1e, 0xd3, + 0xef, 0x35, 0x76, 0x01, 0x4a, 0x4d, 0xaf, 0xa9, 0xde, 0xa8, 0x47, 0xf4, 0xe2, 0x04, + 0xae, 0x66, 0x34, 0x12, + ], + leaf_time: 668286647, + leaf_target_bits: 472021669, + leaf_sapling_root: [ + 0x86, 0x36, 0x5e, 0xaf, 0xab, 0xe6, 0xef, 0x94, 0x1a, 0xb6, 0x46, 0x30, 0x53, 0x77, + 0xb7, 0x77, 0x4f, 0x8d, 0xdf, 0x3b, 0x92, 0x64, 0xa8, 0x29, 0x11, 0xf9, 0x83, 0x36, + 0xe7, 0x8d, 0x3d, 0x01, + ], + leaf_work: [ + 0xb4, 0x2b, 0xbf, 0x6c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, + ], + leaf_height: 3500015, + leaf_sapling_tx_count: 1, + leaf_orchard_root: [ + 0x9c, 0xd0, 0xf1, 0x13, 0x69, 0xe4, 0x7b, 0xa3, 0xe1, 0x17, 0xfb, 0x88, 0x70, 0x66, + 0x4d, 0xd9, 0x21, 0x99, 0xcf, 0x4c, 0x57, 0x48, 0xa9, 0x9c, 0x18, 0x69, 0x29, 0x04, + 0xcb, 0x63, 0x27, 0xd8, + ], + leaf_orchard_tx_count: 3, + leaf_ironwood_root: [ + 0xc6, 0x46, 0x22, 0x62, 0x84, 0x35, 0xc5, 0x2e, 0x73, 0x83, 0xdd, 0x9e, 0xce, 0x18, + 0x16, 0x1f, 0x19, 0xf3, 0x0a, 0xa2, 0xbd, 0xd2, 0xe4, 0x80, 0xf2, 0x1f, 0x40, 0x0d, + 0x70, 0xc3, 0x62, 0xb1, + ], + leaf_ironwood_tx_count: 7, + leaf_serialized: &[ + 0x26, 0x7e, 0x9f, 0x5f, 0xb6, 0xe6, 0xc5, 0x19, 0x6a, 0x67, 0xfb, 0xe4, 0x1e, 0xd3, + 0xef, 0x35, 0x76, 0x01, 0x4a, 0x4d, 0xaf, 0xa9, 0xde, 0xa8, 0x47, 0xf4, 0xe2, 0x04, + 0xae, 0x66, 0x34, 0x12, 0xb7, 0x3e, 0xd5, 0x27, 0xb7, 0x3e, 0xd5, 0x27, 0xa5, 0x7a, + 0x22, 0x1c, 0xa5, 0x7a, 0x22, 0x1c, 0x86, 0x36, 0x5e, 0xaf, 0xab, 0xe6, 0xef, 0x94, + 0x1a, 0xb6, 0x46, 0x30, 0x53, 0x77, 0xb7, 0x77, 0x4f, 0x8d, 0xdf, 0x3b, 0x92, 0x64, + 0xa8, 0x29, 0x11, 0xf9, 0x83, 0x36, 0xe7, 0x8d, 0x3d, 0x01, 0x86, 0x36, 0x5e, 0xaf, + 0xab, 0xe6, 0xef, 0x94, 0x1a, 0xb6, 0x46, 0x30, 0x53, 0x77, 0xb7, 0x77, 0x4f, 0x8d, + 0xdf, 0x3b, 0x92, 0x64, 0xa8, 0x29, 0x11, 0xf9, 0x83, 0x36, 0xe7, 0x8d, 0x3d, 0x01, + 0xb4, 0x2b, 0xbf, 0x6c, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xef, 0x67, 0x35, 0x00, 0xfe, 0xef, 0x67, 0x35, 0x00, + 0x01, 0x9c, 0xd0, 0xf1, 0x13, 0x69, 0xe4, 0x7b, 0xa3, 0xe1, 0x17, 0xfb, 0x88, 0x70, + 0x66, 0x4d, 0xd9, 0x21, 0x99, 0xcf, 0x4c, 0x57, 0x48, 0xa9, 0x9c, 0x18, 0x69, 0x29, + 0x04, 0xcb, 0x63, 0x27, 0xd8, 0x9c, 0xd0, 0xf1, 0x13, 0x69, 0xe4, 0x7b, 0xa3, 0xe1, + 0x17, 0xfb, 0x88, 0x70, 0x66, 0x4d, 0xd9, 0x21, 0x99, 0xcf, 0x4c, 0x57, 0x48, 0xa9, + 0x9c, 0x18, 0x69, 0x29, 0x04, 0xcb, 0x63, 0x27, 0xd8, 0x03, 0xc6, 0x46, 0x22, 0x62, + 0x84, 0x35, 0xc5, 0x2e, 0x73, 0x83, 0xdd, 0x9e, 0xce, 0x18, 0x16, 0x1f, 0x19, 0xf3, + 0x0a, 0xa2, 0xbd, 0xd2, 0xe4, 0x80, 0xf2, 0x1f, 0x40, 0x0d, 0x70, 0xc3, 0x62, 0xb1, + 0xc6, 0x46, 0x22, 0x62, 0x84, 0x35, 0xc5, 0x2e, 0x73, 0x83, 0xdd, 0x9e, 0xce, 0x18, + 0x16, 0x1f, 0x19, 0xf3, 0x0a, 0xa2, 0xbd, 0xd2, 0xe4, 0x80, 0xf2, 0x1f, 0x40, 0x0d, + 0x70, 0xc3, 0x62, 0xb1, 0x07, + ], + peaks: &[&[ + 0x42, 0xe3, 0x36, 0x70, 0x05, 0xdd, 0x6d, 0xc4, 0xb5, 0xe5, 0x6d, 0x4a, 0x15, 0x76, + 0xbd, 0xa8, 0x7a, 0x91, 0x1a, 0x8c, 0x50, 0xa2, 0x7c, 0x9e, 0x84, 0x4b, 0xd7, 0x3f, + 0x8b, 0x3a, 0xa6, 0x64, 0xdf, 0x2c, 0x5b, 0x18, 0xb7, 0x3e, 0xd5, 0x27, 0x6a, 0x47, + 0x0a, 0x1d, 0xa5, 0x7a, 0x22, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x86, 0x36, 0x5e, 0xaf, + 0xab, 0xe6, 0xef, 0x94, 0x1a, 0xb6, 0x46, 0x30, 0x53, 0x77, 0xb7, 0x77, 0x4f, 0x8d, + 0xdf, 0x3b, 0x92, 0x64, 0xa8, 0x29, 0x11, 0xf9, 0x83, 0x36, 0xe7, 0x8d, 0x3d, 0x01, + 0x83, 0x0a, 0x36, 0x56, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xef, 0x67, 0x35, 0x00, + 0x31, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x9c, 0xd0, 0xf1, 0x13, 0x69, 0xe4, 0x7b, 0xa3, 0xe1, + 0x17, 0xfb, 0x88, 0x70, 0x66, 0x4d, 0xd9, 0x21, 0x99, 0xcf, 0x4c, 0x57, 0x48, 0xa9, + 0x9c, 0x18, 0x69, 0x29, 0x04, 0xcb, 0x63, 0x27, 0xd8, 0x35, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xc6, 0x46, 0x22, 0x62, 0x84, 0x35, 0xc5, 0x2e, 0x73, 0x83, 0xdd, 0x9e, 0xce, 0x18, + 0x16, 0x1f, 0x19, 0xf3, 0x0a, 0xa2, 0xbd, 0xd2, 0xe4, 0x80, 0xf2, 0x1f, 0x40, 0x0d, + 0x70, 0xc3, 0x62, 0xb1, 0x42, + ]], + root_serialized: &[ + 0x42, 0xe3, 0x36, 0x70, 0x05, 0xdd, 0x6d, 0xc4, 0xb5, 0xe5, 0x6d, 0x4a, 0x15, 0x76, + 0xbd, 0xa8, 0x7a, 0x91, 0x1a, 0x8c, 0x50, 0xa2, 0x7c, 0x9e, 0x84, 0x4b, 0xd7, 0x3f, + 0x8b, 0x3a, 0xa6, 0x64, 0xdf, 0x2c, 0x5b, 0x18, 0xb7, 0x3e, 0xd5, 0x27, 0x6a, 0x47, + 0x0a, 0x1d, 0xa5, 0x7a, 0x22, 0x1c, 0xf4, 0x91, 0x46, 0xc8, 0x30, 0x77, 0x23, 0xda, + 0x5d, 0x02, 0xd0, 0x94, 0x3f, 0x1f, 0x31, 0x8a, 0x5d, 0xf7, 0xda, 0xe5, 0xfe, 0x69, + 0x59, 0x7b, 0x32, 0xef, 0x24, 0xd6, 0x64, 0x40, 0xdd, 0x4c, 0x86, 0x36, 0x5e, 0xaf, + 0xab, 0xe6, 0xef, 0x94, 0x1a, 0xb6, 0x46, 0x30, 0x53, 0x77, 0xb7, 0x77, 0x4f, 0x8d, + 0xdf, 0x3b, 0x92, 0x64, 0xa8, 0x29, 0x11, 0xf9, 0x83, 0x36, 0xe7, 0x8d, 0x3d, 0x01, + 0x83, 0x0a, 0x36, 0x56, 0x10, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, + 0x00, 0x00, 0x00, 0x00, 0xfe, 0xe0, 0x67, 0x35, 0x00, 0xfe, 0xef, 0x67, 0x35, 0x00, + 0x31, 0x9a, 0x10, 0x81, 0xbc, 0xba, 0x58, 0xc3, 0x3a, 0x49, 0x7b, 0xed, 0xa3, 0x84, + 0x41, 0x6a, 0x85, 0x98, 0x1b, 0x8b, 0x76, 0x10, 0x40, 0xf0, 0x52, 0xa3, 0xc1, 0x0e, + 0x6a, 0x60, 0x38, 0x51, 0xe1, 0x9c, 0xd0, 0xf1, 0x13, 0x69, 0xe4, 0x7b, 0xa3, 0xe1, + 0x17, 0xfb, 0x88, 0x70, 0x66, 0x4d, 0xd9, 0x21, 0x99, 0xcf, 0x4c, 0x57, 0x48, 0xa9, + 0x9c, 0x18, 0x69, 0x29, 0x04, 0xcb, 0x63, 0x27, 0xd8, 0x35, 0x65, 0xe2, 0x32, 0x26, + 0x84, 0x55, 0x04, 0xa6, 0xb6, 0xea, 0x12, 0x84, 0x0d, 0x49, 0x72, 0xb1, 0x6a, 0x3e, + 0x53, 0xcc, 0x66, 0x83, 0x1f, 0x9d, 0xbe, 0xd1, 0x30, 0x63, 0xd2, 0xe8, 0xeb, 0x84, + 0xc6, 0x46, 0x22, 0x62, 0x84, 0x35, 0xc5, 0x2e, 0x73, 0x83, 0xdd, 0x9e, 0xce, 0x18, + 0x16, 0x1f, 0x19, 0xf3, 0x0a, 0xa2, 0xbd, 0xd2, 0xe4, 0x80, 0xf2, 0x1f, 0x40, 0x0d, + 0x70, 0xc3, 0x62, 0xb1, 0x42, + ], + hash_chain_history_root: [ + 0x7f, 0x38, 0x51, 0x37, 0x47, 0x84, 0xa9, 0x6d, 0x4e, 0xa1, 0xbf, 0x18, 0xe2, 0x93, + 0x07, 0xb0, 0xf5, 0x50, 0xb5, 0x51, 0x34, 0x4d, 0xb4, 0x6b, 0xcf, 0xfc, 0xf5, 0x2a, + 0x71, 0xdd, 0xe8, 0x9e, + ], + }, +]; diff --git a/crates/zcash_history/src/tree.rs b/crates/zcash_history/src/tree.rs new file mode 100644 index 00000000..afea03ba --- /dev/null +++ b/crates/zcash_history/src/tree.rs @@ -0,0 +1,779 @@ +use alloc::collections::BTreeMap; +use alloc::vec::Vec; + +use crate::{Entry, EntryKind, EntryLink, Error, Version}; + +/// Represents partially loaded tree. +/// +/// Some kind of "view" into the array representation of the MMR tree. +/// With only some of the leaves/nodes pre-loaded / pre-generated. +/// Exact amount of the loaded data can be calculated by the constructing party, +/// depending on the length of the tree and maximum amount of operations that are going +/// to happen after construction. `Tree` should not be used as self-contained data structure, +/// since it's internal state can grow indefinitely after serial operations. +/// Intended use of this `Tree` is to instantiate it based on partially loaded data (see example +/// how to pick right nodes from the array representation of MMR Tree), perform several operations +/// (append-s/delete-s) and then drop it. +pub struct Tree { + stored: BTreeMap>, + + // This can grow indefinitely if `Tree` is misused as a self-contained data structure + generated: Vec>, + + // number of persistent(!) tree entries + stored_count: u32, + + root: EntryLink, +} + +impl Tree { + /// Resolve link originated from this tree + pub fn resolve_link(&self, link: EntryLink) -> Result, Error> { + match link { + EntryLink::Generated(index) => self.generated.get(index as usize), + EntryLink::Stored(index) => self.stored.get(&index), + } + .map(|node| IndexedNode { node, link }) + .ok_or(Error::ExpectedInMemory(link)) + } + + fn push(&mut self, data: Entry) -> EntryLink { + let idx = self.stored_count; + self.stored_count += 1; + self.stored.insert(idx, data); + EntryLink::Stored(idx) + } + + fn push_generated(&mut self, data: Entry) -> EntryLink { + self.generated.push(data); + EntryLink::Generated(self.generated.len() as u32 - 1) + } + + /// Populate tree with plain list of the leaves/nodes. For now, only for tests, + /// since this `Tree` structure is for partially loaded tree (but it might change) + #[cfg(test)] + pub fn populate(loaded: Vec>, root: EntryLink) -> Self { + let mut result = Tree::invalid(); + result.stored_count = loaded.len() as u32; + for (idx, item) in loaded.into_iter().enumerate() { + result.stored.insert(idx as u32, item); + } + result.root = root; + + result + } + + // Empty tree with invalid root + fn invalid() -> Self { + Tree { + root: EntryLink::Generated(0), + generated: Default::default(), + stored: Default::default(), + stored_count: 0, + } + } + + /// New view into the tree array representation + /// + /// `length` is total length of the array representation (is generally not a sum of + /// peaks.len + extra.len) + /// `peaks` is peaks of the mmr tree + /// `extra` is some extra nodes that calculated to be required during next one or more + /// operations on the tree. + /// + /// # Panics + /// + /// Will panic if `peaks` is empty. + pub fn new(length: u32, peaks: Vec<(u32, Entry)>, extra: Vec<(u32, Entry)>) -> Self { + assert!(!peaks.is_empty()); + + let mut result = Tree::invalid(); + + result.stored_count = length; + + let mut root = EntryLink::Stored(peaks[0].0); + for (r#gen, (idx, node)) in peaks.into_iter().enumerate() { + result.stored.insert(idx, node); + if r#gen != 0 { + let next_generated = combine_nodes( + result + .resolve_link(root) + .expect("Inserted before, cannot fail; qed"), + result + .resolve_link(EntryLink::Stored(idx)) + .expect("Inserted before, cannot fail; qed"), + ); + root = result.push_generated(next_generated); + } + } + + for (idx, node) in extra { + result.stored.insert(idx, node); + } + + result.root = root; + + result + } + + pub(crate) fn get_peaks( + &self, + root: EntryLink, + target: &mut Vec, + ) -> Result<(), Error> { + let (left_child_link, right_child_link) = { + let root = self.resolve_link(root)?; + if root.node.complete() { + target.push(root.link); + return Ok(()); + } + (root.left()?, root.right()?) + }; + + self.get_peaks(left_child_link, target)?; + self.get_peaks(right_child_link, target)?; + Ok(()) + } + + /// Append one leaf to the tree. + /// + /// Returns links to actual nodes that has to be persisted as the result of the append. + /// If completed without error, at least one link to the appended + /// node (with metadata provided in `new_leaf`) will be returned. + pub fn append_leaf(&mut self, new_leaf: V::NodeData) -> Result, Error> { + let root = self.root; + let new_leaf_link = self.push(Entry::new_leaf(new_leaf)); + let mut appended = vec![new_leaf_link]; + + let mut peaks = Vec::new(); + self.get_peaks(root, &mut peaks)?; + + let mut merge_stack = vec![new_leaf_link]; + + // Scan the peaks right-to-left, merging together equal-sized adjacent + // complete subtrees. After this, merge_stack only contains peaks of + // unequal-sized subtrees. + while let Some(next_peak) = peaks.pop() { + let next_merge = merge_stack + .pop() + .expect("there should be at least one, initial or re-pushed"); + + if let Some(stored) = { + let peak = self.resolve_link(next_peak)?; + let m = self.resolve_link(next_merge)?; + if peak.node.leaf_count() == m.node.leaf_count() { + Some(combine_nodes(peak, m)) + } else { + None + } + } { + let link = self.push(stored); + merge_stack.push(link); + appended.push(link); + continue; + } else { + merge_stack.push(next_merge); + merge_stack.push(next_peak); + } + } + + let mut new_root = merge_stack + .pop() + .expect("Loop above cannot reduce the merge_stack"); + // Scan the peaks left-to-right, producing new generated nodes that + // connect the subtrees + while let Some(next_child) = merge_stack.pop() { + new_root = self.push_generated(combine_nodes( + self.resolve_link(new_root)?, + self.resolve_link(next_child)?, + )) + } + + self.root = new_root; + + Ok(appended) + } + + #[cfg(test)] + fn for_children(&self, node: EntryLink, f: F) { + let (left, right) = { + let link = self + .resolve_link(node) + .expect("Failed to resolve link in test"); + ( + link.left().expect("Failed to find node in test"), + link.right().expect("Failed to find node in test"), + ) + }; + f(left, right); + } + + fn pop(&mut self) { + self.stored.remove(&(self.stored_count - 1)); + self.stored_count -= 1; + } + + /// Truncate one leaf from the end of the tree. + /// + /// Returns actual number of nodes that should be removed by the caller + /// from the end of the array representation. + pub fn truncate_leaf(&mut self) -> Result { + let root = { + let (leaves, root_left_child) = { + let n = self.resolve_link(self.root)?; + (n.node.leaf_count(), n.node.left()?) + }; + if leaves & 1 != 0 { + self.pop(); + self.root = root_left_child; + return Ok(1); + } else { + self.resolve_link(self.root)? + } + }; + + let mut peaks = vec![root.left()?]; + let mut subtree_root_link = root.right()?; + let mut truncated = 1; + + loop { + let left_link = self.resolve_link(subtree_root_link)?.node; + if let EntryKind::Node(left, right) = left_link.kind { + peaks.push(left); + subtree_root_link = right; + truncated += 1; + } else { + if root.node.complete() { + truncated += 1; + } + break; + } + } + + let mut new_root = *peaks.first().expect("At lest 1 elements in peaks"); + + for next_peak in peaks.into_iter().skip(1) { + new_root = self.push_generated(combine_nodes( + self.resolve_link(new_root)?, + self.resolve_link(next_peak)?, + )); + } + + for _ in 0..truncated { + self.pop(); + } + + self.root = new_root; + + Ok(truncated) + } + + /// Length of array representation of the tree. + pub fn len(&self) -> u32 { + self.stored_count + } + + /// Link to the root node + pub fn root(&self) -> EntryLink { + self.root + } + + /// Reference to the root node. + pub fn root_node(&self) -> Result, Error> { + self.resolve_link(self.root) + } + + /// If this tree is empty. + pub fn is_empty(&self) -> bool { + self.stored_count == 0 + } +} + +/// Reference to the node with link attached. +#[derive(Debug)] +pub struct IndexedNode<'a, V: Version> { + node: &'a Entry, + link: EntryLink, +} + +impl IndexedNode<'_, V> { + fn left(&self) -> Result { + self.node.left().map_err(|e| e.augment(self.link)) + } + + fn right(&self) -> Result { + self.node.right().map_err(|e| e.augment(self.link)) + } + + /// Reference to the entry struct. + pub fn node(&self) -> &Entry { + self.node + } + + /// Reference to the entry metadata. + pub fn data(&self) -> &V::NodeData { + &self.node.data + } + + /// Actual link by what this node was resolved. + pub fn link(&self) -> EntryLink { + self.link + } +} + +fn combine_nodes<'a, V: Version>(left: IndexedNode<'a, V>, right: IndexedNode<'a, V>) -> Entry { + Entry { + kind: EntryKind::Node(left.link, right.link), + data: V::combine(&left.node.data, &right.node.data), + } +} + +#[cfg(test)] +mod tests { + use super::{Entry, EntryKind, EntryLink, Tree}; + use crate::{NodeData, NodeDataV2, NodeDataV3, V2, V3, Version}; + + use assert_matches::assert_matches; + use proptest::prelude::*; + + fn leaf(height: u32) -> NodeDataV2 { + NodeDataV2 { + v1: NodeData { + consensus_branch_id: 1, + subtree_commitment: [0u8; 32], + start_time: 0, + end_time: 0, + start_target: 0, + end_target: 0, + start_sapling_root: [0u8; 32], + end_sapling_root: [0u8; 32], + subtree_total_work: 0.into(), + start_height: height as u64, + end_height: height as u64, + sapling_tx: 7, + }, + start_orchard_root: [0u8; 32], + end_orchard_root: [0u8; 32], + orchard_tx: 42, + } + } + + fn ironwood_leaf(height: u32) -> NodeDataV3 { + NodeDataV3 { + v2: leaf(height), + start_ironwood_root: [height as u8; 32], + end_ironwood_root: [height as u8; 32], + ironwood_tx: u64::from(height), + } + } + + fn initial() -> Tree { + let node1 = Entry::new_leaf(leaf(1)); + let node2 = Entry::new_leaf(leaf(2)); + + let node3 = Entry { + data: V2::combine(&node1.data, &node2.data), + kind: EntryKind::Leaf, + }; + + Tree::populate(vec![node1, node2, node3], EntryLink::Stored(2)) + } + + // returns tree with specified number of leafs and it's root + fn generated(length: u32) -> Tree { + assert!(length >= 3); + let mut tree = initial(); + for i in 2..length { + tree.append_leaf(leaf(i + 1)).expect("Failed to append"); + } + + tree + } + + fn ironwood_initial() -> Tree { + let node1 = Entry::new_leaf(ironwood_leaf(1)); + let node2 = Entry::new_leaf(ironwood_leaf(2)); + + let node3 = Entry { + data: V3::combine(&node1.data, &node2.data), + kind: EntryKind::Leaf, + }; + + Tree::populate(vec![node1, node2, node3], EntryLink::Stored(2)) + } + + #[test] + fn discrete_append() { + let mut tree = initial(); + + // ** APPEND 3 ** + let appended = tree.append_leaf(leaf(3)).expect("Failed to append"); + let new_root = tree.root_node().expect("Failed to resolve root").node; + + // initial tree: (2) + // / \ + // (0) (1) + // + // new tree: + // (4g) + // / \ + // (2) \ + // / \ \ + // (0) (1) (3) + // + // so only (3) is added as real leaf + // while new root, (4g) is generated one + assert_eq!(new_root.data.v1.end_height, 3); + assert_eq!(appended.len(), 1); + + // ** APPEND 4 ** + let appended = tree.append_leaf(leaf(4)).expect("Failed to append"); + + let new_root = tree.root_node().expect("Failed to resolve root").node; + + // intermediate tree: + // (4g) + // / \ + // (2) \ + // / \ \ + // (0) (1) (3) + // + // new tree: + // ( 6 ) + // / \ + // (2) (5) + // / \ / \ + // (0) (1) (3) (4) + // + // so (4), (5), (6) are added as real leaves + // and new root, (6) is stored one + assert_eq!(new_root.data.v1.end_height, 4); + assert_eq!(appended.len(), 3); + assert_matches!(tree.root(), EntryLink::Stored(6)); + + // ** APPEND 5 ** + + let appended = tree.append_leaf(leaf(5)).expect("Failed to append"); + let new_root = tree.root_node().expect("Failed to resolve root").node; + + // intermediate tree: + // ( 6 ) + // / \ + // (2) (5) + // / \ / \ + // (0) (1) (3) (4) + // + // new tree: + // ( 8g ) + // / \ + // ( 6 ) \ + // / \ \ + // (2) (5) \ + // / \ / \ \ + // (0) (1) (3) (4) (7) + // + // so (7) is added as real leaf + // and new root, (8g) is generated one + assert_eq!(new_root.data.v1.end_height, 5); + assert_eq!(appended.len(), 1); + assert_matches!(tree.root(), EntryLink::Generated(_)); + tree.for_children(tree.root(), |l, r| { + assert_matches!(l, EntryLink::Stored(6)); + assert_matches!(r, EntryLink::Stored(7)); + }); + + // *** APPEND #6 *** + let appended = tree.append_leaf(leaf(6)).expect("Failed to append"); + let new_root = tree.root_node().expect("Failed to resolve root").node; + + // intermediate tree: + // ( 8g ) + // / \ + // ( 6 ) \ + // / \ \ + // (2) (5) \ + // / \ / \ \ + // (0) (1) (3) (4) (7) + // + // new tree: + // (---10g--) + // / \ + // ( 6 ) \ + // / \ \ + // (2) (5) (9) + // / \ / \ / \ + // (0) (1) (3) (4) (7) (8) + // + // so (7) is added as real leaf + // and new root, (10g) is generated one + assert_eq!(new_root.data.v1.end_height, 6); + assert_eq!(appended.len(), 2); + assert_matches!(tree.root(), EntryLink::Generated(_)); + tree.for_children(tree.root(), |l, r| { + assert_matches!(l, EntryLink::Stored(6)); + assert_matches!(r, EntryLink::Stored(9)); + }); + + // *** APPEND #7 *** + + let appended = tree.append_leaf(leaf(7)).expect("Failed to append"); + let new_root = tree.root_node().expect("Failed to resolve root").node; + + // intermediate tree: + // (---8g---) + // / \ + // ( 6 ) \ + // / \ \ + // (2) (5) (9) + // / \ / \ / \ + // (0) (1) (3) (4) (7) (8) + // + // new tree: + // (---12g--) + // / \ + // (---11g---) \ + // / \ \ + // ( 6 ) \ \ + // / \ \ \ + // (2) (5) (9) \ + // / \ / \ / \ \ + // (0) (1) (3) (4) (7) (8) (10) + // + // so (10) is added as real leaf + // and new root, (12g) is generated one + assert_eq!(new_root.data.v1.end_height, 7); + assert_eq!(appended.len(), 1); + assert_matches!(tree.root(), EntryLink::Generated(_)); + tree.for_children(tree.root(), |l, r| { + assert_matches!(l, EntryLink::Generated(_)); + tree.for_children(l, |l, r| { + assert_matches!((l, r), (EntryLink::Stored(6), EntryLink::Stored(9))) + }); + assert_matches!(r, EntryLink::Stored(10)); + }); + } + + #[test] + fn truncate_simple() { + let mut tree = generated(9); + let total_truncated = tree.truncate_leaf().expect("Failed to truncate"); + + // initial tree: + // + // (-------16g------) + // / \ + // (--------14-------) \ + // / \ \ + // ( 6 ) ( 13 ) \ + // / \ / \ \ + // (2) (5) (9) (12) \ + // / \ / \ / \ / \ \ + // (0) (1) (3) (4) (7) (8) (10) (11) (15) + // + // new tree: + // (--------14-------) + // / \ + // ( 6 ) ( 13 ) + // / \ / \ + // (2) (5) (9) (12) + // / \ / \ / \ / \ + // (0) (1) (3) (4) (7) (8) (10) (11) + // + // so (15) is truncated + // and new root, (14) is a stored one now + + assert_matches!(tree.root(), EntryLink::Stored(14)); + assert_eq!(total_truncated, 1); + assert_eq!(tree.len(), 15); + } + + #[test] + fn truncate_generated() { + let mut tree = generated(10); + let deleted = tree.truncate_leaf().expect("Failed to truncate"); + + // initial tree: + // + // (--------18g--------) + // / \ + // (--------14-------) \ + // / \ \ + // ( 6 ) ( 13 ) \ + // / \ / \ \ + // (2) (5) (9) (12) (17) + // / \ / \ / \ / \ / \ + // (0) (1) (3) (4) (7) (8) (10) (11) (15) (16) + // + // new tree: + // (-------16g------) + // / \ + // (--------14-------) \ + // / \ \ + // ( 6 ) ( 13 ) \ + // / \ / \ \ + // (2) (5) (9) (12) \ + // / \ / \ / \ / \ \ + // (0) (1) (3) (4) (7) (8) (10) (11) (15) + + // new root is generated + + assert_matches!(tree.root(), EntryLink::Generated(_)); + + tree.for_children(tree.root(), |left, right| { + assert_matches!( + (left, right), + (EntryLink::Stored(14), EntryLink::Stored(15)) + ) + }); + + // two stored nodes should leave us (leaf 16 and no longer needed node 17) + assert_eq!(deleted, 2); + assert_eq!(tree.len(), 16); + } + + #[test] + fn ironwood_version_append_and_truncate() { + let mut tree = ironwood_initial(); + + let appended = tree + .append_leaf(ironwood_leaf(3)) + .expect("Failed to append"); + let root = tree.root_node().expect("Failed to resolve root").node; + + assert_eq!(appended.len(), 1); + assert_eq!(root.data.v2.v1.start_height, 1); + assert_eq!(root.data.v2.v1.end_height, 3); + assert_eq!(root.data.start_ironwood_root, [1; 32]); + assert_eq!(root.data.end_ironwood_root, [3; 32]); + assert_eq!(root.data.ironwood_tx, 6); + + let truncated = tree.truncate_leaf().expect("Failed to truncate"); + let root = tree.root_node().expect("Failed to resolve root").node; + + assert_eq!(truncated, 1); + assert_eq!(root.data.v2.v1.start_height, 1); + assert_eq!(root.data.v2.v1.end_height, 2); + assert_eq!(root.data.start_ironwood_root, [1; 32]); + assert_eq!(root.data.end_ironwood_root, [2; 32]); + assert_eq!(root.data.ironwood_tx, 3); + } + + #[test] + fn tree_len() { + let mut tree = initial(); + + assert_eq!(tree.len(), 3); + + for i in 0..2 { + tree.append_leaf(leaf(i + 3)).expect("Failed to append"); + } + assert_eq!(tree.len(), 7); + + tree.truncate_leaf().expect("Failed to truncate"); + + assert_eq!(tree.len(), 4); + } + + #[test] + fn tree_len_long() { + let mut tree = initial(); + + assert_eq!(tree.len(), 3); + + for i in 0..4094 { + tree.append_leaf(leaf(i + 3)).expect("Failed to append"); + } + assert_eq!(tree.len(), 8191); // 4096*2-1 (full tree) + + for _ in 0..2049 { + tree.truncate_leaf().expect("Failed to truncate"); + } + + assert_eq!(tree.len(), 4083); // 4095 - log2(4096) + } + + proptest! { + #[test] + fn prop_there_and_back(number in 0u32..=1024) { + let mut tree = initial(); + for i in 0..number { + tree.append_leaf(leaf(i+3)).expect("Failed to append"); + } + for _ in 0..number { + tree.truncate_leaf().expect("Failed to truncate"); + } + + assert_matches!(tree.root(), EntryLink::Stored(2)); + } + + #[test] + fn prop_leaf_count(number in 3u32..=1024) { + let mut tree = initial(); + for i in 1..(number-1) { + tree.append_leaf(leaf(i+2)).expect("Failed to append"); + } + + assert_eq!(tree.root_node().expect("no root").node.leaf_count(), number as u64); + } + + #[test] + fn prop_parity(number in 3u32..=2048) { + let mut tree = initial(); + for i in 1..(number-1) { + tree.append_leaf(leaf(i+2)).expect("Failed to append"); + } + + if number & (number - 1) == 0 { + assert_matches!(tree.root(), EntryLink::Stored(_)); + } else { + assert_matches!(tree.root(), EntryLink::Generated(_)); + } + } + + #[test] + fn prop_parity_with_truncate( + add_and_delete in (0u32..=2048).prop_flat_map( + |add| (Just(add), 0..=add) + ) + ) { + let (add, delete) = add_and_delete; + // First we add `add` number of leaves, then delete `delete` number of leaves + // What is left should be consistent with generated-stored structure + let mut tree = initial(); + for i in 0..add { + tree.append_leaf(leaf(i+3)).expect("Failed to append"); + } + for _ in 0..delete { + tree.truncate_leaf().expect("Failed to truncate"); + } + + let total = add - delete + 2; + + if total & (total - 1) == 0 { + assert_matches!(tree.root(), EntryLink::Stored(_)); + } else { + assert_matches!(tree.root(), EntryLink::Generated(_)); + } + } + + #[test] + fn prop_stored_length( + add_and_delete in (0u32..=2048).prop_flat_map( + |add| (Just(add), 0..=add) + ) + ) { + let (add, delete) = add_and_delete; + let mut tree = initial(); + for i in 0..add { + tree.append_leaf(leaf(i+3)).expect("Failed to append"); + } + for _ in 0..delete { + tree.truncate_leaf().expect("Failed to truncate"); + } + + let total = add - delete + 2; + + assert!(total * total > tree.len()) + } + } +} diff --git a/crates/zcash_history/src/version.rs b/crates/zcash_history/src/version.rs new file mode 100644 index 00000000..81a8676c --- /dev/null +++ b/crates/zcash_history/src/version.rs @@ -0,0 +1,263 @@ +use alloc::vec::Vec; +use core::fmt; + +use blake2b_simd::Params as Blake2Params; +use corez::io; + +#[cfg(zcash_unstable = "nutachyon")] +use crate::NodeDataV4; +use crate::{MAX_NODE_DATA_SIZE, NodeData, NodeDataV2, NodeDataV3}; + +fn blake2b_personal(personalization: &[u8], input: &[u8]) -> [u8; 32] { + let hash_result = Blake2Params::new() + .hash_length(32) + .personal(personalization) + .to_state() + .update(input) + .finalize(); + let mut result = [0u8; 32]; + result.copy_from_slice(hash_result.as_bytes()); + result +} + +fn personalization(branch_id: u32) -> [u8; 16] { + let mut result = [0u8; 16]; + result[..12].copy_from_slice(b"ZcashHistory"); + result[12..16].copy_from_slice(&branch_id.to_le_bytes()); + result +} + +/// A version of the chain history tree. +pub trait Version { + /// The node data for this tree version. + type NodeData: fmt::Debug; + + /// Returns the consensus branch ID for the given node data. + fn consensus_branch_id(data: &Self::NodeData) -> u32; + + /// Returns the start height for the given node data. + fn start_height(data: &Self::NodeData) -> u64; + + /// Returns the end height for the given node data. + fn end_height(data: &Self::NodeData) -> u64; + + /// Combines two nodes' metadata. + fn combine(left: &Self::NodeData, right: &Self::NodeData) -> Self::NodeData { + assert_eq!( + Self::consensus_branch_id(left), + Self::consensus_branch_id(right) + ); + + let mut hash_buf = [0u8; MAX_NODE_DATA_SIZE * 2]; + let size = { + let mut cursor = corez::io::Cursor::new(&mut hash_buf[..]); + Self::write(left, &mut cursor) + .expect("Writing to memory buf with enough length cannot fail; qed"); + Self::write(right, &mut cursor) + .expect("Writing to memory buf with enough length cannot fail; qed"); + cursor.position() as usize + }; + + let hash = blake2b_personal( + &personalization(Self::consensus_branch_id(left)), + &hash_buf[..size], + ); + + Self::combine_inner(hash, left, right) + } + + /// Combines two nodes metadata. + /// + /// For internal use. + fn combine_inner( + subtree_commitment: [u8; 32], + left: &Self::NodeData, + right: &Self::NodeData, + ) -> Self::NodeData; + + /// Parses node data from the given reader. + fn read(consensus_branch_id: u32, r: &mut R) -> io::Result; + + /// Writes the byte representation of the given node data to the given writer. + fn write(data: &Self::NodeData, w: &mut W) -> io::Result<()>; + + /// Converts to byte representation. + #[allow(clippy::wrong_self_convention)] + fn to_bytes(data: &Self::NodeData) -> Vec { + let mut buf = [0u8; MAX_NODE_DATA_SIZE]; + let pos = { + let mut cursor = corez::io::Cursor::new(&mut buf[..]); + Self::write(data, &mut cursor).expect("Cursor cannot fail"); + cursor.position() as usize + }; + + buf[0..pos].to_vec() + } + + /// Convert from byte representation. + fn from_bytes>(consensus_branch_id: u32, buf: T) -> io::Result { + let mut cursor = corez::io::Cursor::new(buf); + Self::read(consensus_branch_id, &mut cursor) + } + + /// Hash node metadata + fn hash(data: &Self::NodeData) -> [u8; 32] { + let bytes = Self::to_bytes(data); + + blake2b_personal(&personalization(Self::consensus_branch_id(data)), &bytes) + } +} + +/// Version 1 of the Zcash chain history tree. +/// +/// This version was used for the Heartwood and Canopy epochs. +pub enum V1 {} + +impl Version for V1 { + type NodeData = NodeData; + + fn consensus_branch_id(data: &Self::NodeData) -> u32 { + data.consensus_branch_id + } + + fn start_height(data: &Self::NodeData) -> u64 { + data.start_height + } + + fn end_height(data: &Self::NodeData) -> u64 { + data.end_height + } + + fn combine_inner( + subtree_commitment: [u8; 32], + left: &Self::NodeData, + right: &Self::NodeData, + ) -> Self::NodeData { + NodeData::combine_inner(subtree_commitment, left, right) + } + + fn read(consensus_branch_id: u32, r: &mut R) -> io::Result { + NodeData::read(consensus_branch_id, r) + } + + fn write(data: &Self::NodeData, w: &mut W) -> io::Result<()> { + data.write(w) + } +} + +/// Version 2 of the Zcash chain history tree. +/// +/// This version is used from the NU5 epoch. +pub enum V2 {} + +impl Version for V2 { + type NodeData = NodeDataV2; + + fn consensus_branch_id(data: &Self::NodeData) -> u32 { + data.v1.consensus_branch_id + } + + fn start_height(data: &Self::NodeData) -> u64 { + data.v1.start_height + } + + fn end_height(data: &Self::NodeData) -> u64 { + data.v1.end_height + } + + fn combine_inner( + subtree_commitment: [u8; 32], + left: &Self::NodeData, + right: &Self::NodeData, + ) -> Self::NodeData { + NodeDataV2::combine_inner(subtree_commitment, left, right) + } + + fn read(consensus_branch_id: u32, r: &mut R) -> io::Result { + NodeDataV2::read(consensus_branch_id, r) + } + + fn write(data: &Self::NodeData, w: &mut W) -> io::Result<()> { + data.write(w) + } +} + +/// Version 3 of the Zcash chain history tree. +/// +/// This version is used from the NU6.3 epoch for history nodes that include +/// Ironwood shielded pool metadata. Earlier epochs continue to use the +/// corresponding earlier history tree versions. +pub enum V3 {} + +impl Version for V3 { + type NodeData = NodeDataV3; + + fn consensus_branch_id(data: &Self::NodeData) -> u32 { + data.v2.v1.consensus_branch_id + } + + fn start_height(data: &Self::NodeData) -> u64 { + data.v2.v1.start_height + } + + fn end_height(data: &Self::NodeData) -> u64 { + data.v2.v1.end_height + } + + fn combine_inner( + subtree_commitment: [u8; 32], + left: &Self::NodeData, + right: &Self::NodeData, + ) -> Self::NodeData { + NodeDataV3::combine_inner(subtree_commitment, left, right) + } + + fn read(consensus_branch_id: u32, r: &mut R) -> io::Result { + NodeDataV3::read(consensus_branch_id, r) + } + + fn write(data: &Self::NodeData, w: &mut W) -> io::Result<()> { + data.write(w) + } +} + +/// Version 4 of the Zcash chain history tree. +/// +/// This version is used from the NuTachyon epoch for history nodes that include +/// Tachyon shielded pool metadata. Earlier epochs continue to use the +/// corresponding earlier history tree versions. +#[cfg(zcash_unstable = "nutachyon")] +pub enum V4 {} + +#[cfg(zcash_unstable = "nutachyon")] +impl Version for V4 { + type NodeData = NodeDataV4; + + fn consensus_branch_id(data: &Self::NodeData) -> u32 { + data.v3.v2.v1.consensus_branch_id + } + + fn start_height(data: &Self::NodeData) -> u64 { + data.v3.v2.v1.start_height + } + + fn end_height(data: &Self::NodeData) -> u64 { + data.v3.v2.v1.end_height + } + + fn combine_inner( + subtree_commitment: [u8; 32], + left: &Self::NodeData, + right: &Self::NodeData, + ) -> Self::NodeData { + NodeDataV4::combine_inner(subtree_commitment, left, right) + } + + fn read(consensus_branch_id: u32, r: &mut R) -> io::Result { + NodeDataV4::read(consensus_branch_id, r) + } + + fn write(data: &Self::NodeData, w: &mut W) -> io::Result<()> { + data.write(w) + } +} diff --git a/crates/zcash_keys/Cargo.toml b/crates/zcash_keys/Cargo.toml index db5beeb9..f29cde2a 100644 --- a/crates/zcash_keys/Cargo.toml +++ b/crates/zcash_keys/Cargo.toml @@ -37,10 +37,10 @@ sapling = { workspace = true, optional = true } secp256k1 = { version = "0.29", features = ["alloc"], optional = true, default-features = false } secrecy = "0.8" subtle = { version = "2.2.3", default-features = false } -transparent = { version = "0.10.0", default-features = false, package = "zcash_transparent" } -zcash_address = { version = "0.13.0", default-features = false } +transparent = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.0", default-features = false, package = "zcash_transparent" } +zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.13.0", default-features = false } zcash_encoding = { version = "0.4", default-features = false } -zcash_protocol = { version = "0.10.2", default-features = false } +zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.5", default-features = false } zeroize = { version = "1.7", optional = true, default-features = false } zip32 = { version = "0.2", default-features = false } @@ -55,8 +55,8 @@ rand = { version = "0.8", default-features = false } rand_chacha = "0.3" rand_core = { version = "0.6", default-features = false } secp256k1 = { version = "0.29", features = ["alloc", "rand"], default-features = false } -transparent = { version = "0.10.0", features = ["test-dependencies"], default-features = false, package = "zcash_transparent" } -zcash_address = { version = "0.13.0", features = ["test-dependencies"], default-features = false } +transparent = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.0", features = ["test-dependencies"], default-features = false, package = "zcash_transparent" } +zcash_address = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.13.0", features = ["test-dependencies"], default-features = false } zcash_script = { version = "0.4.3", default-features = false } [features] diff --git a/crates/zcash_primitives/Cargo.toml b/crates/zcash_primitives/Cargo.toml index 2b92499d..68bd25ce 100644 --- a/crates/zcash_primitives/Cargo.toml +++ b/crates/zcash_primitives/Cargo.toml @@ -44,12 +44,15 @@ redjubjub = { workspace = true } sapling = { workspace = true } secp256k1 = { version = "0.29", features = ["alloc"], optional = true, default-features = false } sha2 = { version = "0.10", default-features = false } -transparent = { version = "0.10.0", default-features = false, package = "zcash_transparent" } +transparent = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.0", default-features = false, package = "zcash_transparent" } zcash_encoding = { version = "0.4", default-features = false } zcash_note_encryption = { version = "0.4.1", features = ["pre-zip-212"] } -zcash_protocol = { version = "0.10.0", default-features = false } +zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.5", default-features = false } zcash_script = { version = "0.4.3", default-features = false } +[target.'cfg(zcash_unstable = "nutachyon")'.dependencies] +zcash_tachyon = { git = "https://github.com/tachyon-zcash/tachyon", rev = "2dc7010c3e7771c539fd1c03a06bc6be1a7316c7", version = "0.0.0", default-features = false } + [dev-dependencies] assert_matches = "1.5" bls12_381 = { workspace = true, features = ["default"] } @@ -61,8 +64,8 @@ proptest = ">=1,<1.7" rand = "0.10" rand_xorshift = "0.5" sapling = { workspace = true, features = ["test-dependencies"] } -transparent = { version = "0.10.0", features = ["test-dependencies"], default-features = false, package = "zcash_transparent" } -zcash_protocol = { version = "0.10.0", features = ["local-consensus", "test-dependencies"], default-features = false } +transparent = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.0", features = ["test-dependencies"], default-features = false, package = "zcash_transparent" } +zcash_protocol = { git = "https://github.com/zcash/librustzcash.git", rev = "c7235b1fc4b4296b8af2e26bf2f6adb24f873f56", version = "0.10.5", features = ["local-consensus", "test-dependencies"], default-features = false } zip32 = { version = "0.2", default-features = false } [target."cfg(unix)".dev-dependencies] @@ -81,6 +84,7 @@ std = [ "sapling/std", "orchard/std", "transparent/std", + "zcash_tachyon/std", ] temporary-zcashd = [] test-dependencies = [ @@ -99,7 +103,7 @@ level = "warn" priority = 0 check-cfg = [ "cfg(tokio_unstable)", - 'cfg(zcash_unstable, values("nu7"))', + 'cfg(zcash_unstable, values("nu7", "nutachyon"))', "cfg(live_network_tests)", ] diff --git a/crates/zcash_primitives/src/transaction/builder.rs b/crates/zcash_primitives/src/transaction/builder.rs index 05416f4c..056e7e2a 100644 --- a/crates/zcash_primitives/src/transaction/builder.rs +++ b/crates/zcash_primitives/src/transaction/builder.rs @@ -905,6 +905,8 @@ impl Builder { BranchId::Nu6_3 => true, #[cfg(zcash_unstable = "nu7")] BranchId::Nu7 => true, + #[cfg(zcash_unstable = "nutachyon")] + BranchId::NuTachyon => true, _ => false, }; let ironwood_available = version.has_ironwood() && ironwood_branch; @@ -1580,6 +1582,8 @@ impl Builder Builder BundleVersion { - if matches!(v, TxVersion::V6) { + if match v { + TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, + _ => false, + } { return BundleVersion::orchard_v3(); } let _ = v; diff --git a/crates/zcash_primitives/src/transaction/components/tachyon.rs b/crates/zcash_primitives/src/transaction/components/tachyon.rs new file mode 100644 index 00000000..e049e42f --- /dev/null +++ b/crates/zcash_primitives/src/transaction/components/tachyon.rs @@ -0,0 +1,15 @@ +//! Functions for parsing and serialization of Tachyon transaction components. + +use corez::io::{self, Read, Write}; + +use zcash_tachyon::TachyonBundle; + +/// Reads a Tachyon bundle from a V7 transaction. +pub fn read_v7_bundle(reader: R) -> io::Result { + TachyonBundle::read(reader) +} + +/// Writes a Tachyon bundle in a V7 transaction. +pub fn write_v7_bundle(bundle: &TachyonBundle, writer: W) -> io::Result<()> { + bundle.write(writer) +} diff --git a/crates/zcash_primitives/src/transaction/mod.rs b/crates/zcash_primitives/src/transaction/mod.rs index 97061086..e170b881 100644 --- a/crates/zcash_primitives/src/transaction/mod.rs +++ b/crates/zcash_primitives/src/transaction/mod.rs @@ -35,6 +35,9 @@ use self::{ }; use ::transparent::util::sha256d::{HashReader, HashWriter}; +#[cfg(zcash_unstable = "nutachyon")] +use self::components::tachyon as tachyon_serialization; + #[cfg(feature = "circuits")] use ::sapling::builder as sapling_builder; @@ -44,6 +47,8 @@ use zcash_protocol::constants::{ }; use zcash_protocol::constants::{V6_TX_VERSION, V6_VERSION_GROUP_ID}; +#[cfg(zcash_unstable = "nutachyon")] +use zcash_protocol::constants::{V7_TX_VERSION, V7_VERSION_GROUP_ID}; pub use zcash_protocol::TxId; @@ -74,6 +79,11 @@ pub enum TxVersion { V5, /// Transaction version 6, specified in [ZIP 229](https://zips.z.cash/zip-0229). V6, + /// Transaction version 7, introduced by the NuTachyon network upgrade. + /// + /// V7 extends the V6 transaction body and digest structure with a Tachyon bundle. + #[cfg(zcash_unstable = "nutachyon")] + V7, } impl TxVersion { @@ -88,6 +98,8 @@ impl TxVersion { (V4_TX_VERSION, V4_VERSION_GROUP_ID) => Ok(TxVersion::V4), (V5_TX_VERSION, V5_VERSION_GROUP_ID) => Ok(TxVersion::V5), (V6_TX_VERSION, V6_VERSION_GROUP_ID) => Ok(TxVersion::V6), + #[cfg(zcash_unstable = "nutachyon")] + (V7_TX_VERSION, V7_VERSION_GROUP_ID) => Ok(TxVersion::V7), _ => Err(io::Error::new( io::ErrorKind::InvalidData, "Unknown transaction format", @@ -117,6 +129,8 @@ impl TxVersion { TxVersion::V4 => V4_TX_VERSION, TxVersion::V5 => V5_TX_VERSION, TxVersion::V6 => V6_TX_VERSION, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => V7_TX_VERSION, } } @@ -127,6 +141,8 @@ impl TxVersion { TxVersion::V4 => V4_VERSION_GROUP_ID, TxVersion::V5 => V5_VERSION_GROUP_ID, TxVersion::V6 => V6_VERSION_GROUP_ID, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => V7_VERSION_GROUP_ID, } } @@ -145,6 +161,8 @@ impl TxVersion { TxVersion::V3 | TxVersion::V4 => true, TxVersion::V5 => false, TxVersion::V6 => false, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => false, } } @@ -159,6 +177,8 @@ impl TxVersion { TxVersion::V4 => true, TxVersion::V5 => true, TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, } } @@ -168,6 +188,8 @@ impl TxVersion { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 => false, TxVersion::V5 => true, TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, } } @@ -176,6 +198,21 @@ impl TxVersion { match self { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 | TxVersion::V5 => false, TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, + } + } + + /// Returns `true` if this transaction version supports the Tachyon protocol. + #[cfg(zcash_unstable = "nutachyon")] + pub fn has_tachyon(&self) -> bool { + match self { + TxVersion::Sprout(_) + | TxVersion::V3 + | TxVersion::V4 + | TxVersion::V5 + | TxVersion::V6 => false, + TxVersion::V7 => true, } } @@ -184,6 +221,8 @@ impl TxVersion { match self { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 | TxVersion::V5 => false, TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, } } @@ -202,6 +241,8 @@ impl TxVersion { BranchId::Nu6_3 => TxVersion::V6, #[cfg(zcash_unstable = "nu7")] BranchId::Nu7 => TxVersion::V6, + #[cfg(zcash_unstable = "nutachyon")] + BranchId::NuTachyon => TxVersion::V7, } } @@ -220,6 +261,8 @@ impl TxVersion { Nu6_3 => true, #[cfg(zcash_unstable = "nu7")] Nu7 => false, // ZIP 2003 + #[cfg(zcash_unstable = "nutachyon")] + NuTachyon => false, }, TxVersion::V5 => match consensus_branch_id { Sprout | Overwinter | Sapling | Blossom | Heartwood | Canopy => false, @@ -227,6 +270,8 @@ impl TxVersion { Nu6_3 => true, #[cfg(zcash_unstable = "nu7")] Nu7 => true, + #[cfg(zcash_unstable = "nutachyon")] + NuTachyon => true, }, TxVersion::V6 => match consensus_branch_id { Sprout | Overwinter | Sapling | Blossom | Heartwood | Canopy | Nu5 | Nu6 @@ -234,7 +279,11 @@ impl TxVersion { Nu6_3 => true, // Ironwood / NU6.3 #[cfg(zcash_unstable = "nu7")] Nu7 => true, // ZIP 230 or ZIP 248, whichever is chosen for activation + #[cfg(zcash_unstable = "nutachyon")] + NuTachyon => true, }, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => consensus_branch_id == NuTachyon, } } } @@ -319,6 +368,8 @@ pub struct TransactionData { sapling_bundle: Option>, orchard_bundle: Option>, ironwood_bundle: Option>, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle, } impl Clone for TransactionData { @@ -335,6 +386,8 @@ impl Clone for TransactionData { sapling_bundle: self.sapling_bundle.clone(), orchard_bundle: self.orchard_bundle.clone(), ironwood_bundle: self.ironwood_bundle.clone(), + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: self.tachyon_bundle.clone(), } } } @@ -377,6 +430,8 @@ impl TransactionData { sapling_bundle, orchard_bundle, ironwood_bundle: None, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, } } @@ -403,8 +458,71 @@ impl TransactionData { orchard_bundle: Option>, ironwood_bundle: Option>, ) -> Self { + Self::from_parts_v6_or_v7( + TxVersion::V6, + consensus_branch_id, + lock_time, + expiry_height, + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + zip233_amount, + transparent_bundle, + sapling_bundle, + orchard_bundle, + ironwood_bundle, + ) + } + + /// Constructs a V7 [`TransactionData`] from its constituent parts, including the Tachyon + /// bundle. + #[cfg(zcash_unstable = "nutachyon")] + #[allow(clippy::too_many_arguments)] + pub fn from_parts_v7( + consensus_branch_id: BranchId, + lock_time: u32, + expiry_height: BlockHeight, + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] zip233_amount: Zatoshis, + transparent_bundle: Option>, + sapling_bundle: Option>, + orchard_bundle: Option>, + ironwood_bundle: Option>, + tachyon_bundle: zcash_tachyon::TachyonBundle, + ) -> Self { + let mut data = Self::from_parts_v6_or_v7( + TxVersion::V7, + consensus_branch_id, + lock_time, + expiry_height, + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + zip233_amount, + transparent_bundle, + sapling_bundle, + orchard_bundle, + ironwood_bundle, + ); + data.tachyon_bundle = tachyon_bundle; + data + } + + #[allow(clippy::too_many_arguments)] + fn from_parts_v6_or_v7( + version: TxVersion, + consensus_branch_id: BranchId, + lock_time: u32, + expiry_height: BlockHeight, + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] zip233_amount: Zatoshis, + transparent_bundle: Option>, + sapling_bundle: Option>, + orchard_bundle: Option>, + ironwood_bundle: Option>, + ) -> Self { + debug_assert!(match version { + TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, + _ => false, + }); TransactionData { - version: TxVersion::V6, + version, consensus_branch_id, lock_time, expiry_height, @@ -415,6 +533,8 @@ impl TransactionData { sapling_bundle, orchard_bundle, ironwood_bundle, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, } } @@ -461,6 +581,11 @@ impl TransactionData { self.zip233_amount } + #[cfg(zcash_unstable = "nutachyon")] + pub fn tachyon_bundle(&self) -> &zcash_tachyon::TachyonBundle { + &self.tachyon_bundle + } + /// Returns the total fees paid by the transaction, given a function that can be used to /// retrieve the value of previous transactions' transparent outputs that are being spent in /// this transaction. @@ -491,6 +616,15 @@ impl TransactionData { self.ironwood_bundle .as_ref() .map_or_else(ZatBalance::zero, |b| *b.value_balance()), + #[cfg(zcash_unstable = "nutachyon")] + { + let value_balance = match &self.tachyon_bundle { + zcash_tachyon::TachyonBundle::NoBundle => 0i64, + zcash_tachyon::TachyonBundle::Proven(s) => i64::from(s.value_balance), + zcash_tachyon::TachyonBundle::Adjunct(s) => i64::from(s.value_balance), + }; + ZatBalance::try_from(value_balance).map_err(|_| BalanceError::Overflow)? + }, #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] -ZatBalance::from(self.zip233_amount), ]; @@ -525,6 +659,8 @@ impl TransactionData { digester.digest_sapling(self.version, self.sapling_bundle.as_ref()), digester.digest_orchard(self.version, self.orchard_bundle.as_ref()), digester.digest_ironwood(self.ironwood_bundle.as_ref()), + #[cfg(zcash_unstable = "nutachyon")] + digester.digest_tachyon(&self.tachyon_bundle), ) } @@ -576,6 +712,8 @@ impl TransactionData { sapling_bundle: f_sapling(self.sapling_bundle), orchard_bundle: f_orchard(self.orchard_bundle), ironwood_bundle: f_orchard(self.ironwood_bundle), + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: self.tachyon_bundle, } } @@ -615,6 +753,8 @@ impl TransactionData { sapling_bundle: f_sapling(self.sapling_bundle)?, orchard_bundle: f_orchard(self.orchard_bundle)?, ironwood_bundle: f_orchard(self.ironwood_bundle)?, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: self.tachyon_bundle, }) } @@ -651,6 +791,8 @@ impl TransactionData { |f, a| f.map_authorization(a), ) }), + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: self.tachyon_bundle, ironwood_bundle: self.ironwood_bundle.map(|b| { b.map_authorization( &mut f_orchard, @@ -690,6 +832,8 @@ impl Transaction { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 => Self::from_data_v4(data), TxVersion::V5 => Ok(Self::from_data_v5(data)), TxVersion::V6 => Ok(Self::from_data_v6(data)), + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => Ok(Self::from_data_v6(data)), } } @@ -742,6 +886,8 @@ impl Transaction { } TxVersion::V5 => Self::read_v5(reader.into_base_reader(), version), TxVersion::V6 => Self::read_v6(reader.into_base_reader(), version), + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => Self::read_v7(reader.into_base_reader(), version), } } @@ -819,6 +965,8 @@ impl Transaction { }), orchard_bundle: None, ironwood_bundle: None, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, }, }) } @@ -870,6 +1018,8 @@ impl Transaction { sapling_bundle, orchard_bundle, ironwood_bundle: None, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, }; Ok(Self::from_data_v5(data)) @@ -903,12 +1053,51 @@ impl Transaction { sapling_bundle, orchard_bundle, ironwood_bundle, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, }; Ok(Self::from_data_v6(data)) } - /// Utility function for reading header data common to v5 and v6 transactions. + /// Reads a V7 transaction: the V6 body followed by a Tachyon bundle. + #[cfg(zcash_unstable = "nutachyon")] + fn read_v7(mut reader: R, version: TxVersion) -> io::Result { + let header_fragment = Self::read_v6_header_fragment(&mut reader)?; + + let transparent_bundle = Self::read_transparent(&mut reader)?; + let sapling_bundle = sapling_serialization::read_v5_bundle(&mut reader)?; + let orchard_bundle = orchard_serialization::read_v6_bundle( + &mut reader, + header_fragment.consensus_branch_id, + orchard::ValuePool::Orchard, + )?; + let ironwood_bundle = orchard_serialization::read_v6_bundle( + &mut reader, + header_fragment.consensus_branch_id, + orchard::ValuePool::Ironwood, + )?; + let tachyon_bundle = tachyon_serialization::read_v7_bundle(&mut reader)?; + + let data = TransactionData { + version, + consensus_branch_id: header_fragment.consensus_branch_id, + lock_time: header_fragment.lock_time, + expiry_height: header_fragment.expiry_height, + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + zip233_amount: header_fragment.zip233_amount, + transparent_bundle, + sprout_bundle: None, + sapling_bundle, + orchard_bundle, + ironwood_bundle, + tachyon_bundle, + }; + + Ok(Self::from_data_v6(data)) + } + + /// Utility function for reading header data common to V5 and later transactions. fn read_header_fragment(mut reader: R) -> io::Result<(BranchId, u32, BlockHeight)> { let consensus_branch_id = reader.read_u32_le().and_then(|value| { BranchId::try_from(value).map_err(|_e| { @@ -960,6 +1149,8 @@ impl Transaction { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 => self.write_v4(writer), TxVersion::V5 => self.write_v5(writer), TxVersion::V6 => self.write_v6(writer), + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => self.write_v7(writer), } } @@ -1048,6 +1239,26 @@ impl Transaction { Ok(()) } + /// Writes a V7 transaction: the V6 body followed by a Tachyon bundle. + #[cfg(zcash_unstable = "nutachyon")] + pub fn write_v7(&self, mut writer: W) -> io::Result<()> { + if self.sprout_bundle.is_some() { + return Err(io::Error::new( + io::ErrorKind::InvalidInput, + "Sprout components cannot be present when serializing to the V7 transaction format.", + )); + } + self.write_v6_header(&mut writer)?; + + self.write_transparent(&mut writer)?; + self.write_v5_sapling(&mut writer)?; + orchard_serialization::write_v6_bundle(self.orchard_bundle.as_ref(), &mut writer)?; + orchard_serialization::write_v6_bundle(self.ironwood_bundle.as_ref(), &mut writer)?; + tachyon_serialization::write_v7_bundle(&self.tachyon_bundle, &mut writer)?; + + Ok(()) + } + pub fn write_v5_header(&self, mut writer: W) -> io::Result<()> { self.version.write(&mut writer)?; writer.write_u32_le(u32::from(self.consensus_branch_id))?; @@ -1104,6 +1315,9 @@ pub struct TxDigests { /// ID is derived from these digests, `None` is combined as the empty Ironwood bundle digest /// using the Ironwood bundle personalization. pub ironwood_digest: Option, + /// The digest of the Tachyon bundle used by version 7 transactions. + #[cfg(zcash_unstable = "nutachyon")] + pub tachyon_digest: [u8; 32], } pub trait TransactionDigest { @@ -1113,6 +1327,9 @@ pub trait TransactionDigest { type OrchardDigest; /// The digest type produced for the Ironwood bundle in version 6 transactions. type IronwoodDigest; + /// The digest type produced for the Tachyon bundle in version 7 transactions. + #[cfg(zcash_unstable = "nutachyon")] + type TachyonDigest; type Digest; @@ -1155,6 +1372,10 @@ pub trait TransactionDigest { ironwood_bundle: Option<&orchard::Bundle>, ) -> Self::IronwoodDigest; + /// Computes the digest for the Tachyon bundle in version 7 transactions. + #[cfg(zcash_unstable = "nutachyon")] + fn digest_tachyon(&self, tachyon_bundle: &zcash_tachyon::TachyonBundle) -> Self::TachyonDigest; + fn combine( &self, header_digest: Self::HeaderDigest, @@ -1162,6 +1383,7 @@ pub trait TransactionDigest { sapling_digest: Self::SaplingDigest, orchard_digest: Self::OrchardDigest, ironwood_digest: Self::IronwoodDigest, + #[cfg(zcash_unstable = "nutachyon")] tachyon_digest: Self::TachyonDigest, ) -> Self::Digest; } @@ -1205,6 +1427,8 @@ pub mod testing { BranchId::Nu6_3 => Just(TxVersion::V6).boxed(), #[cfg(zcash_unstable = "nu7")] BranchId::Nu7 => Just(TxVersion::V6).boxed(), + #[cfg(zcash_unstable = "nutachyon")] + BranchId::NuTachyon => Just(TxVersion::V7).boxed(), } } @@ -1231,6 +1455,8 @@ pub mod testing { sapling_bundle, orchard_bundle, ironwood_bundle, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, } } } @@ -1260,6 +1486,8 @@ pub mod testing { sapling_bundle, orchard_bundle, ironwood_bundle, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, } } } @@ -1287,6 +1515,8 @@ pub mod testing { sapling_bundle, orchard_bundle, ironwood_bundle, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_bundle: zcash_tachyon::TachyonBundle::NoBundle, } } } diff --git a/crates/zcash_primitives/src/transaction/sighash.rs b/crates/zcash_primitives/src/transaction/sighash.rs index b4af6ce3..3af34810 100644 --- a/crates/zcash_primitives/src/transaction/sighash.rs +++ b/crates/zcash_primitives/src/transaction/sighash.rs @@ -51,5 +51,10 @@ pub fn signature_hash< TxVersion::V5 => v5_signature_hash(tx, signable_input, txid_parts), TxVersion::V6 => v6_signature_hash(tx, signable_input, txid_parts), + + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => { + crate::transaction::sighash_v6::v7_signature_hash(tx, signable_input, txid_parts) + } }) } diff --git a/crates/zcash_primitives/src/transaction/sighash_v6.rs b/crates/zcash_primitives/src/transaction/sighash_v6.rs index e0e78751..fbf11e66 100644 --- a/crates/zcash_primitives/src/transaction/sighash_v6.rs +++ b/crates/zcash_primitives/src/transaction/sighash_v6.rs @@ -7,6 +7,9 @@ use crate::transaction::{ sighash_v5::transparent_sig_digest, txid::to_hash_v6, }; +#[cfg(zcash_unstable = "nutachyon")] +use crate::transaction::txid::to_hash_v7; + pub fn v6_signature_hash< TA: TransparentAuthorizingContext, A: Authorization, @@ -36,3 +39,34 @@ pub fn v6_signature_hash< txid_parts.ironwood_digest, ) } + +/// Computes the V7 signature hash, including the Tachyon bundle's effecting commitment. +#[cfg(zcash_unstable = "nutachyon")] +pub fn v7_signature_hash< + TA: TransparentAuthorizingContext, + A: Authorization, +>( + tx: &TransactionData, + signable_input: &SignableInput<'_>, + txid_parts: &TxDigests, +) -> Blake2bHash { + assert_eq!( + tx.transparent_bundle.is_some(), + txid_parts.transparent_digests.is_some() + ); + + to_hash_v7( + tx.consensus_branch_id, + txid_parts.header_digest, + transparent_sig_digest( + tx.transparent_bundle + .as_ref() + .zip(txid_parts.transparent_digests.as_ref()), + signable_input, + ), + txid_parts.sapling_digest, + txid_parts.orchard_digest, + txid_parts.ironwood_digest, + txid_parts.tachyon_digest, + ) +} diff --git a/crates/zcash_primitives/src/transaction/tests.rs b/crates/zcash_primitives/src/transaction/tests.rs index 8fe585fe..3728751c 100644 --- a/crates/zcash_primitives/src/transaction/tests.rs +++ b/crates/zcash_primitives/src/transaction/tests.rs @@ -17,6 +17,9 @@ use { zcash_script::script, }; +#[cfg(all(test, zcash_unstable = "nutachyon"))] +use zcash_protocol::constants::{V7_TX_VERSION, V7_VERSION_GROUP_ID}; + #[cfg(all(test, not(zcash_unstable = "nu7")))] use crate::transaction::{ TransactionDigest, @@ -70,6 +73,289 @@ fn suggested_version_for_v5_branches_is_not_v6() { ); } +#[test] +#[cfg(zcash_unstable = "nutachyon")] +fn v7_is_enabled_by_nu_tachyon_and_roundtrips() { + assert_eq!( + TxVersion::suggested_for_branch(BranchId::NuTachyon), + TxVersion::V7 + ); + assert!(TxVersion::V7.valid_in_branch(BranchId::NuTachyon)); + assert!(!TxVersion::V7.valid_in_branch(BranchId::Nu6_3)); + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + assert!(TxVersion::V7.has_zip233()); + + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + let zip233_amount = Zatoshis::const_from_u64(123_456); + + let tx = TransactionData::from_parts_v7( + BranchId::NuTachyon, + 0, + 0u32.into(), + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + zip233_amount, + None, + None, + None, + None, + zcash_tachyon::TachyonBundle::NoBundle, + ) + .freeze() + .unwrap(); + assert!(tx.tachyon_bundle().is_no_bundle()); + + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + { + let tx_without_burn = TransactionData::from_parts_v7( + BranchId::NuTachyon, + 0, + 0u32.into(), + Zatoshis::ZERO, + None, + None, + None, + None, + zcash_tachyon::TachyonBundle::NoBundle, + ) + .freeze() + .unwrap(); + assert_ne!(tx.txid(), tx_without_burn.txid()); + } + + let mut encoded = Vec::new(); + tx.write(&mut encoded).unwrap(); + assert_eq!(&encoded[..4], &(V7_TX_VERSION | (1 << 31)).to_le_bytes()); + assert_eq!(&encoded[4..8], &V7_VERSION_GROUP_ID.to_le_bytes()); + assert_eq!( + &encoded[8..12], + &u32::from(BranchId::NuTachyon).to_le_bytes() + ); + + let decoded = Transaction::read(&encoded[..], BranchId::Sprout).unwrap(); + assert_eq!(decoded.version(), TxVersion::V7); + assert_eq!(decoded.consensus_branch_id(), BranchId::NuTachyon); + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + assert_eq!(decoded.zip233_amount(), zip233_amount); + assert!(decoded.tachyon_bundle().is_no_bundle()); + let mut reencoded = Vec::new(); + decoded.write(&mut reencoded).unwrap(); + assert_eq!(reencoded, encoded); +} + +#[test] +#[cfg(zcash_unstable = "nutachyon")] +fn v7_tachyon_bundle_roundtrips_and_changes_commitments() { + use crate::transaction::{Authorized, sighash_v6::v7_signature_hash}; + use rand::{SeedableRng, rngs::StdRng}; + use zcash_tachyon::{ + ActionPlan, Bundle, BundlePlan, Note, PointerStamp, TachyonBundle, + effect::Output, + entropy::ActionEntropy, + keys::private::SpendingKey, + note::CommitmentTrapdoor, + nullifier, + value::{Positive, Trapdoor}, + }; + + let rng = &mut StdRng::seed_from_u64(0); + let spending_key = SpendingKey::from([1; 32]); + let note = Note { + pk: spending_key.derive_payment_key(), + value: Positive::try_from(1u64).unwrap(), + psi: nullifier::Trapdoor::random(rng), + rcm: CommitmentTrapdoor::random(rng), + }; + let plan = BundlePlan::new( + Vec::new(), + alloc::vec![ActionPlan::::output( + note, + ActionEntropy::random(rng), + Trapdoor::random(rng), + )], + ); + let unproven = plan + .sign(rng, &[0; 32], &spending_key.derive_auth_private()) + .unwrap(); + let tachyon_bundle = TachyonBundle::Adjunct(Bundle { + actions: unproven.actions, + value_balance: unproven.value_balance, + binding_sig: unproven.binding_sig, + memo: unproven.memo, + stamp: PointerStamp::try_from([0xee; 64]).unwrap(), + }); + + let transaction = TransactionData::::from_parts_v7( + BranchId::NuTachyon, + 0, + 0u32.into(), + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + Zatoshis::ZERO, + None, + None, + None, + None, + tachyon_bundle.clone(), + ) + .freeze() + .unwrap(); + let transaction_without_tachyon = TransactionData::::from_parts_v7( + BranchId::NuTachyon, + 0, + 0u32.into(), + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + Zatoshis::ZERO, + None, + None, + None, + None, + TachyonBundle::NoBundle, + ) + .freeze() + .unwrap(); + + assert!(matches!( + transaction.tachyon_bundle(), + TachyonBundle::Adjunct(_) + )); + assert_ne!(transaction.txid(), transaction_without_tachyon.txid()); + assert_ne!( + transaction.auth_commitment(), + transaction_without_tachyon.auth_commitment() + ); + + let sighash_transaction = TransactionData::::from_parts_v7( + BranchId::NuTachyon, + 0, + 0u32.into(), + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + Zatoshis::ZERO, + None, + None, + None, + None, + tachyon_bundle, + ); + let sighash_transaction_without_tachyon = TransactionData::::from_parts_v7( + BranchId::NuTachyon, + 0, + 0u32.into(), + #[cfg(all(zcash_unstable = "nu7", feature = "zip-233"))] + Zatoshis::ZERO, + None, + None, + None, + None, + TachyonBundle::NoBundle, + ); + let txid_parts = sighash_transaction.digest(TxIdDigester); + let txid_parts_without_tachyon = sighash_transaction_without_tachyon.digest(TxIdDigester); + assert_ne!( + v7_signature_hash(&sighash_transaction, &SignableInput::Shielded, &txid_parts,), + v7_signature_hash( + &sighash_transaction_without_tachyon, + &SignableInput::Shielded, + &txid_parts_without_tachyon, + ), + ); + + assert!( + transaction + .fee_paid::(|_| unreachable!()) + .is_err() + ); + assert_eq!( + transaction_without_tachyon + .fee_paid::(|_| unreachable!()), + Ok(Some(Zatoshis::ZERO)) + ); + + let mut encoded = Vec::new(); + transaction.write(&mut encoded).unwrap(); + let decoded = Transaction::read(&encoded[..], BranchId::Sprout).unwrap(); + assert!(matches!( + decoded.tachyon_bundle(), + TachyonBundle::Adjunct(_) + )); + + let mut reencoded = Vec::new(); + decoded.write(&mut reencoded).unwrap(); + assert_eq!(reencoded, encoded); +} + +#[test] +#[cfg(all(zcash_unstable = "nutachyon", not(zcash_unstable = "nu7")))] +fn v7_zakura_serialization_vectors_deserialize_and_reserialize_exactly() { + use zcash_tachyon::TachyonBundle; + + #[derive(Clone, Copy)] + enum ExpectedBundle { + None, + Adjunct, + Proven, + } + + let vectors = [ + ( + "empty", + include_str!("tests/data/v7_empty.hex"), + ExpectedBundle::None, + 0, + ), + ( + "adjunct", + include_str!("tests/data/v7_tachyon_adjunct.hex"), + ExpectedBundle::Adjunct, + 1, + ), + ( + "proven", + include_str!("tests/data/v7_tachyon_proven.hex"), + ExpectedBundle::Proven, + 1, + ), + ( + "multi-action proven", + include_str!("tests/data/v7_tachyon_multi_action_proven.hex"), + ExpectedBundle::Proven, + 2, + ), + ]; + + for (name, encoded_hex, expected_bundle, expected_action_count) in vectors { + let encoded = hex::decode(encoded_hex.trim()).unwrap(); + let transaction = Transaction::read(&encoded[..], BranchId::Sprout) + .unwrap_or_else(|error| panic!("{name} vector did not deserialize: {error}")); + + assert_eq!(transaction.version(), TxVersion::V7, "{name}"); + assert_eq!( + transaction.consensus_branch_id(), + BranchId::NuTachyon, + "{name}" + ); + assert_eq!( + transaction + .tachyon_bundle() + .as_dyn() + .map_or(0, |bundle| bundle.actions.len()), + expected_action_count, + "{name}" + ); + assert!( + matches!( + (transaction.tachyon_bundle(), expected_bundle), + (TachyonBundle::NoBundle, ExpectedBundle::None) + | (TachyonBundle::Adjunct(_), ExpectedBundle::Adjunct) + | (TachyonBundle::Proven(_), ExpectedBundle::Proven) + ), + "{name} bundle state differs" + ); + + let mut reencoded = Vec::new(); + transaction.write(&mut reencoded).unwrap(); + assert_eq!(reencoded, encoded, "{name} reserialization differs"); + } +} + #[cfg(all(test, not(zcash_unstable = "nu7")))] #[test] fn v4_transactions_remain_valid_in_nu6_3() { @@ -885,6 +1171,15 @@ proptest! { } } +#[cfg(zcash_unstable = "nutachyon")] +proptest! { + #![proptest_config(ProptestConfig::with_cases(10))] + #[test] + fn tx_serialization_roundtrip_nu_tachyon(tx in arb_tx(BranchId::NuTachyon)) { + check_roundtrip(tx)?; + } +} + #[test] fn zip_0143() { for tv in self::data::zip_0143::make_test_vectors() { diff --git a/crates/zcash_primitives/src/transaction/tests/data/v7_empty.hex b/crates/zcash_primitives/src/transaction/tests/data/v7_empty.hex new file mode 100644 index 00000000..e2c819c1 --- /dev/null +++ b/crates/zcash_primitives/src/transaction/tests/data/v7_empty.hex @@ -0,0 +1 @@ +0700008068636174fcffffff000000000000000000000000000000 diff --git a/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_adjunct.hex b/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_adjunct.hex new file mode 100644 index 00000000..2c37a517 --- /dev/null +++ b/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_adjunct.hex @@ -0,0 +1 @@ +0700008068636174fcffffff00000000000000000000000000000200000000000000000100000000ed302d991bf94c09fc98462200000000000000000000000000000040ba6454c4a1d42730b53cbf30d05d3f95aa541c98eba0205a75bb7983443b3731010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020200eeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeeee diff --git a/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_multi_action_proven.hex b/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_multi_action_proven.hex new file mode 100644 index 00000000..06989016 --- /dev/null +++ b/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_multi_action_proven.hex @@ -0,0 +1 @@ +0700008068636174fcffffff0000000000000000000000000000012c010000000000000200000000ed302d991bf94c09fc98462200000000000000000000000000000040ba6454c4a1d42730b53cbf30d05d3f95aa541c98eba0205a75bb7983443b373100000000ed302d991bf94c09fc98462200000000000000000000000000000040336a1f7ed0903193f39fa5306f3fd88d8a0a8907a1defde547f117e7075d9e010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010103030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303030303020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000185068a3d140960147c9750b27804e5bc27a7c75c5bb21ad308147bb33a990be032f2222227c6801d9cbac77a1e54884299e3f6a65ed819456ab9e549e206c1a373f333333ea0daf32301606a8fb9939c1e0b03a3616ee12c67692b02f5901f12d5f555555c6580ae6f8e822b5273ca4f06593dbd767c60fa50d7a6852ca2b9e1b0100000000000000cd6d63a93b98612d2650efde8ff4991de7d2e4e34dc4a2a366e255a058d4c71cbc519092acba344cf39e3b15e74a88a9e45fc4a309bbc5900799cfbe692d6e142546ecaee1e61f8d868367459c3d0e66c382d292dda9580670dab4625e0b3667000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_proven.hex b/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_proven.hex new file mode 100644 index 00000000..9917c5e1 --- /dev/null +++ b/crates/zcash_primitives/src/transaction/tests/data/v7_tachyon_proven.hex @@ -0,0 +1 @@ +0700008068636174fcffffff00000000000000000000000000000164000000000000000100000000ed302d991bf94c09fc98462200000000000000000000000000000040ba6454c4a1d42730b53cbf30d05d3f95aa541c98eba0205a75bb7983443b3731010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010101010202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020202020200000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000001160e7bcdd53d173145d7366c9e10b0eb7461760e7719b59d32c384812e5cc89015f555555c6580ae6f8e822b5273ca4f06593dbd767c60fa50d7a6852ca2b9e1b0100000000000000cd6d63a93b98612d2650efde8ff4991de7d2e4e34dc4a2a366e255a058d4c71cbc519092acba344cf39e3b15e74a88a9e45fc4a309bbc5900799cfbe692d6e142546ecaee1e61f8d868367459c3d0e66c382d292dda9580670dab4625e0b3667000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000000 diff --git a/crates/zcash_primitives/src/transaction/txid.rs b/crates/zcash_primitives/src/transaction/txid.rs index a637d983..d97567eb 100644 --- a/crates/zcash_primitives/src/transaction/txid.rs +++ b/crates/zcash_primitives/src/transaction/txid.rs @@ -59,6 +59,8 @@ fn sapling_spends_noncompact_personalization(version: TxVersion) -> &'static [u8 ZCASH_SAPLING_SPENDS_NONCOMPACT_HASH_PERSONALIZATION } TxVersion::V6 => ZCASH_SAPLING_SPENDS_V6_NONCOMPACT_HASH_PERSONALIZATION, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => ZCASH_SAPLING_SPENDS_V6_NONCOMPACT_HASH_PERSONALIZATION, } } @@ -68,6 +70,8 @@ fn sapling_auth_personalization(version: TxVersion) -> &'static [u8; 16] { ZCASH_SAPLING_SIGS_HASH_PERSONALIZATION } TxVersion::V6 => ZCASH_SAPLING_V6_SIGS_HASH_PERSONALIZATION, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => ZCASH_SAPLING_V6_SIGS_HASH_PERSONALIZATION, } } @@ -75,6 +79,8 @@ fn sapling_auth_includes_anchor(version: TxVersion) -> bool { match version { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 | TxVersion::V5 => false, TxVersion::V6 => true, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => true, } } @@ -89,6 +95,8 @@ fn orchard_commitment_domain(version: TxVersion) -> (ValuePool, OrchardTxVersion (ValuePool::Orchard, OrchardTxVersion::V5) } TxVersion::V6 => (ValuePool::Orchard, OrchardTxVersion::V6), + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => (ValuePool::Orchard, OrchardTxVersion::V6), } } @@ -165,6 +173,8 @@ pub(crate) fn hash_sapling_spends( let write_anchor = match version { TxVersion::Sprout(_) | TxVersion::V3 | TxVersion::V4 | TxVersion::V5 => true, TxVersion::V6 => false, + #[cfg(zcash_unstable = "nutachyon")] + TxVersion::V7 => false, }; if write_anchor { nh.write_all(&s_spend.anchor().to_repr()).unwrap(); @@ -304,6 +314,8 @@ impl TransactionDigest for TxIdDigester { type SaplingDigest = Option; type OrchardDigest = Option; type IronwoodDigest = Option; + #[cfg(zcash_unstable = "nutachyon")] + type TachyonDigest = [u8; 32]; type Digest = TxDigests; @@ -365,6 +377,11 @@ impl TransactionDigest for TxIdDigester { }) } + #[cfg(zcash_unstable = "nutachyon")] + fn digest_tachyon(&self, tachyon_bundle: &zcash_tachyon::TachyonBundle) -> Self::TachyonDigest { + tachyon_bundle.commitment() + } + fn combine( &self, header_digest: Self::HeaderDigest, @@ -372,6 +389,7 @@ impl TransactionDigest for TxIdDigester { sapling_digest: Self::SaplingDigest, orchard_digest: Self::OrchardDigest, ironwood_digest: Self::IronwoodDigest, + #[cfg(zcash_unstable = "nutachyon")] tachyon_digest: Self::TachyonDigest, ) -> Self::Digest { TxDigests { header_digest, @@ -379,6 +397,8 @@ impl TransactionDigest for TxIdDigester { sapling_digest, orchard_digest, ironwood_digest, + #[cfg(zcash_unstable = "nutachyon")] + tachyon_digest, } } } @@ -467,6 +487,57 @@ pub(crate) fn to_hash_v6( h.finalize() } +/// Combines transaction component digests for a version 7 transaction. +#[cfg(zcash_unstable = "nutachyon")] +pub(crate) fn to_hash_v7( + consensus_branch_id: BranchId, + header_digest: Blake2bHash, + transparent_digest: Blake2bHash, + sapling_digest: Option, + orchard_digest: Option, + ironwood_digest: Option, + tachyon_digest: [u8; 32], +) -> Blake2bHash { + let mut personal = [0; 16]; + personal[..12].copy_from_slice(ZCASH_TX_PERSONALIZATION_PREFIX); + (&mut personal[12..]) + .write_u32_le(consensus_branch_id.into()) + .unwrap(); + + let mut h = hasher(&personal); + h.write_all(header_digest.as_bytes()).unwrap(); + h.write_all(transparent_digest.as_bytes()).unwrap(); + h.write_all( + sapling_digest + .unwrap_or_else(hash_sapling_txid_empty) + .as_bytes(), + ) + .unwrap(); + h.write_all( + orchard_digest + .unwrap_or_else(|| { + let (value_pool, tx_version) = orchard_commitment_domain(TxVersion::V7); + orchard::commitments::hash_bundle_txid_empty(value_pool, tx_version) + .expect("empty Orchard bundle txid commitment is valid for its tx format") + }) + .as_bytes(), + ) + .unwrap(); + h.write_all( + ironwood_digest + .unwrap_or_else(|| { + let (value_pool, tx_version) = ironwood_v6_domain(); + orchard::commitments::hash_bundle_txid_empty(value_pool, tx_version) + .expect("empty Ironwood bundle txid commitment is valid") + }) + .as_bytes(), + ) + .unwrap(); + h.write_all(&tachyon_digest).unwrap(); + + h.finalize() +} + /// Combines transaction component digests into a transaction ID. /// /// Version 6 transactions include the Ironwood bundle digest as a separate @@ -477,6 +548,20 @@ pub fn to_txid( consensus_branch_id: BranchId, digests: &TxDigests, ) -> TxId { + #[cfg(zcash_unstable = "nutachyon")] + if txversion.has_tachyon() { + let txid_digest = to_hash_v7( + consensus_branch_id, + digests.header_digest, + hash_transparent_txid_data(digests.transparent_digests.as_ref()), + digests.sapling_digest, + digests.orchard_digest, + digests.ironwood_digest, + digests.tachyon_digest, + ); + return TxId::from_bytes(<[u8; 32]>::try_from(txid_digest.as_bytes()).unwrap()); + } + let txid_digest = if txversion.has_ironwood() { to_hash_v6( consensus_branch_id, @@ -515,6 +600,8 @@ impl TransactionDigest for BlockTxCommitmentDigester { type SaplingDigest = Blake2bHash; type OrchardDigest = Blake2bHash; type IronwoodDigest = Blake2bHash; + #[cfg(zcash_unstable = "nutachyon")] + type TachyonDigest = [u8; 32]; type Digest = Blake2bHash; @@ -610,6 +697,11 @@ impl TransactionDigest for BlockTxCommitmentDigester { ) } + #[cfg(zcash_unstable = "nutachyon")] + fn digest_tachyon(&self, tachyon_bundle: &zcash_tachyon::TachyonBundle) -> Self::TachyonDigest { + tachyon_bundle.auth_digest() + } + fn combine( &self, tx_context: Self::HeaderDigest, @@ -617,6 +709,7 @@ impl TransactionDigest for BlockTxCommitmentDigester { sapling_digest: Self::SaplingDigest, orchard_digest: Self::OrchardDigest, ironwood_digest: Self::IronwoodDigest, + #[cfg(zcash_unstable = "nutachyon")] tachyon_digest: Self::TachyonDigest, ) -> Self::Digest { let (_txversion, consensus_branch_id) = tx_context; let mut personal = [0; 16]; @@ -634,6 +727,11 @@ impl TransactionDigest for BlockTxCommitmentDigester { h.write_all(ironwood_digest.as_bytes()).unwrap(); } + #[cfg(zcash_unstable = "nutachyon")] + if _txversion.has_tachyon() { + h.write_all(&tachyon_digest).unwrap(); + } + h.finalize() } } diff --git a/deny.toml b/deny.toml index 78e883ad..265f70a8 100644 --- a/deny.toml +++ b/deny.toml @@ -54,10 +54,27 @@ skip = [ { name = "syn", version = "=1.0.109" }, { name = "syn", version = "=2.0.119" }, { name = "windows-sys", version = "=0.52.0" }, + # zcash_history uses the unbounded CompactSize API introduced in 0.5, + # while the other imported librustzcash crates still depend on 0.4. + { name = "zcash_encoding", version = "=0.5.0" }, + # The cfg-gated Tachyon/Ragu stack consumes the published Zakura 1.0.1 + # crates and its own maybe-rayon fork, while this workspace builds the + # corresponding packages from local paths or crates.io. Keep these source + # duplicates exact until the external stack can share workspace sources. + { name = "maybe-rayon", version = "=0.1.1" }, + { name = "zakura-bls12-381", version = "=1.0.1" }, + { name = "zakura-jubjub", version = "=1.0.1" }, + { name = "zakura-pasta-curves", version = "=1.0.1" }, + { name = "zakura-reddsa", version = "=1.0.1" }, ] [sources] unknown-registry = "deny" unknown-git = "deny" allow-registry = ["https://github.com/rust-lang/crates.io-index"] -allow-git = [] +allow-git = [ + "https://github.com/tachyon-zcash/maybe-rayon.git", + "https://github.com/tachyon-zcash/ragu", + "https://github.com/tachyon-zcash/tachyon", + "https://github.com/zcash/librustzcash.git", +] diff --git a/docs/changelog/unreleased/178.md b/docs/changelog/unreleased/178.md new file mode 100644 index 00000000..65a71068 --- /dev/null +++ b/docs/changelog/unreleased/178.md @@ -0,0 +1,9 @@ +## zakura-primitives + +### Added + +- Added experimental NuTachyon and V7 transaction support, including ZIP-233 + burn amounts, Tachyon bundle serialization, value balance accounting, + transaction IDs, signature hashes, and authorization digests, behind the + corresponding unstable cfgs, with cross-implementation serialization vectors + ([#178](https://github.com/zakura-core/common/pull/178)).