Trait iop_keyvault::Network
source · [−]pub trait Network: Subtree {
fn p2pkh_addr(&self) -> &'static [u8; 1];
fn p2sh_addr(&self) -> &'static [u8; 1];
fn wif(&self) -> &'static [u8; 1];
fn bip32_xprv(&self) -> &'static [u8; 4];
fn bip32_xpub(&self) -> &'static [u8; 4];
fn message_prefix(&self) -> &'static str;
fn slip44(&self) -> i32;
fn subtree(&self) -> &dyn Subtree<Suite = <Self as Subtree>::Suite>;
}
Expand description
Strategy that can be implemented for different clones of the Bitcoin network. It is a trait rather than an enumeration to leave it open for extensions outside this crate. A few example implementations can be found under the network submodules.
Required Methods
fn p2pkh_addr(&self) -> &'static [u8; 1]
fn p2pkh_addr(&self) -> &'static [u8; 1]
to_p2pkh_addr
needs a prefix
fn bip32_xprv(&self) -> &'static [u8; 4]
fn bip32_xprv(&self) -> &'static [u8; 4]
to_xprv
and from_xprv
needs version bytes
fn bip32_xpub(&self) -> &'static [u8; 4]
fn bip32_xpub(&self) -> &'static [u8; 4]
to_xpub
and from_xpub
needs version bytes
fn message_prefix(&self) -> &'static str
fn message_prefix(&self) -> &'static str
signed free-text messages are prefixed with this text