Add the beginnings of Sprout and Sapling key types

This commit is contained in:
Deirdre Connolly 2020-03-13 18:58:02 -04:00 committed by Deirdre Connolly
parent b4832ab7cb
commit 7af9b80f3b
3 changed files with 29 additions and 0 deletions

View File

@ -1,3 +1,5 @@
//! Address types.
pub mod sapling;
pub mod sprout;
pub mod transparent;

View File

@ -1,4 +1,11 @@
//! Sapling key types
//!
//! "The spend authorizing key ask, proof authorizing key (ak, nsk),
//! full viewing key (ak, nk, ovk), incoming viewing key ivk, and each
//! diversied payment address addr_d = (d, pk_d ) are derived from sk,
//! as described in [Sapling Key Components][ps]."
//!
//! [ps]: https://zips.z.cash/protocol/protocol.pdf#saplingkeycomponents
use std::{
fmt,

View File

@ -1,4 +1,10 @@
//! Sprout key types
//!
//! "The receiving key sk_enc, the incoming viewing key ivk = (apk,
//! sk_enc), and the shielded payment address addr_pk = (a_pk, pk_enc) are
//! derived from a_sk, as described in [Sprout Key Components][ps]
//!
//! [ps]: https://zips.z.cash/protocol/protocol.pdf#sproutkeycomponents
use std::{
fmt,
@ -12,6 +18,20 @@ use proptest_derive::Arbitrary;
use crate::serialization::{SerializationError, ZcashDeserialize, ZcashSerialize};
/// All other Sprout key types derive from the SpendingKey value.
pub struct SpendingKey;
pub struct ReceivingKey;
pub struct PayingKey;
pub struct TransmissionKey;
pub struct IncomingViewingKey {
paying_key: PayingKey,
receiving_key: ReceivingKey,
}
#[cfg(test)]
proptest! {