Class MerkleTree.MerkleProof

java.lang.Object
com.privatechain.crypto.MerkleTree.MerkleProof
Enclosing class:
MerkleTree

public static final class MerkleTree.MerkleProof extends Object
Immutable Merkle inclusion proof for a single transaction.

A proof consists of an ordered list of MerkleTree.MerkleProof.ProofNode elements, one per tree level from the leaf up to (but not including) the root. Each node provides the sibling hash and whether the sibling is the left child at that level (FR-CRYPTO-07).

Since:
1.0.0
  • Constructor Details

  • Method Details

    • getTransactionId

      public String getTransactionId()
      Returns the transaction ID this proof covers.
      Returns:
      non-null, non-blank transaction ID
    • getPath

      Returns the ordered sibling path from leaf to root.
      Returns:
      unmodifiable list of MerkleTree.MerkleProof.ProofNode
    • getDepth

      public int getDepth()
      Returns the depth of the tree from which this proof was generated, which equals the number of sibling hashes in the path.
      Returns:
      tree depth (0 for a single-transaction block)
    • toString

      public String toString()
      Overrides:
      toString in class Object