deriveAddressKeys method

Bip32KeyPair deriveAddressKeys({
  1. int purpose = defaultPurpose,
  2. int coinType = defaultCoinType,
  3. int account = defaultAccountIndex,
  4. int role = paymentRole,
  5. int index = defaultAddressIndex,
})

run down the 5 level hierarchical chain to derive a new address key pair.

Implementation

Bip32KeyPair deriveAddressKeys(
    {int purpose = defaultPurpose,
    int coinType = defaultCoinType,
    int account = defaultAccountIndex,
    int role = paymentRole,
    int index = defaultAddressIndex}) {
  final rootKeys =
      Bip32KeyPair(signingKey: rootSigningKey, verifyKey: rootVerifyKey);
  final purposeKey = derive(keys: rootKeys, index: purpose);
  final coinKey = derive(keys: purposeKey, index: coinType);
  final accountKey = derive(keys: coinKey, index: account);
  final roleKeys = derive(keys: accountKey, index: role);
  final addressKeys = derive(keys: roleKeys, index: index);
  return addressKeys;
}