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
Once we can represent private storage slots using points (#7437), we'll be able to provide proper support for partial notes (as was attempted in #7226). This involves combining multiple values into a Grumpkin Point so that we can later leverage fully homomorphic encryption in public.
For example, if we have a ValueNote with value, randomness and npk in a Map<AztecAddress, PrivateSet<ValueNote>>, then we may want to privately commit to the recipient address (and hence storage slot), randomness and npk, while still being able to modify the value in public:
point = storage_slot * g0 + value * g1 + randomness * g2 + npk * g3
Since points are fairly arbitrary, we could represent this in a data structure that knows about the generators and provides proper functions to alter the hidden contents:
implValueNote{fnnew(storage_slot,value,randomness,npk) -> Self{ ...}// privately commit into a hidden point, which can be made publicfnto_hidden_point(self) -> ValueNoteHiddenPoint{ValueNoteHiddenPoint::new(self.storage_slot* g0 + self.value* g1 + self.randomness* g2 + self.npk* g3)}}structValueNoteHiddenPoint{inner:GrumpkinPoint}implValueNoteHiddenPoint{fnnew(point:GrumpkinPoint) -> Self{Self{inner: point }}// Alter the hidden value contents, can be done in publicfnadd_value(self,amount:Field) -> Self{// Note that we use the same generator for value as when creating the hidden pointself.inner + value * g1
}// Drop the point into a Field, which we can use as we used the old note hash and e.g. pass it to the kernelsfnfinalize(self) -> Field{self.inner.x}}
When creating partial notes we'd do to_hidden_point (or to_partial_note or whatever), which'd then be passed to public and finalize'd there. If creating the note fully in private we'd need to use the exact same hashing and not e.g. pedersen (because notes created in private and finalized in public should be indistinguishable), and we'd do to_hidden_point().finalize(), or maybe ValueNote would have a finalize helper fn that does this.
Modeling this intermediate value in this way would I think greatly reduce the room for error, and provide a lot of clarity regarding what a partial note is, how it is used, what operations can be done with it, and the different stages it goes through (private as struct -> optionally public as hidden point -> finalized as field).
to_hidden_point and add_value need to be kept in sync to use the same generators. There is no reason why we would not be able to eventually autogenerate them.
The text was updated successfully, but these errors were encountered:
Once we can represent private storage slots using points (#7437), we'll be able to provide proper support for partial notes (as was attempted in #7226). This involves combining multiple values into a Grumpkin Point so that we can later leverage fully homomorphic encryption in public.
For example, if we have a
ValueNote
withvalue
,randomness
andnpk
in aMap<AztecAddress, PrivateSet<ValueNote>>
, then we may want to privately commit to the recipient address (and hence storage slot), randomness and npk, while still being able to modify the value in public:Since points are fairly arbitrary, we could represent this in a data structure that knows about the generators and provides proper functions to alter the hidden contents:
When creating partial notes we'd do
to_hidden_point
(orto_partial_note
or whatever), which'd then be passed to public andfinalize
'd there. If creating the note fully in private we'd need to use the exact same hashing and not e.g. pedersen (because notes created in private and finalized in public should be indistinguishable), and we'd doto_hidden_point().finalize()
, or maybeValueNote
would have afinalize
helper fn that does this.Modeling this intermediate value in this way would I think greatly reduce the room for error, and provide a lot of clarity regarding what a partial note is, how it is used, what operations can be done with it, and the different stages it goes through (private as struct -> optionally public as hidden point -> finalized as field).
to_hidden_point
andadd_value
need to be kept in sync to use the same generators. There is no reason why we would not be able to eventually autogenerate them.The text was updated successfully, but these errors were encountered: