Keyboard shortcuts

Press or to navigate between chapters

Press ? to show this help

Press Esc to hide this help

CMTNode

A node in the Cartesian Merkle Tree containing key, priority, hash, and child references.

Each node maintains the three essential properties of the CMT: - Key: Used for BST ordering and proof generation - Priority: Randomized value for heap property maintenance - Merkle Hash: Cryptographic commitment to this node and its subtree - Children: References to left and right child nodes

Fully qualified path: cartesian_merkle_tree::library::node::CMTNode

[derive(Drop, Copy, Debug)]
pub struct CMTNode {
    pub key: felt252,
    pub priority: felt252,
    pub merkle_hash: felt252,
    pub left_child: Option<Box<CMTNode>>,
    pub right_child: Option<Box<CMTNode>>,
}

Members

key

The key value for BST ordering and identification

Fully qualified path: cartesian_merkle_tree::library::node::CMTNode::key

pub key: felt252

priority

Randomized priority for heap property (derived from key)

Fully qualified path: cartesian_merkle_tree::library::node::CMTNode::priority

pub priority: felt252

merkle_hash

Merkle hash commitment to this node and its children

Fully qualified path: cartesian_merkle_tree::library::node::CMTNode::merkle_hash

pub merkle_hash: felt252

left_child

Reference to the left child node (keys < this.key)

Fully qualified path: cartesian_merkle_tree::library::node::CMTNode::left_child

pub left_child: Option<Box<CMTNode>>

right_child

Reference to the right child node (keys > this.key)

Fully qualified path: cartesian_merkle_tree::library::node::CMTNode::right_child

pub right_child: Option<Box<CMTNode>>