Crate crypto_addr

source ·
Expand description

crates.rs loicense docs

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 using format standards from 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
  • Parse strings to Address format specs
  • Supports P2SHWPKH Bitcoin addresses
  • Supports Arbitrary prefix for Bitcoin Cash addresses
  • Ethereum-like addresses (available with crate feature eth)
  • EIP55 support

Limitations

Currently the following limitations exist:

  • Does not support native bech32 Segwit Bitcoin addresses
  • Does not support Public Key validation

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.

Enums

  • Format specification for generating addresses from public keys.
  • Bitcoin Address format type
  • 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

Type Definitions