BSV-ex v0.2.5 BSV.Extended.PrivateKey View Source
BIP-32 extended private key module.
Link to this section Summary
Functions
Converts the given BIP39 seed to an extended private key.
Converts the given xprv string to an extended private key.
Returns the extended public key from the given extended private key.
Converts the given extended private key struct to an encoded xprv string.
Link to this section Types
Extended Private Key
Link to this section Functions
Converts the given BIP39 seed to an extended private key.
Options
The accepted options are:
:encoding
- Optionally decode the given seed with either the:base64
or:hex
encoding scheme.:network
- Specify the intended network. Defaults to:main
. Set to:test
for testnet.
Examples
iex> key = BSV.Extended.PrivateKey.from_seed(BSV.Test.bsv_seed)
...> key.__struct__ == BSV.Extended.PrivateKey
true
Converts the given xprv string to an extended private key.
Examples
iex> key = "xprv9s21ZrQH143K2EktC9YxsGeBkkid7yZD7y9gnL7GNkpD6xmF5JoGGgKBQk2tQtA9vAnEfZ6mxhhmULRN5zNwrnDsmX38VGFyBJuhxQPGMsS"
...> |> BSV.Extended.PrivateKey.from_string
...> key.__struct__ == BSV.Extended.PrivateKey
true
Link to this function
get_public_key(private_key, options \\ [])
View Sourceget_public_key(t(), keyword()) :: BSV.Extended.PublicKey.t()
Returns the extended public key from the given extended private key.
Examples
iex> key = BSV.Extended.PrivateKey.from_seed(BSV.Test.bsv_seed)
...> |> BSV.Extended.PrivateKey.get_public_key
...> key.__struct__ == BSV.Extended.PublicKey
true
Converts the given extended private key struct to an encoded xprv string.
Examples
iex> BSV.Extended.PrivateKey.from_seed(BSV.Test.bsv_seed)
...> |> BSV.Extended.PrivateKey.to_string
"xprv9s21ZrQH143K2EktC9YxsGeBkkid7yZD7y9gnL7GNkpD6xmF5JoGGgKBQk2tQtA9vAnEfZ6mxhhmULRN5zNwrnDsmX38VGFyBJuhxQPGMsS"