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: boolWhether this view key is meant for floonet or not
depth: u8How many derivations this key is from the master (which is 0)
child_number: ChildNumberChild number of the key used to derive from parent (0 for master)
rewind_hash: Vec<u8>Hash used to generate rewind nonce
Implementations§
Source§impl 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 StructuralPartialEq for ViewKey
Auto Trait Implementations§
impl Freeze for ViewKey
impl RefUnwindSafe for ViewKey
impl Send for ViewKey
impl Sync for ViewKey
impl Unpin for ViewKey
impl UnwindSafe for ViewKey
Blanket Implementations§
Source§impl<T> BorrowMut<T> for Twhere
T: ?Sized,
impl<T> BorrowMut<T> for Twhere
T: ?Sized,
Source§fn borrow_mut(&mut self) -> &mut T
fn borrow_mut(&mut self) -> &mut T
Mutably borrows from an owned value. Read more
Source§impl<T> CloneToUninit for Twhere
T: Clone,
impl<T> CloneToUninit for Twhere
T: Clone,
Source§impl<Q, K> Equivalent<K> for Q
impl<Q, K> Equivalent<K> for Q
Source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key and return true if they are equal.