# bitcoin_elixir v0.1.0 - API Reference

## Modules

- [BitcoinElixir](BitcoinElixir.md): Bitcoin Cash for Elixir.

- Addresses
  - [BitcoinElixir.CashAddr](BitcoinElixir.CashAddr.md): Encode and decode Bitcoin Cash addresses (CashAddr), including the
token-aware types from CHIP-2022-02 CashTokens.
  - [BitcoinElixir.PaymentURI](BitcoinElixir.PaymentURI.md): Build and parse payment links (BIP21 with CashAddr), such as
`bitcoincash:qq…?amount=0.0015&label=Enkaji`. Amounts are handled as whole
satoshis, never floats.
  - [BitcoinElixir.Script](BitcoinElixir.Script.md): Locking scripts for addresses, and the Electrum "scripthash" used to look an
address up on an Electrum or Fulcrum server.

- Keys
  - [BitcoinElixir.HD](BitcoinElixir.HD.md): Watch-only BIP32: parse an extended public key (`xpub`, or `tpub` for test
networks) and derive child public keys and addresses from it. No private
key is ever involved, so a server can make a fresh address for every
invoice while the wallet that owns the xpub keeps the money.

- Network
  - [BitcoinElixir.Electrum](BitcoinElixir.Electrum.md): A client for the Electrum Cash protocol, served by Fulcrum and other
Electrum servers. Use it to look up addresses (by scripthash), transactions
and the chain tip.
  - [BitcoinElixir.Electrum.Connection](BitcoinElixir.Electrum.Connection.md): A long-lived connection to an Electrum server, for requests and live
notifications. It reconnects with backoff, moves to the next server when one
fails, and subscribes again after every reconnect.

- Primitives
  - [BitcoinElixir.Base58](BitcoinElixir.Base58.md): Base58 and Base58Check, as used by extended keys and legacy addresses.
  - [BitcoinElixir.Hash](BitcoinElixir.Hash.md): The hash functions Bitcoin Cash uses, from Erlang's `:crypto`.

