tapRootAddress property

String get tapRootAddress

Implementation

String get tapRootAddress {
  if (data.pubkey == null) return '';

  final pub = _secp256k1.curve.decodePoint(data.pubkey!)!;

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

  return addr;
}