Interface MerkleProof
-
- All Implemented Interfaces:
@DoNotImplement() public interface MerkleProof
MerkleProofs can be used to verify if some specific data is part of a MerkleTree.
Use createAuditProof to create a proof for a set of leaves for an existing MerkleTree. Construct a MerkleProof from its (
treeSize
,leaves
,hashes
) when you want toverify
} if the leaves to be checked are part of a MerkleTree with the specific root.
-
-
Method Summary
Modifier and Type Method Description abstract MerkleProofType
getProofType()
Returns the type of the proof. abstract int
getTreeSize()
Returns the size of the MerkleTree out of which this proof was created. abstract List<IndexedMerkleLeaf>
getLeaves()
Returns disclosed plain data of a MerkleTree which are to be verified that they are indeed part of a MerkleTree
.abstract List<SecureHash>
getHashes()
Returns the hashed intermediate node data supplementing the plain data. abstract boolean
verify(@NotNull() SecureHash root, @NotNull() MerkleTreeHashDigest digest)
Checks if the MerkleProof has been generated from a MerkleTree with the given root. abstract SecureHash
calculateRoot(@NotNull() MerkleTreeHashDigest digest)
Rebuilds the MerkleTree from the MerkleProof and returns its root SecureHash. -
-
Method Detail
-
getProofType
@NotNull() abstract MerkleProofType getProofType()
Returns the type of the proof.
-
getTreeSize
abstract int getTreeSize()
Returns the size of the MerkleTree out of which this proof was created.
-
getLeaves
abstract List<IndexedMerkleLeaf> getLeaves()
Returns disclosed plain data of a MerkleTree which are to be verified that they are indeed part of a
MerkleTree
.
-
getHashes
abstract List<SecureHash> getHashes()
Returns the hashed intermediate node data supplementing the plain data.
-
verify
abstract boolean verify(@NotNull() SecureHash root, @NotNull() MerkleTreeHashDigest digest)
Checks if the MerkleProof has been generated from a MerkleTree with the given root.
- Parameters:
root
- The root of the tree to be verified.digest
- The tree's digest.
-
calculateRoot
abstract SecureHash calculateRoot(@NotNull() MerkleTreeHashDigest digest)
Rebuilds the MerkleTree from the MerkleProof and returns its root SecureHash.
- Parameters:
digest
- The tree's digest.
-
-
-
-