Documentation ¶
Index ¶
- func FromKey(key []byte) (string, error)
- func FromMasterDerivationKey(mdk types.MasterDerivationKey) (string, error)
- func FromPrivateKey(sk ed25519.PrivateKey) (string, error)
- func ToKey(mnemonic string) ([]byte, error)
- func ToMasterDerivationKey(mnemonic string) (mdk types.MasterDerivationKey, err error)
- func ToPrivateKey(mnemonic string) (sk ed25519.PrivateKey, err error)
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func FromKey ¶
FromKey converts a 32-byte key into a 25 word mnemonic. The generated mnemonic includes a checksum. Each word in the mnemonic represents 11 bits of data, and the last 11 bits are reserved for the checksum.
func FromMasterDerivationKey ¶
func FromMasterDerivationKey(mdk types.MasterDerivationKey) (string, error)
FromMasterDerivationKey is a helper that converts an MDK to a human-readable mnemonic
func FromPrivateKey ¶
func FromPrivateKey(sk ed25519.PrivateKey) (string, error)
FromPrivateKey is a helper that converts an ed25519 private key to a human-readable mnemonic
func ToKey ¶
ToKey converts a mnemonic generated using this library into the source key used to create it. It returns an error if the passed mnemonic has an incorrect checksum, if the number of words is unexpected, or if one of the passed words is not found in the words list.
func ToMasterDerivationKey ¶
func ToMasterDerivationKey(mnemonic string) (mdk types.MasterDerivationKey, err error)
ToMasterDerivationKey is a helper that converts a mnemonic directly to a master derivation key
func ToPrivateKey ¶
func ToPrivateKey(mnemonic string) (sk ed25519.PrivateKey, err error)
ToPrivateKey is a helper that converts a mnemonic directly to an ed25519 private key
Types ¶
This section is empty.