Crate crypto_addr
source ·Expand description
Library crate for computing cryptocurrency addresses from public keys and
encoding private keys as WIFs for various cryptocurrency blockchains. See
AddressFormat for a list of supported address formats. This crate is
unique in that it supports address generation for several different
blockchains.
⚠️ Warning
The software contained is provided as-is and makes no guarantee of accuracy. The author takes no responsibility for lost funds or any other damage that results from use of this software.
Features
- Generate addresses using standard address formats for several blockchains
- Encode private keys as WIF using standard WIF formats for several blockchains
- Supports Arbitrary prefix for cashaddr addresses
- Error detection for invalid inputs
- Ethereum-like addresses (available with crate feature
eth) - EIP55 support
Limitations
Currently the following limitations exist:
- Only supports P2PKH addresses
Usage
The main interface for the crate is provided by the Address and WIF traits . These
traits provide methods for generating addresses and WIFs (serialized private keys)
respectively. Both traits are implemented for all types that implement AsRef<[u8]>.
Enums
- Format specification for generating addresses from public keys.
- Error enum describing something that went wrong.
- Format specification for formatting a private key as WIF.
Traits
- Generate an Address string from existing Public Key
- Encode a private key using WIF format