zebra_chain/sapling/
note.rs

1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
//! Sapling notes

mod ciphertexts;
mod nullifiers;

#[cfg(any(test, feature = "proptest-impl"))]
mod arbitrary;

use crate::{
    amount::{Amount, NonNegative},
    transaction::Memo,
};

use super::{
    commitment::CommitmentRandomness,
    keys::{Diversifier, TransmissionKey},
};

pub use ciphertexts::{EncryptedNote, WrappedNoteKey};

pub use nullifiers::Nullifier;

/// A Note represents that a value is spendable by the recipient who
/// holds the spending key corresponding to a given shielded payment
/// address.
#[derive(Clone, Debug)]
pub struct Note {
    /// The diversifer of the recipient's shielded payment address.
    pub diversifier: Diversifier,
    /// The diversified transmission key of the recipient's shielded
    /// payment address.
    pub transmission_key: TransmissionKey,
    /// An integer representing the value of the note in zatoshi.
    pub value: Amount<NonNegative>,
    /// A random commitment trapdoor used to produce the associated
    /// note commitment.
    pub rcm: CommitmentRandomness,
    /// The note memo, after decryption
    pub memo: Memo,
}