Package 

Class LeafNode

  • All Implemented Interfaces:
    java.lang.AutoCloseable , org.bitcoindevkit.Disposable , org.bitcoindevkit.LeafNodeInterface

    
    public class LeafNode
     implements Disposable, AutoCloseable, LeafNodeInterface
                        

    Store information about taproot leaf node.

    • Method Summary

      Modifier and Type Method Description
      Unit destroy()
      Unit close()
      UByte depth() Returns the depth of this script leaf in the tap tree.
      String leafHash() Computes a leaf hash for this ScriptLeaf if the leaf is known.
      UByte leafVersion() Returns leaf version of the script if the leaf is known.
      List<String> merkleBranch() Returns reference to the merkle proof (hashing partners) to get this node in form of `TaprootMerkleBranch`.
      String nodeHash() Computes the `TapNodeHash` for this `ScriptLeaf`.
      Script script() Returns reference to the leaf script if the leaf is known.
      String toString()
      • Methods inherited from class java.lang.Object

        clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
    • Method Detail

      • depth

         UByte depth()

        Returns the depth of this script leaf in the tap tree.

      • leafHash

         String leafHash()

        Computes a leaf hash for this ScriptLeaf if the leaf is known. This TapLeafHash is useful while signing taproot script spends. See LeafNode::node_hash for computing the TapNodeHash which returns the hidden node hash if the node is hidden.

      • leafVersion

         UByte leafVersion()

        Returns leaf version of the script if the leaf is known.

      • merkleBranch

         List<String> merkleBranch()

        Returns reference to the merkle proof (hashing partners) to get this node in form of `TaprootMerkleBranch`.

      • nodeHash

         String nodeHash()

        Computes the `TapNodeHash` for this `ScriptLeaf`. This returns the leaf hash if the leaf is known and the hidden node hash if the leaf is hidden. See also, `bdk_electrum::bdk_core::bitcoin::taproot::LeafNode::leaf_hash`.

      • script

         Script script()

        Returns reference to the leaf script if the leaf is known.