com.r3corda.core.transactions / 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, outputs, commands, attachments refs. Merkle Tree is kept in a recursive data structure. Building is done bottom up, from all leaves hashes. If a row in a tree has an odd number of elements - the final hash is hashed with itself.

### Types

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

### Properties

hash | `val hash: SecureHash`

### Functions

hashNodes | `fun hashNodes(right: MerkleTree): MerkleTree`

### Companion Object Functions

getMerkleTree | `fun getMerkleTree(allLeavesHashes: List<SecureHash>): MerkleTree` Merkle tree building using hashes.

### Inheritors

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