From 85dd5fae8608cbe70d3ce8d070ff532f6a2d9c79 Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Wed, 25 Feb 2026 15:18:27 -0500 Subject: [PATCH 1/9] initialize bip-032 changes --- .../key_management/key_tree/keys_private.rs | 22 +++---- .../key_management/key_tree/keys_public.rs | 63 +++++++++---------- .../src/key_management/secret_holders.rs | 4 +- 3 files changed, 42 insertions(+), 47 deletions(-) diff --git a/key_protocol/src/key_management/key_tree/keys_private.rs b/key_protocol/src/key_management/key_tree/keys_private.rs index 1ff7095e..d9ad9548 100644 --- a/key_protocol/src/key_management/key_tree/keys_private.rs +++ b/key_protocol/src/key_management/key_tree/keys_private.rs @@ -63,7 +63,7 @@ impl KeyNode for ChildKeysPrivate { input.extend_from_slice(b"LEE_seed_priv"); input.extend_from_slice(&parent_pt.to_bytes()); - input.extend_from_slice(&cci.to_le_bytes()); + input.extend_from_slice(&cci.to_be_bytes()); let hash_value = hmac_sha512::HMAC::mac(input, self.ccc); @@ -193,26 +193,26 @@ mod tests { let child_node = ChildKeysPrivate::nth_child(&root_node, 42u32); let expected_ccc: [u8; 32] = [ - 145, 59, 225, 32, 54, 168, 14, 45, 60, 253, 57, 202, 31, 86, 142, 234, 51, 57, 154, 88, - 132, 200, 92, 191, 220, 144, 42, 184, 108, 35, 226, 146, + 27, 73, 133, 213, 214, 63, 217, 184, 164, 17, 172, 140, 223, 95, 255, 157, 11, 0, 58, + 53, 82, 147, 121, 120, 199, 50, 30, 28, 103, 24, 121, 187, ]; let expected_nsk: NullifierSecretKey = [ - 19, 100, 119, 73, 191, 225, 234, 219, 129, 88, 40, 229, 63, 225, 189, 136, 69, 172, - 221, 186, 147, 83, 150, 207, 70, 17, 228, 70, 113, 87, 227, 31, + 124, 61, 40, 92, 33, 135, 3, 41, 200, 234, 3, 69, 102, 184, 57, 191, 106, 151, 194, + 192, 103, 132, 141, 112, 249, 108, 192, 117, 24, 48, 70, 216, ]; let expected_npk: NullifierPublicKey = nssa_core::NullifierPublicKey([ - 133, 235, 223, 151, 12, 69, 26, 222, 60, 125, 235, 125, 167, 212, 201, 168, 101, 242, - 111, 239, 1, 228, 12, 252, 146, 53, 75, 17, 187, 255, 122, 181, + 116, 231, 246, 189, 145, 240, 37, 59, 219, 223, 216, 246, 116, 171, 223, 55, 197, 200, + 134, 192, 221, 40, 218, 167, 239, 5, 11, 95, 147, 247, 162, 226, ]); let expected_vsk: ViewingSecretKey = [ - 218, 219, 193, 132, 160, 6, 178, 194, 139, 248, 199, 81, 17, 133, 37, 201, 58, 104, 49, - 222, 187, 46, 156, 93, 14, 118, 209, 243, 38, 101, 77, 45, + 33, 155, 68, 60, 102, 70, 47, 105, 194, 129, 44, 26, 143, 198, 44, 244, 185, 31, 236, + 252, 205, 89, 138, 107, 39, 38, 154, 73, 109, 166, 41, 114, ]; let expected_vpk_as_bytes: [u8; 33] = [ - 3, 164, 65, 167, 88, 167, 179, 51, 159, 27, 241, 174, 77, 174, 142, 106, 128, 96, 69, - 74, 117, 231, 42, 193, 235, 153, 206, 116, 102, 7, 101, 192, 45, + 2, 78, 213, 113, 117, 105, 162, 248, 175, 68, 128, 232, 106, 204, 208, 159, 11, 78, 48, + 244, 127, 112, 46, 0, 93, 184, 1, 77, 132, 160, 75, 152, 88, ]; assert!(expected_ccc == child_node.ccc); diff --git a/key_protocol/src/key_management/key_tree/keys_public.rs b/key_protocol/src/key_management/key_tree/keys_public.rs index 7c5d6e38..28814398 100644 --- a/key_protocol/src/key_management/key_tree/keys_public.rs +++ b/key_protocol/src/key_management/key_tree/keys_public.rs @@ -19,15 +19,21 @@ impl ChildKeysPublic { match ((2u32).pow(31)).cmp(&cci) { // Non-harden std::cmp::Ordering::Greater => { - hash_input.extend_from_slice(self.cpk.value()); - hash_input.extend_from_slice(&cci.to_le_bytes()); + // BIP-032 compatibility requires 1-byte header from the public_key; + // Not stored in `self.cpk.value()` + let sk = secp256k1::SecretKey::from_byte_array(*self.csk.value()) + .expect("32 bytes, within curve order"); + let pk = secp256k1::PublicKey::from_secret_key(&secp256k1::Secp256k1::new(), &sk); + hash_input.extend_from_slice(&secp256k1::PublicKey::serialize(&pk)); + hash_input.extend_from_slice(&cci.to_be_bytes()); hmac_sha512::HMAC::mac(hash_input, self.ccc) } // Harden _ => { + hash_input.extend_from_slice(&[0u8]); hash_input.extend_from_slice(self.csk.value()); - hash_input.extend_from_slice(&(cci).to_le_bytes()); + hash_input.extend_from_slice(&cci.to_be_bytes()); hmac_sha512::HMAC::mac(hash_input, self.ccc) } @@ -62,7 +68,7 @@ impl KeyNode for ChildKeysPublic { .unwrap(); let csk = nssa::PrivateKey::try_new( - csk.add_tweak(&Scalar::from_le_bytes(*self.csk.value()).unwrap()) + csk.add_tweak(&Scalar::from_be_bytes(*self.csk.value()).unwrap()) .expect("Expect a valid Scalar") .secret_bytes(), ) @@ -131,6 +137,7 @@ mod tests { 202, 148, 181, 228, 35, 222, 58, 84, 156, 24, 146, 86, ]) .unwrap(); + let expected_cpk: PublicKey = PublicKey::try_new([ 219, 141, 130, 105, 11, 203, 187, 124, 112, 75, 223, 22, 11, 164, 153, 127, 59, 247, 244, 166, 75, 66, 242, 224, 35, 156, 161, 75, 41, 51, 76, 245, @@ -154,26 +161,20 @@ mod tests { let cci = (2u32).pow(31) + 13; let child_keys = ChildKeysPublic::nth_child(&root_keys, cci); - print!( - "{} {}", - child_keys.csk.value()[0], - child_keys.csk.value()[1] - ); - let expected_ccc = [ - 126, 175, 244, 41, 41, 173, 134, 103, 139, 140, 195, 86, 194, 147, 116, 48, 71, 107, - 253, 235, 114, 139, 60, 115, 226, 205, 215, 248, 240, 190, 196, 6, + 149, 226, 13, 4, 194, 12, 69, 29, 9, 234, 209, 119, 98, 4, 128, 91, 37, 103, 192, 31, + 130, 126, 123, 20, 90, 34, 173, 209, 101, 248, 155, 36, ]; let expected_csk: PrivateKey = PrivateKey::try_new([ - 128, 148, 53, 165, 222, 155, 163, 108, 186, 182, 124, 67, 90, 86, 59, 123, 95, 224, - 171, 4, 51, 131, 254, 57, 241, 178, 82, 161, 204, 206, 79, 107, + 9, 65, 33, 228, 25, 82, 219, 117, 91, 217, 11, 223, 144, 85, 246, 26, 123, 216, 107, + 213, 33, 52, 188, 22, 198, 246, 71, 46, 245, 174, 16, 47, ]) .unwrap(); let expected_cpk: PublicKey = PublicKey::try_new([ - 149, 240, 55, 15, 178, 67, 245, 254, 44, 141, 95, 223, 238, 62, 85, 11, 248, 9, 11, 40, - 69, 211, 116, 13, 189, 35, 8, 95, 233, 154, 129, 58, + 142, 143, 238, 159, 105, 165, 224, 252, 108, 62, 53, 209, 176, 219, 249, 38, 90, 241, + 201, 81, 194, 146, 236, 5, 83, 152, 238, 243, 138, 16, 229, 15, ]) .unwrap(); @@ -194,26 +195,20 @@ mod tests { let cci = 13; let child_keys = ChildKeysPublic::nth_child(&root_keys, cci); - print!( - "{} {}", - child_keys.csk.value()[0], - child_keys.csk.value()[1] - ); - let expected_ccc = [ - 50, 29, 113, 102, 49, 130, 64, 0, 247, 95, 135, 187, 118, 162, 65, 65, 194, 53, 189, - 242, 66, 178, 168, 2, 51, 193, 155, 72, 209, 2, 207, 251, + 79, 228, 242, 119, 211, 203, 198, 175, 95, 36, 4, 234, 139, 45, 137, 138, 54, 211, 187, + 16, 28, 79, 80, 232, 216, 101, 145, 19, 101, 220, 217, 141, ]; let expected_csk: PrivateKey = PrivateKey::try_new([ - 162, 32, 211, 190, 180, 74, 151, 246, 189, 93, 8, 57, 182, 239, 125, 245, 192, 255, 24, - 186, 251, 23, 194, 186, 252, 121, 190, 54, 147, 199, 1, 109, + 185, 147, 32, 242, 145, 91, 123, 77, 42, 33, 134, 84, 12, 165, 117, 70, 158, 201, 95, + 153, 14, 12, 92, 235, 128, 156, 194, 169, 68, 35, 165, 127, ]) .unwrap(); let expected_cpk: PublicKey = PublicKey::try_new([ - 183, 48, 207, 170, 221, 111, 118, 9, 40, 67, 123, 162, 159, 169, 34, 157, 23, 37, 232, - 102, 231, 187, 199, 191, 205, 146, 159, 22, 79, 100, 10, 223, + 119, 16, 145, 121, 97, 244, 186, 35, 136, 34, 140, 171, 206, 139, 11, 208, 207, 121, + 158, 45, 28, 22, 140, 98, 161, 179, 212, 173, 238, 220, 2, 34, ]) .unwrap(); @@ -235,19 +230,19 @@ mod tests { let child_keys = ChildKeysPublic::nth_child(&root_keys, cci); let expected_ccc = [ - 101, 15, 69, 152, 144, 22, 105, 89, 175, 21, 13, 50, 160, 167, 93, 80, 94, 99, 192, - 252, 1, 126, 196, 217, 149, 164, 60, 75, 237, 90, 104, 83, + 221, 208, 47, 189, 174, 152, 33, 25, 151, 114, 233, 191, 57, 15, 40, 140, 46, 87, 126, + 58, 215, 40, 246, 111, 166, 113, 183, 145, 173, 11, 27, 182, ]; let expected_csk: PrivateKey = PrivateKey::try_new([ - 46, 196, 131, 199, 190, 180, 250, 222, 41, 188, 221, 156, 255, 239, 251, 207, 239, 202, - 166, 216, 107, 236, 195, 48, 167, 69, 97, 13, 132, 117, 76, 89, + 223, 29, 87, 189, 126, 24, 117, 225, 190, 57, 0, 143, 207, 168, 231, 139, 170, 192, 81, + 254, 126, 10, 115, 42, 141, 157, 70, 171, 199, 231, 198, 132, ]) .unwrap(); let expected_cpk: PublicKey = PublicKey::try_new([ - 93, 151, 154, 238, 175, 198, 53, 146, 255, 43, 37, 52, 214, 165, 69, 161, 38, 20, 68, - 166, 143, 80, 149, 216, 124, 203, 240, 114, 168, 111, 33, 83, + 96, 123, 245, 51, 214, 216, 215, 205, 70, 145, 105, 221, 166, 169, 122, 27, 94, 112, + 228, 110, 249, 177, 85, 173, 180, 248, 185, 199, 112, 246, 83, 33, ]) .unwrap(); diff --git a/key_protocol/src/key_management/secret_holders.rs b/key_protocol/src/key_management/secret_holders.rs index d5aac258..316e6154 100644 --- a/key_protocol/src/key_management/secret_holders.rs +++ b/key_protocol/src/key_management/secret_holders.rs @@ -87,7 +87,7 @@ impl SecretSpendingKey { hasher.update(PREFIX); hasher.update(self.0); hasher.update(SUFFIX_1); - hasher.update(index.to_le_bytes()); + hasher.update(index.to_be_bytes()); hasher.update(SUFFIX_2); ::from(hasher.finalize_fixed()) @@ -106,7 +106,7 @@ impl SecretSpendingKey { hasher.update(PREFIX); hasher.update(self.0); hasher.update(SUFFIX_1); - hasher.update(index.to_le_bytes()); + hasher.update(index.to_be_bytes()); hasher.update(SUFFIX_2); hasher.finalize_fixed().into() From 3ed6ce3f1ca3f338bc934effc6da563a1b0c5f44 Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Wed, 25 Feb 2026 19:00:01 -0500 Subject: [PATCH 2/9] fix wallet json --- wallet/configs/debug/wallet_config.json | 94 +++++-------------------- wallet/src/chain_storage.rs | 62 ++++++++-------- 2 files changed, 47 insertions(+), 109 deletions(-) diff --git a/wallet/configs/debug/wallet_config.json b/wallet/configs/debug/wallet_config.json index 512a9a16..8f357312 100644 --- a/wallet/configs/debug/wallet_config.json +++ b/wallet/configs/debug/wallet_config.json @@ -8,85 +8,23 @@ "initial_accounts": [ { "Public": { - "account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV", + "account_id": "DZJA7kNNqoYsBiDFSdjpQwzQbAg9SXHcVe7ruwW11Xqh", "pub_sign_key": [ - 16, - 162, - 106, - 154, - 236, - 125, - 52, - 184, - 35, - 100, - 238, - 174, - 69, - 197, - 41, - 77, - 187, - 10, - 118, - 75, - 0, - 11, - 148, - 238, - 185, - 181, - 133, - 17, - 220, - 72, - 124, - 77 + 106, 164, 195, 101, 105, 155, 137, 217, 99, 239, 133, 165, 152, 104, 185, 97, 43, 96, 1, 249, 7, 80, 180, 151, 6, 98, 166, 39, 118, 51, 46, 129 ] } }, { "Public": { - "account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo", + "account_id": "gyaTLqDhi1b3W7xbSiZw1ToZMqJdHHgigTpK2hiZWS8", "pub_sign_key": [ - 113, - 121, - 64, - 177, - 204, - 85, - 229, - 214, - 178, - 6, - 109, - 191, - 29, - 154, - 63, - 38, - 242, - 18, - 244, - 219, - 8, - 208, - 35, - 136, - 23, - 127, - 207, - 237, - 216, - 169, - 190, - 27 + 194, 118, 30, 134, 242, 177, 171, 11, 64, 74, 249, 10, 99, 97, 126, 66, 154, 44, 229, 34, 200, 226, 178, 57, 185, 252, 130, 170, 23, 90, 68, 56 ] } }, { "Private": { - "account_id": "2ECgkFTaXzwjJBXR7ZKmXYQtpHbvTTHK9Auma4NL9AUo", + "account_id": "HWkW5qd4XK3me6sCAb4bfPj462k33DjtKtEcYpuzNwB", "account": { "program_owner": [ 0, @@ -103,19 +41,19 @@ "nonce": 0 }, "key_chain": { - "secret_spending_key": [112, 17, 152, 192, 217, 201, 142, 92, 111, 68, 85, 222, 107, 73, 78, 196, 118, 226, 37, 17, 185, 177, 149, 182, 9, 85, 187, 152, 163, 144, 68, 121], + "secret_spending_key": [14, 202, 241, 109, 32, 181, 152, 140, 76, 153, 108, 57, 77, 192, 181, 97, 108, 144, 122, 45, 219, 5, 203, 193, 82, 123, 83, 34, 250, 214, 137, 63], "private_key_holder": { - "nullifier_secret_key": [52, 33, 235, 245, 42, 132, 163, 182, 114, 56, 144, 187, 147, 23, 184, 227, 128, 12, 180, 142, 217, 110, 188, 177, 155, 141, 23, 127, 216, 185, 33, 126], - "viewing_secret_key": [44, 81, 165, 166, 34, 188, 192, 240, 40, 9, 83, 189, 215, 184, 246, 154, 247, 227, 155, 16, 121, 238, 4, 245, 63, 135, 192, 213, 222, 247, 120, 86] + "nullifier_secret_key": [174, 56, 101, 30, 248, 249, 100, 0, 122, 199, 209, 246, 58, 163, 223, 146, 59, 143, 78, 95, 41, 186, 106, 187, 53, 63, 75, 244, 233, 185, 110, 199], + "viewing_secret_key": [251, 85, 223, 73, 142, 127, 134, 132, 185, 210, 100, 103, 198, 108, 229, 80, 176, 211, 249, 114, 110, 7, 225, 17, 7, 69, 204, 32, 47, 242, 103, 247] }, - "nullifer_public_key": [13, 25, 40, 5, 198, 248, 210, 248, 237, 121, 124, 145, 186, 142, 253, 216, 236, 69, 193, 32, 166, 167, 49, 133, 172, 111, 159, 46, 84, 17, 157, 23], - "viewing_public_key": [3, 43, 116, 165, 161, 27, 150, 158, 175, 198, 215, 27, 121, 126, 158, 224, 249, 92, 168, 163, 173, 115, 120, 122, 89, 173, 133, 94, 39, 238, 62, 52, 193] + "nullifer_public_key": [139, 19, 158, 11, 155, 231, 85, 206, 132, 228, 220, 114, 145, 89, 113, 156, 238, 142, 242, 74, 182, 91, 43, 100, 6, 190, 31, 15, 31, 88, 96, 204], + "viewing_public_key": [3, 136, 153, 50, 191, 184, 135, 36, 29, 107, 57, 9, 218, 135, 249, 213, 118, 215, 118, 173, 30, 137, 116, 77, 17, 86, 62, 154, 31, 173, 19, 167, 211] } } }, { "Private": { - "account_id": "E8HwiTyQe4H9HK7icTvn95HQMnzx49mP9A2ddtMLpNaN", + "account_id": "HUpbRQ1vEcZv5y6TDYv9tpt1VA64ji2v4RDLJfK2rpZn", "account": { "program_owner": [ 0, @@ -132,13 +70,13 @@ "nonce": 0 }, "key_chain": { - "secret_spending_key": [48, 175, 124, 10, 230, 240, 166, 14, 249, 254, 157, 226, 208, 124, 122, 177, 203, 139, 192, 180, 43, 120, 55, 151, 50, 21, 113, 22, 254, 83, 148, 56], + "secret_spending_key": [32, 162, 244, 221, 2, 133, 168, 250, 240, 52, 92, 187, 157, 116, 249, 203, 143, 194, 214, 112, 115, 142, 153, 78, 241, 173, 103, 242, 192, 196, 29, 133], "private_key_holder": { - "nullifier_secret_key": [99, 82, 190, 140, 234, 10, 61, 163, 15, 211, 179, 54, 70, 166, 87, 5, 182, 68, 117, 244, 217, 23, 99, 9, 4, 177, 230, 125, 109, 91, 160, 30], - "viewing_secret_key": [205, 32, 76, 251, 255, 236, 96, 119, 61, 111, 65, 100, 75, 218, 12, 22, 17, 170, 55, 226, 21, 154, 161, 34, 208, 74, 27, 1, 119, 13, 88, 128] + "nullifier_secret_key": [188, 235, 121, 54, 131, 206, 7, 215, 94, 231, 102, 22, 12, 27, 253, 161, 248, 206, 41, 160, 206, 149, 5, 217, 127, 235, 154, 230, 198, 232, 102, 31], + "viewing_secret_key": [89, 116, 140, 122, 211, 179, 190, 229, 18, 94, 56, 235, 48, 99, 104, 228, 111, 72, 231, 18, 247, 97, 110, 60, 238, 138, 0, 25, 92, 44, 30, 145] }, - "nullifer_public_key": [32, 67, 72, 164, 106, 53, 66, 239, 141, 15, 52, 230, 136, 177, 2, 236, 207, 243, 134, 135, 210, 143, 87, 232, 215, 128, 194, 120, 113, 224, 4, 165], - "viewing_public_key": [2, 79, 110, 46, 203, 29, 206, 205, 18, 86, 27, 189, 104, 103, 113, 181, 110, 53, 78, 172, 11, 171, 190, 18, 126, 214, 81, 77, 192, 154, 58, 195, 238] + "nullifer_public_key": [173, 134, 33, 223, 54, 226, 10, 71, 215, 254, 143, 172, 24, 244, 243, 208, 65, 112, 118, 70, 217, 240, 69, 100, 129, 3, 121, 25, 213, 132, 42, 45], + "viewing_public_key": [2, 43, 42, 253, 112, 83, 195, 164, 26, 141, 92, 28, 224, 120, 155, 119, 225, 1, 45, 42, 245, 172, 134, 136, 52, 183, 170, 96, 115, 212, 114, 120, 37] } } } diff --git a/wallet/src/chain_storage.rs b/wallet/src/chain_storage.rs index 2b3f3f4e..e934774e 100644 --- a/wallet/src/chain_storage.rs +++ b/wallet/src/chain_storage.rs @@ -170,40 +170,40 @@ mod tests { let initial_acc1 = serde_json::from_str( r#"{ "Public": { - "account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV", + "account_id": "DZJA7kNNqoYsBiDFSdjpQwzQbAg9SXHcVe7ruwW11Xqh", "pub_sign_key": [ - 16, - 162, 106, - 154, - 236, - 125, - 52, - 184, - 35, - 100, - 238, - 174, - 69, - 197, - 41, - 77, - 187, - 10, - 118, - 75, - 0, - 11, - 148, - 238, - 185, - 181, + 164, + 195, + 101, + 105, + 155, + 137, + 217, + 99, + 239, 133, - 17, - 220, - 72, - 124, - 77 + 165, + 152, + 104, + 185, + 97, + 43, + 96, + 1, + 249, + 7, + 80, + 180, + 151, + 6, + 98, + 166, + 39, + 118, + 51, + 46, + 129 ] } }"#, From ab41bff5cc920bebeeb20dcbd76a58d3b2507a0c Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Fri, 27 Feb 2026 18:30:54 -0500 Subject: [PATCH 3/9] update config files --- indexer/service/configs/indexer_config.json | 126 ++-- .../configs/debug/sequencer_config.json | 130 ++-- .../configs/docker/sequencer_config.json | 124 ++-- wallet/configs/debug/wallet_config.json | 552 ++++++++++++++--- wallet/src/chain_storage.rs | 94 +-- wallet/src/config.rs | 580 ++++++++++++------ 6 files changed, 1095 insertions(+), 511 deletions(-) diff --git a/indexer/service/configs/indexer_config.json b/indexer/service/configs/indexer_config.json index 247caa8e..8b1b3c5e 100644 --- a/indexer/service/configs/indexer_config.json +++ b/indexer/service/configs/indexer_config.json @@ -11,49 +11,49 @@ "channel_id": "0101010101010101010101010101010101010101010101010101010101010101", "initial_accounts": [ { - "account_id": "BLgCRDXYdQPMMWVHYRFGQZbgeHx9frkipa8GtpG2Syqy", + "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "balance": 10000 }, { - "account_id": "Gj1mJy5W7J5pfmLRujmQaLfLMWidNxQ6uwnhb666ZwHw", + "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "balance": 20000 } ], "initial_commitments": [ { "npk": [ - 63, - 202, - 178, + 139, + 19, + 158, + 11, + 155, 231, - 183, - 82, - 237, - 212, - 216, - 221, - 215, - 255, - 153, - 101, - 177, - 161, - 254, - 210, - 128, - 122, - 54, - 190, - 230, - 151, - 183, - 64, - 225, - 229, - 113, - 1, + 85, + 206, + 132, 228, - 97 + 220, + 114, + 145, + 89, + 113, + 156, + 238, + 142, + 242, + 74, + 182, + 91, + 43, + 100, + 6, + 190, + 31, + 15, + 31, + 88, + 96, + 204 ], "account": { "program_owner": [ @@ -73,38 +73,38 @@ }, { "npk": [ - 192, - 251, - 166, - 243, - 167, - 236, - 84, - 249, - 35, - 136, - 130, + 173, + 134, + 33, + 223, + 54, + 226, + 10, + 71, + 215, + 254, + 143, 172, - 219, - 225, - 161, - 139, - 229, - 89, - 243, - 125, - 194, - 213, - 209, - 30, - 23, - 174, - 100, + 24, 244, - 124, - 74, - 140, - 47 + 243, + 208, + 65, + 112, + 118, + 70, + 217, + 240, + 69, + 100, + 129, + 3, + 121, + 25, + 213, + 132, + 42, + 45 ], "account": { "program_owner": [ @@ -157,4 +157,4 @@ 37, 37 ] -} +} \ No newline at end of file diff --git a/sequencer_runner/configs/debug/sequencer_config.json b/sequencer_runner/configs/debug/sequencer_config.json index b53124c2..a2306dee 100644 --- a/sequencer_runner/configs/debug/sequencer_config.json +++ b/sequencer_runner/configs/debug/sequencer_config.json @@ -20,50 +20,50 @@ "indexer_rpc_url": "ws://localhost:8779", "initial_accounts": [ { - "account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV", + "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "balance": 10000 }, { - "account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo", + "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "balance": 20000 } ], "initial_commitments": [ { - "npk":[ - 177, - 64, - 1, + "npk": [ + 139, + 19, + 158, 11, - 87, - 38, - 254, - 159, + 155, 231, - 165, - 1, - 94, - 64, - 137, - 243, - 76, - 249, - 101, - 251, - 129, - 33, - 101, - 189, - 30, - 42, - 11, - 191, - 34, - 103, - 186, - 227, - 230 - ] , + 85, + 206, + 132, + 228, + 220, + 114, + 145, + 89, + 113, + 156, + 238, + 142, + 242, + 74, + 182, + 91, + 43, + 100, + 6, + 190, + 31, + 15, + 31, + 88, + 96, + 204 + ], "account": { "program_owner": [ 0, @@ -82,38 +82,38 @@ }, { "npk": [ - 32, - 67, - 72, - 164, - 106, - 53, - 66, - 239, - 141, - 15, - 52, - 230, - 136, - 177, - 2, - 236, - 207, - 243, + 173, 134, - 135, - 210, - 143, - 87, - 232, + 33, + 223, + 54, + 226, + 10, + 71, 215, - 128, - 194, - 120, - 113, - 224, - 4, - 165 + 254, + 143, + 172, + 24, + 244, + 243, + 208, + 65, + 112, + 118, + 70, + 217, + 240, + 69, + 100, + 129, + 3, + 121, + 25, + 213, + 132, + 42, + 45 ], "account": { "program_owner": [ @@ -166,4 +166,4 @@ 37, 37 ] -} +} \ No newline at end of file diff --git a/sequencer_runner/configs/docker/sequencer_config.json b/sequencer_runner/configs/docker/sequencer_config.json index ce79f4e2..45cef1b6 100644 --- a/sequencer_runner/configs/docker/sequencer_config.json +++ b/sequencer_runner/configs/docker/sequencer_config.json @@ -20,49 +20,49 @@ "indexer_rpc_url": "ws://localhost:8779", "initial_accounts": [ { - "account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV", + "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "balance": 10000 }, { - "account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo", + "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "balance": 20000 } ], "initial_commitments": [ { "npk": [ - 63, - 202, - 178, + 139, + 19, + 158, + 11, + 155, 231, - 183, - 82, - 237, - 212, - 216, - 221, - 215, - 255, - 153, - 101, - 177, - 161, - 254, - 210, - 128, - 122, - 54, - 190, - 230, - 151, - 183, - 64, - 225, - 229, - 113, - 1, + 85, + 206, + 132, 228, - 97 + 220, + 114, + 145, + 89, + 113, + 156, + 238, + 142, + 242, + 74, + 182, + 91, + 43, + 100, + 6, + 190, + 31, + 15, + 31, + 88, + 96, + 204 ], "account": { "program_owner": [ @@ -82,38 +82,38 @@ }, { "npk": [ - 192, - 251, - 166, - 243, - 167, - 236, - 84, - 249, - 35, - 136, - 130, + 173, + 134, + 33, + 223, + 54, + 226, + 10, + 71, + 215, + 254, + 143, 172, - 219, - 225, - 161, - 139, - 229, - 89, - 243, - 125, - 194, - 213, - 209, - 30, - 23, - 174, - 100, + 24, 244, - 124, - 74, - 140, - 47 + 243, + 208, + 65, + 112, + 118, + 70, + 217, + 240, + 69, + 100, + 129, + 3, + 121, + 25, + 213, + 132, + 42, + 45 ], "account": { "program_owner": [ diff --git a/wallet/configs/debug/wallet_config.json b/wallet/configs/debug/wallet_config.json index a3f025bd..2f0ed07a 100644 --- a/wallet/configs/debug/wallet_config.json +++ b/wallet/configs/debug/wallet_config.json @@ -1,85 +1,479 @@ { - "override_rust_log": null, - "sequencer_addr": "http://127.0.0.1:3040", - "seq_poll_timeout": "30s", - "seq_tx_poll_max_blocks": 15, - "seq_poll_max_retries": 10, - "seq_block_poll_max_amount": 100, - "initial_accounts": [ - { - "Public": { - "account_id": "DZJA7kNNqoYsBiDFSdjpQwzQbAg9SXHcVe7ruwW11Xqh", - "pub_sign_key": [ - 106, 164, 195, 101, 105, 155, 137, 217, 99, 239, 133, 165, 152, 104, 185, 97, 43, 96, 1, 249, 7, 80, 180, 151, 6, 98, 166, 39, 118, 51, 46, 129 - ] - } - }, - { - "Public": { - "account_id": "gyaTLqDhi1b3W7xbSiZw1ToZMqJdHHgigTpK2hiZWS8", - "pub_sign_key": [ - 194, 118, 30, 134, 242, 177, 171, 11, 64, 74, 249, 10, 99, 97, 126, 66, 154, 44, 229, 34, 200, 226, 178, 57, 185, 252, 130, 170, 23, 90, 68, 56 - ] - } - }, + "override_rust_log": null, + "sequencer_addr": "http://127.0.0.1:3040", + "seq_poll_timeout": "30s", + "seq_tx_poll_max_blocks": 15, + "seq_poll_max_retries": 10, + "seq_block_poll_max_amount": 100, + "initial_accounts": [ { - "Private": { - "account_id": "HWkW5qd4XK3me6sCAb4bfPj462k33DjtKtEcYpuzNwB", - "account": { - "program_owner": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "balance": 10000, - "data": [], - "nonce": 0 + "Public": { + "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", + "pub_sign_key": [ + 106, + 164, + 195, + 101, + 105, + 155, + 137, + 217, + 99, + 239, + 133, + 165, + 152, + 104, + 185, + 97, + 43, + 96, + 1, + 249, + 7, + 80, + 180, + 151, + 6, + 98, + 166, + 39, + 118, + 51, + 46, + 129 + ] + } }, - "key_chain": { - "secret_spending_key": [14, 202, 241, 109, 32, 181, 152, 140, 76, 153, 108, 57, 77, 192, 181, 97, 108, 144, 122, 45, 219, 5, 203, 193, 82, 123, 83, 34, 250, 214, 137, 63], - "private_key_holder": { - "nullifier_secret_key": [174, 56, 101, 30, 248, 249, 100, 0, 122, 199, 209, 246, 58, 163, 223, 146, 59, 143, 78, 95, 41, 186, 106, 187, 53, 63, 75, 244, 233, 185, 110, 199], - "viewing_secret_key": [251, 85, 223, 73, 142, 127, 134, 132, 185, 210, 100, 103, 198, 108, 229, 80, 176, 211, 249, 114, 110, 7, 225, 17, 7, 69, 204, 32, 47, 242, 103, 247] - }, - "nullifer_public_key": [139, 19, 158, 11, 155, 231, 85, 206, 132, 228, 220, 114, 145, 89, 113, 156, 238, 142, 242, 74, 182, 91, 43, 100, 6, 190, 31, 15, 31, 88, 96, 204], - "viewing_public_key": [3, 136, 153, 50, 191, 184, 135, 36, 29, 107, 57, 9, 218, 135, 249, 213, 118, 215, 118, 173, 30, 137, 116, 77, 17, 86, 62, 154, 31, 173, 19, 167, 211] - } - } - }, - { - "Private": { - "account_id": "HUpbRQ1vEcZv5y6TDYv9tpt1VA64ji2v4RDLJfK2rpZn", - "account": { - "program_owner": [ - 0, - 0, - 0, - 0, - 0, - 0, - 0, - 0 - ], - "balance": 20000, - "data": [], - "nonce": 0 + { + "Public": { + "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", + "pub_sign_key": [ + 137, + 26, + 226, + 88, + 249, + 44, + 168, + 68, + 122, + 246, + 207, + 9, + 196, + 29, + 150, + 179, + 160, + 97, + 135, + 208, + 152, + 185, + 26, + 178, + 204, + 23, + 180, + 46, + 60, + 74, + 47, + 161 + ] + } }, - "key_chain": { - "secret_spending_key": [32, 162, 244, 221, 2, 133, 168, 250, 240, 52, 92, 187, 157, 116, 249, 203, 143, 194, 214, 112, 115, 142, 153, 78, 241, 173, 103, 242, 192, 196, 29, 133], - "private_key_holder": { - "nullifier_secret_key": [188, 235, 121, 54, 131, 206, 7, 215, 94, 231, 102, 22, 12, 27, 253, 161, 248, 206, 41, 160, 206, 149, 5, 217, 127, 235, 154, 230, 198, 232, 102, 31], - "viewing_secret_key": [89, 116, 140, 122, 211, 179, 190, 229, 18, 94, 56, 235, 48, 99, 104, 228, 111, 72, 231, 18, 247, 97, 110, 60, 238, 138, 0, 25, 92, 44, 30, 145] - }, - "nullifer_public_key": [173, 134, 33, 223, 54, 226, 10, 71, 215, 254, 143, 172, 24, 244, 243, 208, 65, 112, 118, 70, 217, 240, 69, 100, 129, 3, 121, 25, 213, 132, 42, 45], - "viewing_public_key": [2, 43, 42, 253, 112, 83, 195, 164, 26, 141, 92, 28, 224, 120, 155, 119, 225, 1, 45, 42, 245, 172, 134, 136, 52, 183, 170, 96, 115, 212, 114, 120, 37] + { + "Private": { + "account_id": "HWkW5qd4XK3me6sCAb4bfPj462k33DjtKtEcYpuzNwB", + "account": { + "program_owner": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "balance": 10000, + "data": [], + "nonce": 0 + }, + "key_chain": { + "secret_spending_key": [ + 14, + 202, + 241, + 109, + 32, + 181, + 152, + 140, + 76, + 153, + 108, + 57, + 77, + 192, + 181, + 97, + 108, + 144, + 122, + 45, + 219, + 5, + 203, + 193, + 82, + 123, + 83, + 34, + 250, + 214, + 137, + 63 + ], + "private_key_holder": { + "nullifier_secret_key": [ + 174, + 56, + 101, + 30, + 248, + 249, + 100, + 0, + 122, + 199, + 209, + 246, + 58, + 163, + 223, + 146, + 59, + 143, + 78, + 95, + 41, + 186, + 106, + 187, + 53, + 63, + 75, + 244, + 233, + 185, + 110, + 199 + ], + "viewing_secret_key": [ + 251, + 85, + 223, + 73, + 142, + 127, + 134, + 132, + 185, + 210, + 100, + 103, + 198, + 108, + 229, + 80, + 176, + 211, + 249, + 114, + 110, + 7, + 225, + 17, + 7, + 69, + 204, + 32, + 47, + 242, + 103, + 247 + ] + }, + "nullifier_public_key": [ + 139, + 19, + 158, + 11, + 155, + 231, + 85, + 206, + 132, + 228, + 220, + 114, + 145, + 89, + 113, + 156, + 238, + 142, + 242, + 74, + 182, + 91, + 43, + 100, + 6, + 190, + 31, + 15, + 31, + 88, + 96, + 204 + ], + "viewing_public_key": [ + 3, + 136, + 153, + 50, + 191, + 184, + 135, + 36, + 29, + 107, + 57, + 9, + 218, + 135, + 249, + 213, + 118, + 215, + 118, + 173, + 30, + 137, + 116, + 77, + 17, + 86, + 62, + 154, + 31, + 173, + 19, + 167, + 211 + ] + } + } + }, + { + "Private": { + "account_id": "HUpbRQ1vEcZv5y6TDYv9tpt1VA64ji2v4RDLJfK2rpZn", + "account": { + "program_owner": [ + 0, + 0, + 0, + 0, + 0, + 0, + 0, + 0 + ], + "balance": 20000, + "data": [], + "nonce": 0 + }, + "key_chain": { + "secret_spending_key": [ + 32, + 162, + 244, + 221, + 2, + 133, + 168, + 250, + 240, + 52, + 92, + 187, + 157, + 116, + 249, + 203, + 143, + 194, + 214, + 112, + 115, + 142, + 153, + 78, + 241, + 173, + 103, + 242, + 192, + 196, + 29, + 133 + ], + "private_key_holder": { + "nullifier_secret_key": [ + 188, + 235, + 121, + 54, + 131, + 206, + 7, + 215, + 94, + 231, + 102, + 22, + 12, + 27, + 253, + 161, + 248, + 206, + 41, + 160, + 206, + 149, + 5, + 217, + 127, + 235, + 154, + 230, + 198, + 232, + 102, + 31 + ], + "viewing_secret_key": [ + 89, + 116, + 140, + 122, + 211, + 179, + 190, + 229, + 18, + 94, + 56, + 235, + 48, + 99, + 104, + 228, + 111, + 72, + 231, + 18, + 247, + 97, + 110, + 60, + 238, + 138, + 0, + 25, + 92, + 44, + 30, + 145 + ] + }, + "nullifier_public_key": [ + 173, + 134, + 33, + 223, + 54, + 226, + 10, + 71, + 215, + 254, + 143, + 172, + 24, + 244, + 243, + 208, + 65, + 112, + 118, + 70, + 217, + 240, + 69, + 100, + 129, + 3, + 121, + 25, + 213, + 132, + 42, + 45 + ], + "viewing_public_key": [ + 2, + 43, + 42, + 253, + 112, + 83, + 195, + 164, + 26, + 141, + 92, + 28, + 224, + 120, + 155, + 119, + 225, + 1, + 45, + 42, + 245, + 172, + 134, + 136, + 52, + 183, + 170, + 96, + 115, + 212, + 114, + 120, + 37 + ] + } + } } - } - } - ], - "basic_auth": null + ], + "basic_auth": null } \ No newline at end of file diff --git a/wallet/src/chain_storage.rs b/wallet/src/chain_storage.rs index 4961ee55..45ea84fb 100644 --- a/wallet/src/chain_storage.rs +++ b/wallet/src/chain_storage.rs @@ -170,39 +170,39 @@ mod tests { let initial_acc1 = serde_json::from_str( r#"{ "Public": { - "account_id": "DZJA7kNNqoYsBiDFSdjpQwzQbAg9SXHcVe7ruwW11Xqh", + "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "pub_sign_key": [ 106, 164, - 195, + 195, 101, 105, 155, 137, 217, - 99, + 99, 239, 133, 165, 152, 104, 185, - 97, - 43, - 96, - 1, + 97, + 43, + 96, + 1, 249, - 7, - 80, + 7, + 80, 180, - 151, - 6, - 98, + 151, + 6, + 98, 166, 39, - 118, - 51, - 46, + 118, + 51, + 46, 129 ] } @@ -213,40 +213,40 @@ mod tests { let initial_acc2 = serde_json::from_str( r#"{ "Public": { - "account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo", + "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "pub_sign_key": [ - 113, - 121, - 64, - 177, - 204, - 85, - 229, - 214, - 178, - 6, - 109, - 191, - 29, - 154, - 63, - 38, - 242, - 18, - 244, - 219, - 8, - 208, - 35, - 136, - 23, - 127, + 137, + 26, + 226, + 88, + 249, + 44, + 168, + 68, + 122, + 246, 207, - 237, - 216, - 169, - 190, - 27 + 9, + 196, + 29, + 150, + 179, + 160, + 97, + 135, + 208, + 152, + 185, + 26, + 178, + 204, + 23, + 180, + 46, + 60, + 74, + 47, + 161 ] } }"#, diff --git a/wallet/src/config.rs b/wallet/src/config.rs index 3780a065..a1b62a91 100644 --- a/wallet/src/config.rs +++ b/wallet/src/config.rs @@ -214,88 +214,88 @@ impl Default for WalletConfig { basic_auth: None, initial_accounts: { let init_acc_json = r#" - [ + [ { "Public": { - "account_id": "6iArKUXxhUJqS7kCaPNhwMWt3ro71PDyBj7jwAyE2VQV", + "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "pub_sign_key": [ - 16, - 162, 106, - 154, - 236, - 125, - 52, - 184, - 35, - 100, - 238, - 174, - 69, - 197, - 41, - 77, - 187, - 10, - 118, - 75, - 0, - 11, - 148, - 238, - 185, - 181, + 164, + 195, + 101, + 105, + 155, + 137, + 217, + 99, + 239, 133, - 17, - 220, - 72, - 124, - 77 + 165, + 152, + 104, + 185, + 97, + 43, + 96, + 1, + 249, + 7, + 80, + 180, + 151, + 6, + 98, + 166, + 39, + 118, + 51, + 46, + 129 ] } }, { "Public": { - "account_id": "7wHg9sbJwc6h3NP1S9bekfAzB8CHifEcxKswCKUt3YQo", + "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "pub_sign_key": [ - 113, - 121, - 64, - 177, - 204, - 85, - 229, - 214, - 178, - 6, - 109, - 191, - 29, - 154, - 63, - 38, - 242, - 18, - 244, - 219, - 8, - 208, - 35, - 136, - 23, - 127, + 137, + 26, + 226, + 88, + 249, + 44, + 168, + 68, + 122, + 246, 207, - 237, - 216, - 169, - 190, - 27 + 9, + 196, + 29, + 150, + 179, + 160, + 97, + 135, + 208, + 152, + 185, + 26, + 178, + 204, + 23, + 180, + 46, + 60, + 74, + 47, + 161 ] } }, { "Private": { - "account_id": "FpdcxBrMkHWqXCBQ6FG98eYfWGY6jWZRsKNSi1FwDMxy", + "account_id": "HWkW5qd4XK3me6sCAb4bfPj462k33DjtKtEcYpuzNwB", "account": { "program_owner": [ 0, @@ -313,151 +313,184 @@ impl Default for WalletConfig { }, "key_chain": { "secret_spending_key": [ - 239, - 27, - 159, - 83, - 199, - 194, - 132, - 33, - 20, - 28, - 217, - 103, - 101, - 57, - 27, - 125, - 84, - 57, - 19, - 86, - 98, - 135, - 161, - 221, - 108, - 125, + 14, + 202, + 241, + 109, + 32, + 181, 152, - 174, - 161, - 64, - 16, - 200 + 140, + 76, + 153, + 108, + 57, + 77, + 192, + 181, + 97, + 108, + 144, + 122, + 45, + 219, + 5, + 203, + 193, + 82, + 123, + 83, + 34, + 250, + 214, + 137, + 63 ], "private_key_holder": { "nullifier_secret_key": [ - 71, - 195, - 16, - 119, + 174, + 56, + 101, + 30, + 248, + 249, + 100, 0, - 98, - 35, - 106, - 139, - 82, - 145, - 50, - 27, - 140, - 206, - 19, - 53, 122, - 166, - 76, - 195, - 0, - 16, - 19, - 21, + 199, + 209, + 246, + 58, + 163, + 223, + 146, + 59, 143, - 155, - 119, - 9, - 200, - 81, - 105 + 78, + 95, + 41, + 186, + 106, + 187, + 53, + 63, + 75, + 244, + 233, + 185, + 110, + 199 ], "viewing_secret_key": [ - 5, - 117, - 221, - 27, - 236, - 199, - 53, - 22, + 251, + 85, + 223, + 73, + 142, + 127, + 134, + 132, + 185, + 210, + 100, + 103, + 198, + 108, + 229, + 80, + 176, + 211, 249, - 231, - 98, - 147, - 213, - 116, - 191, - 82, - 188, - 148, - 175, - 98, - 139, - 52, - 232, - 249, - 220, - 217, - 83, - 58, - 112, - 155, - 197, - 196 + 114, + 110, + 7, + 225, + 17, + 7, + 69, + 204, + 32, + 47, + 242, + 103, + 247 ] }, - "nullifer_public_key": [ - 177, - 64, - 1, + "nullifier_public_key": [ + 139, + 19, + 158, 11, - 87, - 38, - 254, - 159, + 155, 231, - 165, - 1, - 94, - 64, - 137, - 243, - 76, - 249, - 101, - 251, - 129, - 33, - 101, - 189, - 30, - 42, - 11, - 191, - 34, - 103, - 186, - 227, - 230 + 85, + 206, + 132, + 228, + 220, + 114, + 145, + 89, + 113, + 156, + 238, + 142, + 242, + 74, + 182, + 91, + 43, + 100, + 6, + 190, + 31, + 15, + 31, + 88, + 96, + 204 ], "viewing_public_key": [ - 2, 69, 126, 43, 158, 209, 172, 144, 23, 185, 208, 25, 163, 166, 176, 200, 225, 251, 106, 211, 4, 199, 112, 243, 207, 144, 135, 56, 157, 167, 32, 219, 38] + 3, + 136, + 153, + 50, + 191, + 184, + 135, + 36, + 29, + 107, + 57, + 9, + 218, + 135, + 249, + 213, + 118, + 215, + 118, + 173, + 30, + 137, + 116, + 77, + 17, + 86, + 62, + 154, + 31, + 173, + 19, + 167, + 211 + ] } } }, { "Private": { - "account_id": "E8HwiTyQe4H9HK7icTvn95HQMnzx49mP9A2ddtMLpNaN", + "account_id": "HUpbRQ1vEcZv5y6TDYv9tpt1VA64ji2v4RDLJfK2rpZn", "account": { "program_owner": [ 0, @@ -475,20 +508,177 @@ impl Default for WalletConfig { }, "key_chain": { "secret_spending_key": [ - 48, 175, 124, 10, 230, 240, 166, 14, 249, 254, 157, 226, 208, 124, 122, 177, 203, 139, 192, 180, 43, 120, 55, 151, 50, 21, 113, 22, 254, 83, 148, 56], + 32, + 162, + 244, + 221, + 2, + 133, + 168, + 250, + 240, + 52, + 92, + 187, + 157, + 116, + 249, + 203, + 143, + 194, + 214, + 112, + 115, + 142, + 153, + 78, + 241, + 173, + 103, + 242, + 192, + 196, + 29, + 133 + ], "private_key_holder": { "nullifier_secret_key": [ - 99, 82, 190, 140, 234, 10, 61, 163, 15, 211, 179, 54, 70, 166, 87, 5, 182, 68, 117, 244, 217, 23, 99, 9, 4, 177, 230, 125, 109, 91, 160, 30 + 188, + 235, + 121, + 54, + 131, + 206, + 7, + 215, + 94, + 231, + 102, + 22, + 12, + 27, + 253, + 161, + 248, + 206, + 41, + 160, + 206, + 149, + 5, + 217, + 127, + 235, + 154, + 230, + 198, + 232, + 102, + 31 ], "viewing_secret_key": [ - 205, 32, 76, 251, 255, 236, 96, 119, 61, 111, 65, 100, 75, 218, 12, 22, 17, 170, 55, 226, 21, 154, 161, 34, 208, 74, 27, 1, 119, 13, 88, 128 + 89, + 116, + 140, + 122, + 211, + 179, + 190, + 229, + 18, + 94, + 56, + 235, + 48, + 99, + 104, + 228, + 111, + 72, + 231, + 18, + 247, + 97, + 110, + 60, + 238, + 138, + 0, + 25, + 92, + 44, + 30, + 145 ] }, - "nullifer_public_key": [ - 32, 67, 72, 164, 106, 53, 66, 239, 141, 15, 52, 230, 136, 177, 2, 236, 207, 243, 134, 135, 210, 143, 87, 232, 215, 128, 194, 120, 113, 224, 4, 165 + "nullifier_public_key": [ + 173, + 134, + 33, + 223, + 54, + 226, + 10, + 71, + 215, + 254, + 143, + 172, + 24, + 244, + 243, + 208, + 65, + 112, + 118, + 70, + 217, + 240, + 69, + 100, + 129, + 3, + 121, + 25, + 213, + 132, + 42, + 45 ], "viewing_public_key": [ - 2, 79, 110, 46, 203, 29, 206, 205, 18, 86, 27, 189, 104, 103, 113, 181, 110, 53, 78, 172, 11, 171, 190, 18, 126, 214, 81, 77, 192, 154, 58, 195, 238 + 2, + 43, + 42, + 253, + 112, + 83, + 195, + 164, + 26, + 141, + 92, + 28, + 224, + 120, + 155, + 119, + 225, + 1, + 45, + 42, + 245, + 172, + 134, + 136, + 52, + 183, + 170, + 96, + 115, + 212, + 114, + 120, + 37 ] } } From 7daf32611ac70f11882606e53b2b44d2f35c76d9 Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Mon, 2 Mar 2026 16:42:32 -0500 Subject: [PATCH 4/9] add necessary typo back in --- wallet/configs/debug/wallet_config.json | 4 ++-- wallet/src/config.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/wallet/configs/debug/wallet_config.json b/wallet/configs/debug/wallet_config.json index 2f0ed07a..964bcf78 100644 --- a/wallet/configs/debug/wallet_config.json +++ b/wallet/configs/debug/wallet_config.json @@ -138,7 +138,7 @@ 63 ], "private_key_holder": { - "nullifier_secret_key": [ + "nullifer_secret_key": [ 174, 56, 101, @@ -333,7 +333,7 @@ 133 ], "private_key_holder": { - "nullifier_secret_key": [ + "nullifer_secret_key": [ 188, 235, 121, diff --git a/wallet/src/config.rs b/wallet/src/config.rs index a1b62a91..486b392f 100644 --- a/wallet/src/config.rs +++ b/wallet/src/config.rs @@ -416,7 +416,7 @@ impl Default for WalletConfig { 247 ] }, - "nullifier_public_key": [ + "nullifer_public_key": [ 139, 19, 158, @@ -611,7 +611,7 @@ impl Default for WalletConfig { 145 ] }, - "nullifier_public_key": [ + "nullifer_public_key": [ 173, 134, 33, From a5119dc3f3c7b3ea6d48de3df9c22a87ae03b7a4 Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Mon, 9 Mar 2026 11:50:37 -0400 Subject: [PATCH 5/9] fix wallet configs --- wallet/configs/debug/wallet_config.json | 128 ++++++++++++------------ wallet/src/chain_storage.rs | 124 +++++++++++------------ wallet/src/config.rs | 128 ++++++++++++------------ 3 files changed, 190 insertions(+), 190 deletions(-) diff --git a/wallet/configs/debug/wallet_config.json b/wallet/configs/debug/wallet_config.json index 964bcf78..1835c88a 100644 --- a/wallet/configs/debug/wallet_config.json +++ b/wallet/configs/debug/wallet_config.json @@ -10,38 +10,38 @@ "Public": { "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "pub_sign_key": [ - 106, - 164, - 195, - 101, - 105, - 155, - 137, - 217, - 99, - 239, - 133, - 165, - 152, - 104, - 185, - 97, - 43, - 96, - 1, - 249, - 7, - 80, - 180, - 151, - 6, - 98, - 166, + 127, 39, - 118, - 51, - 46, - 129 + 48, + 152, + 242, + 91, + 113, + 230, + 192, + 5, + 169, + 81, + 159, + 38, + 120, + 218, + 141, + 28, + 127, + 1, + 246, + 162, + 119, + 120, + 226, + 217, + 148, + 138, + 189, + 249, + 1, + 251 ] } }, @@ -49,38 +49,38 @@ "Public": { "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "pub_sign_key": [ - 137, - 26, - 226, - 88, - 249, - 44, - 168, - 68, - 122, - 246, - 207, - 9, - 196, - 29, - 150, - 179, - 160, - 97, - 135, - 208, - 152, - 185, - 26, - 178, - 204, + 244, + 52, + 248, + 116, 23, - 180, - 46, - 60, - 74, - 47, - 161 + 32, + 1, + 69, + 134, + 174, + 67, + 53, + 109, + 42, + 236, + 98, + 87, + 218, + 8, + 98, + 34, + 246, + 4, + 221, + 183, + 93, + 105, + 115, + 59, + 134, + 252, + 76 ] } }, @@ -138,7 +138,7 @@ 63 ], "private_key_holder": { - "nullifer_secret_key": [ + "nullifier_secret_key": [ 174, 56, 101, @@ -333,7 +333,7 @@ 133 ], "private_key_holder": { - "nullifer_secret_key": [ + "nullifier_secret_key": [ 188, 235, 121, diff --git a/wallet/src/chain_storage.rs b/wallet/src/chain_storage.rs index 45ea84fb..0188568b 100644 --- a/wallet/src/chain_storage.rs +++ b/wallet/src/chain_storage.rs @@ -172,38 +172,38 @@ mod tests { "Public": { "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "pub_sign_key": [ - 106, - 164, - 195, - 101, - 105, - 155, - 137, - 217, - 99, - 239, - 133, - 165, - 152, - 104, - 185, - 97, - 43, - 96, - 1, - 249, - 7, - 80, - 180, - 151, - 6, - 98, - 166, + 127, 39, - 118, - 51, - 46, - 129 + 48, + 152, + 242, + 91, + 113, + 230, + 192, + 5, + 169, + 81, + 159, + 38, + 120, + 218, + 141, + 28, + 127, + 1, + 246, + 162, + 119, + 120, + 226, + 217, + 148, + 138, + 189, + 249, + 1, + 251 ] } }"#, @@ -215,38 +215,38 @@ mod tests { "Public": { "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "pub_sign_key": [ - 137, - 26, - 226, - 88, - 249, - 44, - 168, - 68, - 122, - 246, - 207, - 9, - 196, - 29, - 150, - 179, - 160, - 97, - 135, - 208, - 152, - 185, - 26, - 178, - 204, + 244, + 52, + 248, + 116, 23, - 180, - 46, - 60, - 74, - 47, - 161 + 32, + 1, + 69, + 134, + 174, + 67, + 53, + 109, + 42, + 236, + 98, + 87, + 218, + 8, + 98, + 34, + 246, + 4, + 221, + 183, + 93, + 105, + 115, + 59, + 134, + 252, + 76 ] } }"#, diff --git a/wallet/src/config.rs b/wallet/src/config.rs index 486b392f..a1b7bfe2 100644 --- a/wallet/src/config.rs +++ b/wallet/src/config.rs @@ -219,38 +219,38 @@ impl Default for WalletConfig { "Public": { "account_id": "CbgR6tj5kWx5oziiFptM7jMvrQeYY3Mzaao6ciuhSr2r", "pub_sign_key": [ - 106, - 164, - 195, - 101, - 105, - 155, - 137, - 217, - 99, - 239, - 133, - 165, - 152, - 104, - 185, - 97, - 43, - 96, - 1, - 249, - 7, - 80, - 180, - 151, - 6, - 98, - 166, + 127, 39, - 118, - 51, - 46, - 129 + 48, + 152, + 242, + 91, + 113, + 230, + 192, + 5, + 169, + 81, + 159, + 38, + 120, + 218, + 141, + 28, + 127, + 1, + 246, + 162, + 119, + 120, + 226, + 217, + 148, + 138, + 189, + 249, + 1, + 251 ] } }, @@ -258,38 +258,38 @@ impl Default for WalletConfig { "Public": { "account_id": "2RHZhw9h534Zr3eq2RGhQete2Hh667foECzXPmSkGni2", "pub_sign_key": [ - 137, - 26, - 226, - 88, - 249, - 44, - 168, - 68, - 122, - 246, - 207, - 9, - 196, - 29, - 150, - 179, - 160, - 97, - 135, - 208, - 152, - 185, - 26, - 178, - 204, + 244, + 52, + 248, + 116, 23, - 180, - 46, - 60, - 74, - 47, - 161 + 32, + 1, + 69, + 134, + 174, + 67, + 53, + 109, + 42, + 236, + 98, + 87, + 218, + 8, + 98, + 34, + 246, + 4, + 221, + 183, + 93, + 105, + 115, + 59, + 134, + 252, + 76 ] } }, @@ -416,7 +416,7 @@ impl Default for WalletConfig { 247 ] }, - "nullifer_public_key": [ + "nullifier_public_key": [ 139, 19, 158, @@ -611,7 +611,7 @@ impl Default for WalletConfig { 145 ] }, - "nullifer_public_key": [ + "nullifier_public_key": [ 173, 134, 33, From b1747548b22b872c53c8b3fd909d9960660a097c Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Mon, 9 Mar 2026 12:23:57 -0400 Subject: [PATCH 6/9] fix nullifer typo --- integration_tests/src/config.rs | 8 ++++---- .../tests/auth_transfer/private.rs | 4 ++-- integration_tests/tests/keys_restoration.rs | 2 +- integration_tests/tests/token.rs | 2 +- integration_tests/tests/wallet_ffi.rs | 2 +- .../key_management/key_tree/keys_private.rs | 10 +++++----- key_protocol/src/key_management/mod.rs | 18 +++++++++--------- key_protocol/src/key_protocol_core/mod.rs | 2 +- wallet-ffi/src/keys.rs | 2 +- wallet/src/cli/account.rs | 4 ++-- wallet/src/lib.rs | 4 ++-- wallet/src/privacy_preserving_tx.rs | 2 +- wallet/src/transaction_utils.rs | 2 +- 13 files changed, 31 insertions(+), 31 deletions(-) diff --git a/integration_tests/src/config.rs b/integration_tests/src/config.rs index 8dd18a25..c4f2256e 100644 --- a/integration_tests/src/config.rs +++ b/integration_tests/src/config.rs @@ -141,11 +141,11 @@ impl InitialData { let mut private_charlie_key_chain = KeyChain::new_os_random(); let mut private_charlie_account_id = - AccountId::from(&private_charlie_key_chain.nullifer_public_key); + AccountId::from(&private_charlie_key_chain.nullifier_public_key); let mut private_david_key_chain = KeyChain::new_os_random(); let mut private_david_account_id = - AccountId::from(&private_david_key_chain.nullifer_public_key); + AccountId::from(&private_david_key_chain.nullifier_public_key); // Ensure consistent ordering if private_charlie_account_id > private_david_account_id { @@ -202,7 +202,7 @@ impl InitialData { self.private_accounts .iter() .map(|(key_chain, account)| CommitmentsInitialData { - npk: key_chain.nullifer_public_key.clone(), + npk: key_chain.nullifier_public_key.clone(), account: account.clone(), }) .collect() @@ -220,7 +220,7 @@ impl InitialData { }) }) .chain(self.private_accounts.iter().map(|(key_chain, account)| { - let account_id = AccountId::from(&key_chain.nullifer_public_key); + let account_id = AccountId::from(&key_chain.nullifier_public_key); InitialAccountData::Private(InitialAccountDataPrivate { account_id, account: account.clone(), diff --git a/integration_tests/tests/auth_transfer/private.rs b/integration_tests/tests/auth_transfer/private.rs index aa8ca180..6140dd7f 100644 --- a/integration_tests/tests/auth_transfer/private.rs +++ b/integration_tests/tests/auth_transfer/private.rs @@ -175,7 +175,7 @@ async fn private_transfer_to_owned_account_using_claiming_path() -> Result<()> { let command = Command::AuthTransfer(AuthTransferSubcommand::Send { from: format_private_account_id(from), to: None, - to_npk: Some(hex::encode(to_keys.nullifer_public_key.0)), + to_npk: Some(hex::encode(to_keys.nullifier_public_key.0)), to_vpk: Some(hex::encode(to_keys.viewing_public_key.0)), amount: 100, }); @@ -335,7 +335,7 @@ async fn private_transfer_to_owned_account_continuous_run_path() -> Result<()> { let command = Command::AuthTransfer(AuthTransferSubcommand::Send { from: format_private_account_id(from), to: None, - to_npk: Some(hex::encode(to_keys.nullifer_public_key.0)), + to_npk: Some(hex::encode(to_keys.nullifier_public_key.0)), to_vpk: Some(hex::encode(to_keys.viewing_public_key.0)), amount: 100, }); diff --git a/integration_tests/tests/keys_restoration.rs b/integration_tests/tests/keys_restoration.rs index 1bd207be..38b9c5b8 100644 --- a/integration_tests/tests/keys_restoration.rs +++ b/integration_tests/tests/keys_restoration.rs @@ -64,7 +64,7 @@ async fn sync_private_account_with_non_zero_chain_index() -> Result<()> { let command = Command::AuthTransfer(AuthTransferSubcommand::Send { from: format_private_account_id(from), to: None, - to_npk: Some(hex::encode(to_keys.nullifer_public_key.0)), + to_npk: Some(hex::encode(to_keys.nullifier_public_key.0)), to_vpk: Some(hex::encode(to_keys.viewing_public_key.0)), amount: 100, }); diff --git a/integration_tests/tests/token.rs b/integration_tests/tests/token.rs index 0ff6eee5..a058c94e 100644 --- a/integration_tests/tests/token.rs +++ b/integration_tests/tests/token.rs @@ -1117,7 +1117,7 @@ async fn token_claiming_path_with_private_accounts() -> Result<()> { let subcommand = TokenProgramAgnosticSubcommand::Mint { definition: format_private_account_id(definition_account_id), holder: None, - holder_npk: Some(hex::encode(holder_keys.nullifer_public_key.0)), + holder_npk: Some(hex::encode(holder_keys.nullifier_public_key.0)), holder_vpk: Some(hex::encode(holder_keys.viewing_public_key.0)), amount: mint_amount, }; diff --git a/integration_tests/tests/wallet_ffi.rs b/integration_tests/tests/wallet_ffi.rs index e57e6b13..0b30f107 100644 --- a/integration_tests/tests/wallet_ffi.rs +++ b/integration_tests/tests/wallet_ffi.rs @@ -599,7 +599,7 @@ fn test_wallet_ffi_get_private_account_keys() -> Result<()> { .unwrap() .0; - let expected_npk = &key_chain.nullifer_public_key; + let expected_npk = &key_chain.nullifier_public_key; let expected_vpk = &key_chain.viewing_public_key; assert_eq!(&keys.npk(), expected_npk); diff --git a/key_protocol/src/key_management/key_tree/keys_private.rs b/key_protocol/src/key_management/key_tree/keys_private.rs index d9ad9548..9b2bf70f 100644 --- a/key_protocol/src/key_management/key_tree/keys_private.rs +++ b/key_protocol/src/key_management/key_tree/keys_private.rs @@ -39,7 +39,7 @@ impl KeyNode for ChildKeysPrivate { value: ( KeyChain { secret_spending_key: ssk, - nullifer_public_key: npk, + nullifier_public_key: npk, viewing_public_key: vpk, private_key_holder: PrivateKeyHolder { nullifier_secret_key: nsk, @@ -86,7 +86,7 @@ impl KeyNode for ChildKeysPrivate { value: ( KeyChain { secret_spending_key: ssk, - nullifer_public_key: npk, + nullifier_public_key: npk, viewing_public_key: vpk, private_key_holder: PrivateKeyHolder { nullifier_secret_key: nsk, @@ -109,7 +109,7 @@ impl KeyNode for ChildKeysPrivate { } fn account_id(&self) -> nssa::AccountId { - nssa::AccountId::from(&self.value.0.nullifer_public_key) + nssa::AccountId::from(&self.value.0.nullifier_public_key) } } @@ -175,7 +175,7 @@ mod tests { assert!(expected_ssk == keys.value.0.secret_spending_key); assert!(expected_ccc == keys.ccc); assert!(expected_nsk == keys.value.0.private_key_holder.nullifier_secret_key); - assert!(expected_npk == keys.value.0.nullifer_public_key); + assert!(expected_npk == keys.value.0.nullifier_public_key); assert!(expected_vsk == keys.value.0.private_key_holder.viewing_secret_key); assert!(expected_vpk_as_bytes == keys.value.0.viewing_public_key.to_bytes()); } @@ -217,7 +217,7 @@ mod tests { assert!(expected_ccc == child_node.ccc); assert!(expected_nsk == child_node.value.0.private_key_holder.nullifier_secret_key); - assert!(expected_npk == child_node.value.0.nullifer_public_key); + assert!(expected_npk == child_node.value.0.nullifier_public_key); assert!(expected_vsk == child_node.value.0.private_key_holder.viewing_secret_key); assert!(expected_vpk_as_bytes == child_node.value.0.viewing_public_key.to_bytes()); } diff --git a/key_protocol/src/key_management/mod.rs b/key_protocol/src/key_management/mod.rs index 6e2891ce..d5aacdf9 100644 --- a/key_protocol/src/key_management/mod.rs +++ b/key_protocol/src/key_management/mod.rs @@ -16,7 +16,7 @@ pub mod secret_holders; pub struct KeyChain { pub secret_spending_key: SecretSpendingKey, pub private_key_holder: PrivateKeyHolder, - pub nullifer_public_key: NullifierPublicKey, + pub nullifier_public_key: NullifierPublicKey, pub viewing_public_key: ViewingPublicKey, } @@ -29,13 +29,13 @@ impl KeyChain { let private_key_holder = secret_spending_key.produce_private_key_holder(None); - let nullifer_public_key = private_key_holder.generate_nullifier_public_key(); + let nullifier_public_key = private_key_holder.generate_nullifier_public_key(); let viewing_public_key = private_key_holder.generate_viewing_public_key(); Self { secret_spending_key, private_key_holder, - nullifer_public_key, + nullifier_public_key, viewing_public_key, } } @@ -48,13 +48,13 @@ impl KeyChain { let private_key_holder = secret_spending_key.produce_private_key_holder(None); - let nullifer_public_key = private_key_holder.generate_nullifier_public_key(); + let nullifier_public_key = private_key_holder.generate_nullifier_public_key(); let viewing_public_key = private_key_holder.generate_viewing_public_key(); Self { secret_spending_key, private_key_holder, - nullifer_public_key, + nullifier_public_key, viewing_public_key, } } @@ -90,7 +90,7 @@ mod tests { // Check that key holder fields are initialized with expected types assert_ne!( - account_id_key_holder.nullifer_public_key.as_ref(), + account_id_key_holder.nullifier_public_key.as_ref(), &[0u8; 32] ); } @@ -116,7 +116,7 @@ mod tests { let utxo_secret_key_holder = top_secret_key_holder.produce_private_key_holder(None); - let nullifer_public_key = utxo_secret_key_holder.generate_nullifier_public_key(); + let nullifier_public_key = utxo_secret_key_holder.generate_nullifier_public_key(); let viewing_public_key = utxo_secret_key_holder.generate_viewing_public_key(); let pub_account_signing_key = nssa::PrivateKey::new_os_random(); @@ -147,7 +147,7 @@ mod tests { println!("Account {:?}", account.value().to_base58()); println!( "Nulifier public key {:?}", - hex::encode(nullifer_public_key.to_byte_array()) + hex::encode(nullifier_public_key.to_byte_array()) ); println!( "Viewing public key {:?}", @@ -180,7 +180,7 @@ mod tests { fn test_non_trivial_chain_index() { let keys = account_with_chain_index_2_for_tests(); - let eph_key_holder = EphemeralKeyHolder::new(&keys.nullifer_public_key); + let eph_key_holder = EphemeralKeyHolder::new(&keys.nullifier_public_key); let key_sender = eph_key_holder.calculate_shared_secret_sender(&keys.viewing_public_key); let key_receiver = keys.calculate_shared_secret_receiver( diff --git a/key_protocol/src/key_protocol_core/mod.rs b/key_protocol/src/key_protocol_core/mod.rs index 42e4b672..65f0aeb3 100644 --- a/key_protocol/src/key_protocol_core/mod.rs +++ b/key_protocol/src/key_protocol_core/mod.rs @@ -46,7 +46,7 @@ impl NSSAUserData { ) -> bool { let mut check_res = true; for (account_id, (key, _)) in accounts_keys_map { - let expected_account_id = nssa::AccountId::from(&key.nullifer_public_key); + let expected_account_id = nssa::AccountId::from(&key.nullifier_public_key); if expected_account_id != *account_id { println!("{}, {}", expected_account_id, account_id); check_res = false; diff --git a/wallet-ffi/src/keys.rs b/wallet-ffi/src/keys.rs index bd26fa8c..c54525d9 100644 --- a/wallet-ffi/src/keys.rs +++ b/wallet-ffi/src/keys.rs @@ -128,7 +128,7 @@ pub unsafe extern "C" fn wallet_ffi_get_private_account_keys( }; // NPK is a 32-byte array - let npk_bytes = key_chain.nullifer_public_key.0; + let npk_bytes = key_chain.nullifier_public_key.0; // VPK is a compressed secp256k1 point (33 bytes) let vpk_bytes = key_chain.viewing_public_key.to_bytes(); diff --git a/wallet/src/cli/account.rs b/wallet/src/cli/account.rs index 7f936284..109e6a1d 100644 --- a/wallet/src/cli/account.rs +++ b/wallet/src/cli/account.rs @@ -145,7 +145,7 @@ impl WalletSubcommand for NewSubcommand { println!( "Generated new account with account_id Private/{account_id} at path {chain_index}", ); - println!("With npk {}", hex::encode(key.nullifer_public_key.0)); + println!("With npk {}", hex::encode(key.nullifier_public_key.0)); println!( "With vpk {}", hex::encode(key.viewing_public_key.to_bytes()) @@ -246,7 +246,7 @@ impl WalletSubcommand for AccountSubcommand { .get_private_account(account_id) .ok_or(anyhow::anyhow!("Private account not found in storage"))?; - println!("npk {}", hex::encode(key.nullifer_public_key.0)); + println!("npk {}", hex::encode(key.nullifier_public_key.0)); println!("vpk {}", hex::encode(key.viewing_public_key.to_bytes())); } } diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 8d8924cf..8b78db57 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -238,7 +238,7 @@ impl WalletCore { pub fn get_private_account_commitment(&self, account_id: AccountId) -> Option { let (keys, account) = self.storage.user_data.get_private_account(account_id)?; - Some(Commitment::new(&keys.nullifer_public_key, account)) + Some(Commitment::new(&keys.nullifier_public_key, account)) } /// Poll transactions @@ -433,7 +433,7 @@ impl WalletCore { let affected_accounts = private_account_key_chains .flat_map(|(acc_account_id, key_chain, index)| { let view_tag = EncryptedAccountData::compute_view_tag( - key_chain.nullifer_public_key.clone(), + key_chain.nullifier_public_key.clone(), key_chain.viewing_public_key.clone(), ); diff --git a/wallet/src/privacy_preserving_tx.rs b/wallet/src/privacy_preserving_tx.rs index e43966d4..43928cb3 100644 --- a/wallet/src/privacy_preserving_tx.rs +++ b/wallet/src/privacy_preserving_tx.rs @@ -212,7 +212,7 @@ async fn private_acc_preparation( let nsk = from_keys.private_key_holder.nullifier_secret_key; - let from_npk = from_keys.nullifer_public_key; + let from_npk = from_keys.nullifier_public_key; let from_vpk = from_keys.viewing_public_key; // TODO: Remove this unwrap, error types must be compatible diff --git a/wallet/src/transaction_utils.rs b/wallet/src/transaction_utils.rs index 2a48d3e6..2adc3033 100644 --- a/wallet/src/transaction_utils.rs +++ b/wallet/src/transaction_utils.rs @@ -39,7 +39,7 @@ impl WalletCore { let mut nsk = None; let mut proof = None; - let from_npk = from_keys.nullifer_public_key; + let from_npk = from_keys.nullifier_public_key; let from_vpk = from_keys.viewing_public_key; let sender_commitment = Commitment::new(&from_npk, &from_acc); From 4fdefd35578e582cc047aff0fee28d131ed4c75b Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Wed, 18 Mar 2026 16:53:07 -0400 Subject: [PATCH 7/9] fix typo --- key_protocol/src/key_management/mod.rs | 18 +++++++++--------- wallet/src/lib.rs | 2 +- 2 files changed, 10 insertions(+), 10 deletions(-) diff --git a/key_protocol/src/key_management/mod.rs b/key_protocol/src/key_management/mod.rs index e29e5862..dcdaff45 100644 --- a/key_protocol/src/key_management/mod.rs +++ b/key_protocol/src/key_management/mod.rs @@ -16,7 +16,7 @@ pub type PublicAccountSigningKey = [u8; 32]; pub struct KeyChain { pub secret_spending_key: SecretSpendingKey, pub private_key_holder: PrivateKeyHolder, - pub nullifer_public_key: NullifierPublicKey, + pub nullifier_public_key: NullifierPublicKey, pub viewing_public_key: ViewingPublicKey, } @@ -30,13 +30,13 @@ impl KeyChain { let private_key_holder = secret_spending_key.produce_private_key_holder(None); - let nullifer_public_key = private_key_holder.generate_nullifier_public_key(); + let nullifier_public_key = private_key_holder.generate_nullifier_public_key(); let viewing_public_key = private_key_holder.generate_viewing_public_key(); Self { secret_spending_key, private_key_holder, - nullifer_public_key, + nullifier_public_key, viewing_public_key, } } @@ -50,13 +50,13 @@ impl KeyChain { let private_key_holder = secret_spending_key.produce_private_key_holder(None); - let nullifer_public_key = private_key_holder.generate_nullifier_public_key(); + let nullifier_public_key = private_key_holder.generate_nullifier_public_key(); let viewing_public_key = private_key_holder.generate_viewing_public_key(); Self { secret_spending_key, private_key_holder, - nullifer_public_key, + nullifier_public_key, viewing_public_key, } } @@ -93,7 +93,7 @@ mod tests { // Check that key holder fields are initialized with expected types assert_ne!( - account_id_key_holder.nullifer_public_key.as_ref(), + account_id_key_holder.nullifier_public_key.as_ref(), &[0_u8; 32] ); } @@ -119,7 +119,7 @@ mod tests { let utxo_secret_key_holder = top_secret_key_holder.produce_private_key_holder(None); - let nullifer_public_key = utxo_secret_key_holder.generate_nullifier_public_key(); + let nullifier_public_key = utxo_secret_key_holder.generate_nullifier_public_key(); let viewing_public_key = utxo_secret_key_holder.generate_viewing_public_key(); let pub_account_signing_key = nssa::PrivateKey::new_os_random(); @@ -150,7 +150,7 @@ mod tests { println!("Account {:?}", account.value().to_base58()); println!( "Nulifier public key {:?}", - hex::encode(nullifer_public_key.to_byte_array()) + hex::encode(nullifier_public_key.to_byte_array()) ); println!( "Viewing public key {:?}", @@ -183,7 +183,7 @@ mod tests { fn non_trivial_chain_index() { let keys = account_with_chain_index_2_for_tests(); - let eph_key_holder = EphemeralKeyHolder::new(&keys.nullifer_public_key); + let eph_key_holder = EphemeralKeyHolder::new(&keys.nullifier_public_key); let key_sender = eph_key_holder.calculate_shared_secret_sender(&keys.viewing_public_key); let key_receiver = keys.calculate_shared_secret_receiver( diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index a7a8daca..79729fc4 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -469,7 +469,7 @@ impl WalletCore { let affected_accounts = private_account_key_chains .flat_map(|(acc_account_id, key_chain, index)| { let view_tag = EncryptedAccountData::compute_view_tag( - &key_chain.nullifer_public_key, + &key_chain.nullifier_public_key, &key_chain.viewing_public_key, ); From 83ef7890023bb3e6a015e1e22cd16e4c44977a2f Mon Sep 17 00:00:00 2001 From: jonesmarvin8 <83104039+jonesmarvin8@users.noreply.github.com> Date: Wed, 18 Mar 2026 18:44:07 -0400 Subject: [PATCH 8/9] lint issues --- integration_tests/src/config.rs | 303 +++++++++--------- .../key_management/key_tree/keys_private.rs | 16 +- .../key_management/key_tree/keys_public.rs | 66 ++-- .../src/key_management/secret_holders.rs | 2 + 4 files changed, 203 insertions(+), 184 deletions(-) diff --git a/integration_tests/src/config.rs b/integration_tests/src/config.rs index c4f2256e..5bcf59b9 100644 --- a/integration_tests/src/config.rs +++ b/integration_tests/src/config.rs @@ -1,6 +1,6 @@ use std::{net::SocketAddr, path::PathBuf, time::Duration}; -use anyhow::{Context, Result}; +use anyhow::{Context as _, Result}; use bytesize::ByteSize; use common::block::{AccountInitialData, CommitmentsInitialData}; use indexer_service::{BackoffConfig, ChannelId, ClientConfig, IndexerConfig}; @@ -13,6 +13,157 @@ use wallet::config::{ InitialAccountData, InitialAccountDataPrivate, InitialAccountDataPublic, WalletConfig, }; +/// Sequencer config options available for custom changes in integration tests. +#[derive(Debug, Clone, Copy)] +pub struct SequencerPartialConfig { + pub max_num_tx_in_block: usize, + pub max_block_size: ByteSize, + pub mempool_max_size: usize, + pub block_create_timeout: Duration, +} + +impl Default for SequencerPartialConfig { + fn default() -> Self { + Self { + max_num_tx_in_block: 20, + max_block_size: ByteSize::mib(1), + mempool_max_size: 10_000, + block_create_timeout: Duration::from_secs(10), + } + } +} + +pub struct InitialData { + pub public_accounts: Vec<(PrivateKey, u128)>, + pub private_accounts: Vec<(KeyChain, Account)>, +} + +impl InitialData { + #[must_use] + pub fn with_two_public_and_two_private_initialized_accounts() -> Self { + let mut public_alice_private_key = PrivateKey::new_os_random(); + let mut public_alice_public_key = + PublicKey::new_from_private_key(&public_alice_private_key); + let mut public_alice_account_id = AccountId::from(&public_alice_public_key); + + let mut public_bob_private_key = PrivateKey::new_os_random(); + let mut public_bob_public_key = PublicKey::new_from_private_key(&public_bob_private_key); + let mut public_bob_account_id = AccountId::from(&public_bob_public_key); + + // Ensure consistent ordering + if public_alice_account_id > public_bob_account_id { + std::mem::swap(&mut public_alice_private_key, &mut public_bob_private_key); + std::mem::swap(&mut public_alice_public_key, &mut public_bob_public_key); + std::mem::swap(&mut public_alice_account_id, &mut public_bob_account_id); + } + + let mut private_charlie_key_chain = KeyChain::new_os_random(); + let mut private_charlie_account_id = + AccountId::from(&private_charlie_key_chain.nullifier_public_key); + + let mut private_david_key_chain = KeyChain::new_os_random(); + let mut private_david_account_id = + AccountId::from(&private_david_key_chain.nullifier_public_key); + + // Ensure consistent ordering + if private_charlie_account_id > private_david_account_id { + std::mem::swap(&mut private_charlie_key_chain, &mut private_david_key_chain); + std::mem::swap( + &mut private_charlie_account_id, + &mut private_david_account_id, + ); + } + + Self { + public_accounts: vec![ + (public_alice_private_key, 10_000), + (public_bob_private_key, 20_000), + ], + private_accounts: vec![ + ( + private_charlie_key_chain, + Account { + balance: 10_000, + data: Data::default(), + program_owner: DEFAULT_PROGRAM_ID, + nonce: 0_u128.into(), + }, + ), + ( + private_david_key_chain, + Account { + balance: 20_000, + data: Data::default(), + program_owner: DEFAULT_PROGRAM_ID, + nonce: 0_u128.into(), + }, + ), + ], + } + } + + fn sequencer_initial_accounts(&self) -> Vec { + self.public_accounts + .iter() + .map(|(priv_key, balance)| { + let pub_key = PublicKey::new_from_private_key(priv_key); + let account_id = AccountId::from(&pub_key); + AccountInitialData { + account_id, + balance: *balance, + } + }) + .collect() + } + + fn sequencer_initial_commitments(&self) -> Vec { + self.private_accounts + .iter() + .map(|(key_chain, account)| CommitmentsInitialData { + npk: key_chain.nullifier_public_key.clone(), + account: account.clone(), + }) + .collect() + } + + fn wallet_initial_accounts(&self) -> Vec { + self.public_accounts + .iter() + .map(|(priv_key, _)| { + let pub_key = PublicKey::new_from_private_key(priv_key); + let account_id = AccountId::from(&pub_key); + InitialAccountData::Public(InitialAccountDataPublic { + account_id, + pub_sign_key: priv_key.clone(), + }) + }) + .chain(self.private_accounts.iter().map(|(key_chain, account)| { + let account_id = AccountId::from(&key_chain.nullifier_public_key); + InitialAccountData::Private(Box::new(InitialAccountDataPrivate { + account_id, + account: account.clone(), + key_chain: key_chain.clone(), + })) + })) + .collect() + } +} + +#[derive(Debug, Clone, Copy)] +pub enum UrlProtocol { + Http, + Ws, +} + +impl std::fmt::Display for UrlProtocol { + fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { + match self { + Self::Http => write!(f, "http"), + Self::Ws => write!(f, "ws"), + } + } +} + pub fn indexer_config( bedrock_addr: SocketAddr, home: PathBuf, @@ -37,25 +188,6 @@ pub fn indexer_config( }) } -/// Sequencer config options available for custom changes in integration tests. -pub struct SequencerPartialConfig { - pub max_num_tx_in_block: usize, - pub max_block_size: ByteSize, - pub mempool_max_size: usize, - pub block_create_timeout: Duration, -} - -impl Default for SequencerPartialConfig { - fn default() -> Self { - Self { - max_num_tx_in_block: 20, - max_block_size: ByteSize::mib(1), - mempool_max_size: 10_000, - block_create_timeout: Duration::from_secs(10), - } - } -} - pub fn sequencer_config( partial: SequencerPartialConfig, home: PathBuf, @@ -116,135 +248,6 @@ pub fn wallet_config( }) } -pub struct InitialData { - pub public_accounts: Vec<(PrivateKey, u128)>, - pub private_accounts: Vec<(KeyChain, Account)>, -} - -impl InitialData { - pub fn with_two_public_and_two_private_initialized_accounts() -> Self { - let mut public_alice_private_key = PrivateKey::new_os_random(); - let mut public_alice_public_key = - PublicKey::new_from_private_key(&public_alice_private_key); - let mut public_alice_account_id = AccountId::from(&public_alice_public_key); - - let mut public_bob_private_key = PrivateKey::new_os_random(); - let mut public_bob_public_key = PublicKey::new_from_private_key(&public_bob_private_key); - let mut public_bob_account_id = AccountId::from(&public_bob_public_key); - - // Ensure consistent ordering - if public_alice_account_id > public_bob_account_id { - std::mem::swap(&mut public_alice_private_key, &mut public_bob_private_key); - std::mem::swap(&mut public_alice_public_key, &mut public_bob_public_key); - std::mem::swap(&mut public_alice_account_id, &mut public_bob_account_id); - } - - let mut private_charlie_key_chain = KeyChain::new_os_random(); - let mut private_charlie_account_id = - AccountId::from(&private_charlie_key_chain.nullifier_public_key); - - let mut private_david_key_chain = KeyChain::new_os_random(); - let mut private_david_account_id = - AccountId::from(&private_david_key_chain.nullifier_public_key); - - // Ensure consistent ordering - if private_charlie_account_id > private_david_account_id { - std::mem::swap(&mut private_charlie_key_chain, &mut private_david_key_chain); - std::mem::swap( - &mut private_charlie_account_id, - &mut private_david_account_id, - ); - } - - Self { - public_accounts: vec![ - (public_alice_private_key, 10_000), - (public_bob_private_key, 20_000), - ], - private_accounts: vec![ - ( - private_charlie_key_chain, - Account { - balance: 10_000, - data: Data::default(), - program_owner: DEFAULT_PROGRAM_ID, - nonce: 0, - }, - ), - ( - private_david_key_chain, - Account { - balance: 20_000, - data: Data::default(), - program_owner: DEFAULT_PROGRAM_ID, - nonce: 0, - }, - ), - ], - } - } - - fn sequencer_initial_accounts(&self) -> Vec { - self.public_accounts - .iter() - .map(|(priv_key, balance)| { - let pub_key = PublicKey::new_from_private_key(priv_key); - let account_id = AccountId::from(&pub_key); - AccountInitialData { - account_id, - balance: *balance, - } - }) - .collect() - } - - fn sequencer_initial_commitments(&self) -> Vec { - self.private_accounts - .iter() - .map(|(key_chain, account)| CommitmentsInitialData { - npk: key_chain.nullifier_public_key.clone(), - account: account.clone(), - }) - .collect() - } - - fn wallet_initial_accounts(&self) -> Vec { - self.public_accounts - .iter() - .map(|(priv_key, _)| { - let pub_key = PublicKey::new_from_private_key(priv_key); - let account_id = AccountId::from(&pub_key); - InitialAccountData::Public(InitialAccountDataPublic { - account_id, - pub_sign_key: priv_key.clone(), - }) - }) - .chain(self.private_accounts.iter().map(|(key_chain, account)| { - let account_id = AccountId::from(&key_chain.nullifier_public_key); - InitialAccountData::Private(InitialAccountDataPrivate { - account_id, - account: account.clone(), - key_chain: key_chain.clone(), - }) - })) - .collect() - } -} - -pub enum UrlProtocol { - Http, - Ws, -} - -impl std::fmt::Display for UrlProtocol { - fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result { - match self { - UrlProtocol::Http => write!(f, "http"), - UrlProtocol::Ws => write!(f, "ws"), - } - } -} - pub fn addr_to_url(protocol: UrlProtocol, addr: SocketAddr) -> Result { // Convert 0.0.0.0 to 127.0.0.1 for client connections // When binding to port 0, the server binds to 0.0.0.0: @@ -259,7 +262,7 @@ pub fn addr_to_url(protocol: UrlProtocol, addr: SocketAddr) -> Result { } fn bedrock_channel_id() -> ChannelId { - let channel_id: [u8; 32] = [0u8, 1] + let channel_id: [u8; 32] = [0_u8, 1] .repeat(16) .try_into() .unwrap_or_else(|_| unreachable!()); diff --git a/key_protocol/src/key_management/key_tree/keys_private.rs b/key_protocol/src/key_management/key_tree/keys_private.rs index 9b2bf70f..071d596c 100644 --- a/key_protocol/src/key_management/key_tree/keys_private.rs +++ b/key_protocol/src/key_management/key_tree/keys_private.rs @@ -1,4 +1,4 @@ -use k256::{Scalar, elliptic_curve::PrimeField}; +use k256::{Scalar, elliptic_curve::PrimeField as _}; use nssa_core::{NullifierPublicKey, encryption::ViewingPublicKey}; use serde::{Deserialize, Serialize}; @@ -12,7 +12,7 @@ use crate::key_management::{ pub struct ChildKeysPrivate { pub value: (KeyChain, nssa::Account), pub ccc: [u8; 32], - /// Can be [`None`] if root + /// Can be [`None`] if root. pub cci: Option, } @@ -54,6 +54,7 @@ impl KeyNode for ChildKeysPrivate { } fn nth_child(&self, cci: u32) -> Self { + #[expect(clippy::arithmetic_side_effects, reason = "TODO: fix later")] let parent_pt = Scalar::from_repr(self.value.0.private_key_holder.nullifier_secret_key.into()) .expect("Key generated as scalar, must be valid representation") @@ -63,6 +64,7 @@ impl KeyNode for ChildKeysPrivate { input.extend_from_slice(b"LEE_seed_priv"); input.extend_from_slice(&parent_pt.to_bytes()); + #[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")] input.extend_from_slice(&cci.to_be_bytes()); let hash_value = hmac_sha512::HMAC::mac(input, self.ccc); @@ -113,12 +115,20 @@ impl KeyNode for ChildKeysPrivate { } } +#[expect( + clippy::single_char_lifetime_names, + reason = "TODO add meaningful name" +)] impl<'a> From<&'a ChildKeysPrivate> for &'a (KeyChain, nssa::Account) { fn from(value: &'a ChildKeysPrivate) -> Self { &value.value } } +#[expect( + clippy::single_char_lifetime_names, + reason = "TODO add meaningful name" +)] impl<'a> From<&'a mut ChildKeysPrivate> for &'a mut (KeyChain, nssa::Account) { fn from(value: &'a mut ChildKeysPrivate) -> Self { &mut value.value @@ -190,7 +200,7 @@ mod tests { ]; let root_node = ChildKeysPrivate::root(seed); - let child_node = ChildKeysPrivate::nth_child(&root_node, 42u32); + let child_node = ChildKeysPrivate::nth_child(&root_node, 42_u32); let expected_ccc: [u8; 32] = [ 27, 73, 133, 213, 214, 63, 217, 184, 164, 17, 172, 140, 223, 95, 255, 157, 11, 0, 58, diff --git a/key_protocol/src/key_management/key_tree/keys_public.rs b/key_protocol/src/key_management/key_tree/keys_public.rs index 28814398..ec7a31f1 100644 --- a/key_protocol/src/key_management/key_tree/keys_public.rs +++ b/key_protocol/src/key_management/key_tree/keys_public.rs @@ -8,36 +8,32 @@ pub struct ChildKeysPublic { pub csk: nssa::PrivateKey, pub cpk: nssa::PublicKey, pub ccc: [u8; 32], - /// Can be [`None`] if root + /// Can be [`None`] if root. pub cci: Option, } impl ChildKeysPublic { + #[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")] fn compute_hash_value(&self, cci: u32) -> [u8; 64] { let mut hash_input = vec![]; - match ((2u32).pow(31)).cmp(&cci) { - // Non-harden - std::cmp::Ordering::Greater => { - // BIP-032 compatibility requires 1-byte header from the public_key; - // Not stored in `self.cpk.value()` - let sk = secp256k1::SecretKey::from_byte_array(*self.csk.value()) - .expect("32 bytes, within curve order"); - let pk = secp256k1::PublicKey::from_secret_key(&secp256k1::Secp256k1::new(), &sk); - hash_input.extend_from_slice(&secp256k1::PublicKey::serialize(&pk)); - hash_input.extend_from_slice(&cci.to_be_bytes()); - - hmac_sha512::HMAC::mac(hash_input, self.ccc) - } - // Harden - _ => { - hash_input.extend_from_slice(&[0u8]); - hash_input.extend_from_slice(self.csk.value()); - hash_input.extend_from_slice(&cci.to_be_bytes()); - - hmac_sha512::HMAC::mac(hash_input, self.ccc) - } + if ((2_u32).pow(31)).cmp(&cci) == std::cmp::Ordering::Greater { + // Non-harden. + // BIP-032 compatibility requires 1-byte header from the public_key; + // Not stored in `self.cpk.value()`. + let sk = secp256k1::SecretKey::from_byte_array(*self.csk.value()) + .expect("32 bytes, within curve order"); + let pk = secp256k1::PublicKey::from_secret_key(&secp256k1::Secp256k1::new(), &sk); + hash_input.extend_from_slice(&secp256k1::PublicKey::serialize(&pk)); + } else { + // Harden. + hash_input.extend_from_slice(&[0_u8]); + hash_input.extend_from_slice(self.csk.value()); } + + hash_input.extend_from_slice(&cci.to_be_bytes()); + + hmac_sha512::HMAC::mac(hash_input, self.ccc) } } @@ -67,16 +63,20 @@ impl KeyNode for ChildKeysPublic { ) .unwrap(); - let csk = nssa::PrivateKey::try_new( - csk.add_tweak(&Scalar::from_be_bytes(*self.csk.value()).unwrap()) + let csk = nssa::PrivateKey::try_new({ + #[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")] + let scalar = Scalar::from_be_bytes(*self.csk.value()).unwrap(); + + csk.add_tweak(&scalar) .expect("Expect a valid Scalar") - .secret_bytes(), - ) + .secret_bytes() + }) .unwrap(); - if secp256k1::constants::CURVE_ORDER < *csk.value() { - panic!("Secret key cannot exceed curve order"); - } + assert!( + secp256k1::constants::CURVE_ORDER >= *csk.value(), + "Secret key cannot exceed curve order" + ); let ccc = *hash_value .last_chunk::<32>() @@ -105,6 +105,10 @@ impl KeyNode for ChildKeysPublic { } } +#[expect( + clippy::single_char_lifetime_names, + reason = "TODO add meaningful name" +)] impl<'a> From<&'a ChildKeysPublic> for &'a nssa::PrivateKey { fn from(value: &'a ChildKeysPublic) -> Self { &value.csk @@ -158,7 +162,7 @@ mod tests { 187, 148, 92, 44, 253, 210, 37, ]; let root_keys = ChildKeysPublic::root(seed); - let cci = (2u32).pow(31) + 13; + let cci = (2_u32).pow(31) + 13; let child_keys = ChildKeysPublic::nth_child(&root_keys, cci); let expected_ccc = [ @@ -226,7 +230,7 @@ mod tests { 187, 148, 92, 44, 253, 210, 37, ]; let root_keys = ChildKeysPublic::root(seed); - let cci = (2u32).pow(31); //equivant to 0, thus non-harden. + let cci = (2_u32).pow(31); //equivant to 0, thus non-harden. let child_keys = ChildKeysPublic::nth_child(&root_keys, cci); let expected_ccc = [ diff --git a/key_protocol/src/key_management/secret_holders.rs b/key_protocol/src/key_management/secret_holders.rs index b504f0df..9643abe0 100644 --- a/key_protocol/src/key_management/secret_holders.rs +++ b/key_protocol/src/key_management/secret_holders.rs @@ -79,6 +79,7 @@ impl SeedHolder { impl SecretSpendingKey { #[must_use] + #[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")] pub fn generate_nullifier_secret_key(&self, index: Option) -> NullifierSecretKey { const PREFIX: &[u8; 8] = b"LEE/keys"; const SUFFIX_1: &[u8; 1] = &[1]; @@ -100,6 +101,7 @@ impl SecretSpendingKey { } #[must_use] + #[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")] pub fn generate_viewing_secret_key(&self, index: Option) -> ViewingSecretKey { const PREFIX: &[u8; 8] = b"LEE/keys"; const SUFFIX_1: &[u8; 1] = &[2]; From c40c62a484b67409e823e9a098a789970e1c85ad Mon Sep 17 00:00:00 2001 From: Daniil Polyakov Date: Thu, 19 Mar 2026 18:03:23 +0300 Subject: [PATCH 9/9] fix: satisfy clippy --- Cargo.lock | 1 + indexer/core/Cargo.toml | 1 - .../src/key_management/key_tree/keys_private.rs | 14 +++++++------- .../src/key_management/key_tree/keys_public.rs | 9 ++++----- nssa/Cargo.toml | 2 +- programs/amm/Cargo.toml | 6 ++++-- 6 files changed, 17 insertions(+), 16 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 6faf3b1e..6bb8255c 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -8971,6 +8971,7 @@ dependencies = [ "nssa", "nssa_core", "optfield", + "rand 0.8.5", "serde", "serde_json", "sha2", diff --git a/indexer/core/Cargo.toml b/indexer/core/Cargo.toml index 8129c1ea..13e81088 100644 --- a/indexer/core/Cargo.toml +++ b/indexer/core/Cargo.toml @@ -28,4 +28,3 @@ async-stream.workspace = true [dev-dependencies] tempfile.workspace = true - diff --git a/key_protocol/src/key_management/key_tree/keys_private.rs b/key_protocol/src/key_management/key_tree/keys_private.rs index 071d596c..0b20a310 100644 --- a/key_protocol/src/key_management/key_tree/keys_private.rs +++ b/key_protocol/src/key_management/key_tree/keys_private.rs @@ -137,13 +137,13 @@ impl<'a> From<&'a mut ChildKeysPrivate> for &'a mut (KeyChain, nssa::Account) { #[cfg(test)] mod tests { - use nssa_core::{NullifierPublicKey, NullifierSecretKey}; + use nssa_core::NullifierSecretKey; use super::*; use crate::key_management::{self, secret_holders::ViewingSecretKey}; #[test] - fn test_master_key_generation() { + fn master_key_generation() { let seed: [u8; 64] = [ 252, 56, 204, 83, 232, 123, 209, 188, 187, 167, 39, 213, 71, 39, 58, 65, 125, 134, 255, 49, 43, 108, 92, 53, 173, 164, 94, 142, 150, 74, 21, 163, 43, 144, 226, 87, 199, 18, @@ -153,7 +153,7 @@ mod tests { let keys = ChildKeysPrivate::root(seed); - let expected_ssk: SecretSpendingKey = key_management::secret_holders::SecretSpendingKey([ + let expected_ssk = key_management::secret_holders::SecretSpendingKey([ 246, 79, 26, 124, 135, 95, 52, 51, 201, 27, 48, 194, 2, 144, 51, 219, 245, 128, 139, 222, 42, 195, 105, 33, 115, 97, 186, 0, 97, 14, 218, 191, ]); @@ -168,11 +168,11 @@ mod tests { 34, 234, 19, 222, 2, 22, 12, 163, 252, 88, 11, 0, 163, ]; - let expected_npk: NullifierPublicKey = nssa_core::NullifierPublicKey([ + let expected_npk = nssa_core::NullifierPublicKey([ 7, 123, 125, 191, 233, 183, 201, 4, 20, 214, 155, 210, 45, 234, 27, 240, 194, 111, 97, 247, 155, 113, 122, 246, 192, 0, 70, 61, 76, 71, 70, 2, ]); - let expected_vsk: ViewingSecretKey = [ + let expected_vsk = [ 155, 90, 54, 75, 228, 130, 68, 201, 129, 251, 180, 195, 250, 64, 34, 230, 241, 204, 216, 50, 149, 156, 10, 67, 208, 74, 9, 10, 47, 59, 50, 202, ]; @@ -191,7 +191,7 @@ mod tests { } #[test] - fn test_child_keys_generation() { + fn child_keys_generation() { let seed: [u8; 64] = [ 252, 56, 204, 83, 232, 123, 209, 188, 187, 167, 39, 213, 71, 39, 58, 65, 125, 134, 255, 49, 43, 108, 92, 53, 173, 164, 94, 142, 150, 74, 21, 163, 43, 144, 226, 87, 199, 18, @@ -211,7 +211,7 @@ mod tests { 124, 61, 40, 92, 33, 135, 3, 41, 200, 234, 3, 69, 102, 184, 57, 191, 106, 151, 194, 192, 103, 132, 141, 112, 249, 108, 192, 117, 24, 48, 70, 216, ]; - let expected_npk: NullifierPublicKey = nssa_core::NullifierPublicKey([ + let expected_npk = nssa_core::NullifierPublicKey([ 116, 231, 246, 189, 145, 240, 37, 59, 219, 223, 216, 246, 116, 171, 223, 55, 197, 200, 134, 192, 221, 40, 218, 167, 239, 5, 11, 95, 147, 247, 162, 226, ]); diff --git a/key_protocol/src/key_management/key_tree/keys_public.rs b/key_protocol/src/key_management/key_tree/keys_public.rs index ec7a31f1..73ed7bee 100644 --- a/key_protocol/src/key_management/key_tree/keys_public.rs +++ b/key_protocol/src/key_management/key_tree/keys_public.rs @@ -64,7 +64,6 @@ impl KeyNode for ChildKeysPublic { .unwrap(); let csk = nssa::PrivateKey::try_new({ - #[expect(clippy::big_endian_bytes, reason = "BIP-032 uses big endian")] let scalar = Scalar::from_be_bytes(*self.csk.value()).unwrap(); csk.add_tweak(&scalar) @@ -122,7 +121,7 @@ mod tests { use super::*; #[test] - fn test_master_keys_generation() { + fn master_keys_generation() { let seed = [ 88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173, 134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87, @@ -154,7 +153,7 @@ mod tests { } #[test] - fn test_harden_child_keys_generation() { + fn harden_child_keys_generation() { let seed = [ 88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173, 134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87, @@ -188,7 +187,7 @@ mod tests { } #[test] - fn test_nonharden_child_keys_generation() { + fn nonharden_child_keys_generation() { let seed = [ 88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173, 134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87, @@ -222,7 +221,7 @@ mod tests { } #[test] - fn test_edge_case_child_keys_generation_2_power_31() { + fn edge_case_child_keys_generation_2_power_31() { let seed = [ 88, 189, 37, 237, 199, 125, 151, 226, 69, 153, 165, 113, 191, 69, 188, 221, 9, 34, 173, 134, 61, 109, 34, 103, 121, 39, 237, 14, 107, 194, 24, 194, 191, 14, 237, 185, 12, 87, diff --git a/nssa/Cargo.toml b/nssa/Cargo.toml index e1b6805f..b50f189b 100644 --- a/nssa/Cargo.toml +++ b/nssa/Cargo.toml @@ -37,4 +37,4 @@ test-case = "3.3.1" [features] default = [] prove = ["risc0-zkvm/prove"] -test-utils = [] \ No newline at end of file +test-utils = [] diff --git a/programs/amm/Cargo.toml b/programs/amm/Cargo.toml index 449d5dcc..30074ac8 100644 --- a/programs/amm/Cargo.toml +++ b/programs/amm/Cargo.toml @@ -8,10 +8,12 @@ license = { workspace = true } workspace = true [dependencies] -nssa = { workspace = true, optional = true, features = ["test-utils"], default-features = true } +nssa = { workspace = true, optional = true, features = [ + "test-utils", +], default-features = true } nssa_core.workspace = true token_core.workspace = true amm_core.workspace = true [features] -nssa = ["dep:nssa"] \ No newline at end of file +nssa = ["dep:nssa"]