zebra/zebra-chain/src/sapling/note.rs

44 lines
1.1 KiB
Rust
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

//! Sapling notes
#![allow(clippy::unit_arg)]
#![allow(dead_code)]
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 recipients shielded payment address.
pub diversifier: Diversifier,
/// The diversified transmission key of the recipients 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,
}