View Source BitcoinLib.Key.PublicKey.Address.P2SH (BitcoinLib v0.2.0-pre3)

Implementation of P2SH-P2WPKH addresses

BIP13: Address Format for pay-to-script-hash https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki BIP16: Pay to Script Hash https://github.com/bitcoin/bips/blob/master/bip-0016.mediawiki

Source: https://github.com/bitcoin/bips/blob/master/bip-0013.mediawiki

Link to this section Summary

Functions

Creates a P2SH-P2WPKH address, which is starting by 3, out of an Extended Public Key

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()

Creates a P2SH-P2WPKH address, which is starting by 3, out of an Extended Public Key

examples

Examples

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