2021-01-21 04:16:50 -08:00
|
|
|
use crate::{keys::FullViewingKey, value::NoteValue, Address};
|
2021-01-20 12:09:09 -08:00
|
|
|
|
2021-02-08 07:21:04 -08:00
|
|
|
/// The ZIP 212 seed randomness for a note.
|
|
|
|
#[derive(Debug)]
|
|
|
|
struct RandomSeed([u8; 32]);
|
|
|
|
|
|
|
|
impl RandomSeed {
|
|
|
|
fn psi(&self) -> () {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn rcm(&self) -> () {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
fn esk(&self) -> () {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
2021-01-20 12:09:09 -08:00
|
|
|
/// A discrete amount of funds received by an address.
|
|
|
|
#[derive(Debug)]
|
2021-01-21 04:16:50 -08:00
|
|
|
pub struct Note {
|
2021-01-20 12:09:09 -08:00
|
|
|
/// The recipient of the funds.
|
2021-01-21 04:16:50 -08:00
|
|
|
recipient: Address,
|
2021-01-20 12:09:09 -08:00
|
|
|
/// The value of this note.
|
2021-01-21 04:16:50 -08:00
|
|
|
value: NoteValue,
|
2021-02-08 07:21:04 -08:00
|
|
|
/// A unique creation ID for this note.
|
|
|
|
///
|
|
|
|
/// This is set to the nullifier of the note that was spent in the [`Action`] that
|
|
|
|
/// created this note.
|
|
|
|
///
|
|
|
|
/// [`Action`]: crate::bundle::Action
|
|
|
|
rho: Nullifier,
|
|
|
|
/// The seed randomness for various note components.
|
|
|
|
rseed: RandomSeed,
|
2021-01-20 12:09:09 -08:00
|
|
|
}
|
|
|
|
|
2021-01-21 04:16:50 -08:00
|
|
|
impl Note {
|
2021-01-20 12:09:09 -08:00
|
|
|
/// Derives the commitment to this note.
|
|
|
|
pub fn commitment(&self) -> NoteCommitment {
|
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
|
|
|
|
/// Derives the nullifier for this note.
|
2021-01-21 04:16:50 -08:00
|
|
|
pub fn nullifier(&self, _: &FullViewingKey) -> Nullifier {
|
2021-01-20 12:09:09 -08:00
|
|
|
todo!()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
/// An encrypted note.
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct EncryptedNote;
|
|
|
|
|
|
|
|
/// A commitment to a note.
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct NoteCommitment;
|
|
|
|
|
|
|
|
/// A unique nullifier for a note.
|
|
|
|
#[derive(Debug)]
|
|
|
|
pub struct Nullifier;
|