public class KeyDerivation
extends java.lang.Object
Modifier and Type | Class and Description |
---|---|
static class |
KeyDerivation.Bip32Node
Represents a node in the Bip32 derivation tree.
|
Constructor and Description |
---|
KeyDerivation() |
Modifier and Type | Method and Description |
---|---|
static KeyDerivation.Bip32Node |
deriveChildPrivateKey(KeyDerivation.Bip32Node node,
int childIndex)
INPUT:
(kL,kR): 64 bytes private eddsa key
A: 32 bytes public key (y coordinate only), optional as A = kR.G (y coordinate only)
c: 32 bytes chain code
i: child index to compute (hardened if >= 0x80000000)
OUTPUT:
(kL_i,kR_i): 64 bytes ith-child private eddsa key
A_i: 32 bytes ith-child public key, A_i = kR_i.G (y coordinatte only)
c_i: 32 bytes ith-child chain code
PROCESS:
1.
|
static KeyDerivation.Bip32Node |
deriveChildPublicKey(byte[] parentPublicKey,
byte[] chainCode,
int childIndex) |
static KeyDerivation.Bip32Node |
deriveChildPublicKey(KeyDerivation.Bip32Node node,
int childIndex) |
static KeyDerivation.Bip32Node |
deriveChildPublicKey(PublicKeyDerivationInfo derivationInfo) |
static KeyDerivation.Bip32Node |
deriveChildPublicKey(SerializedMasterPublicKey serializedMasterPublicKey,
int childIndex) |
static KeyDerivation.Bip32Node |
deriveMnemonic(java.lang.String path,
java.lang.String mnemonic) |
static KeyDerivation.Bip32Node |
deriveSeed(java.lang.String path,
byte[] seed) |
static byte[] |
mnemonicToSeed(java.lang.String mnemonic) |
static byte[] |
mnemonicToSeed(java.lang.String mnemonic,
java.lang.String passphrase) |
public static KeyDerivation.Bip32Node deriveMnemonic(java.lang.String path, java.lang.String mnemonic)
path
- bip32 pathmnemonic
- bip39 wordspublic static byte[] mnemonicToSeed(java.lang.String mnemonic)
public static byte[] mnemonicToSeed(java.lang.String mnemonic, java.lang.String passphrase)
public static KeyDerivation.Bip32Node deriveSeed(java.lang.String path, byte[] seed)
path
- bip32 string path to derive (eg 42'/1/2)seed
- 512 bits seedpublic static KeyDerivation.Bip32Node deriveChildPublicKey(PublicKeyDerivationInfo derivationInfo)
public static KeyDerivation.Bip32Node deriveChildPublicKey(KeyDerivation.Bip32Node node, int childIndex)
public static KeyDerivation.Bip32Node deriveChildPublicKey(SerializedMasterPublicKey serializedMasterPublicKey, int childIndex)
public static KeyDerivation.Bip32Node deriveChildPublicKey(byte[] parentPublicKey, byte[] chainCode, int childIndex)
public static KeyDerivation.Bip32Node deriveChildPrivateKey(KeyDerivation.Bip32Node node, int childIndex)
node
- nodechildIndex
- child index