Added alongside the Taproot class shall be two classes to represent a MAST tree: TapBranch and TapLeaf. Both of these shall inherit from a TapNode base class. The TapLeaf class shall be Writable with a script and leaf version. The TapBranch class must contain two TapNode children. The constructor will take a left and right node.
The Taproot class will be updated to take a TapNode as mast in addition to an internal key. If mast is null, then the existing key-path-only tweak will be used. The class will provide a leaves getter to access underlying leafs in the left-to-right order. A new controlBlockFor(int n) method will obtain the control block data for a given leaf.
Added alongside the
Taproot
class shall be two classes to represent a MAST tree:TapBranch
andTapLeaf
. Both of these shall inherit from aTapNode
base class. TheTapLeaf
class shall beWritable
with a script and leaf version. TheTapBranch
class must contain twoTapNode
children. The constructor will take aleft
andright
node.The
Taproot
class will be updated to take aTapNode
asmast
in addition to an internal key. Ifmast
is null, then the existing key-path-only tweak will be used. The class will provide aleaves
getter to access underlying leafs in the left-to-right order. A newcontrolBlockFor(int n)
method will obtain the control block data for a given leaf.