More Note refinements
This commit is contained in:
parent
2c285985c8
commit
15899bc6d3
|
@ -40,6 +40,10 @@ impl ZcashSerialize for Nullifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The randomness used in the Pedersen Hash for note commitment.
|
||||||
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
|
pub struct NoteCommitmentRandomness(redjubjub::Randomizer);
|
||||||
|
|
||||||
/// A Note represents that a value is spendable by the recipient who
|
/// A Note represents that a value is spendable by the recipient who
|
||||||
/// holds the spending key corresponding to a given shielded payment
|
/// holds the spending key corresponding to a given shielded payment
|
||||||
/// address.
|
/// address.
|
||||||
|
@ -53,8 +57,7 @@ pub struct Note {
|
||||||
/// The decrypted form of encrypted Sapling notes on the blockchain.
|
/// The decrypted form of encrypted Sapling notes on the blockchain.
|
||||||
pub struct NotePlaintext {
|
pub struct NotePlaintext {
|
||||||
diversifier: Diversifier,
|
diversifier: Diversifier,
|
||||||
value: u64,
|
value: Amount<NonNegative>,
|
||||||
// TODO: refine as jub-jub appropriate in the base field.
|
|
||||||
note_commitment_randomness: NoteCommitmentRandomness,
|
note_commitment_randomness: NoteCommitmentRandomness,
|
||||||
memo: memo::Memo,
|
memo: memo::Memo,
|
||||||
}
|
}
|
||||||
|
|
|
@ -53,6 +53,16 @@ impl ZcashSerialize for Nullifier {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
/// The randomness used in the Pedersen Hash for note commitment.
|
||||||
|
#[derive(Copy, Clone, Debug, PartialEq)]
|
||||||
|
pub struct NoteCommitmentRandomness(pub [u8; 32]);
|
||||||
|
|
||||||
|
impl AsRef<[u8]> for NoteCommitmentRandomness {
|
||||||
|
fn as_ref(&self) -> &[u8] {
|
||||||
|
&self.0
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
/// A Note represents that a value is spendable by the recipient who
|
/// A Note represents that a value is spendable by the recipient who
|
||||||
/// holds the spending key corresponding to a given shielded payment
|
/// holds the spending key corresponding to a given shielded payment
|
||||||
/// address.
|
/// address.
|
||||||
|
|
Loading…
Reference in New Issue