Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merklize key/value pair #17

Open
mappum opened this issue Aug 27, 2019 · 0 comments
Open

Merklize key/value pair #17

mappum opened this issue Aug 27, 2019 · 0 comments

Comments

@mappum
Copy link
Collaborator

mappum commented Aug 27, 2019

Currently, a node's Merkle structure is H(H(key, value), left_child, right_child). However, this means that in proofs we must always be sent both the key and the value together, whereas in absence proofs there are cases when we only care about the key.

This can be fixed by changing the structure to H(H(key, H(value)), left_child, right_child) to compress the value to a single hash at the cost of one more hash per value update. We could still choose to send the value in proofs if it is less than the hash length and we want to optimize for bandwidth rather than CPU.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant