View Source Bitcoinex.Base58 (bitcoinex v0.1.8)

Includes Base58 serialization and validation.

Some code is inspired by: https://github.com/comboy/bitcoin-elixir/blob/develop/lib/bitcoin/base58_check.ex

Link to this section Summary

Types

Base58 encoding is only supported for p2sh and p2pkh address types.

Functions

Decodes a Base58 encoded string into a byte array and validates checksum.

Decodes a Base58 encoded string into a byte array.

Encodes binary into a Base58 encoded string.

Encodes a binary into a Base58 encoded string.

Validates a Base58 checksum.

Link to this section Types

@type address_type() :: :p2sh | :p2pkh

Base58 encoding is only supported for p2sh and p2pkh address types.

@type byte_list() :: [byte()]

Link to this section Functions

@spec append_checksum(binary()) :: binary()
@spec decode(binary()) :: {:ok, binary()} | {:error, atom()}

Decodes a Base58 encoded string into a byte array and validates checksum.

@spec decode_base!(binary()) :: binary()

Decodes a Base58 encoded string into a byte array.

@spec encode(binary()) :: String.t()

Encodes binary into a Base58 encoded string.

@spec encode_base(binary()) :: String.t()

Encodes a binary into a Base58 encoded string.

@spec validate_checksum(binary()) :: {:ok, binary()} | {:error, atom()}

Validates a Base58 checksum.