suiAddressFromPublicKey function

String suiAddressFromPublicKey(
  1. Uint8List publicKey32
)

0x Sui address: BLAKE2b-256 of the scheme flag (0x00 = Ed25519) plus the public key.

Implementation

String suiAddressFromPublicKey(Uint8List publicKey32) {
  final digest = blake2b(
    concatBytes([
      Uint8List.fromList([0x00]),
      publicKey32,
    ]),
    32,
  );
  return '0x${bytesToHex(digest)}';
}