corda / net.corda.core.crypto / MerkleTree

# MerkleTree

`sealed class MerkleTree`

Creation and verification of a Merkle Tree for a Wire Transaction.

See: https://en.wikipedia.org/wiki/Merkle_tree

Transaction is split into following blocks: inputs, attachments' refs, outputs, commands, notary, signers, tx type, timestamp. Merkle Tree is kept in a recursive data structure. Building is done bottom up, from all leaves' hashes. If number of leaves is not a power of two, the tree is padded with zero hashes.

### Types

Leaf | `class Leaf : MerkleTree`
Node | `class Node : MerkleTree`

### Properties

hash | `val hash: SecureHash`

### Companion Object Functions

getMerkleTree | `fun getMerkleTree(allLeavesHashes: List<SecureHash>): MerkleTree` Merkle tree building using hashes, with zero hash padding to full power of 2.

### Inheritors

Leaf | `class Leaf : MerkleTree`
Node | `class Node : MerkleTree`