ec8Recover function

String ec8Recover({
  1. required String message,
  2. required String sig,
})

Implementation

String ec8Recover({required String message, required String sig}) {
  final messageHash = createEurocoinMessageHash(message);
  final parsedSig = _parseEc8Signature(sig);
  final pubKeyUncompressed = recoverPublicKey(messageHash, parsedSig);

  final uncompressedPrefix = [0x04];
  final pubKeyCompressed = compressPublicKey(
      Uint8List.fromList(uncompressedPrefix + pubKeyUncompressed));
  final pubKeyHex = convert.hex.encode(pubKeyCompressed);
  return pubKeyHex;
}