Package org.symbol.sdk
Class Bip32
java.lang.Object
org.symbol.sdk.Bip32
- Bip32
- BIP-32 HD key derivation (HMAC-SHA512) over BIP-39 mnemonics. Hand-rolled ed25519 SLIP-0010 with a Symbol/NEM root seed key (incl.
"ed25519-keccak seed", which no library implements); the BIP-39 layer is delegated tomnemonic4j.
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic final classRepresentation of a BIP-32 node. -
Constructor Summary
ConstructorsConstructorDescriptionBip32()Creates a BIP-32 root-node factory using the defaulted25519curve and the English wordlist.Creates a BIP-32 root-node factory usingcurveNameand the English wordlist.Creates a BIP-32 root-node factory. -
Method Summary
Modifier and TypeMethodDescriptionfromMnemonic(String mnemonic, String password) Creates a BIP-32 root node from a BIP-39 mnemonic and password.fromSeed(byte[] seed) Creates a BIP-32 root node from a seed.random()Creates a random BIP-39 mnemonic with the default 32-byte entropy length (24 words).random(int seedLength) Creates a random BIP-39 mnemonic.
-
Constructor Details
-
Bip32
public Bip32()Creates a BIP-32 root-node factory using the defaulted25519curve and the English wordlist. -
Bip32
Creates a BIP-32 root-node factory usingcurveNameand the English wordlist.- Parameters:
curveName- Elliptic curve to use (e.g.ed25519ored25519-keccak).
-
Bip32
Creates a BIP-32 root-node factory.- Parameters:
curveName- Elliptic curve to use.mnemonicLanguage- Language of constructed mnemonics.
-
-
Method Details
-
fromSeed
- Bip32.fromSeed
- Creates a BIP-32 root node from a seed.
- Parameters:
seed- BIP-32 seed (typically 64 bytes from BIP-39 mnemonic + password).- Returns:
- BIP-32 root node.
-
fromMnemonic
- Bip32.fromMnemonic
- Creates a BIP-32 root node from a BIP-39 mnemonic and password.
- Parameters:
mnemonic- BIP-39 mnemonic phrase.password- BIP-39 mnemonic password (use empty string when there is no password).- Returns:
- BIP-32 root node.
-
random
- Bip32.random
- Creates a random BIP-39 mnemonic with the default 32-byte entropy length (24 words).
- Returns:
- Random BIP-39 mnemonic phrase.
-
random
- Bip32.random
- Creates a random BIP-39 mnemonic.
- Parameters:
seedLength- Entropy length in bytes; must be one of {16, 20, 24, 28, 32}.- Returns:
- Random mnemonic phrase.
-