Struct komodo_rpc_client::Privkey
source · Expand description
A Bitcoin ECDSA private key
Fields§
§compressed: bool
Whether this private key represents a compressed address
network: Network
The network on which this key should be used
key: SecretKey
The actual ECDSA key
Implementations§
source§impl Privkey
impl Privkey
sourcepub fn from_secret_key(
key: SecretKey,
compressed: bool,
network: Network
) -> Privkey
pub fn from_secret_key(
key: SecretKey,
compressed: bool,
network: Network
) -> Privkey
Creates a Privkey
from a raw secp256k1 secret key
sourcepub fn public_key<C>(&self, secp: &Secp256k1<C>) -> PublicKeywhere
C: Signing,
pub fn public_key<C>(&self, secp: &Secp256k1<C>) -> PublicKeywhere
C: Signing,
Computes the public key as supposed to be used with this secret
sourcepub fn to_address<C>(&self, secp: &Secp256k1<C>) -> Addresswhere
C: Signing,
pub fn to_address<C>(&self, secp: &Secp256k1<C>) -> Addresswhere
C: Signing,
Converts a private key to a segwit address
sourcepub fn to_legacy_address<C>(&self, secp: &Secp256k1<C>) -> Addresswhere
C: Signing,
pub fn to_legacy_address<C>(&self, secp: &Secp256k1<C>) -> Addresswhere
C: Signing,
Converts a private key to a legacy (non-segwit) address
sourcepub fn secret_key(&self) -> &SecretKey
pub fn secret_key(&self) -> &SecretKey
Accessor for the underlying secp key
sourcepub fn into_secret_key(self) -> SecretKey
pub fn into_secret_key(self) -> SecretKey
Accessor for the underlying secp key that consumes the privkey
sourcepub fn is_compressed(&self) -> bool
pub fn is_compressed(&self) -> bool
Accessor for the compressed flag
Trait Implementations§
impl Eq for Privkey
impl StructuralEq for Privkey
impl StructuralPartialEq for Privkey
Auto Trait Implementations§
impl RefUnwindSafe for Privkey
impl Send for Privkey
impl Sync for Privkey
impl Unpin for Privkey
impl UnwindSafe for Privkey
Blanket Implementations§
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.