Skip to content
This repository has been archived by the owner on Jul 20, 2024. It is now read-only.

4. BIP 39 简单实用

QuincySx edited this page May 15, 2018 · 1 revision
//产生随机数 WordCount 可以选择需要生成的助记词长度
byte[] random = RandomSeed.random(WordCount.TWELVE);

//产生助记词 记得传入需要语言
List<String> mnemonic = new MnemonicGenerator(English.INSTANCE).createMnemonic(random);

//产生 seed
byte[] seed = new SeedCalculator().calculateSeed(mnemonic, "");

//可以通过 seed 产生公私钥
ExtendedKey extendedKey = ExtendedKey.create(seed);

参考资料

NovaCrypto-BIP39

Clone this wiki locally