/jbip39

Java implementation of the BIP 39 specification.

Primary LanguageJavaApache License 2.0Apache-2.0

JBIP 39

Build Status Maven Central

Java implementation of the BIP 39 specification.

How to use

Create a new mnemonic (a seed phrase)

  Dictionary dictionary = EnglishDictionary.instance();

  Bip39 bip39 = new Bip39(dictionary);

  byte[] entropy = bip39.generateEntropy(EntropyDesc.ENT_128);

  String mnemonic = bip39.createMnemonic(entropy);

Convert a mnemonic to a seed

  String mnemonic = "legal winner thank year wave sausage worth useful legal winner thank yellow";
  String passphrase = "TREZOR";

  byte[] seed = bip39.createSeed(mnemonic, passphrase);

Download

Download the latest jar via Maven:

<dependency>
  <groupId>org.nightcode</groupId>
  <artifactId>jbip39</artifactId>
  <version>0.1.1</version>
</dependency>

Credits

Wordlists are from the BIP 0039.

Feedback is welcome. Please don't hesitate to open up a new github issue or simply drop me a line at dmitry@nightcode.org.