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

to_p2pkh_addr needs a prefix

In the future p2sh will need a prefix

to_wif and from_wif needs a prefix

to_xprv and from_xprv needs version bytes

to_xpub and from_xpub needs version bytes

signed free-text messages are prefixed with this text

SLIP-44 registered coin number for BIP-44 derivation

upcast the network to a subtree (each network implements subtree, too, but the compiler does not know their relations in the implementation in advance)

Trait Implementations

Formats the value using the given formatter. Read more

Implementors