addressHash static method

List<int> addressHash(
  1. List<int> privKeyBytes,
  2. PubKeyModes pubKeyMode
)

Compute the address hash from private key bytes and public key mode.

This method computes the address hash from the provided private key bytes and the selected public key mode (compressed or uncompressed).

  • privKeyBytes: The private key bytes.
  • pubKeyMode: The selected public key mode.
  • Returns: The address hash as a List

Implementation

static List<int> addressHash(List<int> privKeyBytes, PubKeyModes pubKeyMode) {
  final publicBytes = Secp256k1PrivateKeyEcdsa.fromBytes(privKeyBytes)
      .publicKey
      .point
      .toBytes();

  return Bip38Addr.addressHash(publicBytes, pubKeyMode);
}