From 60ad0d73625bba86e2957b24a4e9c24fc74d06bc Mon Sep 17 00:00:00 2001 From: Artem Chystiakov Date: Wed, 20 Nov 2024 20:19:03 +0200 Subject: [PATCH] fix smt leaf hashing --- .../guides/libs/data-structures/sparse-merkle-tree.md | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/docs/getting-started/guides/libs/data-structures/sparse-merkle-tree.md b/docs/getting-started/guides/libs/data-structures/sparse-merkle-tree.md index ca533d6..cb84a11 100644 --- a/docs/getting-started/guides/libs/data-structures/sparse-merkle-tree.md +++ b/docs/getting-started/guides/libs/data-structures/sparse-merkle-tree.md @@ -26,7 +26,7 @@ Each node also contains a hash; for an `Empty` type node, it is zero. 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. -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. +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.