MCPcopy Create free account
hub / github.com/BitVM/BitVM / generate_p2wpkh_address

Function generate_p2wpkh_address

bridge/src/scripts.rs:73–78  ·  view source on GitHub ↗
(network: Network, public_key: &PublicKey)

Source from the content-addressed store, hash-verified

71}
72
73pub fn generate_p2wpkh_address(network: Network, public_key: &PublicKey) -> Address {
74 Address::p2wpkh(
75 &CompressedPublicKey::try_from(*public_key).expect("Could not compress public key"),
76 network,
77 )
78}
79
80pub fn generate_pay_to_pubkey_script_address(network: Network, public_key: &PublicKey) -> Address {
81 Address::p2wsh(&generate_pay_to_pubkey_script(public_key), network)

Callers 1

Calls

no outgoing calls

Tested by

no test coverage detected