Address & Network API Reference¶
Address
¶
Construction Examples:
- Address Expr:
bc1qar0srrr7xfkvy5l643lydnw9re59gtzzwf5mdq,1BvBMSEYstWetqTFn5Au4m4GFg7xJaNVN2 - Descriptor:
address(wpkh($alice)) - ScriptPubKey:
address(`OP_DUP OP_HASH160 $alice->identifier OP_EQUALVERIFY OP_CHECKSIG`) - ScriptPubKey Bytes:
address(script(0x00147d9620d04e5eac6b9715d37112cbb9ca0c926793)) - Witness Program:
address(`0 0x7d9620d04e5eac6b9715d37112cbb9ca0c926793`) - Taproot Tree:
address(tr[ `$alice OP_CHECKSIG`, `$bob OP_CHECKSIG` ]) - Address String:
address("tb1q0ktzp5zwt6kxh9c46dc39jaeegxfyeunt0q9ca")
Coerces from:
String– Base58Check or Bech32(m) encoded address
Underlying type: bitcoin::Address
address()
¶
address(script_pubkey: Script|Descriptor<Definite>|TapInfo|WshInfo|Address, with_network: Network = testnet) -> Address
Create an Address for the given script_pubkey and with_network (defaults to testnet)
Parse an address string into an Address instance, optionally verifying that the network matches verify_network
Rust source code: src/stdlib/btc.rs:193
Also see: scriptPubKey()
One of p2tr, p2wpkh, p2wsh, p2pkh, p2sh or p2a
Network
¶
Coerces from: (None)
Underlying type: bitcoin::Network