/// Create a witness pay to public key address from a public key
/// This is the native segwit address type for an output redeemable with a single signature
Create a witness pay to public key address from a public key
This is the native segwit address type for an output redeemable with a single signature
Create a witness pay to public key address from a public key This is the native segwit address type for an output redeemable with a single signature
pub fn p2wpkh(pk: &key::PublicKey, network: Network) -> Address {
        let mut hash_engine = hash160::Hash::engine();
        pk.write_into(&mut hash_engine);
        Address {
            network: network,
            payload: Payload::WitnessProgram {
                version: bech32::u5::try_from_u8(0).expect("0<32"),
                program: hash160::Hash::from_engine(hash_engine)[..].to_vec(),
            },
        }
    }
pub fn p2wpkh ( pk : & key :: PublicKey , network : Network ) -> Address { let mut hash_engine = hash160 :: Hash :: engine ( ) ; pk . write_into ( & mut hash_engine ) ; Address { network : network , payload : Payload :: WitnessProgram { version : bech32 :: u5 :: try_from_u8 ( 0 ) . expect ( " " ) , program : hash160 :: Hash :: from_engine ( hash_engine ) [ .. ] . to_vec ( ) , } , } }
Create a witness pay to public key address from a public key
This is the native segwit address type for an output redeemable with a single signature
Create a witness pay to public key address from a public key This is the native segwit address type for an output redeemable with a single signature
pk
&key::PublicKey
network
Network