Skip to content

Commit 60ad0d7

Browse files
committed
fix smt leaf hashing
1 parent 65b9116 commit 60ad0d7

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

docs/getting-started/guides/libs/data-structures/sparse-merkle-tree.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ Each node also contains a hash; for an `Empty` type node, it is zero.
2626

2727
For a `Middle` node, it is calculated as follows: `H(H_L || H_R)`, where `H` is the hash function used within the library, `H_L` is the hash of the left node, and `H_R` is the hash of the right node. By default, the hash function is `Keccak-256`, but it can be changed to another, such as the `Poseidon` hash function.
2828

29-
For a `Leaf` node, the hash is calculated like: `H(1 || k || v)`, where `1` acts as a domain separator, `k` is a key that determines where the leaf will be located in the tree, and `v` is a value representing some data.
29+
For a `Leaf` node, the hash is calculated like: `H(k || v || 1)`, where `1` acts as a domain separator, `k` is a key that determines where the leaf will be located in the tree, and `v` is a value representing some data.
3030

3131
<figure>
3232
<img src={require("/static/img/docs/sparse-merkle-tree.png").default} alt=""/>

0 commit comments

Comments
 (0)