sansseed

package module
v0.0.0-...-319034e Latest Latest
Warning

This package is not in the latest version of its module.

Go to latest
Published: Dec 21, 2022 License: MIT Imports: 8 Imported by: 0

README

SansSeed

SansSeed is both a library and command-line tool for generating BIP39 compatible mnemonic phrases and derivation of BIP39 seeds for research purposes.

Usage

CLI

See Here for details on how to use the sansseedgen CLI tool.

Library
Generating a mnemonic
    // Generate new random entropy for a 24 word seed
    ent, err := sansseed.NewWordEntropy(lengths.SeedBitLength(lengths.TwentyfourWordSeed))
    if err != nil {
        return err
    }

    // Generate an english mnemonic using the new entropy (Note this package currently supports 8 languages)
    res, err := sansseed.MnemonicPhraseForLanguage(ent, languages.BIP39English{})
    if err != nil {
        return err
    }
Derive seed from mnemonic
    optionalPassword := "S3CRET"
    mnemonic := "vessel ladder alter error federal sibling chat ability sun glass valve picture"
    seed := derivation.DeriveSeedFromMnemonic(mnemonic, optionalPassword)

Build

Requires Go version 1.13 or later.

Run all unit tests with $ go test ./...

License

The MIT License

Documentation

Index

Constants

This section is empty.

Variables

This section is empty.

Functions

func DeriveSeedFromMnemonic

func DeriveSeedFromMnemonic(mnemonic string) string

DeriveSeedFromMnemonic is a GoMobile compatible function that returns the hex encoded seed derived from the given mnemonic

func MnemonicPhraseChineaseSimplified

func MnemonicPhraseChineaseSimplified(i []int, e error) ([]string, error)

MnemonicPhraseChineaseSimplified uses given entropy to return a mnemonic phrase for the Chinease Simplified language

func MnemonicPhraseChineaseTraditional

func MnemonicPhraseChineaseTraditional(i []int, e error) ([]string, error)

MnemonicPhraseChineaseTraditional uses given entropy to return a mnemonic phrase for the Chinease Traditional language

func MnemonicPhraseEnglish

func MnemonicPhraseEnglish(i []int, e error) ([]string, error)

MnemonicPhraseEnglish uses given entropy to return a mnemonic phrase for the English language

func MnemonicPhraseForLanguage

func MnemonicPhraseForLanguage(i []int, l wordlists.BIP39Wordlist) ([]string, error)

MnemonicPhraseForLanguage uses given entropy and language to generate a mnemonic phrase

func MnemonicPhraseFrench

func MnemonicPhraseFrench(i []int, e error) ([]string, error)

MnemonicPhraseFrench uses given entropy to return a mnemonic phrase for the French language

func MnemonicPhraseItalian

func MnemonicPhraseItalian(i []int, e error) ([]string, error)

MnemonicPhraseItalian uses given entropy to return a mnemonic phrase for the Italian language

func MnemonicPhraseJapanese

func MnemonicPhraseJapanese(i []int, e error) ([]string, error)

MnemonicPhraseJapanese uses given entropy to return a mnemonic phrase for the Japanese language

func MnemonicPhraseKorean

func MnemonicPhraseKorean(i []int, e error) ([]string, error)

MnemonicPhraseKorean uses given entropy to return a mnemonic phrase for the Korean language

func MnemonicPhraseSpanish

func MnemonicPhraseSpanish(i []int, e error) ([]string, error)

MnemonicPhraseSpanish uses given entropy to return a mnemonic phrase for the Spanish language

func New12WordEntropy

func New12WordEntropy() ([]int, error)

New12WordEntropy returns new twelve length seed as an integer slice

func New15WordEntropy

func New15WordEntropy() ([]int, error)

New15WordEntropy returns new fiveteen length seed as an integer slice

func New18WordEntropy

func New18WordEntropy() ([]int, error)

New18WordEntropy returns new eighteen length seed as an integer slice

func New21WordEntropy

func New21WordEntropy() ([]int, error)

New21WordEntropy returns new twentyone length seed as an integer slice

func New24WordEntropy

func New24WordEntropy() ([]int, error)

New24WordEntropy returns new twentyfour length seed as an integer slice

func New24WordMnemonicPhraseForLanguage

func New24WordMnemonicPhraseForLanguage(language string) (string, error)

New24WordMnemonicPhraseForLanguage is a GoMobile compatible function that returns a new random 24 word mnemonic phrase for given language as a single space seperated string

func NewWordEntropy

func NewWordEntropy(l lengths.SeedBitLength) ([]int, error)

NewWordEntropy returns new mnemonic integer slice of given length

Types

This section is empty.

Directories

Path Synopsis
cmd
sansseedgen command

Jump to

Keyboard shortcuts

? : This menu
/ : Search site
f or F : Jump to
y or Y : Canonical URL