Zebra/zebra-chain/src/notes/sapling.rs

45 lines
1.2 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)]
#[cfg(test)]
mod arbitrary;
mod ciphertexts;
mod nullifiers;
use crate::{
commitments::sapling::CommitmentRandomness,
keys::sapling::{Diversifier, TransmissionKey},
notes::memo::Memo,
types::amount::{Amount, NonNegative},
};
pub use ciphertexts::{EncryptedCiphertext, OutCiphertext};
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.
pub struct Note {
/// The diversier of the recipients shielded payment address.
pub diversifier: Diversifier,
/// The diversied 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 decrypted form of encrypted Sapling notes on the blockchain.
pub struct NotePlaintext {
diversifier: Diversifier,
value: Amount<NonNegative>,
rcm: CommitmentRandomness,
memo: Memo,
}