mirror of https://github.com/zcash/orchard.git
Merge pull request #415 from zcash/zip32-scope
Use the `zip32::Scope` type
This commit is contained in:
commit
5db6454d38
|
@ -26,7 +26,7 @@ and this project adheres to Rust's notion of
|
|||
### Changed
|
||||
- Migrated to the `zip32` crate. The following types have been replaced by the
|
||||
equivalent ones in that crate are now re-exported from there:
|
||||
- `orchard::keys::DiversifierIndex`
|
||||
- `orchard::keys::{DiversifierIndex, Scope}`
|
||||
- `orchard::zip32::ChildIndex`
|
||||
- `orchard::builder`:
|
||||
- `Builder::new` now takes the bundle type to be used in bundle construction,
|
||||
|
|
20
src/keys.rs
20
src/keys.rs
|
@ -27,7 +27,7 @@ use crate::{
|
|||
zip32::{self, ExtendedSpendingKey},
|
||||
};
|
||||
|
||||
pub use ::zip32::DiversifierIndex;
|
||||
pub use ::zip32::{DiversifierIndex, Scope};
|
||||
|
||||
const KDF_ORCHARD_PERSONALIZATION: &[u8; 16] = b"Zcash_OrchardKDF";
|
||||
const ZIP32_PURPOSE: u32 = 32;
|
||||
|
@ -288,24 +288,6 @@ impl CommitIvkRandomness {
|
|||
}
|
||||
}
|
||||
|
||||
/// The scope of a viewing key or address.
|
||||
///
|
||||
/// A "scope" narrows the visibility or usage to a level below "full".
|
||||
///
|
||||
/// Consistent usage of `Scope` enables the user to provide consistent views over a wallet
|
||||
/// to other people. For example, a user can give an external [`IncomingViewingKey`] to a
|
||||
/// merchant terminal, enabling it to only detect "real" transactions from customers and
|
||||
/// not internal transactions from the wallet.
|
||||
#[derive(Clone, Copy, Debug, PartialEq, Eq)]
|
||||
pub enum Scope {
|
||||
/// A scope used for wallet-external operations, namely deriving addresses to give to
|
||||
/// other users in order to receive funds.
|
||||
External,
|
||||
/// A scope used for wallet-internal operations, such as creating change notes,
|
||||
/// auto-shielding, and note management.
|
||||
Internal,
|
||||
}
|
||||
|
||||
/// 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
|
||||
|
|
Loading…
Reference in New Issue