Skip to content

Commit

Permalink
Update create_split_spend
Browse files Browse the repository at this point in the history
  • Loading branch information
ConstanceBeguier committed Jun 20, 2023
1 parent 602e478 commit 1b83a60
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions src/builder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -167,27 +167,23 @@ impl SpendInfo {
}
}

/// Creates a split spend, which is identical to origin normal spend except that we use a random
/// fvk to generate a different nullifier. In addition, the split_flag is raised.
/// Creates a split spend, which is identical to origin normal spend except that
/// `rseed_split_note` contains a random seed. In addition, the split_flag is raised.
///
/// Defined in [Transfer and Burn of Zcash Shielded Assets ZIP-0226 § Split Notes (DRAFT PR)][TransferZSA].
///
/// [TransferZSA]: https://qed-it.github.io/zips/zip-0226.html#split-notes
fn create_split_spend(&self, rng: &mut impl RngCore) -> Self {
let mut note = self.note;
note.is_split_note(rng);
let merkle_path = self.merkle_path.clone();

let sk = SpendingKey::random(rng);
let fvk: FullViewingKey = (&sk).into();

SpendInfo {
dummy_sk: Some(sk),
fvk,
dummy_sk: None,
fvk: self.fvk.clone(),
// We use external scope to avoid unnecessary derivations
scope: Scope::External,
note,
merkle_path,
merkle_path: self.merkle_path.clone(),
split_flag: true,
}
}
Expand Down

0 comments on commit 1b83a60

Please sign in to comment.