API Reference bitcoin_elixir v#0.1.0

Copy Markdown View Source

Modules

Bitcoin Cash for Elixir.

Base58 and Base58Check, as used by extended keys and legacy addresses.

Encode and decode Bitcoin Cash addresses (CashAddr), including the token-aware types from CHIP-2022-02 CashTokens.

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.

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.

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.

The hash functions Bitcoin Cash uses, from Erlang's :crypto.

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.

Locking scripts for addresses, and the Electrum "scripthash" used to look an address up on an Electrum or Fulcrum server.