.github
ci: build, test, and lint.gitignore
add .gitignore file.travis.yml
TESTS: Add .travis.ymlbench_test.go
Use ReverseWordMap to make O(1) lookups for IsMnemonicValid (#2)bip39_test.go
add test for single space character mnemonicbip39.go
bip39.go: fix gosimple linter warning (#5)coverage.txt
Fixed References, Commented, Code Coverage.go.mod
enable Go modules supportgo.sum
enable Go modules supportLICENSE
Initial commit with working entropyp and mnemonic generationREADME.md
update readme with note about forkwordlist.go
Check word list checksumgo-bip39
A golang implementation of the BIP0039 spec for mnemonic seeds
Fork
This is a fork of github.com/tyler-smith/go-bip39 from right after the fixes
from bartekn for MnemonicToByteArray were merged
(commit hash: 52158e4697b87de16ed390e1bdaf813e581008fa).
The tyler-smith repo is undergoing significant refactoring at present that we may
not want (eg. some vars becoming private).
Credits
English wordlist and test vectors are from the standard Python BIP0039 implementation from the Trezor guys: https://github.com/trezor/python-mnemonic
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)
}