Expand description
Addresses
Support for ordinary base58 Bitcoin addresses and private keys
Example: creating a new address from a randomly-generated key pair
use tapyrus::network::constants::Network;
use tapyrus::util::address::Address;
use tapyrus::util::key;
use tapyrus::secp256k1::Secp256k1;
use tapyrus::secp256k1::rand::thread_rng;
// Generate random key pair
let s = Secp256k1::new();
let public_key = key::PublicKey {
compressed: true,
key: s.generate_keypair(&mut thread_rng()).1,
};
// Generate pay-to-pubkey-hash address
let address = Address::p2pkh(&public_key, Network::Prod);
Structs
- A Bitcoin address
Enums
- The different types of addresses.
- Address error.
- The method used to produce an address