Refine Note types a little more
This commit is contained in:
parent
a6a3a640ca
commit
af455f9896
|
|
@ -16,8 +16,13 @@ use super::*;
|
||||||
pub struct Diversifier(pub [u8; 11]);
|
pub struct Diversifier(pub [u8; 11]);
|
||||||
|
|
||||||
pub struct Note {
|
pub struct Note {
|
||||||
value: u64,
|
|
||||||
diversifier: Diversifier,
|
diversifier: Diversifier,
|
||||||
|
// TODO: refine as a type, derived from a scalar mult of the
|
||||||
|
// diversifier as a jubjub group element and the incoming view key
|
||||||
|
// scalar.
|
||||||
|
transmission_key: [u8; 32],
|
||||||
|
value: u64,
|
||||||
|
note_commitment_randomness: NoteCommitmentRandomness,
|
||||||
}
|
}
|
||||||
|
|
||||||
/// The decrypted form of encrypted Sapling notes on the blockchain.
|
/// The decrypted form of encrypted Sapling notes on the blockchain.
|
||||||
|
|
@ -25,7 +30,7 @@ pub struct NotePlaintext {
|
||||||
diversifier: Diversifier,
|
diversifier: Diversifier,
|
||||||
value: u64,
|
value: u64,
|
||||||
// TODO: refine as jub-jub appropriate in the base field.
|
// TODO: refine as jub-jub appropriate in the base field.
|
||||||
note_committment_randomness: NoteCommitmentRandomness,
|
note_commitment_randomness: NoteCommitmentRandomness,
|
||||||
memo: memo::Memo,
|
memo: memo::Memo,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
|
|
@ -10,7 +10,14 @@ use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize}
|
||||||
|
|
||||||
use super::*;
|
use super::*;
|
||||||
|
|
||||||
pub struct Note {}
|
pub struct Note {
|
||||||
|
// TODO: refine type as a SHA-256d output derived from a spending key.
|
||||||
|
paying_key: [u8; 32],
|
||||||
|
value: u64,
|
||||||
|
// TODO: refine type as the input to the PRF that results in a nullifier.
|
||||||
|
nullifier_seed: [u8; 32],
|
||||||
|
note_commitment_randomness: NoteCommitmentRandomness,
|
||||||
|
}
|
||||||
|
|
||||||
/// The decrypted form of encrypted Sprout notes on the blockchain.
|
/// The decrypted form of encrypted Sprout notes on the blockchain.
|
||||||
pub struct NotePlaintext {
|
pub struct NotePlaintext {
|
||||||
|
|
@ -18,7 +25,7 @@ pub struct NotePlaintext {
|
||||||
// TODO: refine type
|
// TODO: refine type
|
||||||
rho: [u8; 32],
|
rho: [u8; 32],
|
||||||
// TODO: refine as jub-jub appropriate in the base field.
|
// TODO: refine as jub-jub appropriate in the base field.
|
||||||
note_committment_randomness: NoteCommitmentRandomness,
|
note_commitment_randomness: NoteCommitmentRandomness,
|
||||||
memo: memo::Memo,
|
memo: memo::Memo,
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
||||||
Loading…
Reference in New Issue