getTaprootAddress static method

String getTaprootAddress(
  1. Uint8List publicKey,
  2. String prefix
)

Implementation

static String getTaprootAddress(Uint8List publicKey, String prefix) {
  final pub = _secp256k1.curve.decodePoint(publicKey)!;

  final info = taprootConstruct(pubKey: pub);
  final words = convertBits(info, 8, 5);
  final addr =
      bech32.encode(Bech32(prefix, [1] + words), encoding: 'bech32m');
  return addr;
}