View Source Bitcoinex.ExtendedKey (bitcoinex v0.1.8)

Contains an an extended key as documented in BIP 32.

Link to this section Summary

Functions

derive_child uses a public or private key xkey to derive the public or private key at index idx. public key -> public child private key -> private child

derive_extended_key uses an extended xkey and a derivation path to derive the extended key at that path

derive_private_child uses a private key xkey to derive the private key at index idx

derive_public_child uses a public or private key xkey to derive the public key at index idx

display returns the extended key as a string

network_from_extended_key returns :testnet or :mainnet depending on the network prefix of the key.

parse_extended_key takes binary or string representation of an extended key and parses it to an extended key object

seed_to_master_private_key transforms a bip32 seed into a master extended private key

serialize_extended_key takes an extended key and returns the binary

to_extended_public_key takes an extended private key and returns an extended public key

to_private_key takes an extended private key and returns the contained private key.

to_public_key takes an extended key xkey and returns the public key.

Link to this section Types

@type t() :: %Bitcoinex.ExtendedKey{
  chaincode: binary(),
  checksum: binary(),
  child_num: binary(),
  depth: binary(),
  key: binary(),
  parent_fingerprint: binary(),
  prefix: binary()
}

Link to this section Functions

Link to this function

derive_child_key(xkey, idx)

View Source
@spec derive_child_key(t(), non_neg_integer()) :: {:ok, t()} | {:error, String.t()}

derive_child uses a public or private key xkey to derive the public or private key at index idx. public key -> public child private key -> private child

Link to this function

derive_extended_key(xkey, derivation_path)

View Source
@spec derive_extended_key(t() | binary(), Bitcoinex.ExtendedKey.DerivationPath.t()) ::
  {:ok, t()} | {:error, String.t()}

derive_extended_key uses an extended xkey and a derivation path to derive the extended key at that path

Link to this function

derive_private_child(xkey, idx)

View Source
@spec derive_private_child(t(), non_neg_integer()) ::
  {:ok, t()} | {:error, String.t()}

derive_private_child uses a private key xkey to derive the private key at index idx

Link to this function

derive_public_child(xkey, idx)

View Source
@spec derive_public_child(t(), non_neg_integer()) :: {:ok, t()} | {:error, String.t()}

derive_public_child uses a public or private key xkey to derive the public key at index idx

Link to this function

display_extended_key(xkey)

View Source
@spec display_extended_key(t()) :: String.t()

display returns the extended key as a string

Link to this function

get_child_num(extended_key)

View Source
@spec get_child_num(t()) :: binary()
@spec get_depth(t()) :: binary()
@spec get_fingerprint(t()) :: binary()
Link to this function

get_parent_fingerprint(extended_key)

View Source
@spec get_parent_fingerprint(t()) :: binary()
Link to this function

get_prefix(extended_key)

View Source
@spec get_prefix(t()) :: binary()
Link to this function

network_from_extended_key(extended_key)

View Source
@spec network_from_extended_key(t()) :: atom()

network_from_extended_key returns :testnet or :mainnet depending on the network prefix of the key.

Link to this function

parse_extended_key(xkey)

View Source
@spec parse_extended_key(binary()) :: {:ok, t()} | {:error, String.t()}

parse_extended_key takes binary or string representation of an extended key and parses it to an extended key object

Link to this function

seed_to_master_private_key(arg, pfx \\ :xprv)

View Source
@spec seed_to_master_private_key(binary(), atom()) ::
  {:ok, t()} | {:error, String.t()}

seed_to_master_private_key transforms a bip32 seed into a master extended private key

Link to this function

serialize_extended_key(xkey)

View Source
@spec serialize_extended_key(t()) :: binary()

serialize_extended_key takes an extended key and returns the binary

Link to this function

to_extended_public_key(xprv)

View Source
@spec to_extended_public_key(t()) :: {:ok, t()} | {:error, String.t()}

to_extended_public_key takes an extended private key and returns an extended public key

@spec to_private_key(t()) ::
  {:ok, Bitcoinex.Secp256k1.PrivateKey.t()} | {:error, String.t()}

to_private_key takes an extended private key and returns the contained private key.

@spec to_public_key(t()) ::
  {:ok, Bitcoinex.Secp256k1.Point.t()} | {:error, String.t()}

to_public_key takes an extended key xkey and returns the public key.