Class Slip10
java.lang.Object
com.codename1.crypto.hd.Slip10
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 Summary
Modifier and TypeMethodDescriptionbyte[]A copy of the 32-byte chain code.child(long index) The hardened child atindex.longThe hardened index this node was derived with.intdepth()The distance from the master node.derive(DerivationPath path) Derives along a path; every index is taken as hardened.Derives along a path such asm/44'/501'/0'/0'.voiddestroy()Wipes the private key and chain code.intThe first four bytes ofHASH160(0x00 || publicKey), as SLIP-10 defines it.static Slip10master(byte[] seed) The master node of a seed (16 to 64 bytes).intThe parent's fingerprint; 0 for the master node.byte[]A copy of the 32-byte Ed25519 private key (the RFC 8032 seed).byte[]The 32-byte Ed25519 public key.
-
Method Details
-
master
The master node of a seed (16 to 64 bytes). -
child
The hardened child atindex. An index belowDerivationPath.HARDENEDis hardened for you, since Ed25519 has no other kind. -
derive
-
derive
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 ofHASH160(0x00 || publicKey), as SLIP-10 defines it. -
destroy
public void destroy()Wipes the private key and chain code.
-