View Source BitcoinLib.Key.Address (BitcoinLib v0.1.2)

Bitcoin address management

Inspired by https://learnmeabitcoin.com/technical/public-key-hash

Link to this section Summary

Functions

Convert public key hash into a P2PKH Bitcoin address.

Link to this section Functions

Link to this function

from_public_key_hash(public_key_hash, address_type \\ :p2sh)

View Source
@spec from_public_key_hash(integer(), :p2pkh | :p2sh) :: String.t()

Convert public key hash into a P2PKH Bitcoin address.

Details can be found here: https://en.bitcoin.it/wiki/Technical_background_of_version_1_Bitcoin_addresses

examples

Examples

iex> 0x6ae201797de3fa7d1d95510f50c1a9c50ce4cc36 ...> |> BitcoinLib.Key.Address.from_public_key_hash(:p2pkh) "1Ak9NVPmwCHEpsSWvM6cNRC7dsYniRmwMG"