Struct aigc_keychain::view_key::ViewKey
source · pub struct ViewKey {
pub is_test: 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_test: bool
Whether this view key is meant for testnet 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§
source§impl ViewKey
impl ViewKey
pub fn create<K, H>( keychain: &K, ext_key: ExtendedPrivKey, hasher: &mut H, is_test: bool ) -> Result<Self, Error>where K: Keychain, H: BIP32Hasher,
pub fn rewind_hash(secp: &Secp256k1, public_root_key: PublicKey) -> Vec<u8> ⓘ
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§
source§impl PartialEq<ViewKey> for ViewKey
impl PartialEq<ViewKey> for ViewKey
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§
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<Q, K> Equivalent<K> for Qwhere
Q: Eq + ?Sized,
K: Borrow<Q> + ?Sized,
impl<Q, K> Equivalent<K> for Qwhere Q: Eq + ?Sized, K: Borrow<Q> + ?Sized,
source§fn equivalent(&self, key: &K) -> bool
fn equivalent(&self, key: &K) -> bool
Compare self to
key
and return true
if they are equal.