Trait iop_keyvault::Network[][src]

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::Suite>; }

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][src]

to_p2pkh_addr needs a prefix

fn p2sh_addr(&self) -> &'static [u8; 1][src]

In the future p2sh will need a prefix

fn wif(&self) -> &'static [u8; 1][src]

to_wif and from_wif needs a prefix

fn bip32_xprv(&self) -> &'static [u8; 4][src]

to_xprv and from_xprv needs version bytes

fn bip32_xpub(&self) -> &'static [u8; 4][src]

to_xpub and from_xpub needs version bytes

fn message_prefix(&self) -> &'static str[src]

signed free-text messages are prefixed with this text

fn slip44(&self) -> i32[src]

SLIP-44 registered coin number for BIP-44 derivation

fn subtree(&self) -> &dyn Subtree<Suite = Self::Suite>[src]

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

Loading content...

Trait Implementations

impl<C: KeyDerivationCrypto + 'static> Debug for &dyn Network<Suite = C>[src]

Implementors

impl Network for iop_keyvault::secp256k1::ark::Devnet[src]

impl Network for iop_keyvault::secp256k1::ark::Mainnet[src]

fn p2sh_addr(&self) -> &'static [u8; 1][src]

There is no BIP-0016 on ARK, so there is no such prefix either

impl Network for iop_keyvault::secp256k1::ark::Testnet[src]

impl Network for iop_keyvault::secp256k1::btc::Mainnet[src]

impl Network for iop_keyvault::secp256k1::btc::Testnet[src]

impl Network for iop_keyvault::secp256k1::hyd::Devnet[src]

impl Network for iop_keyvault::secp256k1::hyd::Mainnet[src]

impl Network for iop_keyvault::secp256k1::hyd::Testnet[src]

impl Network for iop_keyvault::secp256k1::iop::Mainnet[src]

impl Network for iop_keyvault::secp256k1::iop::Testnet[src]

Loading content...