Implement Merkle tree.