deriveArchethicKeypair function

KeyPair deriveArchethicKeypair(
  1. dynamic seed,
  2. String derivationPath,
  3. int index, {
  4. String curve = 'ed25519',
  5. String pathSuffix = '',
})

Implementation

KeyPair deriveArchethicKeypair(
  dynamic seed,
  String derivationPath,
  int index, {
  String curve = 'ed25519',
  String pathSuffix = '',
}) {
  final extendedSeed = deriveServiceSeed(
    seed,
    derivationPath,
    index,
    pathSuffix: pathSuffix,
  );

  return isPathWithIndex(derivationPath)
      ? crypto.generateDeterministicKeyPair(
          extendedSeed,
          curve,
          keychainOriginId,
        )
      : crypto.deriveKeyPair(uint8ListToHex(extendedSeed), index, curve: curve);
}