#address #validate #bitcoin #litecoin #validation

coinaddress

Library for validating the base58 hash checksums, including specifically the bitcoin and litecoin addresses

6 stable releases

Uses old Rust 2015

1.1.3 May 5, 2017
1.1.2 Apr 20, 2015
1.1.1 Feb 5, 2015
1.1.0 Jan 11, 2015
1.0.2 Nov 25, 2014

#6 in #litecoin

31 downloads per month

MIT license

6KB
93 lines

Coinaddress

Master: Master Build Status

Rust library for bitcoin / litecoin / generic base58 addresses checksum validation. The actual check is validating the trailing checksum against the pubkey hash. All addresses using the bitcoin format can be verified.

To validate bitcoin/litecoin address, check that:

validate_btc_address("1theaddress") == Ok(0)  // (or 5, or 111 for testnet)
validate_ltc_address("Ltheaddress") == Ok(48)

Any other address may be checked using:

validate_base58_hash("...") == Ok(...)

The value returned in Ok(...) is the address version/type.

To use the package add it to cargo dependencies:

[dependencies]
coinaddress = "1.*"

lib.rs:

Functions for validating the base58 hash checksums, including specifically the bitcoin and litecoin addresses.

Dependencies

~1MB
~20K SLoC