merkle_proof

Function merkle_proof 

Source
pub fn merkle_proof(
    leaves: &[FpBN256],
    index: usize,
) -> (Vec<FpBN256>, u64, usize)
Expand description

Compute the Merkle path and path index bits for a given leaf index

Generates the Merkle proof for a leaf at the given index, including all sibling nodes along the path to the root and the path indices encoded as a bit pattern.

ยงReturns

Returns a tuple containing:

  • path_elements: Vector of sibling scalar values along the path
  • path_indices: Path indices encoded as a u64 bit pattern
  • levels: Number of levels in the tree