Bip44WithChange is used by Solana to generate a set of keypairs for a given seed. This exists in SolanaKT but is not fully implemented.
private fun getPrivateKeyFromBip44SeedWithChange(seed: ByteArray): ByteArray {
val masterAddress = hdKeyGenerator.getAddressFromSeed(seed, solanaCoin)
val purposeAddress =
hdKeyGenerator.getAddress(masterAddress, PURPOSE, solanaCoin.alwaysHardened) // 44H
val coinTypeAddress =
hdKeyGenerator.getAddress(purposeAddress, TYPE, solanaCoin.alwaysHardened) // 501H
val accountAddress =
hdKeyGenerator.getAddress(coinTypeAddress, ACCOUNT, solanaCoin.alwaysHardened) //0H
val changeAddress = hdKeyGenerator.getAddress(
accountAddress,
CHANGE.toLong(),
solanaCoin.alwaysHardened
) //0H
return changeAddress.privateKey.privateKey
}
CHANGE is a constant set to 0. Therefore you can only get the privateKey without change effectively. You should be able to pass in a change number to this function in vendor.bip32.wallet.
Bip44WithChange is used by Solana to generate a set of keypairs for a given seed. This exists in SolanaKT but is not fully implemented.
CHANGE
is a constant set to 0. Therefore you can only get the privateKey without change effectively. You should be able to pass in a change number to this function in vendor.bip32.wallet.