• Home
  • History
  • Annotate
Name Date Size #Lines LOC

..03-May-2022-

vendor/golang.org/x/crypto/H17-Oct-2018-

wordlists/H17-Oct-2018-

.gitignoreH A D17-Oct-2018487

.travis.ymlH A D17-Oct-2018127

Gopkg.lockH A D17-Oct-2018431

Gopkg.tomlH A D17-Oct-2018602

LICENSEH A D17-Oct-20181.1 KiB

MakefileH A D17-Oct-2018362

README.mdH A D17-Oct-20181.7 KiB

bip39.goH A D17-Oct-201811.4 KiB

bip39_test.goH A D17-Oct-201819.3 KiB

example_test.goH A D17-Oct-20181 KiB

README.md

1# go-bip39
2[![Build Status](https://travis-ci.org/tyler-smith/go-bip39.svg?branch=master)](https://travis-ci.org/tyler-smith/go-bip39)
3[![license](https://img.shields.io/github/license/tyler-smith/go-bip39.svg?maxAge=2592000)](https://github.com/tyler-smith/go-bip39/blob/master/LICENSE)
4[![Documentation](https://godoc.org/github.com/tyler-smith/go-bip39?status.svg)](http://godoc.org/github.com/tyler-smith/go-bip39)
5[![Go Report Card](https://goreportcard.com/badge/github.com/tyler-smith/go-bip39)](https://goreportcard.com/report/github.com/tyler-smith/go-bip39)
6[![GitHub issues](https://img.shields.io/github/issues/tyler-smith/go-bip39.svg)](https://github.com/tyler-smith/go-bip39/issues)
7
8
9A golang implementation of the BIP0039 spec for mnemonic seeds
10
11## Example
12
13```go
14package main
15
16import (
17  "github.com/tyler-smith/go-bip39"
18  "github.com/tyler-smith/go-bip32"
19  "fmt"
20)
21
22func main(){
23  // Generate a mnemonic for memorization or user-friendly seeds
24  entropy, _ := bip39.NewEntropy(256)
25  mnemonic, _ := bip39.NewMnemonic(entropy)
26
27  // Generate a Bip32 HD wallet for the mnemonic and a user supplied password
28  seed := bip39.NewSeed(mnemonic, "Secret Passphrase")
29
30  masterKey, _ := bip32.NewMasterKey(seed)
31  publicKey := masterKey.PublicKey()
32
33  // Display mnemonic and keys
34  fmt.Println("Mnemonic: ", mnemonic)
35  fmt.Println("Master private key: ", masterKey)
36  fmt.Println("Master public key: ", publicKey)
37}
38```
39
40## Credits
41
42Wordlists are from the [bip39 spec](https://github.com/bitcoin/bips/tree/master/bip-0039).
43
44Test vectors are from the standard Python BIP0039 implementation from the
45Trezor team: [https://github.com/trezor/python-mnemonic](https://github.com/trezor/python-mnemonic)
46