View Source BitcoinLib.Key.HD.ExtendedPrivate.ChildFromIndex (BitcoinLib v0.1.3)

Calculates direct childs from a private key based on a given index, and maybe a hardened flag

Link to this section Summary

Functions

Calculates a direct child from a private key based on a given index, and maybe a hardened flag

Link to this section Functions

Link to this function

get(private_key, index, hardened? \\ false)

View Source
@spec get(
  %BitcoinLib.Key.HD.ExtendedPrivate{
    chain_code: term(),
    depth: term(),
    fingerprint: term(),
    index: term(),
    key: term(),
    parent_fingerprint: term()
  },
  integer(),
  boolean()
) ::
  {:ok,
   %BitcoinLib.Key.HD.ExtendedPrivate{
     chain_code: term(),
     depth: term(),
     fingerprint: term(),
     index: term(),
     key: term(),
     parent_fingerprint: term()
   }}
  | {:error, binary()}

Calculates a direct child from a private key based on a given index, and maybe a hardened flag

examples

Examples

iex> %BitcoinLib.Key.HD.ExtendedPrivate{ ...> key: 0xF79BB0D317B310B261A55A8AB393B4C8A1ABA6FA4D08AEF379CABA502D5D67F9, ...> chain_code: 0x463223AAC10FB13F291A1BC76BC26003D98DA661CB76DF61E750C139826DEA8B ...> } ...> |> BitcoinLib.Key.HD.ExtendedPrivate.ChildFromIndex.get(0) {

:ok,
%BitcoinLib.Key.HD.ExtendedPrivate{
  key: 0x39F329FEDBA2A68E2A804FCD9AEEA4104ACE9080212A52CE8B52C1FB89850C72,
  chain_code: 0x05AAE71D7C080474EFAAB01FA79E96F4C6CFE243237780B0DF4BC36106228E31,
  depth: 1,
  index: 0,
  parent_fingerprint: 0x18C1259
}

}