[−][src]Trait slip132::VersionResolver
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)
Required methods
pub fn resolve(
network: Self::Network,
applicable_for: Self::Application,
is_priv: bool
) -> KeyVersion
[src]
network: Self::Network,
applicable_for: Self::Application,
is_priv: bool
) -> KeyVersion
Constructor for KeyVersion
with given network, application scope and
key type (public or private)
Provided methods
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
pub 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.
Implementors
impl VersionResolver for DefaultResolver
[src]
type Network = Network
type Application = KeyApplication
pub fn resolve(
network: Self::Network,
applicable_for: Self::Application,
is_priv: bool
) -> KeyVersion
[src]
network: Self::Network,
applicable_for: Self::Application,
is_priv: bool
) -> KeyVersion