Class MerkleProof

java.lang.Object
com.norswap.nanoeth.trees.patricia.MerkleProof

public final class MerkleProof
extends Object
A proof that a key-value pair belongs to a tree. Note that the tree is question is not stored in this object.
  • Field Summary

    Fields
    Modifier and Type Field Description
    PatriciaNode[] branch
    Merkle tree nodes (in abridged form) on the branch from the root to the node (leaf or branch) that contains the value associated with the key, or to the deepest node that would have to be modified in order to insert a value for key (if value is null).
    byte[] key
    Key being proven.
    byte[] value
    Value whose association with the key is being proven, null if proving absence of value.
  • Constructor Summary

    Constructors
    Constructor Description
    MerkleProof​(byte[] key, byte[] value, PatriciaNode[] branch)  
  • Method Summary

    Modifier and Type Method Description
    boolean verify​(MerkleRoot root)  

    Methods inherited from class java.lang.Object

    clone, equals, finalize, getClass, hashCode, notify, notifyAll, toString, wait, wait, wait
  • Field Details

    • key

      public final byte[] key
      Key being proven.
    • value

      public final byte[] value
      Value whose association with the key is being proven, null if proving absence of value.
    • branch

      public final PatriciaNode[] branch
      Merkle tree nodes (in abridged form) on the branch from the root to the node (leaf or branch) that contains the value associated with the key, or to the deepest node that would have to be modified in order to insert a value for key (if value is null).
  • Constructor Details

    • MerkleProof

      public MerkleProof​(byte[] key, byte[] value, PatriciaNode[] branch)
  • Method Details

    • verify

      public boolean verify​(MerkleRoot root)