dat-ecosystem-archive / book

Documentation on how to implement the Dat Protocol [ DEPRECATED - see https://github.com/hypercore-protocol/new-website/tree/master/guides for similar functionality. More info on active projects and modules at https://dat-ecosystem.org/ ]
https://datprotocol.github.io/book/
Apache License 2.0
68 stars 9 forks source link

Explicitly ention root hash is not stored anywhere #26

Open yoshuawuyts opened 5 years ago

yoshuawuyts commented 5 years ago

In the Merkle Tree & Terminology sections we should emphasize the root hashes aren't persisted anywhere, but only the signatures of the hashes are persisted.

Also emphasize index for the signature is the index of the right-most node in the tree, divided by two. We should update our images to the following:

tree (stays same)

0: #0 = hash(data[0]) ─┐
                       #1 = hash(tree[0] + tree[1])
1: #2 = hash(data[1]) ─┘

2: #4 = hash(data[2])

signatures (added indexes)

0: #0 sig(#0)
1: #1 sig(#1)
2: #2 sig(#1 + #4)