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

44 lines
1.1 KiB
Rust
Raw Normal View History

2020-07-26 10:34:58 -07:00
//! Sapling notes
#![allow(clippy::unit_arg)]
2020-05-26 18:00:58 -07:00
#![allow(dead_code)]
mod ciphertexts;
mod nullifiers;
#[cfg(any(test, feature = "proptest-impl"))]
mod arbitrary;
use crate::{
amount::{Amount, NonNegative},
2020-08-15 18:50:18 -07:00
transaction::Memo,
};
use super::{
commitment::CommitmentRandomness,
keys::{Diversifier, TransmissionKey},
};
pub use ciphertexts::{EncryptedNote, WrappedNoteKey};
pub use nullifiers::Nullifier;
2020-07-09 18:20:50 -07:00
/// A Note represents that a value is spendable by the recipient who
/// holds the spending key corresponding to a given shielded payment
/// address.
2020-08-28 00:54:31 -07:00
#[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,
2020-08-28 00:54:31 -07:00
/// The note memo, after decryption
pub memo: Memo,
}