#bitcoin #addresses #address #experimental #own #risk

bitcoin-address

Utilities for bitcoin addresses

6 releases

0.1.5 Sep 28, 2022
0.1.4 Sep 22, 2022
0.1.1 Aug 24, 2022

#21 in #risk

Download history 24/week @ 2024-03-11 15/week @ 2024-03-18 11/week @ 2024-03-25 63/week @ 2024-04-01 8/week @ 2024-04-08 7/week @ 2024-04-15 21/week @ 2024-04-22 6/week @ 2024-04-29 13/week @ 2024-05-06 14/week @ 2024-05-13 17/week @ 2024-05-20 1/week @ 2024-05-27 22/week @ 2024-06-03 17/week @ 2024-06-10 42/week @ 2024-06-17 18/week @ 2024-06-24

99 downloads per month
Used in 9 crates (5 directly)

MIT license

11KB
120 lines

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

License

MIT © Joe Gesualdo

No runtime deps