View Source BitcoinLib.Key.PublicKey.Address.P2PKH (BitcoinLib v0.2.3)

Implementation of P2PKH addresses

Sources:

Link to this section Summary

Functions

Converts an extended public key into a P2PKH address starting by 1

Link to this section Functions

Link to this function

from_public_key(public_key, network \\ :mainnet)

View Source
@spec from_public_key(
  %BitcoinLib.Key.PublicKey{
    chain_code: term(),
    depth: term(),
    fingerprint: term(),
    index: term(),
    key: term(),
    parent_fingerprint: term(),
    uncompressed_key: term()
  },
  :mainnet | :testnet
) :: binary()

Converts an extended public key into a P2PKH address starting by 1

examples

Examples

iex> %BitcoinLib.Key.PublicKey{ ...> key: <<0x02D0DE0AAEAEFAD02B8BDC8A01A1B8B11C696BD3D66A2C5F10780D95B7DF42645C::264>>, ...> chain_code: <<0::256>> ...> } |> BitcoinLib.Key.PublicKey.Address.P2PKH.from_public_key() "1LoVGDgRs9hTfTNJNuXKSpywcbdvwRXpmK"