Struct epic_keychain::view_key::ViewKey
source · [−]pub struct ViewKey {
pub is_floo: bool,
pub depth: u8,
pub child_number: ChildNumber,
pub rewind_hash: Vec<u8>,
/* private fields */
}
Expand description
Key that can be used to scan the chain for owned outputs This is a public key, meaning it cannot be used to spend those outputs At the moment only depth 0 keys can be used
Fields
is_floo: bool
Whether this view key is meant for floonet or not
depth: u8
How many derivations this key is from the master (which is 0)
child_number: ChildNumber
Child number of the key used to derive from parent (0 for master)
rewind_hash: Vec<u8>
Hash used to generate rewind nonce
Implementations
sourceimpl ViewKey
impl ViewKey
pub fn create<K, H>(
keychain: &K,
ext_key: ExtendedPrivKey,
hasher: &mut H,
is_floo: bool
) -> Result<Self, Error> where
K: Keychain,
H: BIP32Hasher,
pub fn ckd_pub<H>(
&self,
secp: &Secp256k1,
hasher: &mut H,
i: ChildNumber
) -> Result<Self, Error> where
H: BIP32Hasher,
pub fn commit(
&self,
secp: &Secp256k1,
amount: u64,
switch: &SwitchCommitmentType
) -> Result<PublicKey, Error>
Trait Implementations
impl Eq for ViewKey
impl StructuralEq for ViewKey
impl StructuralPartialEq for ViewKey
Auto Trait Implementations
impl RefUnwindSafe for ViewKey
impl Send for ViewKey
impl Sync for ViewKey
impl Unpin for ViewKey
impl UnwindSafe for ViewKey
Blanket Implementations
sourceimpl<T> BorrowMut<T> for T where
T: ?Sized,
impl<T> BorrowMut<T> for T where
T: ?Sized,
const: unstable · sourcefn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
impl<T> CloneAny for T where
T: Any + Clone,
impl<T> CloneAny for T where
T: Any + Clone,
fn clone_any(&self) -> Box<dyn CloneAny + 'static, Global>
fn clone_any_send(&self) -> Box<dyn CloneAny + Send + 'static, Global> where
T: Send,
fn clone_any_sync(&self) -> Box<dyn CloneAny + Sync + 'static, Global> where
T: Sync,
fn clone_any_send_sync(
&self
) -> Box<dyn CloneAny + Sync + Send + 'static, Global> where
T: Send + Sync,
sourceimpl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Q where
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
sourcefn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to key
and return true
if they are equal.
sourceimpl<T> ToOwned for T where
T: Clone,
impl<T> ToOwned for T where
T: Clone,
type Owned = T
type Owned = T
The resulting type after obtaining ownership.
sourcefn clone_into(&self, target: &mut T)
fn clone_into(&self, target: &mut T)
🔬 This is a nightly-only experimental API. (
toowned_clone_into
)Uses borrowed data to replace owned data, usually by cloning. Read more