childKey method

  1. @override
Zip32Sapling childKey(
  1. Bip32KeyIndex index, {
  2. ZCryptoContext? context,
})
override

Derives a child key at the given index.

Implementation

@override
Zip32Sapling childKey(Bip32KeyIndex index, {ZCryptoContext? context}) {
  context ??= DefaultZCryptoContext();
  final extendedKey = keyDerivator.deriveExpandedSpendingKey(
    parent: privateKey,
    index: index,
  );
  return Zip32Sapling(
    privateKey: extendedKey,
    publicKey: extendedKey.toExtendedFvk(),
  );
}