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);