AztecProtocol / aztec-packages

Apache License 2.0
190 stars 192 forks source link

Allow external unconstrained calls #7524

Open nventuro opened 3 months ago

nventuro commented 3 months ago

We currently lack a way to call an top-level unconstrained function from another contract. While this might seem like an odd requirement at first (since the call itself would be unconstrained and therefore unsafe to use), there are many patterns in which we could use these return values as hints to then construct a valid constrained proof. This can be thought of as a way for applications to write custom oracles and distribute them as Noir code, as opposed to requiring extensions to PXE.

The key registry in #7523 is an example of this: lack of this feature means the caller must manually include equivalent unconstrained code, which is error-prone and hard to maintain.

nventuro commented 3 months ago

@spalladino wrote a hacky proof-of-concept of this feature here, which might help illustrate the work involved in implementing this.

nventuro commented 2 months ago

7523 would require also that we can do this for historical blocks, not necessarily the current one.