Documentation ¶
Index ¶
Constants ¶
This section is empty.
Variables ¶
This section is empty.
Functions ¶
func NewSeed ¶
NewSeed creates a new 256-bit random seed to be used for wallet key store initialization.
func SeedFromEncrypted ¶
SeedFromEncrypted takes a AES ECB mode encrypted seed and a password and will decode the original seed from the input. The seed should not be more than 256 bits long to avoid issues with the ECB mode application of AES.
func SeedFromMnemonic ¶
SeedFromMnemonic takes a mnemonic as defined in BIP39 and turns it back into a byte slice used as seed for a wallet key store.
func SeedToEncrypted ¶
SeedToEncrypted takes a random wallet seed and a password and uses AES ECB mode encryption to get the output that can be written to disk securely. The seed shouldn't be more than 256 bits to avoid ECB mode security concerns.
func SeedToMnemonic ¶
SeedToMnemonic takes a random byte slice representing the seed of a wallet key store and turns it into the BIP39 mnemonic representation of words to be used as a offline backup for user wallets.
Types ¶
type Store ¶
type Store struct {
// contains filtered or unexported fields
}
Store represents the key store for a user wallet with a main key used as the root of all key derivations and an argon2 context to parameterize the key derivation algorithm.
func NewStore ¶
NewStore initializes a new key store for a wallet from the given seed. The seed should ideally be 256-bit long and will be used to derive the root key of the key store. The preconfigured argon2 context uses 3 iterations, 1 gigabyte of memory, 4 lanes and an output length of 96 bytes.