Class Slip10

java.lang.Object
com.codename1.crypto.hd.Slip10

public final class Slip10 extends Object

SLIP-10 key derivation for Ed25519, the scheme Solana, Stellar, Cardano-style and Aptos/Sui wallets use on a Mnemonic seed. Ed25519 has no public derivation, so every index is hardened: m/44'/501'/0'/0' is the usual Solana account.

(SLIP-10 over secp256k1 is BIP-32 itself; use Bip32 for that curve.)

  • Method Details

    • master

      public static Slip10 master(byte[] seed)
      The master node of a seed (16 to 64 bytes).
    • child

      public Slip10 child(long index)
      The hardened child at index. An index below DerivationPath.HARDENED is hardened for you, since Ed25519 has no other kind.
    • derive

      public Slip10 derive(String path)
      Derives along a path such as m/44'/501'/0'/0'.
    • derive

      public Slip10 derive(DerivationPath path)
      Derives along a path; every index is taken as hardened.
    • privateKey

      public byte[] privateKey()
      A copy of the 32-byte Ed25519 private key (the RFC 8032 seed). Wipe it after use.
    • publicKey

      public byte[] publicKey()
      The 32-byte Ed25519 public key.
    • chainCode

      public byte[] chainCode()
      A copy of the 32-byte chain code.
    • depth

      public int depth()
      The distance from the master node.
    • childNumber

      public long childNumber()
      The hardened index this node was derived with.
    • parentFingerprint

      public int parentFingerprint()
      The parent's fingerprint; 0 for the master node.
    • fingerprint

      public int fingerprint()
      The first four bytes of HASH160(0x00 || publicKey), as SLIP-10 defines it.
    • destroy

      public void destroy()
      Wipes the private key and chain code.