derive method
If a parent signing key is provided, a child signing key is generated. If a parent verify key is provided and the index is NOT hardened, then a child verify key is also included. If hardened and no signingKey is provied, it returns an empty pair.
Implementation
Bip32KeyPair derive(int index) {
// computes a child extended private key from the parent extended private key.
final derivator = Bip32Ed25519KeyDerivation.instance;
Bip32SigningKey? signingKey = key.signingKey != null
? derivator.ckdPriv(key.signingKey!, harden(index)) as Bip32SigningKey
: null;
return Bip32KeyPair(
signingKey: signingKey, verifyKey: signingKey?.verifyKey);
}