bitcoin-address

Crates.iobitcoin-address
lib.rsbitcoin-address
version0.1.5
sourcesrc
created_at2022-08-24 15:09:19.734235
updated_at2022-09-28 16:51:33.466495
descriptionUtilities for bitcoin addresses
homepage
repository
max_upload_size
id651675
size11,975
Joe Gesualdo (joegesualdo)

documentation

README

Bitcoin Address

Utilities for bitcoin addresses


⚠️ This is experimental. Please use at your own risk.⚠️


Install

Add package to Cargo.toml file

[dependencies]
bitcoin-address = "0.1.5"

Usage:

use bitcoin_address::{
    is_legacy,
    is_nested_segwit,
    is_segwit_native,
    is_segwit_v0,
    is_segwit_v1,
    is_taproot,
}

let legacy_address = "1J9uwBYepTm5737RtzkSEePTevGgDGLP5S".to_string();
let nested_segwit_address = "37u4L57bLqZ8NL9bs1GNX2x52KxviDfvPp".to_string();
let native_segwit_address = "bc1qfvmj8jse4r7203mrchfyt24sjcpna3s2y35ylp".to_string();
let taproot_address =
    "bc1p8denc9m4sqe9hluasrvxkkdqgkydrk5ctxre5nkk4qwdvefn0sdsc6eqxe".to_string();

is_nested_segwit(&nested_segwit_address) // => true
is_legacy(&legacy_address) // => true
is_segwit_native(&nested_segwit_address) // => true
is_segwit_v0(&nested_segwit_address) // => true
is_segwit_v0(&native_segwit_address) // => true
is_segwit_v1(&taproot_address) // => true
is_taproot(&taproot_address) // => true

Resources

To learn about the types of bitcoin addresses, see the RESOURCES.md

Related

License

MIT © Joe Gesualdo

Commit count: 0

cargo fmt