diff --git a/zebra-chain/src/note_encryption.rs b/zebra-chain/src/note_encryption.rs index 86942a35..bdf3125e 100644 --- a/zebra-chain/src/note_encryption.rs +++ b/zebra-chain/src/note_encryption.rs @@ -2,3 +2,9 @@ mod memo; mod sapling; mod sprout; + +#[derive(Copy, Clone, Debug, PartialEq)] +pub struct Diversifier(pub [u8; 11]); + +#[derive(Copy, Clone, Debug, PartialEq)] +pub struct NoteCommitmentRandomness(pub [u8; 32]); diff --git a/zebra-chain/src/note_encryption/sapling.rs b/zebra-chain/src/note_encryption/sapling.rs index 9fcb5efe..b78ab3d0 100644 --- a/zebra-chain/src/note_encryption/sapling.rs +++ b/zebra-chain/src/note_encryption/sapling.rs @@ -5,6 +5,21 @@ use proptest::{arbitrary::Arbitrary, collection::vec, prelude::*}; use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}; +use super::{Diversifier, Memo, NoteCommitmentRandomness}; + +pub struct Note { + value: u64, + diversifier: Diversifier, +} + +pub struct NotePlaintext { + diversifier: Diversifier, + value: u64, + // TODO: refine as jub-jub appropriate in the base field. + note_committment_randomness: NoteCommitmentRandomness, + memo: Memo, +} + /// A ciphertext component for encrypted output notes. pub struct EncryptedCiphertext(pub [u8; 580]); diff --git a/zebra-chain/src/note_encryption/sprout.rs b/zebra-chain/src/note_encryption/sprout.rs index cc3b12dd..ff5005e8 100644 --- a/zebra-chain/src/note_encryption/sprout.rs +++ b/zebra-chain/src/note_encryption/sprout.rs @@ -8,6 +8,17 @@ use proptest::{collection::vec, prelude::*}; use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}; +pub struct Note {} + +pub struct NotePlaintext { + value: u64, + // TODO: refine type + rho: [u8; 32], + // TODO: refine as jub-jub appropriate in the base field. + note_committment_randomness: NoteCommitmentRandomness, + memo: Memo, +} + /// A ciphertext component for encrypted output notes. pub struct EncryptedCiphertext(pub [u8; 601]);