2020-07-26 10:34:58 -07:00
|
|
|
|
//! Sapling notes
|
2020-07-24 17:57:52 -07:00
|
|
|
|
|
2020-07-09 01:20:20 -07:00
|
|
|
|
#![allow(clippy::unit_arg)]
|
2020-05-26 18:00:58 -07:00
|
|
|
|
#![allow(dead_code)]
|
2020-04-19 11:45:25 -07:00
|
|
|
|
|
2020-07-15 01:50:05 -07:00
|
|
|
|
mod ciphertexts;
|
|
|
|
|
mod nullifiers;
|
2020-02-10 15:17:41 -08:00
|
|
|
|
|
2020-09-23 18:52:52 -07:00
|
|
|
|
#[cfg(any(test, feature = "proptest-impl"))]
|
2020-08-15 18:02:07 -07:00
|
|
|
|
mod arbitrary;
|
|
|
|
|
|
2020-07-09 01:20:20 -07:00
|
|
|
|
use crate::{
|
2020-08-14 23:15:36 -07:00
|
|
|
|
amount::{Amount, NonNegative},
|
2020-08-15 18:50:18 -07:00
|
|
|
|
transaction::Memo,
|
2020-07-09 01:20:20 -07:00
|
|
|
|
};
|
|
|
|
|
|
2020-08-15 18:02:07 -07:00
|
|
|
|
use super::{
|
|
|
|
|
commitment::CommitmentRandomness,
|
|
|
|
|
keys::{Diversifier, TransmissionKey},
|
|
|
|
|
};
|
|
|
|
|
|
2020-08-27 21:32:01 -07:00
|
|
|
|
pub use ciphertexts::{EncryptedNote, WrappedNoteKey};
|
2020-07-27 16:02:33 -07:00
|
|
|
|
|
2020-07-15 01:50:05 -07:00
|
|
|
|
pub use nullifiers::Nullifier;
|
2020-07-09 18:20:50 -07:00
|
|
|
|
|
2020-07-09 01:20:20 -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)]
|
2020-02-21 16:35:24 -08:00
|
|
|
|
pub struct Note {
|
2020-08-05 16:06:51 -07:00
|
|
|
|
/// The diversifer of the recipient’s shielded payment address.
|
2020-07-27 16:02:33 -07:00
|
|
|
|
pub diversifier: Diversifier,
|
2020-08-05 16:00:53 -07:00
|
|
|
|
/// The diversified transmission key of the recipient’s shielded
|
2020-07-27 16:02:33 -07:00
|
|
|
|
/// 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,
|
2020-02-10 15:17:41 -08:00
|
|
|
|
}
|