Taproot constructor

Taproot({
  1. required ECPublicKey internalKey,
  2. TapNode? mast,
})

Takes the internalKey to construct the tweaked key. The internal key will be forced to use an even Y coordinate and may not equal the passed internalKey. The mast represents a "Merkelized Abstract Syntax Tree" which is a tree of scripts that can be spent. This can be constructed via TapBranch and TapLeaf objects.

Implementation

Taproot({
  required ECPublicKey internalKey,
  this.mast,
})
: internalKey = internalKey.xonly,
leaves = List.unmodifiable(mast == null ? [] : mast._leaves) {
  if (leaves.toSet().length != leaves.length) {
    throw ArgumentError.value(mast, "mast", "contains duplicate leaves");
  }
}