Trait slip132::VersionResolver[][src]

pub trait VersionResolver: Copy + Clone + PartialEq + Eq + PartialOrd + Ord + Hash + Debug {
    type Network;
    type Application;
    fn resolve(
        network: Self::Network,
        applicable_for: Self::Application,
        is_priv: bool
    ) -> KeyVersion; fn is_pub(_: &KeyVersion) -> Option<bool> { ... }
fn is_prv(_: &KeyVersion) -> Option<bool> { ... }
fn network(_: &KeyVersion) -> Option<Self::Network> { ... }
fn application(_: &KeyVersion) -> Option<Self::Application> { ... }
fn derivation_path(_: &KeyVersion) -> Option<DerivationPath> { ... }
fn make_pub(_: &KeyVersion) -> Option<KeyVersion> { ... }
fn make_prv(_: &KeyVersion) -> Option<KeyVersion> { ... } }

Trait which must be implemented by helpers which do construction, interpretation, verification and cross-conversion of extended public and private key version magic bytes from KeyVersion

Associated Types

type Network[src]

Type that defines recognized network options

type Application[src]

Type that defines possible applications fro public and private keys (types of scriptPubkey descriptors in which they can be used)

Loading content...

Required methods

fn resolve(
    network: Self::Network,
    applicable_for: Self::Application,
    is_priv: bool
) -> KeyVersion
[src]

Constructor for KeyVersion with given network, application scope and key type (public or private)

Loading content...

Provided methods

fn is_pub(_: &KeyVersion) -> Option<bool>[src]

Detects whether provided version corresponds to an extended public key. Returns None if the version is not recognized/unknown to the resolver.

fn is_prv(_: &KeyVersion) -> Option<bool>[src]

Detects whether provided version corresponds to an extended private key. Returns None if the version is not recognized/unknown to the resolver.

fn network(_: &KeyVersion) -> Option<Self::Network>[src]

Detects network used by the provided key version bytes. Returns None if the version is not recognized/unknown to the resolver.

fn application(_: &KeyVersion) -> Option<Self::Application>[src]

Detects application scope defined by the provided key version bytes. Application scope is a types of scriptPubkey descriptors in which given extended public/private keys can be used. Returns None if the version is not recognized/unknown to the resolver.

fn derivation_path(_: &KeyVersion) -> Option<DerivationPath>[src]

Returns BIP 32 derivation path for the provided key version. Returns None if the version is not recognized/unknown to the resolver.

fn make_pub(_: &KeyVersion) -> Option<KeyVersion>[src]

Converts version into version corresponding to an extended public key. Returns None if the resolver does not know how to perform conversion.

fn make_prv(_: &KeyVersion) -> Option<KeyVersion>[src]

Converts version into version corresponding to an extended private key. Returns None if the resolver does not know how to perform conversion.

Loading content...

Implementors

Loading content...