Skip to content

Commit

Permalink
Move ovk to be derived from fvk instead of the spending key
Browse files Browse the repository at this point in the history
  • Loading branch information
str4d committed Feb 8, 2021
1 parent 1add6a7 commit bf9e77b
Showing 1 changed file with 17 additions and 14 deletions.
31 changes: 17 additions & 14 deletions src/keys.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,17 +39,6 @@ impl From<&SpendingKey> for NullifierDerivingKey {
}
}

/// A key that provides the capability to recover outgoing transaction information from
/// the block chain.
#[derive(Debug)]
pub struct OutgoingViewingKey;

impl From<&SpendingKey> for OutgoingViewingKey {
fn from(_: &SpendingKey) -> Self {
todo!()
}
}

/// A key that provides the capability to view incoming and outgoing transactions.
///
/// This key is useful anywhere you need to maintain accurate balance, but do not want the
Expand All @@ -60,7 +49,7 @@ impl From<&SpendingKey> for OutgoingViewingKey {
pub struct FullViewingKey {
ak: AuthorizingKey,
nk: NullifierDerivingKey,
ovk: OutgoingViewingKey,
rivk: (),
}

impl From<&SpendingKey> for FullViewingKey {
Expand All @@ -87,8 +76,8 @@ pub struct Diversifier([u8; 11]);
/// This key is useful in situations where you only need the capability to detect inbound
/// payments, such as merchant terminals.
///
/// This key is not suitable for use in a wallet, as it cannot maintain accurate balance.
/// You should use a [`FullViewingKey`] instead.
/// This key is not suitable for use on its own in a wallet, as it cannot maintain
/// accurate balance. You should use a [`FullViewingKey`] instead.
#[derive(Debug)]
pub struct IncomingViewingKey;

Expand All @@ -104,3 +93,17 @@ impl IncomingViewingKey {
todo!()
}
}

/// A key that provides the capability to recover outgoing transaction information from
/// the block chain.
///
/// This key is not suitable for use on its own in a wallet, as it cannot maintain
/// accurate balance. You should use a [`FullViewingKey`] instead.
#[derive(Debug)]
pub struct OutgoingViewingKey;

impl From<&FullViewingKey> for OutgoingViewingKey {
fn from(_: &FullViewingKey) -> Self {
todo!()
}
}

0 comments on commit bf9e77b

Please sign in to comment.