🔏 The BIP39 library for 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 3423700f97 CI: Try new job names. 5 months ago
.github/workflows CI: Try new job names. 5 months ago
assets/images DOCS: Add banner image to README. 5 months ago
wordlists added czech language wordlist 9 months ago
.gitignore CLEANUP: Linting and doc updates. 5 months ago
.golangci.yml CI: Add .golangci.yml 5 months ago
LICENSE CLEANUP: Linting and doc updates. 5 months ago
Makefile CI: Send test coverage to Coveralls. 5 months ago
README.md DOCS: Fix badges. 5 months ago
bip39.go TESTS: Improve test coverage. 5 months ago
bip39_test.go TESTS: Improve test coverage. 5 months ago
example_test.go add package godoc and examples 2 years ago
go.mod TWEAK: Change go version in go.mod to reflect lowest supported version. 5 months ago
go.sum CLEANUP: Linting and doc updates. 5 months ago

README.md

The bip39 library for Go

PkgGoDev Latest release MIT License Contributors

Build check Go Report Card Coverage Status

Example

package main

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

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)
}