diff --git a/crates/randscan-api/tests/real_node.rs b/crates/randscan-api/tests/real_node.rs index f67ea30..7d98741 100644 --- a/crates/randscan-api/tests/real_node.rs +++ b/crates/randscan-api/tests/real_node.rs @@ -216,8 +216,9 @@ async fn start_node(bin: &PathBuf, cli: &PathBuf) -> (Node, String, String) { "100", "--byte-price", "800", - "--bundle-gas-limit", - "20479", + // No `--bundle-gas-limit`: the node writes its own bundle guest's ceiling, the one + // value its genesis accepts — 20 479 under constraint set 9 (v0.8.0–v0.8.6, chain + // 21), 22 527 under set 11 (v0.8.7, chain 22) — so one test runs on either build. "--gas-dynamic", "10485760,262144,1250", ] @@ -576,7 +577,16 @@ async fn explorer_agrees_with_a_real_shielded_node() { if node_limits["gas_metering"] == "circuit" { let l = &stats["limits"]; assert_eq!(l["gas_metering"], "circuit", "{l}"); - assert_eq!(l["bundle_gas_limit"], 20479); + // The build's own pin (set 9: 20 479, chain 21; set 11: 22 527, chain 22), as the node + // serves it. + assert_eq!( + l["bundle_gas_limit"], node_limits["bundle_gas_limit"], + "{l}" + ); + assert!( + l["bundle_gas_limit"] == 20479 || l["bundle_gas_limit"] == 22527, + "{l}" + ); assert_eq!(l["adjust_bps"], 1250); assert_eq!(l["envelope_bytes"], 1860); assert_eq!(l["hardening_v6"], true); diff --git a/crates/randscan-core/Cargo.toml b/crates/randscan-core/Cargo.toml index a4d3099..65dada4 100644 --- a/crates/randscan-core/Cargo.toml +++ b/crates/randscan-core/Cargo.toml @@ -17,9 +17,9 @@ uuid = { workspace = true } # not publish directly (unlike a `bridge_attest`'s deposit, whose `commitment` field the node # already serves) and link that leaf to its transaction. Pinned to the *exact* versions # `crates/randscan-viewing` uses (fullnode's vendored zkVM, checked at d40fb94 = v0.6.6, chain 18; unchanged at 86941a1 = v0.6.7, chains 18 and 19). The Poseidon2 round -# constants are circuits' committed table (`src/poseidon2_constants.rs`, audit ZKV-2), no longer a -# seeded `rand` `StdRng` draw, so `rand` is only a dev-dependency now: the table's own test re-runs -# the old draw to prove the two equal. Deliberately not a dependency on `crates/randscan-viewing` +# constants are the committed table (`src/poseidon2_constants.rs`, audit ZKV-2) — since constraint +# set 11 (fullnode 60a7d03, chain 22) the Grain table p3-goldilocks 0.7.0 ships — so `rand` is only +# a dev-dependency: the table's own tests sample with it. Deliberately not a dependency on `crates/randscan-viewing` # itself, which is wasm32-only (`getrandom`'s `wasm_js` backend) and excluded from this workspace. p3-goldilocks = "=0.7.0" p3-poseidon2 = "=0.7.0" diff --git a/crates/randscan-core/src/lib.rs b/crates/randscan-core/src/lib.rs index 1f74978..4b16c3d 100644 --- a/crates/randscan-core/src/lib.rs +++ b/crates/randscan-core/src/lib.rs @@ -5,6 +5,8 @@ pub mod amount; pub mod error; pub mod notecommit; +// Byte-identical to fullnode's copy (see its header), whose rows rustfmt would rewrap. +#[rustfmt::skip] pub mod poseidon2_constants; pub mod types; diff --git a/crates/randscan-core/src/notecommit.rs b/crates/randscan-core/src/notecommit.rs index 3920e64..a116d35 100644 --- a/crates/randscan-core/src/notecommit.rs +++ b/crates/randscan-core/src/notecommit.rs @@ -178,16 +178,16 @@ mod tests { use super::*; /// The shared fixture `crates/randscan-viewing/tests/vectors.json`'s `note`/`cm` fields, - /// produced by the fullnode itself: `Note { pk: pk_b, from: pk_a, amount: 1500000000, - /// asset: 0, time: 66, r: aa..22 }`. Cross-checks this crate's hash against the same + /// produced by the fullnode itself (constraint set 11, fullnode 60a7d03): `Note { pk: pk_b, + /// from: pk_a, amount: 1500000000, asset: 0, time: 66, r: aa..22 }`. Cross-checks this crate's hash against the same /// vector `randscan-viewing`'s own tests open, so a drift in either copy is caught. #[test] fn note_commitment_matches_the_shared_test_vector() { let note = Note { - pk: word8_from_hex("53f57f874e8fee7ad3a5e5be820a12ab7836d5b642631c974ed0b5057f9c60aa") + pk: word8_from_hex("e4ed010b677dee856638ef991244116666da47248986444ddcbc86045472f64c") .unwrap(), from: word8_from_hex( - "c37ed965c936aa116c7184b4ae1d285c0a1882813e375a00456ea35df1feb955", + "6a9958fe0337649400adab0f9ce3b95bb472353c0b0e103b9fd353a2678f68b1", ) .unwrap(), amount: 1_500_000_000, @@ -198,7 +198,7 @@ mod tests { }; assert_eq!( word8_to_hex(¬e.commitment()), - "7c73c93ede9ed2995ee876578ea30cdbcc941f952e5fff9d1515ca21e757342d" + "f8514c636114a0bcf79f11f94c0ad0c7e104dbaea54c9ca36fa19c7be5fc4767" ); } @@ -220,8 +220,9 @@ mod tests { } /// The fullnode's and circuits' known-answer vectors for the width-8 permutation - /// (`poseidon2_constants::tests::the_permutation_answers_its_known_vectors`, captured on - /// circuits `573ef2e`, the seeded draw), run through the permutation this crate hashes with. + /// (`poseidon2_constants::tests::the_permutation_answers_its_known_vectors`, constraint set 11's + /// Grain table at fullnode 60a7d03; the seeded draw of sets ≤ 10 answered `0x1e4b2c9e…` for + /// zero), run through the permutation this crate hashes with. #[test] fn the_permutation_answers_the_fullnode_known_vectors() { use p3_symmetric::Permutation; @@ -229,40 +230,40 @@ mod tests { ( [0; 8], [ - 0x1e4b2c9eebb442b0, - 0x2fbb0154ab9d22da, - 0x9c397e8d1b856b3d, - 0x3900699f4fe93a6e, - 0xcb37891674d3ad6b, - 0x9b530f7ac1ef1f56, - 0x0510bc15edfecf33, - 0xf9caffe23a93cd28, + 0x4411ec57c44145f5, + 0x5ff55b96baa2f47b, + 0xdee0e2ae35662802, + 0x023c96b32c07981d, + 0x777e4afeaaf2e6a1, + 0x606c248e5ef427da, + 0x862e82242b2c5001, + 0x61ea532cc4c908c7, ], ), ( [0, 1, 2, 3, 4, 5, 6, 7], [ - 0x682c703ce406cd60, - 0x35fe4cacd5147b44, - 0xf0b819068ae2838e, - 0xde5f0a9ba791a8f4, - 0xcf8ee9826729b322, - 0x38e89ce1e7fcb535, - 0xf58f43c0801e00db, - 0x694ec48edbb331fa, + 0x020cf04a1b214d14, + 0x84e14aaaeacaed25, + 0x1ae0f640e81c7457, + 0xa4d204cbaeb0d8a5, + 0x0cf637b627b3a7ff, + 0x788d304d948b486b, + 0x7327133ea1949af4, + 0xf415abb924da395b, ], ), ( [0xffff_ffff_0000_0000; 8], [ - 0xdfebf956a8205183, - 0xbacca056a5ba1b75, - 0xdc24d665e3f9864b, - 0x1ad86aab4b3e131a, - 0xc68f628d6f8833e6, - 0x0b913e0aa0757959, - 0x248d88435c62b658, - 0x7bc6fc5500a81dbc, + 0x5a986ad1feb0d7b1, + 0x76379c3befced08d, + 0xcebc0f4e8ae21d67, + 0x8f9cc577b6f2cd12, + 0xe0e58584b289c1dd, + 0xf1400ffbb6875b78, + 0x2014ea6e78f1bd58, + 0xbaa54d6e51fd54f1, ], ), ]; @@ -275,25 +276,26 @@ mod tests { } } - /// Two alloc notes of the chain-15 genesis (fullnode `deploy/genesis-chain15.json`), whose - /// commitments every node recomputes from their openings at `rand-node init` (`from` the zero - /// word): a RAND note (asset 0) and the carried-over zUSD note (asset 1). + /// The openings of two alloc notes of the chain-15 genesis (fullnode `deploy/genesis-chain15.json`, + /// `from` the zero word): a RAND note (asset 0) and the carried-over zUSD note (asset 1). The + /// commitments are constraint set 11's, computed by the fullnode crate at 60a7d03 — under set 11 + /// that file no longer builds (its set-9 commitments were `be14787d…` and `d75053df…`). #[test] - fn note_commitments_match_the_chain_15_genesis() { + fn note_commitments_of_the_chain_15_openings_match_the_fullnode() { let cases = [ ( "47bd82b0401f3bc5b33e043fc7d076cca4d88f3233698ead959fa6009f284d36", 1_000_000_000_000u64, 0u32, "21764e9e43246765ae9464120b7bc134a80d62d680c613b649e6d0468fb632f2", - "be14787d4e34115e2b6752b77c51b5de61c1805edfc8133af39cb47ad24f9322", + "579c82febccbda9641690171c3672267e8cea24142e17d77cad8021e4299749b", ), ( "f4a2c7c39a812c47e569cad909a5074076a8530785b1f7c10a4b6ffdcf3c7c96", 1_000_000_000, 1, "32f0d22777439fa85cd3fd04c3afa03295848c08b1eadd805844f3fa81752ab2", - "d75053df4bac3290830cc0eb0f8ce1c461d1583e6c23a2ec01f2dfcd66f882e6", + "5c0d78d1a2005d339c7098bfa148695eac8780bad6d416fc6f66a4d4ece585ae", ), ]; for (pk, amount, asset, r, cm) in cases { @@ -309,8 +311,8 @@ mod tests { } } - /// The 86 round constants are circuits' committed table (`research/src/poseidon2_constants.rs` - /// at 224960c): SHA-256 over INITIAL (4×8), INTERNAL (22), TERMINAL (4×8), each value + /// The 86 round constants are constraint set 11's Grain table (fullnode + /// `crates/randprotocol-zkvm/src/poseidon2_constants.rs` at 60a7d03): SHA-256 over INITIAL (4×8), INTERNAL (22), TERMINAL (4×8), each value /// little-endian, computed from that file, not from this crate's copy. #[test] fn the_constants_are_the_circuits_table() { @@ -330,7 +332,7 @@ mod tests { } assert_eq!( hex::encode(h.finalize()), - "e551d3944d88218c8c4cacb6cb6d8ae4bc2034adc155a6139b0ac77fcc5c24ac" + "a0289c4f0bccd6f759f818fe2e9e245aa1617a9a248cf3460496e2a18a002f82" ); } diff --git a/crates/randscan-core/src/poseidon2_constants.rs b/crates/randscan-core/src/poseidon2_constants.rs index 0262034..bda5f51 100644 --- a/crates/randscan-core/src/poseidon2_constants.rs +++ b/crates/randscan-core/src/poseidon2_constants.rs @@ -1,8 +1,10 @@ -// Copied verbatim from circuits `research/src/poseidon2_constants.rs` at 224960c, which fullnode -// vendors unchanged as `crates/randprotocol-zkvm/src/poseidon2_constants.rs` (f3b8bea). Keep -// everything below this header byte-identical to it; `notecommit::tests` pins the 86 values. +// Copied verbatim from fullnode `crates/randprotocol-zkvm/src/poseidon2_constants.rs` at +// feat/cs11-revendor 60a7d03 (constraint set 11, circuits 76a48dca: the Grain-derived table, +// ZKVM-107). Keep everything below this header byte-identical to it; `notecommit::tests` pins the +// 86 values. -//! The width-8 Goldilocks Poseidon2 round constants, as a literal table (audit finding ZKV-2). +//! The width-8 Goldilocks Poseidon2 round constants, as a literal table (audit finding ZKV-2; +//! since constraint set 11 the Grain derivation, ZKVM-107). //! //! Every Poseidon2 hash this zkVM computes — the Merkle commitments and the Fiat–Shamir //! challenger (`machine::permutation`), the in-circuit `poseidon2` chip's preprocessed round @@ -11,163 +13,83 @@ //! below and nothing else. `rand-zkvm-cuda` has no dependency on this crate (the dependency runs //! the other way), so it compiles this very file into itself with a `#[path]` module //! (`rand-zkvm-cuda/src/constants.rs`): one table, two crates, no copy. That is why this file -//! names only `p3_*` and `rand` paths, never `crate::`. +//! names only `p3_*` and `rand` paths, never `crate::` — and why the tests that need this crate +//! (the Grain re-derivation, the chip's own arithmetic) live in `poseidon2_grain.rs` instead. //! -//! ## How the numbers were made +//! ## Where the numbers come from //! -//! Before this table existed the permutation was built as -//! `Poseidon2Goldilocks::<8>::new_from_rng_128(&mut StdRng::seed_from_u64(PERM_SEED))`, with -//! `PERM_SEED = 0x5261_6e64_5a4b` ("RandZK"), and the chain's hashes (the genesis hash, every -//! program digest, every commitment) were computed with it. The table is that draw, printed once -//! and committed — the same 86 field elements, so not one hash output changes. The draw, exactly: +//! They are the output of the Poseidon paper's Grain LFSR for the parameters of this +//! permutation and nothing else — field type 1 (prime), S-box 0 (`x^alpha`, here `x^7`), +//! `n = 64`, `t = 8`, `R_F = 8`, `R_P = 22` — as `poseidon2_grain.rs` documents step by step. +//! There is no seed to choose. Three things pin the table: //! -//! - `rand 0.10.2`'s `StdRng` (ChaCha12, `chacha20 0.10.2`), seeded by -//! `rand_core 0.10.1`'s `SeedableRng::seed_from_u64(PERM_SEED)`; -//! - `p3-poseidon2 0.7.0`'s `new_from_rng_128` picks `(rounds_f, rounds_p) = (8, 22)` for -//! Goldilocks width 8 without touching the RNG, then draws, in this order: -//! `ExternalLayerConstants::new_from_rng(8, rng)` — the 4 initial rows ([`INITIAL`]), then the -//! 4 terminal rows ([`TERMINAL`]), each row eight `StandardUniform` samples — and then 22 -//! `StandardUniform` scalars for the partial rounds ([`INTERNAL`]); -//! - a Goldilocks `StandardUniform` sample is `p3-goldilocks 0.7.0`'s rejection sampler over -//! `next_u64` (a draw `>= p` is discarded and redrawn), so every value is already canonical. +//! - `poseidon2_grain`'s `the_table_is_the_grain_derivation` re-runs the generator and compares +//! all 86 values; +//! - `tools/poseidon2_grain/grain.py --check` is a second implementation (standard-library +//! Python) that does the same without building the crate; +//! - `tests::the_table_is_the_one_plonky3_ships` (below) compares with `p3-goldilocks 0.7.0`'s +//! `GOLDILOCKS_POSEIDON2_RC_8_{EXTERNAL_INITIAL, INTERNAL, EXTERNAL_FINAL}`, which upstream +//! documents as "Generated by the Grain LFSR with parameters: field_type=1, alpha=7 +//! (exp_flag=0), n=64, t=8, R_F=8, R_P=22". The two derivations were written independently +//! and agree, so this permutation is `p3-goldilocks`'s default width-8 one, the one external +//! cryptanalysis of Plonky3's Goldilocks Poseidon2 is about. //! -//! ## Why a table and not the draw +//! The linear layers are not constants of this file: the external layer is the Poseidon2 +//! paper's `M4`-circulant matrix and the internal layer is `p3-goldilocks`'s +//! `MATRIX_DIAG_8_GOLDILOCKS` (`tables::poseidon2::{mds_light, internal_matmul}`), and the round +//! numbers are `(8, 22)` with `x^7`. //! -//! `rand` documents `StdRng` as *not* reproducible across versions: its algorithm may change in -//! any release. A dependency bump could then have silently changed all 86 constants, every hash -//! with them — an unannounced consensus fork — and an auditor could not check the constants -//! without running the RNG. Now the numbers are in the source, and `tests::the_table_is_the_seeded_draw` -//! re-runs the draw only to prove the table equals it on today's `rand`: if a future `rand` -//! changes `StdRng`, that test goes red, not the chain. `tests::the_permutation_answers_its_known_vectors` -//! pins three permutation outputs captured on the pre-table build. +//! ## History +//! +//! Through constraint set 10 the table was a development draw: +//! `Poseidon2Goldilocks::<8>::new_from_rng_128(&mut StdRng::seed_from_u64(0x5261_6e64_5a4b))` +//! ("RandZK"), printed once and committed (ZKV-2) so a `rand` release could not change it. +//! Constraint set 11 replaced it with the table below (ZKVM-107, `docs/05-roadmap.md`), which +//! moved every Poseidon2 output — every program digest, key, root, commitment and genesis. use p3_goldilocks::{Goldilocks, Poseidon2Goldilocks}; use p3_poseidon2::ExternalLayerConstants; -/// The seed the table was drawn from ("RandZK"). Nothing derives constants from it any more; -/// it survives as the name `rand-zkvm-cuda`'s engines are keyed on (`constants::permutation`), -/// and in the test below that re-runs the draw. +/// An opaque tag, not a seed. Nothing derives constants from it: since constraint set 11 the +/// table is the Grain derivation, which has no seed. It keeps the value it had as the seed of the +/// development draw (`0x5261_6e64_5a4b`, "RandZK") only because `rand-zkvm-cuda`'s engines are +/// keyed on it (`constants::permutation(seed)`, `CpuHashEngine::new`, `GpuProver::probe`, +/// `gpu/ntt.rs::DEFAULT_PERM_SEED`, `recursion`'s `machine/backend.rs::PERM_SEED`): that tag +/// selects this committed table, and any other value selects a `StdRng` draw for that crate's own +/// tests. Renaming it would touch every engine constructor for no change in behaviour. pub const PERM_SEED: u64 = 0x5261_6e64_5a4b; -/// The 4 initial full rounds' constants (the first half of `ExternalLayerConstants`). + +/// The 4 initial full rounds' constants. pub const INITIAL: [[u64; 8]; 4] = [ - [ - 0xee75a7f2107126c1, - 0xd57d10c167af2323, - 0x4229e088ee92d68a, - 0xe1614b8522f9edfd, - 0xaab92b6d01582b3b, - 0x97d27cc9bab4251c, - 0x98f51ee076c58f7b, - 0x1318292a9d21dc29, - ], - [ - 0x23ef19745f84736c, - 0x433b3bb1130d4f75, - 0x3391c4f3e01e4a98, - 0x44eb89e1e2bcdf1c, - 0x4c4eda2a35accf9d, - 0x28e11d56b36e45e5, - 0x4da623de96c338b1, - 0xba4dbc2bce4c8a0f, - ], - [ - 0xbc85eed58a9b7745, - 0x23e79833d8e14a2d, - 0xab21189e14e49139, - 0x56f9b94ec3779c7d, - 0x299e9a969c442ec7, - 0x554b2db9a60a9ed6, - 0xd4749224c7f4b4c1, - 0x148bbafd9a5eda40, - ], - [ - 0x0df862d37fcb4bdb, - 0xcdbea10868b506bc, - 0x467a7199b3f2b56f, - 0x3abd55c99c4e8fd6, - 0xcc144ce8d7401d8a, - 0x08bd5f9b9b27e2a6, - 0x567998b7de34f2bf, - 0x6a3b9291a5ce797b, - ], + [0xdd5743e7f2a5a5d9, 0xcb3a864e58ada44b, 0xffa2449ed32f8cdc, 0x42025f65d6bd13ee, 0x7889175e25506323, 0x34b98bb03d24b737, 0xbdcc535ecc4faa2a, 0x5b20ad869fc0d033], + [0xf1dda5b9259dfcb4, 0x27515210be112d59, 0x4227d1718c766c3f, 0x26d333161a5bd794, 0x49b938957bf4b026, 0x4a56b5938b213669, 0x1120426b48c8353d, 0x6b323c3f10a56cad], + [0xce57d6245ddca6b2, 0xb1fc8d402bba1eb1, 0xb5c5096ca959bd04, 0x6db55cd306d31f7f, 0xc49d293a81cb9641, 0x1ce55a4fe979719f, 0xa92e60a9d178a4d1, 0x002cc64973bcfd8c], + [0xcea721cce82fb11b, 0xe5b55eb8098ece81, 0x4e30525c6f1ddd66, 0x43c6702827070987, 0xaca68430a7b5762a, 0x3674238634df9c93, 0x88cee1c825e33433, 0xde99ae8d74b57176], ]; /// The 22 partial rounds' constants, one scalar each (added to lane 0 only). pub const INTERNAL: [u64; 22] = [ - 0xb4a835a8cf918c3f, - 0xfc8e76ddb453dce0, - 0x8c482d91150cbbb3, - 0x1647c2a95052a02e, - 0x229410bcacea59aa, - 0x95b3a2391389bc0d, - 0xd8e94d4c2993e464, - 0x7f38bf21c1521128, - 0x1f4d8ea8df153211, - 0x6c3108043a789868, - 0xb43065f502f235c3, - 0xa350c3ac510528cd, - 0x7a9e0efb9a8dec74, - 0x49efc1d4bcad501a, - 0xaadce63e6421ce48, - 0xa7cf9e4ee247eab6, - 0xc13bd889a7b0bb77, - 0x3214d332ecc1f5a6, - 0x44e9d60696221771, - 0xcdc1d0e4a7c2d60c, - 0x23e11c18f32582c0, - 0x91f0f07e761248ad, + 0x488897d85ff51f56, 0x1140737ccb162218, 0xa7eeb9215866ed35, 0x9bd2976fee49fcc9, + 0xc0c8f0de580a3fcc, 0x4fb2dae6ee8fc793, 0x343a89f35f37395b, 0x223b525a77ca72c8, + 0x56ccb62574aaa918, 0xc4d507d8027af9ed, 0xa080673cf0b7e95c, 0xf0184884eb70dcf8, + 0x044f10b0cb3d5c69, 0xe9e3f7993938f186, 0x1b761c80e772f459, 0x606cec607a1b5fac, + 0x14a0c2e1d45f03cd, 0x4eace8855398574f, 0xf905ca7103eff3e6, 0xf8c8f8d20862c059, + 0xb524fe8bdd678e5a, 0xfbb7865901a1ec41, ]; -/// The 4 terminal full rounds' constants (the second half of `ExternalLayerConstants`). +/// The 4 terminal full rounds' constants. pub const TERMINAL: [[u64; 8]; 4] = [ - [ - 0x8d8b439f471d3ed8, - 0x6f306da8e7460bd1, - 0x232495c2971b558b, - 0xf5fac7d16c4bd3e4, - 0x2afafe770334cb30, - 0xeb207e7e4c8d9fc6, - 0x8a96037107bc1178, - 0xf1f324d786de2550, - ], - [ - 0x19187837e670ae50, - 0x1960443a687a8d8c, - 0xf63d378c5cc93b62, - 0x687ae437f5a304ad, - 0x69bff4277cf0e371, - 0x93fa2bddac4ec4db, - 0x0b15e520e37982a6, - 0xb3acaa5e2aa2755e, - ], - [ - 0xdd6f2419a8e88629, - 0x7aca3b451c80cfc6, - 0x4ef863d6f17d4ea1, - 0x7f9fe7304c74e395, - 0x1b7a60765cc0afc8, - 0x894938b3e73d019c, - 0x614d2e03db7f63a7, - 0xd43e0575caaa4b7c, - ], - [ - 0x2f9df0ebffe678a3, - 0x641d03c34d5055d9, - 0x87b22e63efbc1bca, - 0x1b495476ff8afc22, - 0x538eac6fda3a7632, - 0xe18814f30a053036, - 0x544bd2c06d7d6a60, - 0x30ca8f9f4bdaebde, - ], + [0x014ef1197d341346, 0x9725e20825d07394, 0xfdb25aef2c5bae3b, 0xbe5402dc598c971e, 0x93a5711f04cdca3d, 0xc45a9a5b2f8fb97b, 0xfe8946a924933545, 0x2af997a27369091c], + [0xaa62c88e0b294011, 0x058eb9d810ce9f74, 0xb3cb23eced349ae4, 0xa3648177a77b4a84, 0x43153d905992d95d, 0xf4e2a97cda44aa4b, 0x5baa2702b908682f, 0x082923bdf4f750d1], + [0x98ae09a325893803, 0xf8a6475077968838, 0xceb0735bf00b2c5f, 0x0a1a5d953888e072, 0x2fcb190489f94475, 0xb5be06270dec69fc, 0x739cb934b09acf8b, 0x537750b75ec7f25b], + [0xe9dd318bae1f3961, 0xf7462137299efe1a, 0xb1f6b8eee9adb940, 0xbdebcc8a809dfe6b, 0x40fc1f791b178113, 0x3ac1c3362d014864, 0x9a016184bdb8aeba, 0x95f2394459fbc25e], ]; + + /// [`INITIAL`] and [`TERMINAL`] as the `ExternalLayerConstants` `p3_poseidon2` builds from. pub fn external() -> ExternalLayerConstants { - ExternalLayerConstants::new( - INITIAL.map(Goldilocks::new_array).to_vec(), - TERMINAL.map(Goldilocks::new_array).to_vec(), - ) + ExternalLayerConstants::new(INITIAL.map(Goldilocks::new_array).to_vec(), TERMINAL.map(Goldilocks::new_array).to_vec()) } /// [`INTERNAL`] as field elements. @@ -193,93 +115,60 @@ pub fn permutation() -> Poseidon2Goldilocks<8> { #[cfg(test)] mod tests { use super::*; + use p3_goldilocks::{ + default_goldilocks_poseidon2_8, GOLDILOCKS_POSEIDON2_RC_8_EXTERNAL_FINAL, GOLDILOCKS_POSEIDON2_RC_8_EXTERNAL_INITIAL, GOLDILOCKS_POSEIDON2_RC_8_INTERNAL, + }; use p3_symmetric::Permutation; use rand::distr::StandardUniform; use rand::rngs::StdRng; use rand::{RngExt, SeedableRng}; - /// The table is exactly the draw it replaced (the module comment's recipe, step by step). - /// Red here after a `rand` upgrade means `StdRng` changed — the table stays, the chain is - /// unaffected, and this test's recipe needs the old `rand` pinned to re-prove the equality. + /// The table is the one `p3-goldilocks` ships for this width, which upstream derived by the + /// same Grain procedure — an implementation this crate did not write. #[test] - fn the_table_is_the_seeded_draw() { - let mut rng = StdRng::seed_from_u64(PERM_SEED); - let ext = ExternalLayerConstants::::new_from_rng(8, &mut rng); - let internal: Vec = (&mut rng).sample_iter(StandardUniform).take(22).collect(); - assert_eq!( - ext.get_initial_constants(), - &INITIAL.map(Goldilocks::new_array)[..], - "initial rows" - ); - assert_eq!( - ext.get_terminal_constants(), - &TERMINAL.map(Goldilocks::new_array)[..], - "terminal rows" - ); - assert_eq!(internal, super::internal().to_vec(), "internal scalars"); - // And the whole permutation, as `p3` would have built it from the seed. - let seeded = - Poseidon2Goldilocks::<8>::new_from_rng_128(&mut StdRng::seed_from_u64(PERM_SEED)); - let table = permutation(); - let mut s = StdRng::seed_from_u64(0x2b5f); - for _ in 0..64 { - let x: [Goldilocks; 8] = core::array::from_fn(|_| s.sample(StandardUniform)); - assert_eq!(table.permute(x), seeded.permute(x)); + fn the_table_is_the_one_plonky3_ships() { + assert_eq!(INITIAL.map(Goldilocks::new_array), GOLDILOCKS_POSEIDON2_RC_8_EXTERNAL_INITIAL); + assert_eq!(Goldilocks::new_array(INTERNAL), GOLDILOCKS_POSEIDON2_RC_8_INTERNAL); + assert_eq!(TERMINAL.map(Goldilocks::new_array), GOLDILOCKS_POSEIDON2_RC_8_EXTERNAL_FINAL); + // So the permutation is `p3-goldilocks`'s default one. + let (ours, theirs) = (permutation(), default_goldilocks_poseidon2_8()); + let mut rng = StdRng::seed_from_u64(0x107); + for _ in 0..256 { + let x: [Goldilocks; 8] = core::array::from_fn(|_| rng.sample(StandardUniform)); + assert_eq!(ours.permute(x), theirs.permute(x)); } } - /// Three outputs of the permutation, captured on the build before this table existed (circuits - /// `573ef2e`, the seeded draw): zero, `0..8`, and every lane at `p - 1`. + /// The development draw constraint sets ≤ 10 used is gone: its first constant is not in the + /// table, and the permutation of zero is not the old one (`0x1e4b2c9eebb442b0…`). + #[test] + fn the_development_draw_is_not_the_table() { + assert!(!INITIAL.iter().flatten().chain(INTERNAL.iter()).chain(TERMINAL.iter().flatten()).any(|x| *x == 0xee75a7f2107126c1)); + assert_ne!(permutation().permute([Goldilocks::new(0); 8])[0], Goldilocks::new(0x1e4b2c9eebb442b0)); + } + + /// Three outputs of the permutation, for whoever ports it (the GPU kernels, the wallet, the + /// full node): zero, `0..8`, and every lane at `p - 1`. #[test] fn the_permutation_answers_its_known_vectors() { - let vectors: [([u64; 8], [u64; 8]); 3] = [ - ( - [0; 8], - [ - 0x1e4b2c9eebb442b0, - 0x2fbb0154ab9d22da, - 0x9c397e8d1b856b3d, - 0x3900699f4fe93a6e, - 0xcb37891674d3ad6b, - 0x9b530f7ac1ef1f56, - 0x0510bc15edfecf33, - 0xf9caffe23a93cd28, - ], - ), - ( - [0, 1, 2, 3, 4, 5, 6, 7], - [ - 0x682c703ce406cd60, - 0x35fe4cacd5147b44, - 0xf0b819068ae2838e, - 0xde5f0a9ba791a8f4, - 0xcf8ee9826729b322, - 0x38e89ce1e7fcb535, - 0xf58f43c0801e00db, - 0x694ec48edbb331fa, - ], - ), - ( - [0xffff_ffff_0000_0000; 8], - [ - 0xdfebf956a8205183, - 0xbacca056a5ba1b75, - 0xdc24d665e3f9864b, - 0x1ad86aab4b3e131a, - 0xc68f628d6f8833e6, - 0x0b913e0aa0757959, - 0x248d88435c62b658, - 0x7bc6fc5500a81dbc, - ], - ), - ]; let perm = permutation(); - for (input, want) in vectors { - assert_eq!( - perm.permute(Goldilocks::new_array(input)), - Goldilocks::new_array(want), - "permute({input:x?})" - ); + for (input, want) in KNOWN_VECTORS { + assert_eq!(perm.permute(Goldilocks::new_array(input)), Goldilocks::new_array(want), "permute({input:x?})"); } } + + const KNOWN_VECTORS: [([u64; 8], [u64; 8]); 3] = [ + ( + [0; 8], + [0x4411ec57c44145f5, 0x5ff55b96baa2f47b, 0xdee0e2ae35662802, 0x023c96b32c07981d, 0x777e4afeaaf2e6a1, 0x606c248e5ef427da, 0x862e82242b2c5001, 0x61ea532cc4c908c7], + ), + ( + [0, 1, 2, 3, 4, 5, 6, 7], + [0x020cf04a1b214d14, 0x84e14aaaeacaed25, 0x1ae0f640e81c7457, 0xa4d204cbaeb0d8a5, 0x0cf637b627b3a7ff, 0x788d304d948b486b, 0x7327133ea1949af4, 0xf415abb924da395b], + ), + ( + [0xffff_ffff_0000_0000; 8], + [0x5a986ad1feb0d7b1, 0x76379c3befced08d, 0xcebc0f4e8ae21d67, 0x8f9cc577b6f2cd12, 0xe0e58584b289c1dd, 0xf1400ffbb6875b78, 0x2014ea6e78f1bd58, 0xbaa54d6e51fd54f1], + ), + ]; } diff --git a/crates/randscan-viewing/Cargo.toml b/crates/randscan-viewing/Cargo.toml index a2ff154..c2f4ff5 100644 --- a/crates/randscan-viewing/Cargo.toml +++ b/crates/randscan-viewing/Cargo.toml @@ -12,8 +12,8 @@ crate-type = ["cdylib", "rlib"] # The exact versions the fullnode's vendored zkVM (crates/randprotocol-zkvm, checked at commit # d40fb94 = v0.6.6, the chain-18 / constraint-set-8 build) pins. # The Poseidon2 round constants are circuits' committed table (../randscan-core/src/ -# poseidon2_constants.rs by #[path], audit ZKV-2), no longer a seeded rand StdRng draw; rand is a -# dev-dependency only, for the table's test that re-runs the old draw. +# poseidon2_constants.rs by #[path], audit ZKV-2) — since constraint set 11 (chain 22) the Grain +# table p3-goldilocks 0.7.0 ships; rand is a dev-dependency only, for the table's tests. p3-goldilocks = "=0.7.0" p3-poseidon2 = "=0.7.0" p3-field = "=0.7.0" diff --git a/crates/randscan-viewing/README.md b/crates/randscan-viewing/README.md index 1267c2e..5902cac 100644 --- a/crates/randscan-viewing/README.md +++ b/crates/randscan-viewing/README.md @@ -6,10 +6,9 @@ sent anywhere. It re-implements, byte for byte, what the fullnode's vendored zkVM does when a wallet opens an envelope (`crates/randprotocol-zkvm/src/{hash,notes,viewing,call_envelope}.rs`, last checked at -commit `d40fb94` = v0.6.6, the chain-18 / constraint-set-8 build; the crate's whole `src/` tree -and its `Cargo.toml` are the same git objects at `86941a1` = v0.6.7, the release chain 18 runs -and chain 19 is cut and run with, so chain 19 needs no rebuild): -the Poseidon2 sponge with the node's seeded round constants, `nk -> pk / ovk / ML-KEM seed`, +fullnode `feat/cs11-revendor` `60a7d03`, the constraint-set-11 build for chain 22, whose Grain +round constants replaced the seeded draw chains 14–21 hashed with; before it `d40fb94` = v0.6.6): +the Poseidon2 sponge with the node's committed round constants, `nk -> pk / ovk / ML-KEM seed`, the note layout and commitment, ChaCha20-Poly1305 with the commitment as associated data, and the three openings (receiver through ML-KEM-768, sender through `ovk`, or the transaction key), plus a call's sealed input transcript checked against the receipt's `H_IN`, and (fullnode diff --git a/crates/randscan-viewing/tests/fixtures/chain20_block1664_attest.json b/crates/randscan-viewing/tests/fixtures/chain20_block1664_attest.json index 0757e92..94d29a2 100644 --- a/crates/randscan-viewing/tests/fixtures/chain20_block1664_attest.json +++ b/crates/randscan-viewing/tests/fixtures/chain20_block1664_attest.json @@ -1,47 +1,47 @@ { - "_source": "chain 20 (genesis 6210cf07), block 1664, tx 4f6e6c54...1a64: rand_getTransaction action, rand_getBridgeState.fees, rand_getCommitments [19,2] (cm, envelope presence) - public data read from node E 2026-10-01", - "action": { - "amount": "100000000", - "asset": 1, - "asset_index": 1, - "attestation_len": 586, - "commitment": "d8f146fd390c839e5cc084a2c560c42f1901968864b834062e8aa28972ace5e2", - "deposit_amount": "99900000", - "fee_note": { - "amount": "100000", - "asset": 1, - "commitment": "47c3ad478fa92b55348204ac0d9884500466aba53d19875b782ada67d2ca6ee4", - "r": "ecee001c9a2a03505fe2d1cb35b040f52ed6e3dbb5409a4ba716f00ac6811d63", - "time": 1599 + "_source": "chain 20 (genesis 6210cf07), block 1664, tx 4f6e6c54...1a64: rand_getTransaction action, rand_getBridgeState.fees, rand_getCommitments [19,2] (cm, envelope presence) - public data read from node E 2026-10-01. Constraint set 11 (fullnode 60a7d03, chain 22) re-commits the same public openings under its Grain Poseidon2 constants: the cm values here (leaves[].cm, action.commitment, fee_note.commitment) are the set-11 commitments of those openings, computed by the fullnode crate, not chain 20's set-9 leaves (d8f146fd..., 47c3ad47...)", + "action": { + "amount": "100000000", + "asset": 1, + "asset_index": 1, + "attestation_len": 586, + "commitment": "508b42d221b93724d70e584796344a3bbcfd999e9ae82142b611e0265eeb155d", + "deposit_amount": "99900000", + "fee_note": { + "amount": "100000", + "asset": 1, + "commitment": "1f55fce62ffb2b108f78c548bf169cf596f21378b4534264fa3c1eb44bf34f2e", + "r": "ecee001c9a2a03505fe2d1cb35b040f52ed6e3dbb5409a4ba716f00ac6811d63", + "time": 1599 + }, + "kind": "bridge_attest", + "pq_signers": [ + 0, + 3, + 4, + 5, + 6, + 7 + ], + "r": "63a44e149332d851011f20ac2c2622e814297177c8b18f7447fe9a0484edb7a0", + "recipient": "rand1DoRgCizWrqBBvgzRbYvu64QQjccEQWHQ8iysTNQAL6pBJH42HHHVWrPWDQ4UMTHvyAfxiHaxZr44vWNU54zkLyNmFSjXRx2Ro1RMwmi7bvp2t287hw5NecaXpwQPQpoqvuNnhtyTknNjSLWMeXgFeDoYy6M5UfWKF7XCRszifXQjMfy72shbt6XXVq7NTLRWFriLSKCJvBoqRufWNr8r5XT4b31xwDccn4Hb8sNcHLQ122F8whPp2U886Lt8AnsRLWy3CypqaYD5PPwRDX8SrRVWydJGpG5WK6Yde95n48cNFSXCxQnuRuC1UiHef4qEP5N4TYqR1GndYbdVQc1nVM3NoscSfuWV8H1RkpenvkegHRZmUxT7W2Ff2jB3i6yt7RHssQvVfeFy3dJ2EVEo8RfAzriBiorsujsCLRwokwJ8t18ijFBhLYxQzW8RtqUHuFPNrQPsRnJ1mpmfCbYp3S8ES3yK7k686skUKJbkGamAjpgC6pM2oK4ztzWv9jJgA8RcTBhE5qktiHm1L4Geh8Dg5TQoZq5BuS7CaKki36eFoBurtbjxEWJwvpAhVihM4wM8TDsRQJ9mTUbQYj5xRAd3t9CSt27SSZKPZon9ZSsPwtkwQyr1JeWhS7aj8a5RMA7c4gJwrjMjcfoGXftrSn3k9p8reCk4Ka28CSpgw1pYG59UYFrZ3JWn4bpw29NRxeD1FRtW4pYEVH2PeN6ebZZvtQE58TKNRPjKsiz8MEx4toALBaK1jhDJfDgvB5d4j6SoFmFnzdjNJXPa7ftAtCJWGrTjKLpxsT6L7mbDnGWg4E6e27aog3W4cMvkxQNTizor645xMpjZF4T1jZV37aXEsdjSCBSkSHxdBPvzxpfLTNTPzf9XtrU2EpLxPsRqHKMAKNyqovPmCvktM9Gde3zBPBPTRwEJ9sbHLcjeCt7xMWVSRm9mBUwKhUBN3Jj31gb5QoE6p4s9w6Far1bQeyw93bMAM5eoy497TGbQXkphZdTrwvLL2di9g8qPW8VjV1cKxUCz1U6isV6PTKW1qduqSziJR4Jtzbb5sUMsAwecu7kGXxtxDr4og8EJz1SZZVBLorUDKGRdmjBEAdzKubfLnHazLCUL6eBW3N2fbSx9Hc7wKVkRD83Mp5Wy1kkBnqZyBzKB7fnaqjf5hhNk1Lh2AYspm63safAnyFFD8S38Bddxnq5m4hqM9Yid5cxWbZTWcbXkXjQyxbAXhppWT9yi3Ed6bdakDD4EyzHoCrC3WTg1ugd6Hatuosnn4MTiTtWKKRUokCNxtEyZonjJmAjKWR3xDr8dycMndQex6Qve9Nch3uEV4qa9QsVnAjhMhsicMDnbpwPUCDrGBc2dAnNa9mBCp8vm1w66hUHa7SKHa2BD1SJDpjc2kM2zieP7YopdtHv3ZPhNwBWszuiTm5WKStGLVe6oXxQT2NsDVp9u6Ga7PeqMdCkQKF79vNq7Vm6dKEadhEq3EQ5cvtHLRPrYcdeSkThEAEeDrqoGcMs8xCZunYvU93vedt878avNA2xcS4HgNeCycEigCX5nRhJAJmjsMJMi8HpUbErH3yRJA5BpxUuzmWuiZfKBNRsQE12tPGT4jnynpwUKqE8Q3wwJ1VR1JngGFN5Rn1seSTtZ5h52zgsYQGqDhyMfb", + "time": 1599 }, - "kind": "bridge_attest", - "pq_signers": [ - 0, - 3, - 4, - 5, - 6, - 7 - ], - "r": "63a44e149332d851011f20ac2c2622e814297177c8b18f7447fe9a0484edb7a0", - "recipient": "rand1DoRgCizWrqBBvgzRbYvu64QQjccEQWHQ8iysTNQAL6pBJH42HHHVWrPWDQ4UMTHvyAfxiHaxZr44vWNU54zkLyNmFSjXRx2Ro1RMwmi7bvp2t287hw5NecaXpwQPQpoqvuNnhtyTknNjSLWMeXgFeDoYy6M5UfWKF7XCRszifXQjMfy72shbt6XXVq7NTLRWFriLSKCJvB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ZuESoMGZE6kMMcpBXfFg1ShBWAYupxtViu6eWK5MEtJXAcAmPVHZ7dPg544jPcawqbduesg2zaU1GH45ipm73nB8P6pkxRp69d2vKKMKg8uiC32E6G5kLwhziCFe9vb7eQA8dE8wP1ejVTheZ4N3NgdbTs3bpxYQ4oEDLUi8NReJQsm1sotedGih8pwsu5zU8KGv3XoqkAPtym1a8Dodw5icsAdrG9o1ZS5t4sVYFpCE4whoVhWeUx1faQCPoBm7Cc2AeMThq2LSvyJ2NLXJv6LSqBF7vCr8pySPRaxjZi2JG6iLBRxhZBaKUaA733bhCyKYkSwwJfeZiFRVUPDZoNcZbjh5z5G9Sahm45moDNYP4BFt8YncVk6gHjtijhLyxLHDpcvtwnKCSd3SWg4n2NmeVk2Rk792pC4UxXqmr2DRmsPDJATfe7dnZErehV78X5QaYQRinASpgxouL2unV2PdrYaxzpguueYVhZDPKfKcBiReFXQQUAjFUhxkxNunu1mCrC34UxxLYjkUatW2zh4eyvx6FKk62wZU84A95gLXqoKchpRXiJh3jKp2z8TQcCFUoBBh7SqPaEfpNQSvHweiQF87bYXGTViB5hWAg3QsaM578ZfCnxPesUaLa1MNvL6piEQHn8Tctxsar8Xw3yZLFxHPhNWKFagkXB6NWhKNr794mNNADaRPbAcL4bhHbLyeEkhVrUo1W65WbxiCUfvhajb4eKQF7WeMVMdgw7QFUCa3G3F4Fj4SswEPyZCoFQsZzMzGooUUg3sKVwqChXRU6J8BsGk4131rwoPBVu9uKUNqNtBSYNnoa1Z8zqubUtEbDZUkPjGp4jyEMQUpcD9GVd4VdaC4YuFy9WHGr2gg5XdFc5hPNk5jzns5hGHQhKnCkAZVMhg3MGJf54zZM81uKUqb5ZVTZBs22c5KsD3jQFG7bbZeLFX3Sv6JMa7dtiw7rC7KAJ1voWseEcWx4fYYthaJWbc1UgnRThdZrDfRD64SToyaiA" - }, - "leaves": [ - { - "index": 19, - "cm": "d8f146fd390c839e5cc084a2c560c42f1901968864b834062e8aa28972ace5e2", - "has_envelope": true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Sd3SWg4n2NmeVk2Rk792pC4UxXqmr2DRmsPDJATfe7dnZErehV78X5QaYQRinASpgxouL2unV2PdrYaxzpguueYVhZDPKfKcBiReFXQQUAjFUhxkxNunu1mCrC34UxxLYjkUatW2zh4eyvx6FKk62wZU84A95gLXqoKchpRXiJh3jKp2z8TQcCFUoBBh7SqPaEfpNQSvHweiQF87bYXGTViB5hWAg3QsaM578ZfCnxPesUaLa1MNvL6piEQHn8Tctxsar8Xw3yZLFxHPhNWKFagkXB6NWhKNr794mNNADaRPbAcL4bhHbLyeEkhVrUo1W65WbxiCUfvhajb4eKQF7WeMVMdgw7QFUCa3G3F4Fj4SswEPyZCoFQsZzMzGooUUg3sKVwqChXRU6J8BsGk4131rwoPBVu9uKUNqNtBSYNnoa1Z8zqubUtEbDZUkPjGp4jyEMQUpcD9GVd4VdaC4YuFy9WHGr2gg5XdFc5hPNk5jzns5hGHQhKnCkAZVMhg3MGJf54zZM81uKUqb5ZVTZBs22c5KsD3jQFG7bbZeLFX3Sv6JMa7dtiw7rC7KAJ1voWseEcWx4fYYthaJWbc1UgnRThdZrDfRD64SToyaiA" }, - { - "index": 20, - "cm": "47c3ad478fa92b55348204ac0d9884500466aba53d19875b782ada67d2ca6ee4", - "has_envelope": false - } - ] + "leaves": [ + { + "index": 19, + "cm": "508b42d221b93724d70e584796344a3bbcfd999e9ae82142b611e0265eeb155d", + "has_envelope": true + }, + { + "index": 20, + "cm": "1f55fce62ffb2b108f78c548bf169cf596f21378b4534264fa3c1eb44bf34f2e", + "has_envelope": false + } + ] } diff --git a/crates/randscan-viewing/tests/fixtures/memo.json b/crates/randscan-viewing/tests/fixtures/memo.json index 6d1978d..f7bbff7 100644 --- a/crates/randscan-viewing/tests/fixtures/memo.json +++ b/crates/randscan-viewing/tests/fixtures/memo.json @@ -1,33 +1,33 @@ { "corrupt": { - "cm": "7c73c93ede9ed2995ee876578ea30cdbcc941f952e5fff9d1515ca21e757342d", + "cm": "f8514c636114a0bcf79f11f94c0ad0c7e104dbaea54c9ca36fa19c7be5fc4767", "envelope": { - "body": "72984ff1332b011c27b5b81d255db7f12f91b6270ef0bda3f778650ce4f6ab351bdcb705d0193431bac101a52cc8b6ee78268f66a395300f40b9c08f8a7b3f3393856933fe9e5454f252985d1deb60c2873c7a657d28c41fd1c5f46df716501c202df17f213cdb4e032a16a1d1be66ba188ddb14deead0656a670d027aca4ce5bf4b3464a676c455e371e118d6fe463eccf1cd1a3e2e123c0da7de9adb408e9cf76e302e1adf9e87e573204b19d36e8d2804319ecf3a4d07d1c5bacf1f72169544975ac43a4a5ed0c8be33d15e6a3fb879752700947a8cacba777cd7a11fff612fd408059357c716456cc0dbc621a1a010f42d0942d4b2f4170debd37c216cf8eeff9d5af479d795e7cc080a7caa70e4b41451ae24f813573b6514324bb5c3ac11de2527997292e06a6405fe6dfc154952de570f1e778cff63adcfb6bfb8ff86d342dec152566bb881da76ca4a43248145c00cf997c6d9e6810549e0a9c542016f15a7d2655555acc906b9516072bd19c18d0fc74375c755314f4d38bf964ebb2762766a145c9fac4bbfc4bacc01ec93c4b59d4fbfb3b2478fdf1488b4b3d927f0c7048d55395ffafb4f368b9b52a3f52e7abf33101229518ff70ffe6c59052073e0186b4af98c0ef0e94e454cb0ad645bd1cb8bdd69335213063d36588214b42d54d4d10ea4e6e69edb5d7429f034aa6d991356a5ec1924fabef49545f814280540eedc1a29e1c224d3eb593e36657e1243a2c9e3c721873e620f6184b4eab41cf73a4ae4d59f9f0d018732a384b6795451d79ae793b38333774185bd1b97ffd661365ce60d88d2747c20fd5957cc5aa03347fd46ef14d41f633ffa04358f6b5058e411d193fcd57cb99cebf5b30c4d96eb0d52cb2b61f77ea24418c51516490745a022acdfcb15150f63dc", - "kem_ct": "5bb9c89a9c94de68542f363afc11ac848601d857611560b54ef75116a11849fa95e887e4e720c2e9c68b50474d71128f8d755a47e31976b04445256cc7f2c5ffe7d160aa0a2cd586ba2f1a58898aa093d1bfe94cb9743a62bfefbe69a07e5a398b02b07d62c19d1538d146bd1c80f23d8c93bcd91be19c6a9bf09f8a6b04c86438713f09aa5f1b37b9fa11d2ba2ab26b99b67e6419d0028959674df95aa49c1af29e9f2fbe45495646c98f8395068eb48f4068d40e3e7b548b8817b37aca1aa9ce4f7f8384198cc4d84bb0c210fb02420a765c6cae92048d4a1269ddb7b87aefe61f5cb822613ede060b5552a41e7bc917d93e058ef12a3a52de4fc81f92ecb63a0da23b60ff8ecc132904e2ecc6942f0d2034ebfb09899c925c8eee3b05357ed5b2472c05079c0e0e0386115d870a3416515b43a49a0fc962149c24000becdd563ecd091cf7a4529514ddeeee283c9fe3b9a58944e4c055eb2100a4fe8b97d6f5ab0e16c239ef9199539173bde1ac3fc2a96da7f8ac1dbe503b9ec4793f86c750a405c55d3fb1ec0ae8a34c3015b1a4265616e72d795f3b4403a5738f4c80374876f7e6c58fab55286a31ee36434bd1d492f52c8e904ef849735bc2576cfe92c455210d4be2b5f93f5d5cce3c7f9b8a8234edf54936d7873054e0e39310950102cfb5ddb623da607e0f9c6d419edadc9403980a918c02fcedcdf8db31ffaa4feeecce28baeadd8fe34ea0eacf7ffab99d893f4868066eabcacd7ea1f51c7d7ee5ef074edfc669b5cd0d7bb952086cbd3905a7bcefda41c5c1b3daef1d39144ba9022530955fc44e4d2984b7d4cbf2b46173dc81dcfadc69a25c8df0eb0b28d5f1ae99211c9818cd2588fef9251f4eb77887ce363353428fdb132b8dc9728a6a0621221367af44deeca9d3667c8b6ac736e535cee1098424f72dd500596fb198fdea83aa31e4dce2f1f3c09afcd4d32e01dfbd16d1ae6b97c09d434ef9861549a46596b71c891597c745aeff5aab71402b114015573b5b845f9ecb78b9b1cad6ca11e83eae408f7b323464dfaf32e047a10032a6b32df1ef5b8b689940e2d8956838791d71a60683301dd85eee0aebc0d8c4612b551c0d382e16134d00880547986b87da8b4417cd401d5f91c01981bcb6a4d3f57d37d0a013326ea70e5b5f71080fade49dbd7be12d18a312592f1627b5347be4536e507550b0a57c97c73a8950ddec1c20e6310dbf547b5bba4022ddc47074b83bdcc3f86cf83ed14d4a5cbf63a7a2f67210c7c66552a49c9e0344e1c5e2adbb6cb7583858adb9b9832f6c9e05c2c9236d505cc6ef8b80be4e17aa2a85d20cba1376dab8dc75b99bc713ecdb6a07ab11862dcea5bb8dd32d386fed39f292352a7ed262fac53dfc6e8bfc12a2b1202e547ce01330c17d503a9d8b15b5d8994b994c9b0da9a58f90b8cf781f3d5e6089a8dedf8733dd613d7c7e34a0b82f796151c87b9437c8133a2a88e6688a1d501f88069bf7dae2789d82c64997bbff08721dc2d99f9be082f54eefa8d737", - "to_receiver": "394abcf48d81346e663a2071a6b6cbd44cca893dbb24e6f8da19752a26b2d0bf82b5ad753b278ef812f70e8dc3ab8bd2866093c588bf99c908fb0c6d", - "to_sender": "232b909f769474f2c4a2f8bddcfce0e07a4d73bdd8f3ab52a212193125132374557a1dd952eb0f0f67132d51896cb22fbeab97fdb1695206ce3909e3" + "body": "ca383ae357affe52dbc2d0c72fce45c33b98994a4a614c38391a7de25f1935cab4fdf3c860ef055c82fb35e4c4172808a0458cb878286063811e8985d5d16bcff5f0fb34b154388aeab29471fcfd63c3603f1ceba734a1c980beaaee3c6f9e72118dcac2a3f885b2d3bc02d8a978c5a15430f889857207dec7d57a4c23da503815435b5ac736f9dfa7127ced7772783b8ed6470a1d1adfeabee15009668d65017971e1bdd45aaf79cc0be31174a96c3fcf39bc506d46b1dab96984f14d7be689dc09b982a71712515b504763f8a2d5a7f2d51b81cf43dd18236572342f07a83dc4c5a7e48538e0f9d6973304107f032f6b81ca38299ffc16b93f6daa74fd68ff21277cfb5fff310d1848bfeb31f7f5e90ccccee9b02f32da92108d3f520fc76070680332373611d562395924315e47a73b6c9866a7ce232fae27b9ac7f0676ab9b38f5c5c6b3ac972f2acf7500b4d4275221e74d6046be72712ec515e0af350d54d247744b89c06747afe318a86923af65c96a98b01440c66543efff14eca874613762b29ce2e465a6ca18dd77d3ca6939bca86af3b032c3ceb29da242424006f1ab78dcaafac4f2bd6d71ce66177381b88fc11b261b9218962b7939d422d8f204865266c5f8e5eddb80cc6a89ff1ce1cea51062a573a99bd086a69747ad5fce8d3f54b31a8b336e592ff087302b56a67da14204a850d24c11d43c3dd66113325b65dfd0f999eb88ad8f2cb13e5e7a0c0d1e5bb5ebc13f03d57509985438f4fb6487ad1c9c803e0368fae62e6435e136fdb24a7b54d7c041c6db0b2b8ca3c92b9a227abc78099e09d9c8ca88fc6246599a52762ffd8fc9bdf5b84e6129dd7960f2ba4689a98dbaf25daaf665ab73fea90089f9bec0137986f6e0aae4668452307669ed1333604316b3b28724", + "kem_ct": "ede9e07a89e16f5c71d1621d3759109fe6f336d81fac8ef8d01c52f0cd495901068e0685abe60a6ff6b1c3f9e4fa500236b72bc6f45a91065c4cb13f9482bd30228e7f908dd30c8bf5746d7104d3c8ed82cffebfc69f92924d5f6de8875d300896398502124ee5bc2f34f76ef00cdb07b3eaac1d7087b07d879ae9d5ecb0cb58d74094fca21e75d56e0be13794745770660d83009a68f3da4cbc9a64904ddfc31a52eb86ee99eaa798a37c888db193bb4a7bb5158f77dacbeebd5666119475490ee0f9a6c1362662c1b91ecca1d9ff413177b151f05b47aadd744d8f50495f3d21cdad59435574aa300219735361023e543abfdf7c0dec1ce62916930d9d33f83d6dde65c0c3a18b3eccc16f5c973a20b1a85b296aeb51ff2f9c3a2105e8c101dc2d090a7fd5cca9f30e9db04e050d49a016f3aec24bba9dab9976133d32bca8d5fb8c1f384cc30de48ac44ddc00fabc9fb4b7d2dbca84d9ed1549aa7dd29c62e7ffbb946908ab4945dc8be327e26df298c5ba4cfaf4301941abb7ac41bdce4ea2352c687733f5ce091d8accb123c12029eae01e6f50ec6d2e05bf41de2c76ccc23a6136857c4878c317a4e1aeeb44c201e55daa8f0f05f56bf89b56f33a418f8e1a14d6fc3c7e5b82815df353076b61ead03d905885dbf424ae6a62bbcf947e220b6ccff679f0accc89d8d7d4025bc0fb5d3fccdeaabfcc85bd189b4f21cd5449ee1c4dd99af8bb92b23ba315b77a3e665839e8b02ddd6df9c64396f3dbc0c548d740795496a9d7388314b599c91be9fba1c7903714a6c20cebaf035088daf7338d3a83cd2f1829009d8a4eeb1965e3bcf48fcef7e5c56b57892386a4ac8ac7ad0080afec538b0f144f8b4ba1e631ee813d9001980614ae90e977282e2fb81437fe875afbbb638cb0a9a8d81c22e42bce82db59ea899c62ddcf66e4ac6ef297334c9c5f9049684ee3377c9535095a9db21e0fe65c315fcd6109911b518b693a935bc3607f39b37935337ce5703216d9a84727321329b786cb5227ee0a639bd160643bf287b3036639f1bf36dcab210bde2e812abfb6c0d73924fb4b540591930d3b4862941dd118f17d4169775d46a66a9b383fd2918d67257e3f5e95174e609318c91bc580e8793fac8531f04a7811bf27f707f469b4a597495d603d60e5f47063dd2ac445835ceffdb10a6ea0489a9fe6f425b6cd5f9d697958fb20adc2e1372de4b00f2fa499dc16d829963300b7d97520cacb0cbac3142154f611cd78ee57f12ff1800e9a048fd8370abdd566ce9a6998bd82d3a00c4b3bbf91bf8442c9630f7581456675b15072fd9c403382b7fab8bd9a5377c6efc53a3210cfc07b88139ddc5c49328f77d504677aeca23beefbe14d3df84fc75f148e29a15814e2bea2ac3a8d59899026ceb2efced4012ec63b84ce8e38c17ec3a26bb69859801d620fc6a885d48659c9a28824566a970b22b20f0c57c8e653d609f02fa73ed3464640ff4f96f3a3f3911a9634a36a851f5fc4fe911a6d912c9e01a2c6eddb3327f1", + "to_receiver": "79012d15c16a1a49977ccaaeadc584ac4d212e035c1f875b2f5e1b0dc844ca7adfeafb84d13062568e77efec2012b9e54e3722c826ed94a4bf054462", + "to_sender": "481c4a6d6a9a74063cc808bcf65ac1a6c608048c7804738bc208e805d11d3f4f1e85d3a9b68ad54ca11ea5a24911f38df0f14d8de70cc0feebae4fd0" }, - "viewing_key": "efd39d32f7e91005e6c738deb2785c32831ad212ef10384ac42330cf7bac7a8f" + "viewing_key": "c82fc4321170c8493cc4135c1f9cb5ac8efe025f8676339fed0a6aec879ccfc2" }, "legacy": { - "cm": "7c73c93ede9ed2995ee876578ea30cdbcc941f952e5fff9d1515ca21e757342d", + "cm": "f8514c636114a0bcf79f11f94c0ad0c7e104dbaea54c9ca36fa19c7be5fc4767", "envelope": { - "body": "ddaea438189e0f04210da3d322c578918f9137176d5e1f0f65e21930ec7e7edbc2ec93780a87ce3efbd7ec2478436f302fd67e4edd6d438441749f066add02b5eb775ac09992fbe94fecbea39da17c33de218388b597a70ab3bc6bde80128c2bb077cce5f361231f6e0ce0fd8492143b1f9eeef346c601d4b97dc351b0e05f8fbe67685668bb7369c8ea2fd4", - "kem_ct": "bacc1ee5dbf79ecebfe02f4f913b54aa8528391c3d245956e835ae7fd14a8b164b6b41d99f8f1f0f9aaff3f94a6b343c6ac5e602792937a28087d0ca1084f0b3e1fc182f6d8227e533026eabbb858ee47ae88b86ee58f43e0749bd797ab4836649ef300f33e316a157d1e1c8bacca2fc30794259c9d5a8451c763a93cd1a68df116e654f941e1238d58ac7c188350cc375939461af8f4888ceb313f8964528512325c7155a9a11f5edd4d3c297e237d1c69aef4f55c162c1444ffccb8a3c480fd0085eb60db4e94544ac594fc16124057b44977f8e513485bfc394f3eb6a9f7caae114afd7d48239edf2a384eb10dbacd65488de97f5a0cbe654d7558dedba2160d01086506f7fb2a5884194fad06101643cda28dfb9acf0b30a5876b396ab8e23e0ff033d33fe8bbda0d86eac8174a3f11f100fa393dbb7dbd3aa078e98fa610abd65ddddab2dcbeee6238bab445047cc8676ba63b505322707fa11019dc999855c945a3c88220e31f3db99b56159d8f6f8ca5d7c82d3d7a2475957f994e0816334221664dcda5ca37fd3735b311c05c6c692c0de924dc7966fc238c62da3e5886ac8acc0f74085d60f9a4a743a4f320a243728561091d702649511a9a34a09c9cfd177fbdcd2c4cd61d8af6825b9ec54f6d37276f6e8fb45e9829c28b0654edb306d6ee32dda18976c2989bf439719176d0682c64f5e19de8943e8083fca6a8c15a929cd89f6f7cd2793d01748d0cc4505c225aa01d31fd1596c8abc708f7538d4b6f6b1179b1310adeaf6afac60cc2f9a3845a75e3103f34c628444ef95f5a1d4e79acd4f0db6f40ac0e4a5fd5eaef75d37286b5293e0a331e70161e66f6bd3a1238a3e00043b39370a8bd2b7269bee0cae2b478cd785115b8bc1a850af34fb6c4b7f7bcf62c277f1c6a09addd9bff7625f6ad925c6596abc4dc2db6bad2943f641268db043034fc45a01332e84effcf82ebacdc1bb4d0b614406442c0f171ea2b5c59dca93900e3dab47f0770e1a6ec3eafac38586d5915a3c387c7c6cddae31f4d255d8e2a391f3a97fee90962d6f7c8d062aaa475dc59254efb4b8593802f1952efc87a20b5049bfe1da13793c8e05466dd4050f5d82a629f9e428dba334e72df7d06f529db4a304dc0fde7e7e984101007b5c1c0783c9a4fabdd2f33215d3c62ca62d5e86d0c0ec386fb5a5ee3da539ba5fbd58f03a7208833039445ce60dcbc9fcc32a94540adec29ef036451f14153ac812bf9d0899aad4571604e7412495655c5a158333614c52d327228a4c29b9168c4f468e401422c5c49c142ada732aab0d331e2a459dcf91ed32572d1bd567d7a8ee81ea8be8dc2f703ba44a80a9fcbed1ce3d4f975606b808842e402ce2cef82fd43d21ef413d6ad88c1793fa640e1fa2b4b7e0912b3de46369f6ef9f62ed6b16d305fd2aff0ab2cbad16afe819a732d193c066ee357503155899468d4c2c1c99c797d99795a357ada01fba8a0670b7b8c16da0f3d7bc4dabbd618b6c34bb864df566297a440084b748471d", - "to_receiver": "31a005184da9588e7a90c7f2a704347796b4a449773f83d4b417b337fabf283c883c987a73033ff8f5dfc4d1e469de38322a66e1e76210f659d9814b", - "to_sender": "d76d318fb97cde6b267d7a4d79fca0e8ef63ee94700f712538dbfeec799b2e2baeb855b5ea77557131d765541bebc87856f3b7b14227b6a431e36010" + "body": "9eb3d6c3f8f8ec97c47f39371fa6c4f9ef378f66178c03590662c9f746b80ec2ae74a3271a7613a3ce9ca100cfee152712f50e1fe314a7e9e9fab151b848731f1242264b7a5395b46a4a85f0281977904e1a01d6fa609e4ddbd363adf276af05c6f490b4025c086238f28b665509af9ba1babefeef101f0d46e214f861ea2e49be3822acc4b207385c94433b", + "kem_ct": "a118ad2d426fb7fb4111356dd5ce4985b2425b2ea2a341bb642c523e2c4d21f0146234f060a4f62b80395b360a216c22246621403086deaf693f0b26afe5a8156e17f11e82c6500387a21919ad30a95fc5b00c430664b23a6decf0edba234d5268d76cf304a045d67645dabc72835182c06460a29e20dd1fba16c843aec8c74edf4d0c182d22324358f606fd08001516ee584028c611ccb806413ed2f1750d9910d9945c17847386da3c470fb7710f5451988490f274a8e70dd428f52f844f68aec92600e58b973885e448d46a52826a0728063d80839e911a6ee84dc27729a6cdf532ce894862314b2e4ce3bb2f69c3e6f2c685d6680e7d22ba301774b9a21f83b8c720e6753baeccc433b7139ab1795f0847540da0eccdb7956eccae12a6e498d656c725b9eb18e7625eeaa0e3aa8b19d7044f353ef407d91c7d8d6d8770471d7249ae72489475ebccd368bb6d544f85995febb6ebcac667ecb6663db0b58c661790e92c64355670b4e5f11b069016b9fe9e9cab4cf0e5ad20d86571c6e6b053f4a1302eb4ed19a8c1df985707083fc715e7459eff335352558b555e2afc7856ca423c046ab1de50a32ffa8d172f37c90b7e868b3e169b3aaf259cda5c3bc97a491854ad9214d5e520ad57fdd55fd00495d026be1e58152ccfd7243110bd9f7fa75a16d669aaa98a3247d4d4045009f2de89f6b648989bfe8b099440685754090a534064c21372f3427b2b26a5eca7a04d92cba756b9accb9aeb0021a01072bdf90a9d0ff7dd5af4f0186375624f84a62918bc78767d07f8fa61bb65b85c8d520f9a09700c27584d0f35dfddef25556adac063aa6a3dd950d291dba880ec4ae71e8d6bbd4c7133d2e1cccb66be1d5cbaaef292dcc5f9140b62ad16394ddfccfad67e105a50bac6ccb8d1232621a3e0c412b8f62cbc1827dd158312e0f9fa1b97cc9efde078349de9ad34307492b0a17021600eb21d591095a2ac09f77cfac3fe26058f3a25827934fec3abda20104e80ba071a469c20e74efbe020b878d5230db1cd923c253afea676cd5064285edeffb1050c4b19163bc0844503afd069c98a7182e97fa9bc18d87ee9431ff8a0c7e1bee989cc0ada35bd9c48e5fbf12242cbfd59930c031941cc59e5356054dad3bb2d52b03b93896c142e8044643c6bd870f7fb18ee3551ac5d51f37a36bf05f0739d70c8bda8c7eb30fe6a51cc37ce1cb5a04030caa6a465de28c5abb082835e911d7c45374b0e0a1c58c4a7888b46d29d900864774fd24431c17b65675209ce7d767b763ad3299649a57e572429c09d89843a5eaa1a080f8f2dae563abf35f6ca9f4b89a1c22becb47ef3843d1f4584972c2d0a4bbe2b6c9965036d10e3cd75683d7d140a28d3603cb2ae9a3fde0a837a4d1e04b78622da4997167baa1bf89ad4980d1df753e342bf7132781e2a480856f62b687f784eaeafec758d03036de0c8c0d5c03c34b12b6d2fe77a348e5e7431e7af36582659ec0fe551cf89d2d4a82ef89660458ed154478282bbcbabddef", + "to_receiver": "9ad31def2f3ec37165e319697098900b79531b02471acbc41306bc7d412ad3c7d47bded91c47e0cada3d76df767a30e70e821d5ba222a91624ff15af", + "to_sender": "42535a5e1f27b498409cac44d29a75bd458888dacd5dc4cee5785b35c4035b1aa2044e70b2d70d73fbbf9fd19f91a7c6ea4a51fb935f89bf78846031" }, - "viewing_key": "efd39d32f7e91005e6c738deb2785c32831ad212ef10384ac42330cf7bac7a8f" + "viewing_key": "c82fc4321170c8493cc4135c1f9cb5ac8efe025f8676339fed0a6aec879ccfc2" }, "memo": { - "cm": "7c73c93ede9ed2995ee876578ea30cdbcc941f952e5fff9d1515ca21e757342d", + "cm": "f8514c636114a0bcf79f11f94c0ad0c7e104dbaea54c9ca36fa19c7be5fc4767", "envelope": { - "body": "69b4db8332c9fa595097c916a30ed1877158717c07bd0ecf215b68f9a3df610ed492ca2580b11923761c2f0ec25774b1e38b8e2870f351570b1f0f5185432f4aa23099a2463063014f62b062654feeb307e2e135f03c63cdc750542dc09c97cec6e3fe008a651aad878db31631b0a197e65c7adf3e7e1ceb2a65e1e453db0ebf265c3b3bfbe022fe182a4442bd8e683c3215e007d74bf4130a809f3798004d3bfdb7ef04ed63ab6672bbd2d6142fddb6e566c7025591736ae986bfe904f30e2cbd6e71885dc8aafa6e524dfe41bd1bb3bd90ce6f2cd24d0cd2cbc2d7983bd54aa089643bd9364bdcd09eff0c635bb35ec61c4c58fbd043a98d9a13d9f4ea3d0a12d6f2ce4f5e1bbe57364498ad5b8db0df786867c8a356a4f2f6aea921e00183acc793a838e0dbcf8d46c8191656100dd7c84e2cc072f5150b5a2496a44d296bee4853ab19e80291491b8fa145f5ab4719366455776fbf3f43e599e32c519ed087d1c8dd37ac39933dce18a5f650a401b01c9a83766be21ce015c5080d414c34f13024d9166aa822ca5ffc0d87db001e6362fecee37cd598c645b006dc413f88f05c375d15b3d96f8befed27eee2e2ececddede4237916bc7d68743e6cea5d3d6a6718b7534aabda692bedfd9cbeb85fc320d645a20a696263483b065ee3c5c7ff2d7e2c7ee399452a7517bcf32dfedd07657768016462b205ce130dd4dbbe43e359bf7bdcbe8e05c76912c42bf7cf2b94de559011b1233ec156a9d06b3894eee284a7b7e40cad44c2abfb0b7bd987c15d6d0a619fc06cbafdbf6444c40bae95434674f1bdf06ff73ebd99b035302a12fb5dd30700a6cb8dce034a7e00e4c7b213dde13cc821852e37314822d1c79dee32a7c421e3d5941222c055886d02f0c12f17349f4c50690ecdbc81f2", - "kem_ct": "88971c5a3f0e192a3a5bd602532c8616179ece808be724155fa52090f8d34a79717c2350674ad6b9947ca2b07f418d2cbdf97d996752251cbf581bb19f9911ea55b06df1c9941669b114fe94972f0278005d10a2d3a55536880f663c4c6fa436ac46dec9fe078355893c66dceab6834234ef0e2dc43c82b48233324861ac8195815978f8cedb01a4efef128364ec163082738798ac380fcbf900e756146eb6c1657515dfef88ccc7b7d3ace332caf3404d76c518eb3bb35b87c99300b481f4b3a6f1a0e6351a606d8c2f72004c545e802198e790a8d2c27d295371ceaeb00608bedc955aae6e245efbe2c5d7d7e2a2bba3b529592e1be4e3562881ebc7c0adfa4b9dbfff758b114acde554a9bb817fcc8c7bd737b5b0fea768c3d7d6d35bc99d81675ba38cc6350cff85069b57d0d12b668d3e74a0c95632ff332f54c840c9047d8f28f6eb291befe7be2fec1a648a08d9f23a76d01565df6e233151e3c457744c036913e48d2f8ed2b52ad6ee3a9414f6c81e1a4b0c8ebc9dec30d6957816165b3551fc66dc3100bdad1fe449ab9bd897279ae6b82fb40842023d81c8a475697dd2517e2c708153b89c0e103b1e8752f9279dc0ed7ed93187575e85d0e8c282d4f0c5ed604318f5f0f28616a5157edd94554ce99e5aaf0e7061c44e24b0f8d6bc6187a736b5d9bbedbfae7db736ba62552d3e6773c2029557c090fff21250eb526a9f5e54779ff13783a8140747b5def80f23b2f19356a17b8f8641d0865ef385479900e3127cabc8f80283ae1e7ecf9928d67814eda8a4b86000b6876b8b464133ed0810360413c98ba64249fa7f3311c2cc4e1e4597f918d68fb51bd51ffaa4451e81e9193d9cab38b50d9228832546be512ad29105ef25297be34a491c3247752c7cc50fcc38213ff275cf571773795cf4e2ecdf03e862e9cc34319d635c94f0365aa7049e31d0a3c65c5ac6486976cec47180fe023be7fac0d004b5b8b8bd43b36f45104edae84207c262d31cf64f0957371f5b2f294ba6c18c2c660f3198f0e0e56036966760f74d4a39407f5f8aa1c2ea1621ea119cae4ace8105d570c0efd432f326fafbb4e3c72aaa418ac86c9fcbf29803bcd1d57598e7fe91990798b66370aa11d8cc946c6d03a8d749940bb26e868a6a112bb798cd0cc0127f2d37629b2f8acfd866c35202cdd920dfefbd905bc6e06441babf82b9198a92e5fd48c8a3b5c8e9933c234c8d3fe26bef8f8d5be585cf1aeb6d507d7d30bc065cec495551a1c1132b30c42c339f4a3d1c154f4ad80db65085d495f468e819f574510d998f01bd58e22947f4c926d0d864d4b92c13a1a1fd9e448ced8be621e80388985de6dad8978bb065a5db7bca79c82d39bb2921595fed1f84addc8a6d88d328d212acf83d2a6fcb0049d6150c8fcf07f14bfc111c331228b63e4f25899e314070dd3e3f040408269f697906e2891c01b14e79bd9d0acf5aa1854c5f11f8a28ca61eaeb2f22251614ecefb259efd7ed2b0776f19d4a8521c3286036c1952a9b6", - "to_receiver": "5a43cafcd73644ff13ee3c94e5d5458397ef643599f712181c58ea17307459d53b36690e0467563307f7c873c031b32d419cc56898f5a7c150e8016d", - "to_sender": "a9d5d0fef88059fa281e7f2c96cccc4f74fb260d0726e9b58adfbf4257548d37719a57eae26f804c5c32b9d62aaabc34e68b2b2a698936f04e43783c" + "body": "908604fdf5c1c3b337f94a99b0513bee181184e542bcffe103daebef4c051185f7756b187087335a3800da3befcb4a02624d1dc0f22ca5827835da450d219fa4fc748f3c5e54be630f2f4cdd7e5a37b9afb864223b7aa3b716aca0ba21164ef0d0a6372345158202d5c7f5944cc932b8ea69df911b6010d57e94349a9eebb46c3c54d6809cd1037b04367be7819bb2564550763edbc9b778b61d284cb624ae0ee5070cebc3a951b04a60e1fa3ad8f9d9e78df7da7f88ee0f2f141524394e5e253ae8d126f34cfb8f777be321016c74c969e462c66594af6bd96879ef337a2a03bd980e091bdfed2152e69cb0dfdb268c30abd60310f6ce37a64fe30ad2a2aa32ba1d922cdc61e301249779fbb502eeb2857f9e53ce0e3b414c2a9b42e07e66fba00ccf76086f121aea3e6e6e5c5b7962cf078476c12b51cb234ffe9ebee0eded7a9587d2c8d5b03dc6b0cae4b7c625caa1ac8ceeffd2068e2c1f346396e469efff2431f1cd589b9b92fee83b6bc47f1dd703e9a5af7c7daf76852f04efadf29276dcb291bf5809cc46f40d0f4e8d76cc3dbafd7545168d6bcc754834e9254ed83444336a3782f70bc94fefb9791a2d3dcb21956953481d8275c76d562dd37709b2ae1a1c74574b0376d893b08e579a2e5a80fc75a0e6d5d133c43bc353ed93676f40ecc4951a1773c57b47652156889200e0ab13378ade61f9379d63dd95c00879e8acbf90a50ced639835185e65d0b53d57ce0df82716a158b52a8bcbd4bbbb54b4d82e7b07b7304b29eb2f3a46f3841d1ec336fdca2910bf7a2880249782dbfe675fa21a16207a43b831217d41b4706e6da76fb1366315eb1f5e186ff3df8748f51573a203c0484c011b68b0192dda84fa61ae7a0e1025eba2cd556b1e6c4910845908860bde973b01d89d", + "kem_ct": "3360f4aa1db03007751c809df28fa0ef32058aa986bf05441d8f7a296c10772168997fa81c5f7f6be9d432102a9a9d7909be5b826bdd288b3b0ef69a1f8d8f632568ce2dcbd6f62ba07c79a8d59fcd2e8b2016550b1f20d8ceec8494b2e3ddb3ef7cab3051d2c87fbad5d67bd330001e3693264fa49fc1fad21279951586260c621348c80b510ea9181ba10bce3f37e524d9e9b724b7f02ae88f23f09a34e4ae67989de8e9d656adb2c1110b11ca9fe73797d7a54d5627757a1c2670cbf75d41eab78a952f4cc18b91f055548726c88b60e2a1ea289d92b75299229619fac9414c2e6f4df4c66313d755ea28e8c3badda39d1515e7072bd3dae2ad7b91750ba3721707ae0e5fed5ab26eeea8efa237fb50897ffe83e1e52a79727747dce017c450a3b64be9c686242c7667231318da4702a09d1b2e89143248c5ea26252e014748b834847e00344d9df37062c2b2631918ca7c5b5644638803500face0b3c9776449f25546e22d9469bf874f3453faa7a86fa519323002c65073524b884173bbb254725767eee6487968a17d912979988a467a74cfd54adb4e594cb6d550b7d77674cf47fa977372572ad65c177bbcb901d5b7b7171c24d64ac042634f4a544d4a8f23c4b2e7d16ee209e66fd48f85a577ccd0472669ef6bfc73b7118fb8ebb53e18572e93d3d3d9ad131832f23e582aeffbffd47d4b17b9b8c490c2bfed349745d49dd013f33530e99859cf5b1df3186ba8cc64f4f55c6daaff9013c175cb4a5d86274e79372a5248f9a8d5c1f751e51d308cb1473d29d404d295c466d53a6cbac4eccd51d54426f0ab7c1460744f6409f9d1115c12caada8f8f746eebfc660dde961cbda0e980ebbc2b700054d2bb3e795b176aeb6e5a0b12b3f94a0f9aab50c87d2f738cbeed01e54e69e234761694943e14177614a09dfbb00e88e97418df43905075c733ea4c630659dacd7cc2b7e1c2fdb532e645f675c228a25a235f098a3868995a9855c9af44903321e745eda98c6d1e4f81f954efeb2ab4e0b2dd0be086d7936be8682b46d8160830d477effa331ed1704df7570ada3ca80852a5da8039f00c467f1d16ed111d2ea722eed69f4e975ad001b355ab255cdab76fdf0d3701c3028681d8842b6b4f6f3cbbd528c8f88be81400f48c59ccb35765f22a006805d19dcb0a55903ab60bfeb9c347724454da43938671f712c81af302c9de2d7ac11dd796f40633486265689f9b4ef9bd37bb0c65cee3b5bf20a243cf2fe59d2e6c0ee517577f59e0843b63c83db94d34604cbb602faac1e33385f6d4e6a4a9b1c30169ae42cc2b89d43cebec4ae80744a3f1e0ac4c5a32bafcdd16754826766b462dba4dc671ffdc1cfe34dd70a02c4d2eac923aa7b7b29256322d1d50c042221276bb8022e65998a872e971a0d3c9b460a14c29bcfb71f15dfb0404df27898c44a2ced1f55a89291c22d0a259fb9bce8d47b4c3812e4ee24c35f8b206fd1baf19799a5ea73cbdbc07893e8d67ce01adbb870673d9a570ee3df3044f76490", + "to_receiver": "1c6e49a4e36351a41ff80b469744311bd7a2e3435f9a67df310597ee6c017ebcf2dbeafe8e1832135daf40d1d49bd74e9051b0e7701d4e8b48e2c35f", + "to_sender": "f76c3c4a4f7fd4ee39d75cdd3e3d63e036acc40d433b5a6e2eca0c5a96ed395c9578f97731e43ddb4818dd909d7b476e80867c6ee250965cbda3550c" }, "memo": "fixture memo", - "viewing_key": "efd39d32f7e91005e6c738deb2785c32831ad212ef10384ac42330cf7bac7a8f" + "viewing_key": "c82fc4321170c8493cc4135c1f9cb5ac8efe025f8676339fed0a6aec879ccfc2" } -} \ No newline at end of file +} diff --git a/crates/randscan-viewing/tests/rebuild.rs b/crates/randscan-viewing/tests/rebuild.rs index 0eb4b94..bd940a8 100644 --- a/crates/randscan-viewing/tests/rebuild.rs +++ b/crates/randscan-viewing/tests/rebuild.rs @@ -2,7 +2,10 @@ //! `wallet::rebuilt_notes_with`), checked against chain 20's first fee-split deposit: block 1664's //! `bridge_attest` minted the depositor's net note (leaf 19, 0.999 zUSD) and the treasury's fee //! note (leaf 20, 0.001 zUSD, no envelope). The fixture is public chain data only; the owners' -//! `pk`s are read out of their public addresses (`rand1` + base58(pk ‖ ML-KEM key)). +//! `pk`s are read out of their public addresses (`rand1` + base58(pk ‖ ML-KEM key)). Since +//! constraint set 11 (chain 22) the leaves are those same openings re-committed under the Grain +//! constants by the fullnode crate (60a7d03), not chain 20's set-9 leaves — see the fixture's +//! `_source`. use randscan_viewing::{rebuild, word8_from_hex, Note, PublicNote, ViewingKey, Word8, DEPOSIT_FROM, MINT_FROM, PROGRAM_FROM}; diff --git a/crates/randscan-viewing/tests/vectors.json b/crates/randscan-viewing/tests/vectors.json index a4d301f..779a319 100644 --- a/crates/randscan-viewing/tests/vectors.json +++ b/crates/randscan-viewing/tests/vectors.json @@ -1,40 +1,40 @@ { - "address_b": "rand15RCkpk2U1cbKaaT7kWvo6WidymEpEQJYHH1nr5ufBaB2UvMyLkLhauNtWnS8nePwYR15Yj2hvg3CLtfEsZkKAZknkAsRTgbS8Wr9bc7J5Zc7QDqrQ7U19cfj3fpKSs6wdzbMJ5V1QWJ4q41gPStge3symcqV7f3W2SBN354xJ9aaxmMPz4JzjXASC1HRDxZ4ZViM1LGxqvyTGwPKvQKdvuicoWuvA6KeZ6oC1kFiXGG8epZ2D3en6ZyGJrx6FMqZxqvMxkD99QyCW85qzFT5FaqyEHCHcW6ZUo1ixoEePhVL6DKQzXuwHbjxNhbsSzXkTxMqoaon49f68z5boju1R24fC7HciteJdt6q5NoM9D5nakczi1YTqoY3PMwzro8WF4wW8mADjr3GvMBPas3AhQ1Eh4WQyis9aEdiwHrLGU8CNMGX8Y2JXFbuXZftsk2skHFTST8ciQa6TVGj5CZBqdQzxxqxjsTnfB3uNvtnmRsoMXbHsYq3mL6SgoEdLbzr3Bo4zbHmYkrZGMhi6oRWoqA8FqJRHQGcbnJFkvsrGiAPtG6E9D2g95wMz3z3iFiAjAfrFVuSZBF9AzcHgSfVAdPhKL7cv49PUAoq5fSwfY3C4X75FbsCMBuAr1Z4vesegxLL3KZRZd1v1kXP57ujAe3nGj5BXd2X2GePT6u6rKUU88GqJoQFW1Vv8s2aRF15Q7a5XdX8LuFaVmMrnkFaZMsMEg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LziD7E1ss5yhsRJR6tJR624FCt8mjWyf1gsMKsDoHQpJacvAGV5fBP821acEaveg4CesGo145AnmBZi5Tcq7k3hsJtxyT32wHBayECsExQPG65AV2DJ2sBUt7YiL8vm5bDjrt3VGNp1DvYRG5pdiZAAXNyRAbjzzZ99eSoxsReRb1QoG4o7KjBumU9Byb114hfV5UowoJhJW1BmXkwmn48Xi8Nwwm3ixfMPSucgzuiVyBsvjfP1dY2iaxMMTaFVUjA6May586ZtC3tGqbZyAzd5VL3fHfQAiCgQNNasYLP4JF9ZenK3ncTsKML7MK3z84cKKP11rQRt6RNavxURxAb5G2LRX5CnA46TbE1QWA6i7JC1dvj2tWLvC1DuQ8sjuqa9fPWdJrU8VSZQZPohGrmfEgPWYhjnYa8kjH2oxFMsf7g2mqp", "call_envelope": { - "body": "78788a223b8975c059316eae31312c760b3a9e3385c76e3490fcd37f16d3c69eb0160ff481259e9f13108ea6dccb02fb40f088dd70f5b70a73ac0081", - "kem_ct": "774611291e2936726a733c04a50da9c7b22be1b1a70ef092af88ec877628ec9e9c1a7fc47b3eb63ee11fc4fb5dc06dfe2d6b64e32703e27c0b2ef259c3b09e42a552274230d2eefb22bab110aa3e4e66f2d30ac2e1f0d15f1afc3752e7bbb93c434edcb63ac78512597e27d160488a702d638a73f13108a593f208ceb691199ee3b9eb1c40f18e18a6a223f3aa11a0d6b022e4940bd5341ea72ce8d1173bf5a0bb825d09712fa8919899962be72974abdfca63ef9fc0df79ee95d3478ffc25a53d1f8c2b0d75b307220676a92b33f54ce18bb0f9427e800e079abe54dc755365d0832b1bfbe0709e87f702ac74cc4a33d44b8477d68fb0f9a5f929eca1ae1c318212beb27e84f8f3398d0517f813a67d44242860f550e02cbc842005efd6b73726fe7bd9f1cba48acfbebb67e337f1945ec217ccbba6378ce38255f6734069b118070effa6e5988e76f7e2f034f59b61d66892f2a7089a77b27b43c523357f692e4722762f273811916537e5d21004fa1758324e9a09884c8611d3cc55045bdd713f566805c65ba4cad0d019a30eb2fc9e4d30cc06886eeaba152b78498f8402a6715f7252266803ac508628884eb315ad742c48e70fd181b7b0e05d369b0e4e646ae6a5f8ad4a2e397493ff0f0ac262e9e4ee5867863afbcc8cee173eb7d0196b3efdfc9780b3d5265f749ab5e52279755a934d3501eac403dd42cd5197323c04c903bc5be8f3e031970ac48441d717e94eb2872f122189579d785174088d5069b829e67b7bc9700fa6f4daaaaeac96ebaf524ddbae5d1a5d3a79d19fa3f3d3f0ed58dea59d8877114c6fcdae45d0a4c627fe2ca6117bfbc44485c0c65c38849e72985f6cc36ca85d9461ef24ef0131ad9403da9408160cdcf308587bf21e39838255874cf0774c03e66bb1fdcccbe55d3793bd9332281301d9810561aa096a06e75f6c568663c528276243466c7a6126a0755f79454a3a3f5e0d6101a8f1cefffbfb173d92a2285a18c926e6db4311df40e26ef82bda3064f131750d8275484834ebc18f74fc711c777d71ca751458294d269df55b6827ecf3abba69e35ad2116bdb264b4e583f8b2d3ed44d792f0b4a71c6dbc2f606c210d731c0318d0349b2b1049818c7fb40052685f9d49760a66e390b38199010bf886f1eed4d4f4c9e5646a16f5374374b8fa686ce196ae0558c2913e77400de4c2f32794842a570b6e3cd60b64132fbf55487eea3af68e1a26182f9e9c936a2b9e5ddd4804eaceb7b4b09049efba4d64a1540242f1b94b0d905ebf642d063fff1cbb93c3a87a91087d95e75d16fc614b6c3fe5e2a670329b9900cb75ea21108264761bfbb57d39dccfac26bebaa237ed5d6dcd42d812bafb916831241dcfad7b087de0970470e775ba4f29c516379fe4d811a59558c2e92eaad4551d4789ae3fbfb41e00286d1a3219d8fc3269980de1e10d7d5df5c65707a109905e83970393d65d5342f8a1e9f9b73d7373deabcd0500333f7f9d0c98cefe9c62d42ca52429c4a4ce4fdf9149874", - "to_auditor": "80fc9df445dc20d348afdb5158e41765e5ecd13f41752cae500859134bbeb733605336164f477eb614935ddb4a00b5cfed2593d75e32585fe2cbbf9c", - "to_sender": "d76d7161585bd4e18613f8286873f0e10d8f51ccc8f248669a37da5b02a63bdb6302aede3d14a8ac5c9bdaf40c8a36299e79499e18a53927290ddaa7" + "body": "8d12177ca9dde1d5c27ea0b318c08a06d9c479ac0b7afb8154deb761e4170748a6435150a37248ea7ca5b792fa4614bc41a5d9d86270d93bb268f1f1", + "kem_ct": "513fbefc6dcd0532ab9e2a662c1510f9845e2839913f6dca95c45207404d36c8cbe80c1b826db6f91db12e54b8a6b6f1ffb74b186ade392d75ab91ed7c9c8a26f0d785d433dc2ab5d7c86b31039bceb5f2958bf4ff77a27faa15cbc54d27c662e95bdaccbcd1914d4f09ad1890b1fb3bed94acd9fab1f7294555e63978dde5e6a9b630bdcde0a0e4058edac803ecd6c40ee7df79b10bd467bb4fb0666e3e603b85494d57c2c89a612e68df84d1d66bdef1c0fa0a70855200e15978f0b2fb089e7c2bf541847c53a2bf8a8c436a134447111ce40663d2af5cd840f812f8a3df7ef36ca4a8d30f7a3ce5afd61bc89ca8c093f0d73ef58a659afc331406641bfb99a8ffbae986e9c1229205fa42c2eb20a3b66f3b57b442ade2bac6dbadf02b6f9a4e1c947c6ff3e8fa1ac4d21c50fc52a7c6c0889d3c15bc24c5aa4fc38aa18b927079b5704b35993d8ee38e1a555df93358b1502ff28d55b161ca2348f4b8843b4f99f79bd917a36a52341589db9dfdbdb2da3977e34c37aa8c0bcbcb16665e1dcc2c78be2ec75437cc0ecbbcf88fc3550f5adae1bac0467635eb1bcfe1778bd00f12d03ebea78454364c0b8fa0da90cafa1fe292c124751001a19c3ebdb26f9e9538d967f04bcfa2fb54d51e9a4636a392d74882a232899383104b411210d87389b4e23e290fa74c12fd1ce212f54904b228b7242a22077a58c03d1811f3f76529f832000258d4b499ecba85998fe56b0b8b88d16c6754bfa6ef0704c5a3e43f68393a6bf4ba47265190cdbf1ebb49c685a76078f8710bbaee5ab3bb8085506178a9c77810cb8df43ee3d2f3ff6565f6026902dd02aa26abdcada772545d51c59ad66fe6824343e6da88ab5070992fbf3c6a5070594ae5a7a361888b6566c7c5c1493e9667825a67ecb4c958b8ebc584dbda082c43bdc9eaa3d72fdf26516383f7429a14efc47065a999dbddecf6592ec968abb0b44b8dc2cf937c3b1f8c9dc15b694e499543ac60abc9400a7b6669719d502018b168b0c31fc869971dc03ee14c31f9a9d8d167fe3f2beca6096d64f90ed648086018b171a5b635d3a40a9683e52057f6b7be114e3c1acba2a796f38622a48ff5fbdc2191af360523f8660489ae71f08adc0ebedb5e5b384997fdb2ff9609c232679b0350cef38f773d7da21a9109ed1f76c1d02889a1144dd38e2356cb3357f709631994cd167a3ceaac24eb03a53d9bc8f5ae3f8ab64548180b18da734c349d2b2d8e671f8058ceb030fea0dfd7f18aa95ca75baac775cb5ab30a76c6e2cc247182199c30836f9748a1f8f2b78a7818b791807f1e5a20f9533b22af197bf3bbba6b414d0b1beb3bfe30971a4526dc629645e42e68fe283db0b3c5589190638e2710ee43bc1030826c369931c9e5317350475e17895cbc9712f1d1d8c6187554285b46d88000876cf4cac76a7ee4ad76a103a40311df8944f41e534b2222200c65fa143908ed4c2db17da471b776192dd33ce1460575fdc48e2d2d6d91791a8684de7c2c9b6e5d89523d99b9", + "to_auditor": "528d8b15fe383def57f434df43fd43bd4302e242a316bf95453c7c378f87fe48fb1d29fdb54886382d8a952f08118df10ed37e14267fafe98bc3f517", + "to_sender": "ff65e10db2ffc76a1c392a9daf033ebdf8e16aa5d79cd9751151bb453562c2d8de54ea2b69e2f7a1a61563b8d8fb2a041bfe0e391a10a20ba0a06fa7" }, - "call_key": "0b11270669babca70010e3465c277d117973068757b6414269b135838c8c7372", - "cm": "7c73c93ede9ed2995ee876578ea30cdbcc941f952e5fff9d1515ca21e757342d", + "call_key": "41a945f2abd070c7f34728493170a1b4bd49a75724fcc5392db29bd4717967dd", + "cm": "f8514c636114a0bcf79f11f94c0ad0c7e104dbaea54c9ca36fa19c7be5fc4767", "envelope": { - "body": "74fb0913c90fd60d5129696973b113ecfff5ba6f547a6cdd5704dc89a6068f7ff3d18f9d3f4d715cba7ea09075c1b8409a378f1d7562d94c0bc67ab9320b4548b37e7f0c460dc34e6f774a1eb5b0683f73e3b6a30b50cd12556fdc21ebda6223db3243024949e2d7d59988a3e64fd7e8ba2d66dc66bd66f0a91bb4c383a0fd77b39603efb42105e81a5c75ff", - "kem_ct": "b47067ec321293f56eb59ac5a5f679357e2d4a30449a869f91524145a63f1199cf943b39f018ead688ecb225acee87c23a32169140e935a6d5541ee68184b435df7ef38628c3e98f2f0a4f31f03c4da6f9d0cfe5f38a23e613f82464ee29c1ed61b91e5e32ac2d2945b92c3dba23d05732ae84dd3cc6dab46fff71ccb05b1fa8deae032ff187b4ddb19fcc6d7050bdbdfbc24c3894fdcb05bfab1a37f6095520af7efc457e8a44db420f986daa7c4cc6ca66ae3d91c9e800b04d1c9502aeb6703cbbead0cc6de61019b5526ad444bd1025aba49202584088221b3644293178153d90e2823c98e41013d2dc63104cc0ac4f6394681c5d0dfb6d50dd9583a8f9b07732d430f65a701b0c309edbd8c57039279e997372d80eb81c8527916520140918bafef6f6f7f3a92601d7af9e9a217f0ec292b9582522c653517783987d9b4720ea8118720a1c0bb0b31f5738db3ad49406d328636b7e0793a1d1fbb16ecf8ad26d586155a74553c1556ad14d475b62418065355f55ede2f79e73a4f1391d03c6c34dda0c8298da32eab0705a9753b1991d09de6a8721e5235484bf918d8b1de70418e85f48bb88e558609d61692437d83ba14c22b95d49f6db20886caa368f9981e49545bb9c8b91932641df7c7afb92de87092a82cb3cc729d22f51ff91d9aab9056e24d3088fb40e2a541cd404ec4314376a648584f50bfa21f405831f4bef0e2f667344abed311e3fa1919ce3ef1225c15d3864cdf27b1429993487cab79d55396bedb9573546a755ff7c07e16fb7be005f5c2ba2bfc316e9da8eee8cc54b5e1480d3b1c34ae54b670fa2a8c05dea88b45768687c293dbdb30c602a743540a5807dd30c238a11a5d4b64b3672d42f9ff7a765de4e9e6ece04e295366825666fa3360c33c8b31af83fa36134e8dc6b70aee83211c6000c6bdfa558bc9038053d49d9791990a8f79e4b1f83d261030377fd25d176d4fc58a7b2e8e22b90f6da4bebc3cb735281b3b235449f696c5526ca79dd5660540c43058751033e77f6c6cfdb57168974024b9c6d49c2aee4d1c34f174ca1afb77b26ff1bbe60589274eda80b5128423eae79f20a7889c9bb56f8569cea5f74d65497b91428774272697a9c7be6675355c972717650063cac5b22ce5d442a745ffca0b02d3f89a20358095b376e6a9efaa3fd8c337c458edff31cf1c4c91ca88fe4ab588fdca4d52c8357cd0091b428161e5f9a7ef0188e90547ce37a7bf748d1b5e6c437c1e7ac23481f4d721bb964f2a0391c4006ddde9515ef37a7860192d2f0f4bda13cca9c5462b8bd32bcb3268cda10ef1e600f406bcfe8417ded521a7d090ea0eeaf4f3882eacffce008cb09faac1ceb8be19aef32cdbca8ba3288adca7cef3eca5ad7bbbdd7715437410f4b1e9511016fd5a648fd0a8bf0b133d8fd4d05b1c52c4e9c374b720a546ba9936a089b58404ddc6cbe16429771e442327e453b3ac2b8b00cf5865d39d77dc0bf4e9821f825ad72f90e65a5520c7d40c4d1127e98fdb413e9433a67", - "to_receiver": "4bb46970e5deead874bb01b31e9bd24aa69673816bfe9e9bb05b1c190a59b0874ede70e9043bf4eec2f51b673a6ecee5e8e0ad12359b266cb8af5faa", - "to_sender": "f1ac2e1d93c208b92af886ce2a91966994df44cf8bab4d287fce7b3dc0c8ef801b4fd9afc4658654f2c828d4b94bcd0b27bab4e3a5e2ffd0e70c7174" + "body": "422aaeab217316e0b403436aa690725b79cd50c7cfb9c1164146b7e5b77345cf29a1e778c9e81828c9a3fb6e2ad6b9fca06ad6ffeb07e12d3cd5e7a6a7324c79bd5cedf6761dc517659e6827c7050f797f8f2452f41bcf5bb66222d940c24c836770314f81843f2adca7d057f5fe5f4da3852180bbdc655054558c0b25be7226e90d25a2f00b5f5417bf430e", + "kem_ct": "f20f8e30f9519d7b5461ef3f6099651b2bcd806e5186a3038fff962cf7b1f7335894e2f7c455ae0646f408523b78cfa82819e51c14114d1f3fc3fc794486a4232cda7058581343a75803a8167012cb86c31ff5a8e7191f29ae7e08bb5f0e6de96b900ec459ce72c771052dd2b4a235ca6b38b485254df71ff193978d623909f0faf27dac5b348313453144ce3b76cb245f79966a2fa454d654f542fdb2c4e0015d7e3d098934ce4c3bf79c492bdbb8df8e505fb1bcfb63ded39705b6991b8af827cb646ab810981eb340b8fa55a097c71538928e41d3f770b0184d0b268c7e8c96f776a1dae035708b0e2eb6803e17bdb1db316efca2260c2694a6b92bd0f60ea62cead613444bf8e57727c0491deeedcc3c7201be3d246782001dfae3abb2b4fd301099e0be3d6dc81070779131423291ba6a1b315b03f9312b7dcdba29b4e76cdd0c7a87bd2e5c8615b8e689aa8823bf68e67ed82952062fec58ad074336ea067fa8e8edf667637e0b4fabd54886a67d956c92f28efbd79e2a5f5b2b55bec132c0d9f4f1d7bdf6af4c1be1814e2aefad5253991d379068859f67ac99957cb3f1527831438812fc3d4fab76067a7e0ba144ef86237eab78f12b662925c96bbe776c33e3add07f0c48637e89a45b7ea3081f004691388465d9bb650d30baf4db0a167da2cde18eab4a777a2750e74467302e86a19ef4886bf494139b00ae5da5139dde20401c098d9508b6a877820a0b04f7b32164959adf7e219848e092a8660bc182091a1865a4f2382e40cf56d4bfbd245daafda5341c660f84f814763eefe2fb5a87bf9b9f8dba5883ddeafae50c9a5246ae4f57d5deec25644b998252ff465bd3c90c1fe14d50a824d41a384e84d684f43beef6da3270f466da25361b9f0bb5134390d18284cf66a77cd6582ff1b13a2f789a89c0194c9d9913dccce8dae386d4914c1e07a2d7058e7ae9e2363c98a45d50305331dfaee0425ae1a84458f84d3e3ab5ea7d6cf8d25e24f11f1de8cc5146d5bb717dabeb5557b64d11da132b6fce7d9253435bc5b14e7370a6581ab80df7fcd656015b2d5623cf62171c150e30cc2e86989f9cb06137fe8c4801d6be3c6f2a0fc3fb028328218dce55f6f99055fa98a7a9913d5883ebd4216edf7277a57367b1a8d16f3918d4dfb8eab1cf7206cf7ddc54673fd27c326161511480bd874f3f93253e898bb05dd62b37755a0b1b4f8f8e7b8395e5570daa5886cbd01ae89de906a87aa0b9a30c5096961a6f55c49ac165c2131c9f1b5a0130585ec15791041abd68103dda76f82fbbafbed56494e7e7ad6c2a3919d1613105618c72e839dfb80f0275708e249356934243dc550adcc212cf10cdbdfe53075161dbfcca0f24b447b7ff046632db2758cabe959cd3c7b02f5af4c90f4b1edcceb6f5a4719eb0f12678e69c0516c887fac86da26b789ef5c20113676eb6329edfa37d467979d6d43e47d54d6e670bea22240abbea7279b5af1a17176880b4ea344c2799c1b34b61e10f87d5d3635a8e40232a21", + "to_receiver": "e3920448a8b03de4ddc68ea4948eef6818f35ccfece2cf21b42af8fae445b534d371749c239c256e73239c9496614c75905e4c45be8cb0ab4442cd8c", + "to_sender": "5a7121e8695eceb4adc00b504598d2b11d63a99785e3572d711db96649540cfe9f710b2873a7ec96b8186d059cfb8208b03fa86e45786dc89a94e40c" }, - "h_in": "c5cdd822373f7560338ea8d1f89249beb07bb15c3dafcc96baa8a5b72b4ebdd3", + "h_in": "f8a8f1435068abd654dc65ceadbefa136d7c65845f76243c2ebcd57d08c10ccc", "inputs": [ 400, 250, 0, 0 ], - "nk_a": "c7af303ece7e56e00be5fe99dfd88d8ffa076ab4b8ea7ef7ca615d0e0736fc13", - "nk_b": "efd39d32f7e91005e6c738deb2785c32831ad212ef10384ac42330cf7bac7a8f", + "nk_a": "6b8d45b20776e10e910256d577fe934e33c05a5a43e3c60b7ae79690e7cbc4f8", + "nk_b": "c82fc4321170c8493cc4135c1f9cb5ac8efe025f8676339fed0a6aec879ccfc2", "note": { "amount": 1500000000, "asset": 0, - "from": "c37ed965c936aa116c7184b4ae1d285c0a1882813e375a00456ea35df1feb955", - "pk": "53f57f874e8fee7ad3a5e5be820a12ab7836d5b642631c974ed0b5057f9c60aa", + "from": "6a9958fe0337649400adab0f9ce3b95bb472353c0b0e103b9fd353a2678f68b1", + "pk": "e4ed010b677dee856638ef991244116666da47248986444ddcbc86045472f64c", "r": "aa000000bb000000cc000000dd000000ee000000ff0000001100000022000000", "time": 66 }, - "nullifier_b": "a0e4998305c9d2edae2ce2c7fe27908a608350f733ce63fd0493c13b60b090ac", - "ovk_a": "ffb63959dc6cc09833ae5aad9ee2dd1aafb074c0b946f03ef0374b5192cb73cc", - "pk_a": "c37ed965c936aa116c7184b4ae1d285c0a1882813e375a00456ea35df1feb955", - "pk_b": "53f57f874e8fee7ad3a5e5be820a12ab7836d5b642631c974ed0b5057f9c60aa", + "nullifier_b": "da6ebb14f2405077fc73b370c1d71cbda7e4713ab162ab438a5e25353d4fe152", + "ovk_a": "15bc7c0def39760737521d0982f4e030430c5b0460598944db5f80fac2fd3da6", + "pk_a": "6a9958fe0337649400adab0f9ce3b95bb472353c0b0e103b9fd353a2678f68b1", + "pk_b": "e4ed010b677dee856638ef991244116666da47248986444ddcbc86045472f64c", "salt": [ 1, 2, @@ -43,7 +43,7 @@ ], "sk_a": "04030201080706050c0b0a09100f0e0d14131211181716151c1b1a19201f1e1d", "sk_b": "0700000007000000070000000700000007000000070000000700000007000000", - "sponge_1_2_3": "55e651bb550905af32c6fa1f6a7d80674fb050507d3d0edda9a81e3da5a17e3f", + "sponge_1_2_3": "fd4aa364b7ff047b298bce3b49a2bb931871487716eb44700d06ed53deee2ef2", "sponge_empty": "0000000000000000000000000000000000000000000000000000000000000000", "tx_key": "0909090909090909090909090909090909090909090909090909090909090909" -} \ No newline at end of file +} diff --git a/crates/randscan-viewing/tests/vectors.rs b/crates/randscan-viewing/tests/vectors.rs index 985d556..49d886f 100644 --- a/crates/randscan-viewing/tests/vectors.rs +++ b/crates/randscan-viewing/tests/vectors.rs @@ -1,7 +1,8 @@ //! Opens envelopes sealed by the fullnode's own crate (`tests/vectors.json`, produced with -//! `randprotocol-zkvm` at commit d40fb94 — v0.6.6, the chain-18 / constraint-set-8 build, whose -//! `src/` is unchanged at 86941a1 = v0.6.7, chain 19's build too; first produced at e2aae20, -//! and every deterministic value has been the same since): the only thing +//! `randprotocol-zkvm` at fullnode `feat/cs11-revendor` 60a7d03 — constraint set 11, chain 22, +//! from the same keys, note, salt and inputs as before; set 11's Grain constants moved every +//! Poseidon2 value in it — the sponge, nk/pk/ovk, the address, the commitment, the nullifier and +//! H_IN. Through set 10 it was produced at d40fb94 (v0.6.6) and first at e2aae20): the only thing //! that pins this re-implementation to the wire format the chain uses. use randscan_viewing::*; diff --git a/frontend/public/viewing/randscan_viewing_bg.wasm b/frontend/public/viewing/randscan_viewing_bg.wasm index 0f586bb..fe908b8 100644 Binary files a/frontend/public/viewing/randscan_viewing_bg.wasm and b/frontend/public/viewing/randscan_viewing_bg.wasm differ