ipld-eth-server/vendor/github.com/tyler-smith/go-bip39
2019-12-02 13:24:46 -06:00
..
wordlists readme additions and vendor updates 2019-12-02 13:24:46 -06:00
.gitignore readme additions and vendor updates 2019-12-02 13:24:46 -06:00
.travis.yml readme additions and vendor updates 2019-12-02 13:24:46 -06:00
bip39_test.go readme additions and vendor updates 2019-12-02 13:24:46 -06:00
bip39.go readme additions and vendor updates 2019-12-02 13:24:46 -06:00
Gopkg.lock readme additions and vendor updates 2019-12-02 13:24:46 -06:00
Gopkg.toml readme additions and vendor updates 2019-12-02 13:24:46 -06:00
LICENSE readme additions and vendor updates 2019-12-02 13:24:46 -06:00
Makefile readme additions and vendor updates 2019-12-02 13:24:46 -06:00
README.md readme additions and vendor updates 2019-12-02 13:24:46 -06:00

go-bip39

Build Status license Documentation Go Report Card GitHub issues

A golang implementation of the BIP0039 spec for mnemonic seeds

Example

package main

import (
  "github.com/tyler-smith/go-bip39"
  "github.com/tyler-smith/go-bip32"
  "fmt"
)

func main(){
  // Generate a mnemonic for memorization or user-friendly seeds
  entropy, _ := bip39.NewEntropy(256)
  mnemonic, _ := bip39.NewMnemonic(entropy)

  // Generate a Bip32 HD wallet for the mnemonic and a user supplied password
  seed := bip39.NewSeed(mnemonic, "Secret Passphrase")

  masterKey, _ := bip32.NewMasterKey(seed)
  publicKey := masterKey.PublicKey()

  // Display mnemonic and keys
  fmt.Println("Mnemonic: ", mnemonic)
  fmt.Println("Master private key: ", masterKey)
  fmt.Println("Master public key: ", publicKey)
}

Credits

Wordlists are from the bip39 spec.

Test vectors are from the standard Python BIP0039 implementation from the Trezor team: https://github.com/trezor/python-mnemonic