View Source BitcoinLib.Key.HD.DerivationPath.Parser.CoinType (BitcoinLib v0.4.2)

Determines which coin type is being used, either bitcoin mainnet or bitcoin testnet.

This is a hardened value.

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

Link to this section Summary

Functions

Converts a list of path levels managed up until the coin type, extracts the coin type 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 coin type, extracts the coin type and returns the remaining levels

examples

Examples

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