Class Bip32

java.lang.Object
org.symbol.sdk.Bip32

public final class Bip32 extends Object
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 to mnemonic4j.
  • Nested Class Summary

    Nested Classes
    Modifier and Type
    Class
    Description
    static final class 
    Representation of a BIP-32 node.
  • Constructor Summary

    Constructors
    Constructor
    Description
    Creates a BIP-32 root-node factory using the default ed25519 curve and the English wordlist.
    Bip32(String curveName)
    Creates a BIP-32 root-node factory using curveName and the English wordlist.
    Bip32(String curveName, String mnemonicLanguage)
    Creates a BIP-32 root-node factory.
  • Method Summary

    Modifier and Type
    Method
    Description
    fromMnemonic(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.
    Creates a random BIP-39 mnemonic with the default 32-byte entropy length (24 words).
    random(int seedLength)
    Creates a random BIP-39 mnemonic.

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Constructor Details

    • Bip32

      public Bip32()
      Creates a BIP-32 root-node factory using the default ed25519 curve and the English wordlist.
    • Bip32

      public Bip32(String curveName)
      Creates a BIP-32 root-node factory using curveName and the English wordlist.
      Parameters:
      curveName - Elliptic curve to use (e.g. ed25519 or ed25519-keccak).
    • Bip32

      public Bip32(String curveName, String mnemonicLanguage)
      Creates a BIP-32 root-node factory.
      Parameters:
      curveName - Elliptic curve to use.
      mnemonicLanguage - Language of constructed mnemonics.
  • Method Details

    • fromSeed

      public Bip32.Bip32Node fromSeed(byte[] seed)
      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

      public Bip32.Bip32Node fromMnemonic(String mnemonic, String password)
      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

      public String 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

      public String random(int seedLength)
      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.