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

45 lines
1.2 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)]
#[cfg(test)]
mod arbitrary;
mod ciphertexts;
mod nullifiers;
use crate::{
amount::{Amount, NonNegative},
commitments::sapling::CommitmentRandomness,
keys::sapling::{Diversifier, TransmissionKey},
notes::memo::Memo,
};
pub use ciphertexts::{EncryptedCiphertext, OutCiphertext};
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.
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-02-22 15:22:28 -08:00
/// The decrypted form of encrypted Sapling notes on the blockchain.
pub struct NotePlaintext {
diversifier: Diversifier,
2020-07-09 18:20:50 -07:00
value: Amount<NonNegative>,
rcm: CommitmentRandomness,
memo: Memo,
}