Package org.bitcoinj.crypto
Class MnemonicCode
java.lang.Object
org.bitcoinj.crypto.MnemonicCode
A MnemonicCode object may be used to convert between binary seed values and
lists of words per the BIP 39
specification
-
Field Summary
Modifier and TypeFieldDescriptionstatic long
UNIX time for when the BIP39 standard was finalised.static MnemonicCode
-
Constructor Summary
ConstructorDescriptionInitialise from the included word list.MnemonicCode
(InputStream wordstream, String wordListDigest) Creates an MnemonicCode object, initializing with words read from the supplied input stream. -
Method Summary
Modifier and TypeMethodDescriptionvoid
Check to see if a mnemonic word list is valid.Gets the word list this code uses.byte[]
Convert mnemonic word list to original entropy value.toMnemonic
(byte[] entropy) Convert entropy data to mnemonic word list.static byte[]
Convert mnemonic word list to seed.
-
Field Details
-
BIP39_STANDARDISATION_TIME_SECS
public static long BIP39_STANDARDISATION_TIME_SECSUNIX time for when the BIP39 standard was finalised. This can be used as a default seed birthday. -
INSTANCE
-
-
Constructor Details
-
MnemonicCode
Initialise from the included word list. Won't work on Android.- Throws:
IOException
-
MnemonicCode
public MnemonicCode(InputStream wordstream, String wordListDigest) throws IOException, IllegalArgumentException Creates an MnemonicCode object, initializing with words read from the supplied input stream. If a wordListDigest is supplied the digest of the words will be checked.- Throws:
IOException
IllegalArgumentException
-
-
Method Details
-
getWordList
Gets the word list this code uses. -
toSeed
Convert mnemonic word list to seed. -
toEntropy
public byte[] toEntropy(List<String> words) throws MnemonicException.MnemonicLengthException, MnemonicException.MnemonicWordException, MnemonicException.MnemonicChecksumException Convert mnemonic word list to original entropy value. -
toMnemonic
Convert entropy data to mnemonic word list. -
check
Check to see if a mnemonic word list is valid.- Throws:
MnemonicException
-