[][src]Struct bitcoin_rpc_client::Privkey

pub struct Privkey {
    pub compressed: bool,
    pub network: Network,
    pub key: SecretKey,
}

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

Methods

impl Privkey
[src]

pub fn from_secret_key(
    key: SecretKey,
    compressed: bool,
    network: Network
) -> Privkey
[src]

Creates a Privkey from a raw secp256k1 secret key

pub fn public_key<C>(&self, secp: &Secp256k1<C>) -> PublicKey where
    C: Signing, 
[src]

Computes the public key as supposed to be used with this secret

pub fn to_address<C>(&self, secp: &Secp256k1<C>) -> Address where
    C: Signing, 
[src]

Converts a private key to a segwit address

pub fn to_legacy_address<C>(&self, secp: &Secp256k1<C>) -> Address where
    C: Signing, 
[src]

Converts a private key to a legacy (non-segwit) address

pub fn secret_key(&self) -> &SecretKey
[src]

Accessor for the underlying secp key

pub fn into_secret_key(self) -> SecretKey
[src]

Accessor for the underlying secp key that consumes the privkey

pub fn network(&self) -> Network
[src]

Accessor for the network type

pub fn is_compressed(&self) -> bool
[src]

Accessor for the compressed flag

Trait Implementations

impl FromStr for Privkey
[src]

type Err = Error

The associated error which can be returned from parsing.

impl Clone for Privkey
[src]

fn clone_from(&mut self, source: &Self)
1.0.0
[src]

Performs copy-assignment from source. Read more

impl Eq for Privkey
[src]

impl Display for Privkey
[src]

impl PartialEq<Privkey> for Privkey
[src]

impl From<Privkey> for PrivateKey
[src]

impl From<PrivateKey> for Privkey
[src]

Auto Trait Implementations

impl Send for Privkey

impl Sync for Privkey

Blanket Implementations

impl<T> From for T
[src]

impl<T, U> Into for T where
    U: From<T>, 
[src]

impl<T> ToOwned for T where
    T: Clone
[src]

type Owned = T

impl<T> ToString for T where
    T: Display + ?Sized
[src]

impl<T, U> TryFrom for T where
    T: From<U>, 
[src]

type Error = !

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Borrow for T where
    T: ?Sized
[src]

impl<T> BorrowMut for T where
    T: ?Sized
[src]

impl<T, U> TryInto for T where
    U: TryFrom<T>, 
[src]

type Error = <U as TryFrom<T>>::Error

🔬 This is a nightly-only experimental API. (try_from)

The type returned in the event of a conversion error.

impl<T> Any for T where
    T: 'static + ?Sized
[src]

impl<Q, K> Equivalent for Q where
    K: Borrow<Q> + ?Sized,
    Q: Eq + ?Sized
[src]

impl<T> Erased for T