MoneroAddress v1.1.0 MoneroAddress View Source

MoneroAddress implements functions decoding and validating Monero base58 encoded addresses. Monero uses different address format than bicoin. The address contains 1 byte network prefix, 2 32 byte public keys - spend key and view key and 4 byte checksm. Address is encoded in 8 byte chunks (11 base58 characters), optionally ‘0’-padded (‘1’ in base58). The address is ths allways 95 character long. Checksm is computed by taking first 4 bytes of keccak-256 hash. Note that Monero does not use official SHA3 but original keccak-256.

Link to this section Summary

Functions

Decodes Monero specific base58 encoded binary

Decodes and validates Monero address. Returns tuple containing network prefix (encoded as integer), public spend key (hex encoded) and public view key (hex encoded)

Encodes public spend key, public view key and optionally payment id into base58 encoded address

Link to this section Functions

Decodes Monero specific base58 encoded binary.

Examples

iex> MoneroAddress.base58_decode!("55LTR8KniP")
<<107, 134, 160, 20, 146, 167, 244>>
Link to this function decode_address!(code, network) View Source

Decodes and validates Monero address. Returns tuple containing network prefix (encoded as integer), public spend key (hex encoded) and public view key (hex encoded)

Examples

iex> MoneroAddress.decode_address!("44AFFq5kSiGBoZ4NMDwYtN18obc8AemS33DBLWs3H7otXft3XjrpDtQGv7SqSsaBYBb98uNbr2VBBEt7f2wfn3RVGQBEP3A", :main)
{18,
       "42f18fc61586554095b0799b5c4b6f00cdeb26a93b20540d366932c6001617b7",
       "5db35109fbba7d5f275fef4b9c49e0cc1c84b219ec6ff652fda54f89f7f63c88", :address}
Link to this function encode_address!(public_spend_key, public_view_key, network, type) View Source

Encodes public spend key, public view key and optionally payment id into base58 encoded address

Examples

iex> MoneroAddress.encode_address!("cd8235338c6d9a4b467d97d20e6ea309d3af16f845abf74b62b48d616ba00ff6", "708dae560daacda2d39d0c0b5586edc92a0fa918f0a444ad7ae029ff1ae81185", :test, :address)
"9zxM5uUAZxDDbGPDtBBpga2eLKhuK5WWJDcLQ3brGwHpiDmro8TrXkpUEd5rHyZecCaeYen7rou6KW1ySfCvU69eG2Bmsiz"