Mirror of A BIP39 implementation in Go.
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.
Tyler Smith c55f737395
Merge pull request #33 from tyler-smith/TS_fix_checksum_check
1 year ago
vendor/golang.org/x/crypto FEATURE: Vendor golang.org/x/crypto until we can remove it. 2 years ago
wordlists add french wordlist 2 years ago
.gitignore FEATURE: Vendor golang.org/x/crypto until we can remove it. 2 years ago
.travis.yml improve travis and modify license 2 years ago
Gopkg.lock FEATURE: Vendor golang.org/x/crypto until we can remove it. 2 years ago
Gopkg.toml FEATURE: Vendor golang.org/x/crypto until we can remove it. 2 years ago
LICENSE improve travis and modify license 2 years ago
Makefile FEATURE: Add basic Makefile for test coverage commands. 2 years ago
README.md BUGFIX,DOC: Fix link to license. 2 years ago
bip39.go BUGFIX: Fix issue #32; not properly validating checksums. 1 year ago
bip39_test.go BUGFIX: Fix issue #32; not properly validating checksums. 1 year ago
example_test.go add package godoc and examples 2 years ago

README.md

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