Open itsdevbear opened 3 months ago
Why is this good though? Could you share some use cases?
Keeping the data in struct form is useful for internal stuff. I can also understand an idea to leave the data as raw bytes and support operating on it like that (e.g. proving, verifying). But turning it into a binary tree which is not really good for either seems strange to me with my limited usage of ssz.
The idea that i'm working towards is a cheaper way to update the "HashTreeRoot" of container. Let's use BeaconState for example in the CL context.
If we store the Data in a tree (maybe the answer here is an n-ary tree) we can update the "HashTreeRoot" of the root object in log(n) time by only having the re-hash the branches that were modified since the last time the root was computed.
My use case is a db cache and prefetcher for BeaconKit.
@karalabe also proof generation
I'm still cooking on some stuff, I'll update within the next few days
Idea is to allow for a in memory tree representation of an SSZ object