publicKeyToAddress function

Uint8List publicKeyToAddress(
  1. Uint8List publicKey
)

Constructs the Ethereum address associated with the given public key by taking the lower 160 bits of the key's sha3 hash.

Implementation

Uint8List publicKeyToAddress(Uint8List publicKey) {
  assert(publicKey.length == 64);
  final hashed = keccak256(publicKey);
  assert(hashed.length == 32);
  return hashed.sublist(12, 32);
}