AztecProtocol / aztec-packages

Apache License 2.0
199 stars 224 forks source link

Allow single-read for multi-field SharedImmutable #8399

Open nventuro opened 2 months ago

nventuro commented 2 months ago

We can follow the same pattern as in the new key registry to read multiple values in a multi-field SharedImmutable state variable provided we also store the hash of said values, and then privately a) perform a historical read of the hash and b) prove that the values are the preimage of the hash. The values would be fetched simply by calling oracles that read public state - no special infrastructure is needed.

This will likely require performing arithmetic over generic numeric params, since we'll need to be able to serialize a struct of serializable items (in order to serialize the struct prior to hashing).

benesjan commented 2 months ago

Created a PR with this a while ago. Currently blocked by incomplete storage slot allocation