Class MerkleRoot

java.lang.Object
com.norswap.nanoeth.data.Hash
com.norswap.nanoeth.data.MerkleRoot
All Implemented Interfaces:
RLPLayoutable

@Wrapper
public final class MerkleRoot
extends Hash
A Hash that is marked as being a Merkle root.

A Merkle root is the hash associated with the root of a Merkle tree.

The hash ("label") associated with a Merkle tree node is the hash of the data for leaf nodes, and the hash of the children's labels for non-leaf nodes.

  • Field Details

    • ZERO

      public static final MerkleRoot ZERO
      A merkle root composed of only zero bytes, which happens to be the merkle root of empty trees.
  • Constructor Details

    • MerkleRoot

      public MerkleRoot​(byte[] bytes)
    • MerkleRoot

      public MerkleRoot​(Hash hash)
    • MerkleRoot

      public MerkleRoot​(String hexString)
      Creates a merkle root from a hex string (e.g. 0x123).

      If the post-0x part of the hex string is not 64 characters long, the hash will be padded with zeroes at the start so that it is 32 bytes long.

  • Method Details