View Source BitcoinLib.Key.HD.DerivationPath.Parser.Purpose (BitcoinLib v0.4.3)

Determines which address space is being used, either bip44, bip49 or bip84.

This is a hardened value.

See: https://github.com/bitcoin/bips/blob/master/bip-0044.mediawiki#purpose

Link to this section Summary

Functions

Converts a list of path levels managed up until the purpose value, extracts the purpose and returns the remaining levels

Link to this section Functions

@spec extract(list()) :: {:ok, nil, []} | {:ok, atom(), list()} | {:error, binary()}

Converts a list of path levels managed up until the purpose value, extracts the purpose and returns the remaining levels

examples

Examples

iex> ["84'", "0", "1", "2", "3"]
...> |> BitcoinLib.Key.HD.DerivationPath.Parser.Purpose.extract()
{:ok, :bip84, ["0", "1", "2", "3"]}