View Source Bitcoinex.Secp256k1.PrivateKey (bitcoinex v0.1.8)

Contains an integer used to create a Point and sign.

Link to this section Summary

Functions

new creates a private key from an integer

returns the base58check encoded private key as a string assumes all keys are compressed

serialize_private_key serializes a private key into hex

to_point calculate Point from private key or integer

wif returns the base58check encoded private key as a string assumes all keys are compressed

Link to this section Types

@type t() :: %Bitcoinex.Secp256k1.PrivateKey{d: non_neg_integer()}

Link to this section Functions

@spec new(non_neg_integer()) :: {:ok, t()} | {:error, String.t()}

new creates a private key from an integer

@spec parse_wif(String.t()) :: {:ok, t(), atom(), boolean()}

returns the base58check encoded private key as a string assumes all keys are compressed

@spec parse_wif_bin(binary()) :: {:ok, t(), atom(), boolean()}
Link to this function

serialize_private_key(prvkey)

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

serialize_private_key serializes a private key into hex

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

to_point calculate Point from private key or integer

Link to this function

wif!(prvkey, network_name)

View Source
@spec wif!(t(), Bitcoinex.Network.network_name()) :: String.t()

wif returns the base58check encoded private key as a string assumes all keys are compressed