diff --git a/book/src/design/nullifiers.md b/book/src/design/nullifiers.md index f84a5145..f9a11bad 100644 --- a/book/src/design/nullifiers.md +++ b/book/src/design/nullifiers.md @@ -246,7 +246,8 @@ The $\mathit{Commit}^{\mathsf{nf}}$ variants were considered to avoid directly d $\mathsf{cm}$ (which in its native type is a base field element, not a group element). We decided instead to follow Sapling by defining an intermediate representation of $\mathsf{cm}$ as a group element, that is only used in nullifier computation. The circuit -already needs to compute $\mathsf{cm}$, so this improves performance by removing +already needs to compute $\mathsf{cm}$, so this improves performance by removing an +additional commitment calculation from the circuit. We also considered variants that used a choice of fixed bases $\mathcal{G_v}$ to provide domain separation for zero-valued notes. The most performant design (similar to the chosen diff --git a/src/builder.rs b/src/builder.rs index 8ccc6274..fd1e9fd5 100644 --- a/src/builder.rs +++ b/src/builder.rs @@ -236,8 +236,16 @@ impl Builder { /// Adds a note to be spent in this transaction. /// + /// - `note` is a spendable note, obtained by trial-decrypting an [`Action`] using the + /// [`zcash_note_encryption`] crate instantiated with [`OrchardDomain`]. + /// - `merkle_path` can be obtained using the [`incrementalmerkletree`] crate + /// instantiated with [`MerkleHashOrchard`]. + /// /// Returns an error if the given Merkle path does not have the required anchor for /// the given note. + /// + /// [`OrchardDomain`]: crate::note_encryption::OrchardDomain + /// [`MerkleHashOrchard`]: crate::tree::MerkleHashOrchard pub fn add_spend( &mut self, fvk: FullViewingKey, diff --git a/src/circuit.rs b/src/circuit.rs index f40a34a0..b61ccb29 100644 --- a/src/circuit.rs +++ b/src/circuit.rs @@ -507,7 +507,7 @@ impl plonk::Circuit for Circuit { let ak = ak_P.extract_p().inner().clone(); let rivk = ScalarFixed::new( ecc_chip.clone(), - layouter.namespace(|| "rcv"), + layouter.namespace(|| "rivk"), self.rivk.map(|rivk| rivk.inner()), )?; @@ -609,7 +609,7 @@ impl plonk::Circuit for Circuit { let rcm_new = ScalarFixed::new( ecc_chip, - layouter.namespace(|| "rcm_old"), + layouter.namespace(|| "rcm_new"), self.rcm_new.as_ref().map(|rcm_new| rcm_new.inner()), )?;