From e9c0aa085802a1c2e42073b0aa0c852946c2d875 Mon Sep 17 00:00:00 2001 From: Sergio Chouhy Date: Fri, 8 May 2026 21:41:48 -0300 Subject: [PATCH] handle comments --- indexer/core/src/lib.rs | 2 +- integration_tests/src/config.rs | 4 +-- .../tests/auth_transfer/private.rs | 4 +-- integration_tests/tests/tps.rs | 4 +-- integration_tests/tests/wallet_ffi.rs | 4 +-- .../src/key_management/key_tree/mod.rs | 2 +- nssa/core/src/circuit_io.rs | 2 +- nssa/core/src/nullifier.rs | 21 ++++++++----- nssa/core/src/program.rs | 6 ++-- .../privacy_preserving_transaction/circuit.rs | 16 +++++----- .../privacy_preserving_transaction/message.rs | 6 ++-- nssa/src/state.rs | 30 +++++++++---------- .../src/bin/privacy_preserving_circuit.rs | 6 ++-- sequencer/core/src/lib.rs | 2 +- testnet_initial_state/src/lib.rs | 4 +-- wallet/src/lib.rs | 18 ++--------- wallet/src/privacy_preserving_tx.rs | 4 +-- 17 files changed, 65 insertions(+), 70 deletions(-) diff --git a/indexer/core/src/lib.rs b/indexer/core/src/lib.rs index 3d57e540..eeb31ebb 100644 --- a/indexer/core/src/lib.rs +++ b/indexer/core/src/lib.rs @@ -48,7 +48,7 @@ impl IndexerCore { .iter() .map(|init_comm_data| { let npk = &init_comm_data.npk; - let account_id = nssa::AccountId::from((npk, 0)); + let account_id = nssa::AccountId::for_regular_private_account(npk, 0); let mut acc = init_comm_data.account.clone(); diff --git a/integration_tests/src/config.rs b/integration_tests/src/config.rs index 7b3825de..9174163a 100644 --- a/integration_tests/src/config.rs +++ b/integration_tests/src/config.rs @@ -60,11 +60,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.nullifier_public_key, 0)); + AccountId::for_regular_private_account(&private_charlie_key_chain.nullifier_public_key, 0); 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, 0)); + AccountId::for_regular_private_account(&private_david_key_chain.nullifier_public_key, 0); // Ensure consistent ordering if private_charlie_account_id > private_david_account_id { diff --git a/integration_tests/tests/auth_transfer/private.rs b/integration_tests/tests/auth_transfer/private.rs index 8db5f8d4..4d268b89 100644 --- a/integration_tests/tests/auth_transfer/private.rs +++ b/integration_tests/tests/auth_transfer/private.rs @@ -605,14 +605,14 @@ async fn shielded_transfers_to_two_identifiers_same_npk() -> Result<()> { .await?; // Both accounts must be discovered with the correct balances. - let account_id_1 = AccountId::from((&npk, identifier_1)); + let account_id_1 = AccountId::for_regular_private_account(&npk, identifier_1); let acc_1 = ctx .wallet() .get_account_private(account_id_1) .context("account for identifier 1 not found after sync")?; assert_eq!(acc_1.balance, 100); - let account_id_2 = AccountId::from((&npk, identifier_2)); + let account_id_2 = AccountId::for_regular_private_account(&npk, identifier_2); let acc_2 = ctx .wallet() .get_account_private(account_id_2) diff --git a/integration_tests/tests/tps.rs b/integration_tests/tests/tps.rs index df74daba..1f132932 100644 --- a/integration_tests/tests/tps.rs +++ b/integration_tests/tests/tps.rs @@ -220,7 +220,7 @@ fn build_privacy_transaction() -> PrivacyPreservingTransaction { data: Data::default(), }, true, - AccountId::from((&sender_npk, 0)), + AccountId::for_regular_private_account(&sender_npk, 0), ); let recipient_nsk = [2; 32]; let recipient_vsk = [99; 32]; @@ -229,7 +229,7 @@ fn build_privacy_transaction() -> PrivacyPreservingTransaction { let recipient_pre = AccountWithMetadata::new( Account::default(), false, - AccountId::from((&recipient_npk, 0)), + AccountId::for_regular_private_account(&recipient_npk, 0), ); let eph_holder_from = EphemeralKeyHolder::new(&sender_npk); diff --git a/integration_tests/tests/wallet_ffi.rs b/integration_tests/tests/wallet_ffi.rs index db84b066..a0904a9a 100644 --- a/integration_tests/tests/wallet_ffi.rs +++ b/integration_tests/tests/wallet_ffi.rs @@ -801,7 +801,7 @@ fn test_wallet_ffi_transfer_shielded() -> Result<()> { let (to, to_keys) = unsafe { let mut out_keys = FfiPrivateAccountKeys::default(); wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys); - let account_id = nssa::AccountId::from((&out_keys.npk(), 0_u128)); + let account_id = nssa::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); let to: FfiBytes32 = (&account_id).into(); (to, out_keys) }; @@ -935,7 +935,7 @@ fn test_wallet_ffi_transfer_private() -> Result<()> { let (to, to_keys) = unsafe { let mut out_keys = FfiPrivateAccountKeys::default(); wallet_ffi_create_private_accounts_key(wallet_ffi_handle, &raw mut out_keys); - let account_id = nssa::AccountId::from((&out_keys.npk(), 0_u128)); + let account_id = nssa::AccountId::for_regular_private_account(&out_keys.npk(), 0_u128); let to: FfiBytes32 = (&account_id).into(); (to, out_keys) }; diff --git a/key_protocol/src/key_management/key_tree/mod.rs b/key_protocol/src/key_management/key_tree/mod.rs index 47999ec7..f1d1c8fd 100644 --- a/key_protocol/src/key_management/key_tree/mod.rs +++ b/key_protocol/src/key_management/key_tree/mod.rs @@ -274,7 +274,7 @@ impl KeyTree { identifier: Identifier, ) -> Option { let node = self.key_map.get(cci)?; - let account_id = nssa::AccountId::from((&node.value.0.nullifier_public_key, identifier)); + let account_id = nssa::AccountId::for_regular_private_account(&node.value.0.nullifier_public_key, identifier); if self.account_id_map.contains_key(&account_id) { return None; } diff --git a/nssa/core/src/circuit_io.rs b/nssa/core/src/circuit_io.rs index 107fac60..cf1052cf 100644 --- a/nssa/core/src/circuit_io.rs +++ b/nssa/core/src/circuit_io.rs @@ -30,7 +30,7 @@ pub enum InputAccountIdentity { Public, /// Init of an authorized standalone private account: no membership proof. The `pre_state` /// must be `Account::default()`. The `account_id` is derived as - /// `AccountId::from((&NullifierPublicKey::from(nsk), identifier))` and matched against + /// `AccountId::for_regular_private_account(&NullifierPublicKey::from(nsk), identifier)` and matched against /// `pre_state.account_id`. PrivateAuthorizedInit { ssk: SharedSecretKey, diff --git a/nssa/core/src/nullifier.rs b/nssa/core/src/nullifier.rs index aafe3f7c..ab23ddc0 100644 --- a/nssa/core/src/nullifier.rs +++ b/nssa/core/src/nullifier.rs @@ -12,10 +12,11 @@ pub type Identifier = u128; #[cfg_attr(any(feature = "host", test), derive(Hash))] pub struct NullifierPublicKey(pub [u8; 32]); -impl From<(&NullifierPublicKey, Identifier)> for AccountId { - fn from(value: (&NullifierPublicKey, Identifier)) -> Self { - let (npk, identifier) = value; - +impl AccountId { + /// Derives an [`AccountId`] for a regular (non-PDA) private account from the nullifier public + /// key and identifier. + #[must_use] + pub fn for_regular_private_account(npk: &NullifierPublicKey, identifier: Identifier) -> Self { // 32 bytes prefix || 32 bytes npk || 16 bytes identifier let mut bytes = [0; 80]; bytes[0..32].copy_from_slice(PRIVATE_ACCOUNT_ID_PREFIX); @@ -31,6 +32,12 @@ impl From<(&NullifierPublicKey, Identifier)> for AccountId { } } +impl From<(&NullifierPublicKey, Identifier)> for AccountId { + fn from((npk, identifier): (&NullifierPublicKey, Identifier)) -> Self { + Self::for_regular_private_account(npk, identifier) + } +} + impl AsRef<[u8]> for NullifierPublicKey { fn as_ref(&self) -> &[u8] { self.0.as_slice() @@ -155,7 +162,7 @@ mod tests { 253, 105, 164, 89, 84, 40, 191, 182, 119, 64, 255, 67, 142, ]); - let account_id = AccountId::from((&npk, 0)); + let account_id = AccountId::for_regular_private_account(&npk, 0); assert_eq!(account_id, expected_account_id); } @@ -172,7 +179,7 @@ mod tests { 56, 247, 99, 121, 165, 182, 234, 255, 19, 127, 191, 72, ]); - let account_id = AccountId::from((&npk, 1)); + let account_id = AccountId::for_regular_private_account(&npk, 1); assert_eq!(account_id, expected_account_id); } @@ -190,7 +197,7 @@ mod tests { 19, 245, 25, 214, 162, 209, 135, 252, 82, 27, 2, 174, 196, ]); - let account_id = AccountId::from((&npk, identifier)); + let account_id = AccountId::for_regular_private_account(&npk, identifier); assert_eq!(account_id, expected_account_id); } diff --git a/nssa/core/src/program.rs b/nssa/core/src/program.rs index 1bd2a5d5..4bbe5926 100644 --- a/nssa/core/src/program.rs +++ b/nssa/core/src/program.rs @@ -190,7 +190,9 @@ impl AccountId { #[must_use] pub fn for_private_account(npk: &NullifierPublicKey, kind: &PrivateAccountKind) -> Self { match kind { - PrivateAccountKind::Regular(identifier) => Self::from((npk, *identifier)), + PrivateAccountKind::Regular(identifier) => { + Self::for_regular_private_account(npk, *identifier) + } PrivateAccountKind::Pda { program_id, seed, @@ -1078,7 +1080,7 @@ mod tests { assert_eq!( AccountId::for_private_account(&npk, &PrivateAccountKind::Regular(identifier)), - AccountId::from((&npk, identifier)), + AccountId::for_regular_private_account(&npk, identifier), ); assert_eq!( AccountId::for_private_account( diff --git a/nssa/src/privacy_preserving_transaction/circuit.rs b/nssa/src/privacy_preserving_transaction/circuit.rs index 750e7602..400f36c8 100644 --- a/nssa/src/privacy_preserving_transaction/circuit.rs +++ b/nssa/src/privacy_preserving_transaction/circuit.rs @@ -222,7 +222,7 @@ mod tests { AccountId::new([0; 32]), ); - let recipient_account_id = AccountId::from((&recipient_keys.npk(), 0)); + let recipient_account_id = AccountId::for_regular_private_account(&recipient_keys.npk(), 0); let recipient = AccountWithMetadata::new(Account::default(), false, recipient_account_id); let balance_to_move: u128 = 37; @@ -296,12 +296,12 @@ mod tests { data: Data::default(), }, true, - AccountId::from((&sender_keys.npk(), 0)), + AccountId::for_regular_private_account(&sender_keys.npk(), 0), ); - let sender_account_id = AccountId::from((&sender_keys.npk(), 0)); + let sender_account_id = AccountId::for_regular_private_account(&sender_keys.npk(), 0); let commitment_sender = Commitment::new(&sender_account_id, &sender_pre.account); - let recipient_account_id = AccountId::from((&recipient_keys.npk(), 0)); + let recipient_account_id = AccountId::for_regular_private_account(&recipient_keys.npk(), 0); let recipient = AccountWithMetadata::new(Account::default(), false, recipient_account_id); let balance_to_move: u128 = 37; @@ -397,7 +397,7 @@ mod tests { let pre = AccountWithMetadata::new( Account::default(), false, - AccountId::from((&account_keys.npk(), 0)), + AccountId::for_regular_private_account(&account_keys.npk(), 0), ); let validity_window_chain_caller = Program::validity_window_chain_caller(); @@ -582,7 +582,7 @@ mod tests { let keys = test_private_account_keys_1(); let identifier: u128 = 99; let ssk = SharedSecretKey::new(&[55; 32], &keys.vpk()); - let account_id = AccountId::from((&keys.npk(), identifier)); + let account_id = AccountId::for_regular_private_account(&keys.npk(), identifier); let pre = AccountWithMetadata::new(Account::default(), true, account_id); let (output, _) = execute_and_prove( @@ -621,7 +621,7 @@ mod tests { true, AccountId::new([0; 32]), ); - let recipient_id = AccountId::from((&keys.npk(), identifier)); + let recipient_id = AccountId::for_regular_private_account(&keys.npk(), identifier); let recipient = AccountWithMetadata::new(Account::default(), false, recipient_id); let (output, _) = execute_and_prove( @@ -653,7 +653,7 @@ mod tests { let keys = test_private_account_keys_1(); let identifier: u128 = 99; let ssk = SharedSecretKey::new(&[55; 32], &keys.vpk()); - let account_id = AccountId::from((&keys.npk(), identifier)); + let account_id = AccountId::for_regular_private_account(&keys.npk(), identifier); let account = Account { program_owner: program.id(), balance: 1, diff --git a/nssa/src/privacy_preserving_transaction/message.rs b/nssa/src/privacy_preserving_transaction/message.rs index 54c2d69f..d86273d8 100644 --- a/nssa/src/privacy_preserving_transaction/message.rs +++ b/nssa/src/privacy_preserving_transaction/message.rs @@ -169,10 +169,10 @@ pub mod tests { let encrypted_private_post_states = Vec::new(); - let account_id2 = nssa_core::account::AccountId::from((&npk2, 0)); + let account_id2 = nssa_core::account::AccountId::for_regular_private_account(&npk2, 0); let new_commitments = vec![Commitment::new(&account_id2, &account2)]; - let account_id1 = nssa_core::account::AccountId::from((&npk1, 0)); + let account_id1 = nssa_core::account::AccountId::for_regular_private_account(&npk1, 0); let old_commitment = Commitment::new(&account_id1, &account1); let new_nullifiers = vec![( Nullifier::for_account_update(&old_commitment, &nsk1), @@ -248,7 +248,7 @@ pub mod tests { let npk = NullifierPublicKey::from(&[1; 32]); let vpk = ViewingPublicKey::from_scalar([2; 32]); let account = Account::default(); - let account_id = nssa_core::account::AccountId::from((&npk, 0)); + let account_id = nssa_core::account::AccountId::for_regular_private_account(&npk, 0); let commitment = Commitment::new(&account_id, &account); let esk = [3; 32]; let shared_secret = SharedSecretKey::new(&esk, &vpk); diff --git a/nssa/src/state.rs b/nssa/src/state.rs index 5e09ab04..511f7518 100644 --- a/nssa/src/state.rs +++ b/nssa/src/state.rs @@ -459,7 +459,7 @@ pub mod tests { #[must_use] pub fn with_private_account(mut self, keys: &TestPrivateKeys, account: &Account) -> Self { - let account_id = AccountId::from((&keys.npk(), 0)); + let account_id = AccountId::for_regular_private_account(&keys.npk(), 0); let commitment = Commitment::new(&account_id, account); self.private_state.0.extend(&[commitment]); self @@ -618,8 +618,8 @@ pub mod tests { ..Account::default() }; - let account_id1 = AccountId::from((&keys1.npk(), 0)); - let account_id2 = AccountId::from((&keys2.npk(), 0)); + let account_id1 = AccountId::for_regular_private_account(&keys1.npk(), 0); + let account_id2 = AccountId::for_regular_private_account(&keys2.npk(), 0); let init_commitment1 = Commitment::new(&account_id1, &account); let init_commitment2 = Commitment::new(&account_id2, &account); @@ -1332,7 +1332,7 @@ pub mod tests { state: &V03State, ) -> PrivacyPreservingTransaction { let program = Program::authenticated_transfer_program(); - let sender_account_id = AccountId::from((&sender_keys.npk(), 0)); + let sender_account_id = AccountId::for_regular_private_account(&sender_keys.npk(), 0); let sender_commitment = Commitment::new(&sender_account_id, sender_private_account); let sender_pre = AccountWithMetadata::new( sender_private_account.clone(), @@ -1396,7 +1396,7 @@ pub mod tests { state: &V03State, ) -> PrivacyPreservingTransaction { let program = Program::authenticated_transfer_program(); - let sender_account_id = AccountId::from((&sender_keys.npk(), 0)); + let sender_account_id = AccountId::for_regular_private_account(&sender_keys.npk(), 0); let sender_commitment = Commitment::new(&sender_account_id, sender_private_account); let sender_pre = AccountWithMetadata::new( sender_private_account.clone(), @@ -1511,8 +1511,8 @@ pub mod tests { &state, ); - let sender_account_id = AccountId::from((&sender_keys.npk(), 0)); - let recipient_account_id = AccountId::from((&recipient_keys.npk(), 0)); + let sender_account_id = AccountId::for_regular_private_account(&sender_keys.npk(), 0); + let recipient_account_id = AccountId::for_regular_private_account(&recipient_keys.npk(), 0); let expected_new_commitment_1 = Commitment::new( &sender_account_id, &Account { @@ -1590,7 +1590,7 @@ pub mod tests { &state, ); - let sender_account_id = AccountId::from((&sender_keys.npk(), 0)); + let sender_account_id = AccountId::for_regular_private_account(&sender_keys.npk(), 0); let expected_new_commitment = Commitment::new( &sender_account_id, &Account { @@ -2826,7 +2826,7 @@ pub mod tests { balance: 100, ..Account::default() }; - let sender_account_id = AccountId::from((&sender_keys.npk(), 0)); + let sender_account_id = AccountId::for_regular_private_account(&sender_keys.npk(), 0); let sender_commitment = Commitment::new(&sender_account_id, &sender_private_account); let sender_init_nullifier = Nullifier::for_account_initialization(&sender_account_id); let mut state = V03State::new_with_genesis_accounts( @@ -2919,8 +2919,8 @@ pub mod tests { (&to_keys.npk(), 0), ); - let from_account_id = AccountId::from((&from_keys.npk(), 0)); - let to_account_id = AccountId::from((&to_keys.npk(), 0)); + let from_account_id = AccountId::for_regular_private_account(&from_keys.npk(), 0); + let to_account_id = AccountId::for_regular_private_account(&to_keys.npk(), 0); let from_commitment = Commitment::new(&from_account_id, &from_account.account); let to_commitment = Commitment::new(&to_account_id, &to_account.account); let from_init_nullifier = Nullifier::for_account_initialization(&from_account_id); @@ -3280,7 +3280,7 @@ pub mod tests { let result = state.transition_from_privacy_preserving_transaction(&tx, 1, 0); assert!(result.is_ok()); - let account_id = AccountId::from((&private_keys.npk(), 0)); + let account_id = AccountId::for_regular_private_account(&private_keys.npk(), 0); let nullifier = Nullifier::for_account_initialization(&account_id); assert!(state.private_state.1.contains(&nullifier)); } @@ -3329,7 +3329,7 @@ pub mod tests { .transition_from_privacy_preserving_transaction(&tx, 1, 0) .unwrap(); - let account_id = AccountId::from((&private_keys.npk(), 0)); + let account_id = AccountId::for_regular_private_account(&private_keys.npk(), 0); let nullifier = Nullifier::for_account_initialization(&account_id); assert!(state.private_state.1.contains(&nullifier)); } @@ -3386,7 +3386,7 @@ pub mod tests { ); // Verify the account is now initialized (nullifier exists) - let account_id = AccountId::from((&private_keys.npk(), 0)); + let account_id = AccountId::for_regular_private_account(&private_keys.npk(), 0); let nullifier = Nullifier::for_account_initialization(&account_id); assert!(state.private_state.1.contains(&nullifier)); @@ -3541,7 +3541,7 @@ pub mod tests { let recipient_account = AccountWithMetadata::new(Account::default(), true, (&recipient_keys.npk(), 0)); - let recipient_account_id = AccountId::from((&recipient_keys.npk(), 0)); + let recipient_account_id = AccountId::for_regular_private_account(&recipient_keys.npk(), 0); let recipient_commitment = Commitment::new(&recipient_account_id, &recipient_account.account); let recipient_init_nullifier = Nullifier::for_account_initialization(&recipient_account_id); diff --git a/program_methods/guest/src/bin/privacy_preserving_circuit.rs b/program_methods/guest/src/bin/privacy_preserving_circuit.rs index c8753350..3e02c169 100644 --- a/program_methods/guest/src/bin/privacy_preserving_circuit.rs +++ b/program_methods/guest/src/bin/privacy_preserving_circuit.rs @@ -521,7 +521,7 @@ fn compute_circuit_output( identifier, } => { let npk = NullifierPublicKey::from(nsk); - let account_id = AccountId::from((&npk, *identifier)); + let account_id = AccountId::for_regular_private_account(&npk, *identifier); assert_eq!(account_id, pre_state.account_id, "AccountId mismatch"); assert!( @@ -558,7 +558,7 @@ fn compute_circuit_output( identifier, } => { let npk = NullifierPublicKey::from(nsk); - let account_id = AccountId::from((&npk, *identifier)); + let account_id = AccountId::for_regular_private_account(&npk, *identifier); assert_eq!(account_id, pre_state.account_id, "AccountId mismatch"); assert!( @@ -590,7 +590,7 @@ fn compute_circuit_output( ssk, identifier, } => { - let account_id = AccountId::from((npk, *identifier)); + let account_id = AccountId::for_regular_private_account(npk, *identifier); assert_eq!(account_id, pre_state.account_id, "AccountId mismatch"); assert_eq!( diff --git a/sequencer/core/src/lib.rs b/sequencer/core/src/lib.rs index bce8151f..df9aa87c 100644 --- a/sequencer/core/src/lib.rs +++ b/sequencer/core/src/lib.rs @@ -141,7 +141,7 @@ impl SequencerCore { .iter() .map(|init_comm_data| { let npk = &init_comm_data.npk; - let account_id = nssa::AccountId::from((npk, 0)); + let account_id = nssa::AccountId::for_regular_private_account(npk, 0); let mut acc = init_comm_data.account.clone(); diff --git a/testnet_initial_state/src/lib.rs b/testnet_initial_state/src/lib.rs index f6f1e288..2c0ceaba 100644 --- a/testnet_initial_state/src/lib.rs +++ b/testnet_initial_state/src/lib.rs @@ -103,7 +103,7 @@ pub struct PrivateAccountPrivateInitialData { impl PrivateAccountPrivateInitialData { #[must_use] pub fn account_id(&self) -> nssa::AccountId { - nssa::AccountId::from((&self.key_chain.nullifier_public_key, self.identifier)) + nssa::AccountId::for_regular_private_account(&self.key_chain.nullifier_public_key, self.identifier) } } @@ -208,7 +208,7 @@ pub fn initial_state() -> V03State { .iter() .map(|init_comm_data| { let npk = &init_comm_data.npk; - let account_id = nssa::AccountId::from((npk, 0)); + let account_id = nssa::AccountId::for_regular_private_account(npk, 0); let mut acc = init_comm_data.account.clone(); diff --git a/wallet/src/lib.rs b/wallet/src/lib.rs index 9011ddfc..2a31ea4b 100644 --- a/wallet/src/lib.rs +++ b/wallet/src/lib.rs @@ -282,7 +282,7 @@ impl WalletCore { .value .0 .nullifier_public_key; - let account_id = AccountId::from((&npk, identifier)); + let account_id = AccountId::for_regular_private_account(&npk, identifier); self.storage.insert_private_account_data( account_id, &PrivateAccountKind::Regular(identifier), @@ -544,21 +544,7 @@ impl WalletCore { ) .map(|(kind, res_acc)| { let npk = &key_chain.nullifier_public_key; - let account_id = match &kind { - PrivateAccountKind::Regular(identifier) => { - nssa::AccountId::from((npk, *identifier)) - } - PrivateAccountKind::Pda { - program_id, - seed, - identifier, - } => nssa::AccountId::for_private_pda( - program_id, - seed, - npk, - *identifier, - ), - }; + let account_id = nssa::AccountId::for_private_account(npk, &kind); (account_id, kind, res_acc) }) }) diff --git a/wallet/src/privacy_preserving_tx.rs b/wallet/src/privacy_preserving_tx.rs index a42efd3c..c37017c3 100644 --- a/wallet/src/privacy_preserving_tx.rs +++ b/wallet/src/privacy_preserving_tx.rs @@ -20,10 +20,10 @@ pub enum PrivacyPreservingAccount { identifier: Identifier, }, /// An owned private PDA: wallet holds the nsk/npk; `account_id` was derived via - /// `AccountId::for_private_pda`. Produces visibility mask 3. + /// [`AccountId::for_private_pda`]. PrivatePdaOwned(AccountId), /// A foreign private PDA: wallet knows the recipient's npk/vpk but not their nsk. - /// Produces visibility mask 3 with a default (uninitialised) account. + /// Uses a default (uninitialised) account. PrivatePdaForeign { account_id: AccountId, npk: NullifierPublicKey,