Skip to content

Commit

Permalink
Add procedure for computing root from proof
Browse files Browse the repository at this point in the history
  • Loading branch information
PhilippGackstatter committed Oct 25, 2023
1 parent 145d0f8 commit 5875752
Showing 1 changed file with 8 additions and 1 deletion.
9 changes: 8 additions & 1 deletion tips/TIP-0045/tip-0045.md
Original file line number Diff line number Diff line change
Expand Up @@ -215,7 +215,14 @@ A **merkle proof** is computed as follows:

### Root Computation

The **merkle root** is the result of `Hash Subtree(Leaves)`.
The **merkle root** can be computed from two different inputs:

- From an array of `Leaves` by calling `Hash Subtree(Leaves)`.
- From a merkle proof by calling `Hash Component` the top-level component of the proof, where `Hash Component` is
defined as:
- If the component is a `Leaf Hash`, return its field `Hash`.
- If the component is a `Value Hash`, return its field `Hash`.
- If the component is a `Node` return `Hash Node(Hash Component(Left), Hash Component(Right))`.

# Detailed design

Expand Down

0 comments on commit 5875752

Please sign in to comment.