You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
{{ message }}
This repository has been archived by the owner on Mar 24, 2023. It is now read-only.
It’s not clear if the namespace is also fed into the hash h as this might or might not be the case depending on what the serialize function looks like. I though I remembered that serialize was narrowed down by specifiying if serialization contains the NID or not but I can't find it currently. In the current form the spec would allow both cases as far as I understand. From a security pov both should be fine as the NID is returned / prefixed in front of the hash anyways (and hence the tree commits to the namespace of each leaf too).
It’s not clear if the namespace is also fed into the hash
h
as this might or might not be the case depending on what theserialize
function looks like. I though I remembered thatserialize
was narrowed down by specifiying if serialization contains the NID or not but I can't find it currently. In the current form the spec would allow both cases as far as I understand. From a security pov both should be fine as the NID is returned / prefixed in front of the hash anyways (and hence the tree commits to the namespace of each leaf too).https://github.com/lazyledger/lazyledger-specs/blob/master/specs/data_structures.md#namespace-merkle-tree
In the implementation it is not and a leaf hash is computed as:
ns(rawData) || ns(rawData) || hash(leafPrefix || rawData)
whererawData
does not contain the namespace.or more precisely:
https://github.com/lazyledger/nmt/blob/4b4c58a9e7c071db650b27a69dccde4821411d07/internal/hasher.go#L63-L67
IMHO, this is a perfect candidate to start putting #108 into practice.
The text was updated successfully, but these errors were encountered: