zebra_chain/sprout/
note.rs

1//! Sprout notes
2
3mod ciphertexts;
4mod mac;
5mod nullifiers;
6
7#[cfg(any(test, feature = "proptest-impl"))]
8mod arbitrary;
9
10use crate::{
11    amount::{Amount, NonNegative},
12    transaction::Memo,
13};
14
15use super::{commitment::CommitmentRandomness, keys::PayingKey};
16
17pub use mac::Mac;
18
19pub use ciphertexts::EncryptedNote;
20
21pub use nullifiers::{Nullifier, NullifierSeed};
22
23/// A Note represents that a value is spendable by the recipient who
24/// holds the spending key corresponding to a given shielded payment
25/// address.
26///
27/// <https://zips.z.cash/protocol/protocol.pdf#notes>
28#[derive(Clone, Debug)]
29#[cfg_attr(
30    any(test, feature = "proptest-impl"),
31    derive(proptest_derive::Arbitrary)
32)]
33pub struct Note {
34    /// The paying key of the recipient's shielded payment address
35    pub paying_key: PayingKey,
36    /// An integer representing the value of the note in zatoshi (1 ZEC
37    /// = 10^8 zatoshi)
38    pub value: Amount<NonNegative>,
39    /// Input to PRF^nf to derive the nullifier of the note
40    pub rho: NullifierSeed,
41    /// A random commitment trapdoor
42    pub rcm: CommitmentRandomness,
43    /// The note memo, after decryption
44    pub memo: Memo,
45}