Name | Date | Size | #Lines | LOC | ||
---|---|---|---|---|---|---|
.. | 03-May-2022 | - | ||||
vendor/golang.org/x/crypto/ | H | 17-Oct-2018 | - | |||
wordlists/ | H | 17-Oct-2018 | - | |||
.gitignore | H A D | 17-Oct-2018 | 487 | |||
.travis.yml | H A D | 17-Oct-2018 | 127 | |||
Gopkg.lock | H A D | 17-Oct-2018 | 431 | |||
Gopkg.toml | H A D | 17-Oct-2018 | 602 | |||
LICENSE | H A D | 17-Oct-2018 | 1.1 KiB | |||
Makefile | H A D | 17-Oct-2018 | 362 | |||
README.md | H A D | 17-Oct-2018 | 1.7 KiB | |||
bip39.go | H A D | 17-Oct-2018 | 11.4 KiB | |||
bip39_test.go | H A D | 17-Oct-2018 | 19.3 KiB | |||
example_test.go | H A D | 17-Oct-2018 | 1 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